From ca784941cdb506b38799e6dcac2ac03c4d0ad730 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Sat, 20 Jul 2024 22:15:39 +0200 Subject: [PATCH 01/48] feat: upgrade gnark-crypto/gnark --- galoisd/go.mod | 7 +- galoisd/go.sum | 10 +- galoisd/pkg/lightclient/nonadjacent/ptau.go | 786 + .../gnark-crypto/ecc/bls12-377/fr/fft/doc.go | 3 +- .../ecc/bls12-377/fr/fft/domain.go | 14 +- .../gnark-crypto/ecc/bls12-377/fr/gkr/gkr.go | 6 +- .../gnark-crypto/ecc/bls12-377/fr/mimc/doc.go | 42 + .../ecc/bls12-377/fr/mimc/mimc.go | 11 +- .../ecc/bls12-377/fr/mimc/options.go | 50 + .../ecc/bls12-377/fr/pedersen/pedersen.go | 54 +- .../gnark-crypto/ecc/bls12-377/g1.go | 446 +- .../gnark-crypto/ecc/bls12-377/g2.go | 452 +- .../ecc/bls12-377/internal/fptower/e12.go | 24 +- .../ecc/bls12-377/internal/fptower/e2.go | 14 +- .../ecc/bls12-377/internal/fptower/e6.go | 12 +- .../gnark-crypto/ecc/bls12-377/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bls12-377/kzg/marshal.go | 47 + .../ecc/bls12-377/multiexp_affine.go | 4 +- .../ecc/bls12-377/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bls12-378/g1.go | 446 +- .../gnark-crypto/ecc/bls12-378/g2.go | 452 +- .../ecc/bls12-378/internal/fptower/e12.go | 24 +- .../ecc/bls12-378/internal/fptower/e2.go | 14 +- .../ecc/bls12-378/internal/fptower/e6.go | 12 +- .../gnark-crypto/ecc/bls12-378/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bls12-378/kzg/marshal.go | 47 + .../ecc/bls12-378/multiexp_affine.go | 4 +- .../ecc/bls12-378/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bls12-381/fr/fft/doc.go | 3 +- .../ecc/bls12-381/fr/fft/domain.go | 14 +- .../gnark-crypto/ecc/bls12-381/fr/gkr/gkr.go | 6 +- .../gnark-crypto/ecc/bls12-381/fr/mimc/doc.go | 42 + .../ecc/bls12-381/fr/mimc/mimc.go | 11 +- .../ecc/bls12-381/fr/mimc/options.go | 50 + .../ecc/bls12-381/fr/pedersen/pedersen.go | 54 +- .../gnark-crypto/ecc/bls12-381/g1.go | 447 +- .../gnark-crypto/ecc/bls12-381/g2.go | 452 +- .../ecc/bls12-381/internal/fptower/e12.go | 24 +- .../ecc/bls12-381/internal/fptower/e2.go | 16 +- .../ecc/bls12-381/internal/fptower/e6.go | 12 +- .../gnark-crypto/ecc/bls12-381/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bls12-381/kzg/marshal.go | 47 + .../ecc/bls12-381/multiexp_affine.go | 4 +- .../ecc/bls12-381/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bls24-315/fr/fft/doc.go | 3 +- .../ecc/bls24-315/fr/fft/domain.go | 14 +- .../gnark-crypto/ecc/bls24-315/fr/gkr/gkr.go | 6 +- .../gnark-crypto/ecc/bls24-315/fr/mimc/doc.go | 42 + .../ecc/bls24-315/fr/mimc/mimc.go | 11 +- .../ecc/bls24-315/fr/mimc/options.go | 50 + .../ecc/bls24-315/fr/pedersen/pedersen.go | 54 +- .../gnark-crypto/ecc/bls24-315/g1.go | 446 +- .../gnark-crypto/ecc/bls24-315/g2.go | 450 +- .../ecc/bls24-315/internal/fptower/e12.go | 3 +- .../ecc/bls24-315/internal/fptower/e2.go | 3 +- .../ecc/bls24-315/internal/fptower/e24.go | 3 +- .../ecc/bls24-315/internal/fptower/e4.go | 3 +- .../gnark-crypto/ecc/bls24-315/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bls24-315/kzg/marshal.go | 47 + .../ecc/bls24-315/multiexp_affine.go | 4 +- .../ecc/bls24-315/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bls24-317/fr/fft/doc.go | 3 +- .../ecc/bls24-317/fr/fft/domain.go | 14 +- .../gnark-crypto/ecc/bls24-317/fr/gkr/gkr.go | 6 +- .../gnark-crypto/ecc/bls24-317/fr/mimc/doc.go | 42 + .../ecc/bls24-317/fr/mimc/mimc.go | 11 +- .../ecc/bls24-317/fr/mimc/options.go | 50 + .../ecc/bls24-317/fr/pedersen/pedersen.go | 54 +- .../gnark-crypto/ecc/bls24-317/g1.go | 447 +- .../gnark-crypto/ecc/bls24-317/g2.go | 450 +- .../ecc/bls24-317/internal/fptower/e12.go | 13 +- .../ecc/bls24-317/internal/fptower/e2.go | 8 +- .../ecc/bls24-317/internal/fptower/e24.go | 21 +- .../ecc/bls24-317/internal/fptower/e4.go | 20 +- .../gnark-crypto/ecc/bls24-317/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bls24-317/kzg/marshal.go | 47 + .../ecc/bls24-317/multiexp_affine.go | 4 +- .../ecc/bls24-317/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bn254/fr/fft/doc.go | 3 +- .../gnark-crypto/ecc/bn254/fr/fft/domain.go | 14 +- .../gnark-crypto/ecc/bn254/fr/gkr/gkr.go | 6 +- .../gnark-crypto/ecc/bn254/fr/mimc/doc.go | 42 + .../gnark-crypto/ecc/bn254/fr/mimc/mimc.go | 11 +- .../gnark-crypto/ecc/bn254/fr/mimc/options.go | 50 + .../ecc/bn254/fr/pedersen/pedersen.go | 54 +- .../consensys/gnark-crypto/ecc/bn254/g1.go | 443 +- .../consensys/gnark-crypto/ecc/bn254/g2.go | 448 +- .../ecc/bn254/internal/fptower/e12.go | 24 +- .../ecc/bn254/internal/fptower/e2.go | 16 +- .../ecc/bn254/internal/fptower/e6.go | 12 +- .../gnark-crypto/ecc/bn254/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bn254/kzg/marshal.go | 47 + .../gnark-crypto/ecc/bn254/multiexp_affine.go | 4 +- .../ecc/bn254/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bn254/pairing.go | 62 +- .../gnark-crypto/ecc/bw6-633/bw6-633.go | 2 +- .../gnark-crypto/ecc/bw6-633/fr/fft/doc.go | 3 +- .../gnark-crypto/ecc/bw6-633/fr/fft/domain.go | 14 +- .../gnark-crypto/ecc/bw6-633/fr/gkr/gkr.go | 6 +- .../gnark-crypto/ecc/bw6-633/fr/mimc/doc.go | 42 + .../gnark-crypto/ecc/bw6-633/fr/mimc/mimc.go | 11 +- .../ecc/bw6-633/fr/mimc/options.go | 50 + .../ecc/bw6-633/fr/pedersen/pedersen.go | 54 +- .../consensys/gnark-crypto/ecc/bw6-633/g1.go | 455 +- .../consensys/gnark-crypto/ecc/bw6-633/g2.go | 451 +- .../ecc/bw6-633/internal/fptower/e3.go | 22 +- .../ecc/bw6-633/internal/fptower/e6.go | 21 +- .../gnark-crypto/ecc/bw6-633/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bw6-633/kzg/marshal.go | 47 + .../ecc/bw6-633/multiexp_affine.go | 4 +- .../ecc/bw6-633/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bw6-633/pairing.go | 2 +- .../gnark-crypto/ecc/bw6-756/bw6-756.go | 2 +- .../consensys/gnark-crypto/ecc/bw6-756/g1.go | 458 +- .../consensys/gnark-crypto/ecc/bw6-756/g2.go | 444 +- .../ecc/bw6-756/internal/fptower/e3.go | 21 +- .../ecc/bw6-756/internal/fptower/e6.go | 21 +- .../gnark-crypto/ecc/bw6-756/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bw6-756/kzg/marshal.go | 47 + .../ecc/bw6-756/multiexp_affine.go | 4 +- .../ecc/bw6-756/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bw6-761/bw6-761.go | 2 +- .../gnark-crypto/ecc/bw6-761/fr/fft/doc.go | 3 +- .../gnark-crypto/ecc/bw6-761/fr/fft/domain.go | 14 +- .../gnark-crypto/ecc/bw6-761/fr/gkr/gkr.go | 6 +- .../gnark-crypto/ecc/bw6-761/fr/mimc/doc.go | 42 + .../gnark-crypto/ecc/bw6-761/fr/mimc/mimc.go | 11 +- .../ecc/bw6-761/fr/mimc/options.go | 50 + .../ecc/bw6-761/fr/pedersen/pedersen.go | 54 +- .../consensys/gnark-crypto/ecc/bw6-761/g1.go | 449 +- .../consensys/gnark-crypto/ecc/bw6-761/g2.go | 443 +- .../ecc/bw6-761/internal/fptower/e3.go | 21 +- .../ecc/bw6-761/internal/fptower/e6.go | 21 +- .../gnark-crypto/ecc/bw6-761/kzg/kzg.go | 38 +- .../gnark-crypto/ecc/bw6-761/kzg/marshal.go | 47 + .../ecc/bw6-761/multiexp_affine.go | 4 +- .../ecc/bw6-761/multiexp_jacobian.go | 4 +- .../gnark-crypto/ecc/bw6-761/pairing.go | 82 +- .../gnark-crypto/ecc/secp256k1/g1.go | 442 +- .../ecc/secp256k1/multiexp_affine.go | 2 +- .../ecc/secp256k1/multiexp_jacobian.go | 2 +- .../gnark-crypto/field/hash/hashutils.go | 6 +- .../consensys/gnark-crypto/kzg/kzg.go | 6 + .../consensys/gnark-crypto/utils/arith.go | 23 - .../consensys/gnark-crypto/utils/testing.go | 52 - .../gnark-crypto/utils/unsafe/dump_slice.go | 102 + .../github.com/consensys/gnark/README.md | 2 +- .../consensys/gnark/backend/backend.go | 11 + .../backend/groth16/bls12-377/marshal.go | 163 + .../gnark/backend/groth16/bls12-377/verify.go | 3 +- .../backend/groth16/bls12-381/marshal.go | 163 + .../gnark/backend/groth16/bls12-381/verify.go | 3 +- .../backend/groth16/bls24-315/marshal.go | 163 + .../gnark/backend/groth16/bls24-315/verify.go | 3 +- .../backend/groth16/bls24-317/marshal.go | 163 + .../gnark/backend/groth16/bls24-317/verify.go | 3 +- .../gnark/backend/groth16/bn254/marshal.go | 163 + .../groth16/bn254/mpcsetup/lagrange.go | 220 + .../backend/groth16/bn254/mpcsetup/marshal.go | 223 + .../backend/groth16/bn254/mpcsetup/phase1.go | 203 + .../backend/groth16/bn254/mpcsetup/phase2.go | 381 + .../backend/groth16/bn254/mpcsetup/setup.go | 112 + .../backend/groth16/bn254/mpcsetup/utils.go | 170 + .../gnark/backend/groth16/bn254/solidity.go | 432 +- .../gnark/backend/groth16/bn254/verify.go | 33 +- .../gnark/backend/groth16/bw6-633/marshal.go | 163 + .../gnark/backend/groth16/bw6-633/verify.go | 3 +- .../gnark/backend/groth16/bw6-761/marshal.go | 163 + .../gnark/backend/groth16/bw6-761/verify.go | 3 +- .../gnark/backend/groth16/groth16.go | 10 +- .../gnark/backend/plonk/bls12-377/prove.go | 292 +- .../gnark/backend/plonk/bls12-377/setup.go | 7 +- .../gnark/backend/plonk/bls12-377/verify.go | 266 +- .../gnark/backend/plonk/bls12-381/prove.go | 292 +- .../gnark/backend/plonk/bls12-381/setup.go | 7 +- .../gnark/backend/plonk/bls12-381/verify.go | 266 +- .../gnark/backend/plonk/bls24-315/prove.go | 292 +- .../gnark/backend/plonk/bls24-315/setup.go | 7 +- .../gnark/backend/plonk/bls24-315/verify.go | 266 +- .../gnark/backend/plonk/bls24-317/prove.go | 292 +- .../gnark/backend/plonk/bls24-317/setup.go | 7 +- .../gnark/backend/plonk/bls24-317/verify.go | 266 +- .../gnark/backend/plonk/bn254/prove.go | 292 +- .../gnark/backend/plonk/bn254/setup.go | 7 +- .../gnark/backend/plonk/bn254/solidity.go | 605 +- .../gnark/backend/plonk/bn254/unmarshal.go | 12 +- .../gnark/backend/plonk/bn254/verify.go | 284 +- .../gnark/backend/plonk/bw6-633/prove.go | 292 +- .../gnark/backend/plonk/bw6-633/setup.go | 7 +- .../gnark/backend/plonk/bw6-633/verify.go | 266 +- .../gnark/backend/plonk/bw6-761/prove.go | 292 +- .../gnark/backend/plonk/bw6-761/setup.go | 7 +- .../gnark/backend/plonk/bw6-761/verify.go | 266 +- .../consensys/gnark/backend/plonk/plonk.go | 9 +- .../gnark/backend/solidity/solidity.go | 33 + .../gnark/backend/solidity/verifyingkey.go | 9 + .../gnark/constraint/bls12-377/coeff.go | 38 + .../gnark/constraint/bls12-377/marshal.go | 101 + .../gnark/constraint/bls12-377/solver.go | 2 +- .../gnark/constraint/bls12-377/system.go | 82 - .../gnark/constraint/bls12-381/coeff.go | 38 + .../gnark/constraint/bls12-381/marshal.go | 101 + .../gnark/constraint/bls12-381/solver.go | 2 +- .../gnark/constraint/bls12-381/system.go | 82 - .../gnark/constraint/bls24-315/coeff.go | 38 + .../gnark/constraint/bls24-315/marshal.go | 101 + .../gnark/constraint/bls24-315/solver.go | 2 +- .../gnark/constraint/bls24-315/system.go | 82 - .../gnark/constraint/bls24-317/coeff.go | 38 + .../gnark/constraint/bls24-317/marshal.go | 101 + .../gnark/constraint/bls24-317/solver.go | 2 +- .../gnark/constraint/bls24-317/system.go | 82 - .../consensys/gnark/constraint/bn254/coeff.go | 38 + .../gnark/constraint/bn254/marshal.go | 101 + .../gnark/constraint/bn254/solver.go | 2 +- .../gnark/constraint/bn254/system.go | 82 - .../gnark/constraint/bw6-633/coeff.go | 38 + .../gnark/constraint/bw6-633/marshal.go | 101 + .../gnark/constraint/bw6-633/solver.go | 2 +- .../gnark/constraint/bw6-633/system.go | 82 - .../gnark/constraint/bw6-761/coeff.go | 38 + .../gnark/constraint/bw6-761/marshal.go | 101 + .../gnark/constraint/bw6-761/solver.go | 2 +- .../gnark/constraint/bw6-761/system.go | 82 - .../consensys/gnark/constraint/core.go | 12 +- .../consensys/gnark/constraint/marshal.go | 363 + .../gnark/constraint/string_utils.go | 2 +- .../gnark/constraint/tinyfield/coeff.go | 38 + .../gnark/constraint/tinyfield/marshal.go | 101 + .../gnark/constraint/tinyfield/solver.go | 2 +- .../gnark/constraint/tinyfield/system.go | 82 - .../vendor/github.com/consensys/gnark/doc.go | 2 +- .../consensys/gnark/frontend/cs/r1cs/api.go | 13 +- .../gnark/frontend/cs/r1cs/api_assertions.go | 27 +- .../gnark/frontend/cs/r1cs/builder.go | 7 +- .../consensys/gnark/frontend/cs/scs/api.go | 23 +- .../gnark/frontend/cs/scs/api_assertions.go | 25 +- .../gnark/frontend/cs/scs/builder.go | 80 +- .../internal/expr/linear_expression.go | 19 +- .../gnark/frontend/internal/expr/term.go | 21 +- .../consensys/gnark/frontend/schema/walk.go | 8 + .../gnark/internal/backend/ioutils/intcomp.go | 74 + .../github.com/consensys/gnark/io/io.go | 8 + .../consensys/gnark/io/roundtrip.go | 17 + .../consensys/gnark/profile/profile_worker.go | 2 + .../std/algebra/emulated/fields_bn254/e12.go | 66 +- .../emulated/fields_bn254/e12_pairing.go | 205 +- .../std/algebra/emulated/fields_bn254/e2.go | 59 +- .../std/algebra/emulated/fields_bn254/e6.go | 174 +- .../algebra/emulated/fields_bn254/hints.go | 156 + .../gnark/std/algebra/emulated/sw_bn254/g2.go | 8 + .../std/algebra/emulated/sw_bn254/hints.go | 169 + .../std/algebra/emulated/sw_bn254/pairing.go | 201 +- .../std/algebra/emulated/sw_emulated/point.go | 10 +- .../consensys/gnark/std/hash/mimc/doc.go | 41 + .../consensys/gnark/std/hash/mimc/mimc.go | 20 +- .../consensys/gnark/std/hash/sha2/sha2.go | 85 +- .../consensys/gnark/std/math/bits/hints.go | 53 - .../consensys/gnark/std/math/bits/naf.go | 50 - .../consensys/gnark/std/math/bitslice/opts.go | 8 + .../gnark/std/math/bitslice/partition.go | 17 +- .../consensys/gnark/std/math/cmp/bounded.go | 229 + .../consensys/gnark/std/math/cmp/generic.go | 105 + .../gnark/std/math/emulated/composition.go | 16 +- .../gnark/std/math/emulated/custommod.go | 99 + .../consensys/gnark/std/math/emulated/doc.go | 12 + .../std/math/emulated/emparams/emparams.go | 69 +- .../gnark/std/math/emulated/field.go | 6 +- .../gnark/std/math/emulated/field_assert.go | 4 +- .../gnark/std/math/emulated/field_mul.go | 74 +- .../gnark/std/math/emulated/field_ops.go | 5 +- .../gnark/std/math/emulated/hints.go | 49 + .../consensys/gnark/std/math/uints/uint8.go | 44 +- .../gnark/std/multicommit/nativecommit.go | 5 +- .../gnark/std/rangecheck/rangecheck_commit.go | 4 +- .../gnark/test/assert_checkcircuit.go | 20 +- .../consensys/gnark/test/assert_options.go | 11 + .../consensys/gnark/test/assert_solidity.go | 71 +- .../github.com/ronanh/intcomp/.gitignore | 16 + .../vendor/github.com/ronanh/intcomp/LICENSE | 201 + .../github.com/ronanh/intcomp/README.md | 80 + .../github.com/ronanh/intcomp/compress.go | 333 + .../ronanh/intcomp/delta_bitpacking.go | 797 + .../ronanh/intcomp/delta_variablebyte.go | 741 + .../github.com/ronanh/intcomp/deltapack.go | 63614 ++++++++++++++++ galoisd/vendor/modules.txt | 17 +- 286 files changed, 82573 insertions(+), 7626 deletions(-) create mode 100644 galoisd/pkg/lightclient/nonadjacent/ptau.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/options.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/options.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/options.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/options.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/options.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/options.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/options.go delete mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/utils/testing.go create mode 100644 galoisd/vendor/github.com/consensys/gnark-crypto/utils/unsafe/dump_slice.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/lagrange.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase1.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase2.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/setup.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/utils.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/solidity/solidity.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/backend/solidity/verifyingkey.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/bls12-377/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/bls12-381/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/bls24-315/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/bls24-317/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/bn254/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/bw6-633/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/bw6-761/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/marshal.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/internal/backend/ioutils/intcomp.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/hints.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/doc.go delete mode 100644 galoisd/vendor/github.com/consensys/gnark/std/math/bits/naf.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/std/math/cmp/bounded.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/std/math/cmp/generic.go create mode 100644 galoisd/vendor/github.com/consensys/gnark/std/math/emulated/custommod.go create mode 100644 galoisd/vendor/github.com/ronanh/intcomp/.gitignore create mode 100644 galoisd/vendor/github.com/ronanh/intcomp/LICENSE create mode 100644 galoisd/vendor/github.com/ronanh/intcomp/README.md create mode 100644 galoisd/vendor/github.com/ronanh/intcomp/compress.go create mode 100644 galoisd/vendor/github.com/ronanh/intcomp/delta_bitpacking.go create mode 100644 galoisd/vendor/github.com/ronanh/intcomp/delta_variablebyte.go create mode 100644 galoisd/vendor/github.com/ronanh/intcomp/deltapack.go diff --git a/galoisd/go.mod b/galoisd/go.mod index e7fa74a82e..e6e0c50f10 100644 --- a/galoisd/go.mod +++ b/galoisd/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/math v1.2.0 github.com/cometbft/cometbft v0.38.2 github.com/consensys/gnark v0.7.2-0.20230418172633-f83323bdf138 - github.com/consensys/gnark-crypto v0.12.2-0.20240215234832-d72fcb379d3e + github.com/consensys/gnark-crypto v0.12.2-0.20240703135258-5d8b5fab1afb github.com/cosmos/cosmos-sdk v0.50.2 github.com/rs/zerolog v1.33.0 github.com/spf13/cobra v1.7.0 @@ -97,6 +97,7 @@ require ( github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/ronanh/intcomp v1.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -120,9 +121,9 @@ require ( replace ( github.com/cometbft/cometbft => github.com/unionlabs/cometbls v0.0.0-20240310221349-e2d54edc212b - github.com/consensys/gnark => github.com/consensys/gnark v0.9.2-0.20240312175655-ce0186ef32c1 + github.com/consensys/gnark => github.com/unionlabs/gnark v0.0.0-20240723153903-9d859afe4c14 // Fork of gnark crypto until https://github.com/ConsenSys/gnark-crypto/pull/314 is merged - github.com/consensys/gnark-crypto => github.com/unionlabs/gnark-crypto v0.0.0-20240112093739-635c1b6963c6 + github.com/consensys/gnark-crypto => github.com/unionlabs/gnark-crypto v0.0.0-20240720201413-c0383b2a80e9 github.com/cosmos/cosmos-sdk => github.com/unionlabs/cosmos-sdk v0.0.0-20240206230727-9973b232e832 github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.4.11 ) diff --git a/galoisd/go.sum b/galoisd/go.sum index 1d095d94a9..5b7f59291d 100644 --- a/galoisd/go.sum +++ b/galoisd/go.sum @@ -81,8 +81,6 @@ github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWa github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark v0.9.2-0.20240312175655-ce0186ef32c1 h1:HQLV1mfE1lGAbJqHqv0rpPZyWv9ieoBvHZ6lJWfXDTQ= -github.com/consensys/gnark v0.9.2-0.20240312175655-ce0186ef32c1/go.mod h1:0dnRvl8EDbPsSZsIg8xOP1Au8cf43xOlT7/BhwMV98g= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -378,6 +376,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/ronanh/intcomp v1.1.0 h1:i54kxmpmSoOZFcWPMWryuakN0vLxLswASsGa07zkvLU= +github.com/ronanh/intcomp v1.1.0/go.mod h1:7FOLy3P3Zj3er/kVrU/pl+Ql7JFZj7bwliMGketo0IU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= @@ -439,8 +439,10 @@ github.com/unionlabs/cometbls v0.0.0-20240310221349-e2d54edc212b h1:KLUmkf0vAzt+ github.com/unionlabs/cometbls v0.0.0-20240310221349-e2d54edc212b/go.mod h1:ZN5TH4WzX9x+hgcipytd0WghjGcCBy6M8YVgnHOCd/0= github.com/unionlabs/cosmos-sdk v0.0.0-20240206230727-9973b232e832 h1:Yzf3nF11ClR8geNwP+oe+ZJG489q4dYgQJlBL42ANiA= github.com/unionlabs/cosmos-sdk v0.0.0-20240206230727-9973b232e832/go.mod h1:iEaeKpRLz88bVPyU7Zk0WODyY05qHmR33vNsFaJ4lP8= -github.com/unionlabs/gnark-crypto v0.0.0-20240112093739-635c1b6963c6 h1:wRt6Yt29bWvwCSeRmRJ/Wm1sRev1GjJGXn4MzSrMbv4= -github.com/unionlabs/gnark-crypto v0.0.0-20240112093739-635c1b6963c6/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o= +github.com/unionlabs/gnark v0.0.0-20240723153903-9d859afe4c14 h1:qI5Bjy9cLI62v5ZOb+1YThbuUHoS9Jd8yJtBqo7Vqzo= +github.com/unionlabs/gnark v0.0.0-20240723153903-9d859afe4c14/go.mod h1:S+QS+G9ZclYU8cukF+fi8+CoWIXy/HUcmcIkc8gj4Q8= +github.com/unionlabs/gnark-crypto v0.0.0-20240720201413-c0383b2a80e9 h1:23VxTNlW0gIcUOW/WKMF7kZITEOictR+hi54g6wkRHs= +github.com/unionlabs/gnark-crypto v0.0.0-20240720201413-c0383b2a80e9/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= diff --git a/galoisd/pkg/lightclient/nonadjacent/ptau.go b/galoisd/pkg/lightclient/nonadjacent/ptau.go new file mode 100644 index 0000000000..2bcdfe00c7 --- /dev/null +++ b/galoisd/pkg/lightclient/nonadjacent/ptau.go @@ -0,0 +1,786 @@ +package nonadjacent + +import ( + "encoding/binary" + "errors" + "fmt" + "io" + "math" + "math/big" + "os" + + "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fp" +) + +/////////////////////////////////////////////////////////////////// +/// PTAU /// +/////////////////////////////////////////////////////////////////// + +// Format +// Taken from the iden3/snarkjs repo powersoftau_new.js file +// https://github.com/iden3/snarkjs/blob/master/src/powersoftau_new.js +/* +Header(1) + n8 + prime + power +tauG1(2) + {(2 ** power)*2-1} [ + G1, tau*G1, tau^2 * G1, .... + ] +tauG2(3) + {2 ** power}[ + G2, tau*G2, tau^2 * G2, ... + ] +alphaTauG1(4) + {2 ** power}[ + alpha*G1, alpha*tau*G1, alpha*tau^2*G1,.... + ] +betaTauG1(5) + {2 ** power} [] + beta*G1, beta*tau*G1, beta*tau^2*G1, .... + ] +betaG2(6) + {1}[ + beta*G2 + ] +contributions(7) - Ignore contributions, users can verify using snarkjs + NContributions + {NContributions}[ + tau*G1 + tau*G2 + alpha*G1 + beta*G1 + beta*G2 + pubKey + tau_g1s + tau_g1sx + tau_g2spx + alpha_g1s + alpha_g1sx + alpha_g1spx + beta_g1s + beta_g1sx + beta_g1spx + partialHash (216 bytes) See https://github.com/mafintosh/blake2b-wasm/blob/23bee06945806309977af802bc374727542617c7/blake2b.wat#L9 + hashNewChallenge + ] +*/ + +// in bytes +const BN254_FIELD_ELEMENT_SIZE = 32 + +type G1 [2]big.Int +type G2 [4]big.Int + +type PtauHeader struct { + N8 uint32 + Prime big.Int + Power uint32 +} + +type Ptau struct { + Header PtauHeader + PTauPubKey PtauPubKey +} + +type PtauPubKey struct { + TauG1 []G1 + TauG2 []G2 + AlphaTauG1 []G1 + BetaTauG1 []G1 + BetaG2 G2 +} + +type PtauFile struct { + Header PtauHeader + Sections [][]SectionSegment + Reader *os.File +} + +func InitPtau(path string) (*PtauFile, error) { + reader, err := os.Open(path) + + if err != nil { + return nil, err + } + + var ptauStr = make([]byte, 4) + _, err = reader.Read(ptauStr) + + fmt.Printf("zkeyStr: %s \n", string(ptauStr)) + + // version + _, err = readULE32(reader) + + // number of sections + _, err = readULE32(reader) + + numSections := uint32(7) + fmt.Printf("num sections: %v \n", numSections) + + // in practice, all sections have only one segment, but who knows... + // 1-based indexing, so we need to allocate one more than the number of sections + sections := make([][]SectionSegment, numSections+1) + for i := uint32(0); i < numSections; i++ { + ht, _ := readULE32(reader) + hl, _ := readULE64(reader) + fmt.Printf("ht: %v \n", ht) + fmt.Printf("hl: %v \n", hl) + if sections[ht] == nil { + sections[ht] = make([]SectionSegment, 0) + } + pos, _ := reader.Seek(0, io.SeekCurrent) + sections[ht] = append(sections[ht], SectionSegment{pos: uint64(pos), size: hl}) + reader.Seek(int64(hl), io.SeekCurrent) + } + + fmt.Printf("sections: %v \n", sections) + + // section size + _, err = readBigInt(reader, 8) + + // Header (1) + seekToUniqueSection(reader, sections, 1) + + // Read header + header, err := readPtauHeader(reader) + + if err != nil { + return nil, err + } + + return &PtauFile{Header: header, Sections: sections, Reader: reader}, nil +} + +func (ptauFile *PtauFile) Close() error { + return ptauFile.Reader.Close() +} + +func (ptauFile *PtauFile) DomainSize() int { + return 1 << ptauFile.Header.Power +} + +func (ptauFile *PtauFile) readG1s(out chan bn254.G1Affine, count int) error { + for i := 0; i < count; i++ { + g1, err := readG1(ptauFile.Reader) + if err != nil { + return err + } + g1Affine := bn254.G1Affine{} + x := bytesToElement(g1[0].Bytes()) + g1Affine.X = x + y := bytesToElement(g1[1].Bytes()) + g1Affine.Y = y + if !g1Affine.IsOnCurve() { + fmt.Printf("readG1s: \n index: %v g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) + panic("g1Affine is not on curve") + } + out <- g1Affine + } + return nil +} + +func (ptauFile *PtauFile) readG2() (bn254.G2Affine, error) { + g2, err := readG2(ptauFile.Reader) + if err != nil { + return bn254.G2Affine{}, err + } + g2Affine := bn254.G2Affine{} + x0 := bytesToElement(g2[0].Bytes()) + x1 := bytesToElement(g2[1].Bytes()) + g2Affine.X.A0 = x0 + g2Affine.X.A1 = x1 + y0 := bytesToElement(g2[2].Bytes()) + y1 := bytesToElement(g2[3].Bytes()) + g2Affine.Y.A0 = y0 + g2Affine.Y.A1 = y1 + if !g2Affine.IsOnCurve() { + + fmt.Printf("readG2s: \n, g2Affine.X.A0: %v \n g2Affine.X.A1: %v \n g2Affine.Y.A0: %v \n g2Affine.Y.A1 %v \n", g2Affine.X.A0.String(), g2Affine.X.A1.String(), g2Affine.Y.A0.String(), g2Affine.Y.A1.String()) + panic("g2Affine is not on curve") + } + return g2Affine, nil +} + +func (ptauFile *PtauFile) readG2s(out chan bn254.G2Affine, count int) error { + for i := 0; i < count; i++ { + g2Affine, err := ptauFile.readG2() + if err != nil { + return err + } + out <- g2Affine + } + return nil +} + +func (ptauFile *PtauFile) ReadTauG1(out chan bn254.G1Affine) error { + defer close(out) + seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 2) + numPoints := ptauFile.DomainSize()*2 - 1 + fmt.Printf("tauG1 numPoints: %v \n", numPoints) + ptauFile.readG1s(out, numPoints) + return nil +} + +func (ptauFile *PtauFile) ReadTauG2(out chan bn254.G2Affine) error { + defer close(out) + seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 3) + numPoints := ptauFile.DomainSize() + fmt.Printf("tauG2 numPoints: %v \n", numPoints) + ptauFile.readG2s(out, numPoints) + return nil +} + +func (ptauFile *PtauFile) ReadAlphaTauG1(out chan bn254.G1Affine) error { + defer close(out) + seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 4) + numPoints := ptauFile.DomainSize() + fmt.Printf("alphaTauG1 numPoints: %v \n", numPoints) + ptauFile.readG1s(out, numPoints) + return nil +} + +func (ptauFile *PtauFile) ReadBetaTauG1(out chan bn254.G1Affine) error { + defer close(out) + seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 5) + numPoints := ptauFile.DomainSize() + fmt.Printf("betaTauG1 numPoints: %v \n", numPoints) + ptauFile.readG1s(out, numPoints) + return nil +} + +func (ptauFile *PtauFile) ReadBetaG2() (bn254.G2Affine, error) { + fmt.Printf("betaG2: \n") + seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 6) + return ptauFile.readG2() +} + +func ReadPtau(zkeyPath string) (Ptau, error) { + reader, err := os.Open(zkeyPath) + + if err != nil { + return Ptau{}, err + } + + defer reader.Close() + + var ptauStr = make([]byte, 4) + _, err = reader.Read(ptauStr) + + fmt.Printf("zkeyStr: %s \n", string(ptauStr)) + + // version + _, err = readULE32(reader) + + // number of sections + _, err = readULE32(reader) + + numSections := uint32(7) + fmt.Printf("num sections: %v \n", numSections) + + // in practice, all sections have only one segment, but who knows... + // 1-based indexing, so we need to allocate one more than the number of sections + sections := make([][]SectionSegment, numSections+1) + for i := uint32(0); i < numSections; i++ { + ht, _ := readULE32(reader) + hl, _ := readULE64(reader) + fmt.Printf("ht: %v \n", ht) + fmt.Printf("hl: %v \n", hl) + if sections[ht] == nil { + sections[ht] = make([]SectionSegment, 0) + } + pos, _ := reader.Seek(0, io.SeekCurrent) + sections[ht] = append(sections[ht], SectionSegment{pos: uint64(pos), size: hl}) + reader.Seek(int64(hl), io.SeekCurrent) + } + + fmt.Printf("sections: %v \n", sections) + + // section size + _, err = readBigInt(reader, 8) + + // Header (1) + seekToUniqueSection(reader, sections, 1) + + // Read header + header, err := readPtauHeader(reader) + + if err != nil { + return Ptau{}, err + } + + // TauG1 (2) + seekToUniqueSection(reader, sections, 2) + + var PtauPubKey PtauPubKey + + twoToPower := uint32(1 << header.Power) + + fmt.Printf("tauG1: \n") + + PtauPubKey.TauG1, err = readG1Array(reader, twoToPower*2-1) + + if err != nil { + return Ptau{}, err + } + + // TauG2 (3) + seekToUniqueSection(reader, sections, 3) + + fmt.Printf("tauG2: \n") + + PtauPubKey.TauG2, err = readG2Array(reader, twoToPower) + + if err != nil { + return Ptau{}, err + } + + // AlphaTauG1 (4) + seekToUniqueSection(reader, sections, 4) + + fmt.Printf("alphaTauG1: \n") + + PtauPubKey.AlphaTauG1, err = readG1Array(reader, twoToPower) + + if err != nil { + return Ptau{}, err + } + + // BetaTauG1 (5) + seekToUniqueSection(reader, sections, 5) + + fmt.Printf("betaTauG1: \n") + + PtauPubKey.BetaTauG1, err = readG1Array(reader, twoToPower) + + if err != nil { + return Ptau{}, err + } + + // BetaG2 (6) + seekToUniqueSection(reader, sections, 6) + + fmt.Printf("betaG2: \n") + + PtauPubKey.BetaG2, err = readG2(reader) + + if err != nil { + return Ptau{}, err + } + + return Ptau{Header: header, PTauPubKey: PtauPubKey}, nil +} + +func readPtauHeader(reader io.ReadSeeker) (PtauHeader, error) { + var header PtauHeader + + n8, err := readULE32(reader) + + if err != nil { + return PtauHeader{}, err + } + + header.N8 = n8 + + prime, err := readBigInt(reader, n8) + + if err != nil { + return PtauHeader{}, err + } + + header.Prime = prime + + power, err := readULE32(reader) + + if err != nil { + return PtauHeader{}, err + } + + header.Power = power + + return header, nil +} + +func readG1Array(reader io.ReadSeeker, numPoints uint32) ([]G1, error) { + g1s := make([]G1, numPoints) + for i := uint32(0); i < numPoints; i++ { + g1, err := readG1(reader) + + if err != nil { + return []G1{}, err + } + + g1s[i] = g1 + } + return g1s, nil +} + +func readG2Array(reader io.ReadSeeker, numPoints uint32) ([]G2, error) { + g2s := make([]G2, numPoints) + + for i := uint32(0); i < numPoints; i++ { + g2, err := readG2(reader) + + if err != nil { + return []G2{}, err + } + + g2s[i] = g2 + } + + return g2s, nil +} + +func readTauG2(reader io.ReadSeeker) ([]G2, error) { + tauG2_s, err := readG2(reader) + + if err != nil { + return []G2{}, err + } + + tauG2_sx, err := readG2(reader) + + if err != nil { + return []G2{}, err + } + + return []G2{tauG2_s, tauG2_sx}, nil +} + +func readG1(reader io.ReadSeeker) (G1, error) { + var g1 G1 + + x, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) + + if err != nil { + return G1{}, err + } + + g1[0] = x + + y, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) + + if err != nil { + return G1{}, err + } + + g1[1] = y + + return g1, nil +} + +func readG2(reader io.ReadSeeker) (G2, error) { + var g2 G2 + + x0, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) + + if err != nil { + return G2{}, err + } + + g2[0] = x0 + + x1, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) + + if err != nil { + return G2{}, err + } + + g2[1] = x1 + + y0, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) + + if err != nil { + return G2{}, err + } + + g2[2] = y0 + + y1, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) + + if err != nil { + return G2{}, err + } + + g2[3] = y1 + + return g2, nil +} + +func readULE32(reader io.Reader) (uint32, error) { + var buffer = make([]byte, 4) + + _, err := reader.Read(buffer) + + if err != nil { + return 0, err + } + + return binary.LittleEndian.Uint32(buffer), nil +} + +func readULE64(reader io.Reader) (uint64, error) { + var buffer = make([]byte, 8) + + _, err := reader.Read(buffer) + + if err != nil { + return 0, err + } + + return binary.LittleEndian.Uint64(buffer), nil +} + +func readBigInt(reader io.Reader, n8 uint32) (big.Int, error) { + var buffer = make([]byte, n8) + + _, err := reader.Read(buffer) + reverseSlice(buffer) + + if err != nil { + return *big.NewInt(0), err + } + + bigInt := big.NewInt(0).SetBytes(buffer) + + return *bigInt, nil +} + +func reverseSlice(slice []byte) []byte { + for i := 0; i < len(slice)/2; i++ { + j := len(slice) - i - 1 + slice[i], slice[j] = slice[j], slice[i] + } + return slice +} + +func bytesToElement(b []byte) fp.Element { + var z fp.Element + reverseSlice(b) + if len(b) < 32 { + b = append(b, make([]byte, 32-len(b))...) + } + + z[0] = binary.LittleEndian.Uint64(b[0:8]) + z[1] = binary.LittleEndian.Uint64(b[8:16]) + z[2] = binary.LittleEndian.Uint64(b[16:24]) + z[3] = binary.LittleEndian.Uint64(b[24:32]) + + return z +} + +/////////////////////////////////////////////////////////////////// +/// ZKEY /// +/////////////////////////////////////////////////////////////////// + +// Taken from the iden3/snarkjs repo, zkey_utils.js +// (https://github.com/iden3/snarkjs/blob/fb144555d8ce4779ad79e707f269771c672a8fb7/src/zkey_utils.js#L20-L45) +// Format +// ====== +// 4 bytes, zket +// 4 bytes, version +// 4 bytes, number of sections +// 4 bytes, section number +// 8 bytes, section size +// Header(1) +// 4 bytes, Prover Type 1 Groth +// HeaderGroth(2) +// 4 bytes, n8q +// n8q bytes, q +// 4 bytes, n8r +// n8r bytes, r +// 4 bytes, NVars +// 4 bytes, NPub +// 4 bytes, DomainSize (multiple of 2) +// alpha1 +// beta1 +// delta1 +// beta2 +// gamma2 +// delta2 + +const GROTH_16_PROTOCOL_ID = uint32(1) + +type NotGroth16 struct { + Err error +} + +func (r *NotGroth16) Error() string { + return fmt.Sprintf("Groth16 is the only supported protocol at this time (PLONK and FFLONK are not): %v", r.Err) +} + +// Incomplete (only extracts necessary fields for conversion to .ph1 format) +type Zkey struct { + ZkeyHeader ZkeyHeader + protocolHeader HeaderGroth +} + +type ZkeyHeader struct { + ProtocolID uint32 + protocolHeader HeaderGroth +} + +type HeaderGroth struct { + n8q uint32 + q big.Int + n8r uint32 + r big.Int + nVars uint32 + nPublic uint32 + domainSize uint32 + power uint32 +} + +type SectionSegment struct { + pos uint64 + size uint64 +} + +func ReadZkey(zkeyPath string) (Zkey, error) { + reader, err := os.Open(zkeyPath) + + if err != nil { + return Zkey{}, err + } + + defer reader.Close() + + // zkey + var zkeyStr = make([]byte, 4) + _, err = reader.Read(zkeyStr) + fmt.Printf("zkeyStr: %s \n", string(zkeyStr)) + + // version + _, err = readULE32(reader) + + // number of sections + numSections, err := readULE32(reader) + fmt.Printf("num sections: %v \n", numSections) + + // in practice, all sections have only one segment, but who knows... + // 1-based indexing, so we need to allocate one more than the number of sections + sections := make([][]SectionSegment, numSections+1) + for i := uint32(0); i < numSections; i++ { + ht, _ := readULE32(reader) + hl, _ := readULE64(reader) + fmt.Printf("ht: %v \n", ht) + fmt.Printf("hl: %v \n", hl) + if sections[ht] == nil { + sections[ht] = make([]SectionSegment, 0) + } + pos, _ := reader.Seek(0, io.SeekCurrent) + sections[ht] = append(sections[ht], SectionSegment{pos: uint64(pos), size: hl}) + reader.Seek(int64(hl), io.SeekCurrent) + } + + fmt.Printf("sections: %v \n", sections) + + // section size + _, err = readBigInt(reader, 8) + + seekToUniqueSection(reader, sections, 1) + header, err := readHeader(reader, sections) + + if err != nil { + return Zkey{}, err + } + + zkey := Zkey{ZkeyHeader: header, protocolHeader: header.protocolHeader} + + return zkey, nil +} + +func seekToUniqueSection(reader io.ReadSeeker, sections [][]SectionSegment, sectionId uint32) { + section := sections[sectionId] + + if len(section) > 1 { + panic("Section has more than one segment") + } + + reader.Seek(int64(section[0].pos), io.SeekStart) +} + +func readHeader(reader io.ReadSeeker, sections [][]SectionSegment) (ZkeyHeader, error) { + var header = ZkeyHeader{} + + protocolID, err := readULE32(reader) + + if err != nil { + return header, err + } + + // if groth16 + if protocolID == GROTH_16_PROTOCOL_ID { + seekToUniqueSection(reader, sections, 2) + headerGroth, err := readHeaderGroth16(reader) + + if err != nil { + return header, err + } + + header = ZkeyHeader{ProtocolID: protocolID, protocolHeader: headerGroth} + + } else { + return header, &NotGroth16{Err: errors.New("ProtocolID is not Groth16")} + } + + return header, nil +} + +func readHeaderGroth16(reader io.ReadSeeker) (HeaderGroth, error) { + var header = HeaderGroth{} + + n8q, err := readULE32(reader) + + fmt.Printf("n8q is: %v \n", n8q) + + if err != nil { + return header, err + } + + q, err := readBigInt(reader, n8q) + + if err != nil { + return header, err + } + + n8r, err := readULE32(reader) + + if err != nil { + return header, err + } + + r, err := readBigInt(reader, n8r) + + if err != nil { + return header, err + } + + nVars, err := readULE32(reader) + + if err != nil { + return header, err + } + + nPublic, err := readULE32(reader) + + if err != nil { + return header, err + } + + domainSize, err := readULE32(reader) + + if err != nil { + return header, err + } + + power := math.Log2(float64(domainSize)) + + power_int := uint32(math.Ceil(power)) + + header = HeaderGroth{n8q: n8q, q: q, n8r: n8r, r: r, nVars: nVars, nPublic: nPublic, domainSize: domainSize, power: power_int} + + return header, nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/doc.go index 2391a9f63b..b5dd44e642 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/doc.go @@ -14,5 +14,6 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT -// Package fft provides in-place discrete Fourier transform. +// Package fft provides in-place discrete Fourier transform on powers-of-two subgroups +// of 𝔽ᵣˣ (the multiplicative group (ℤ/rℤ, x) ). package fft diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/domain.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/domain.go index 7577eba2bf..74645ef46d 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/domain.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft/domain.go @@ -64,6 +64,15 @@ type Domain struct { cosetTableInv []fr.Element } +// GeneratorFullMultiplicativeGroup returns a generator of 𝔽ᵣˣ +func GeneratorFullMultiplicativeGroup() fr.Element { + var res fr.Element + + res.SetUint64(22) + + return res +} + // NewDomain returns a subgroup with a power of 2 cardinality // cardinality >= m // shift: when specified, it's the element by which the set of root of unity is shifted. @@ -72,10 +81,7 @@ func NewDomain(m uint64, opts ...DomainOption) *Domain { domain := &Domain{} x := ecc.NextPowerOfTwo(m) domain.Cardinality = uint64(x) - - // generator of the largest 2-adic subgroup - - domain.FrMultiplicativeGen.SetUint64(22) + domain.FrMultiplicativeGen = GeneratorFullMultiplicativeGroup() if opt.shift != nil { domain.FrMultiplicativeGen.Set(opt.shift) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/gkr/gkr.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/gkr/gkr.go index 19f4e9bb21..5eb0e2c617 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/gkr/gkr.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/gkr/gkr.go @@ -884,10 +884,10 @@ func (g AddGate) Evaluate(x ...fr.Element) (res fr.Element) { // set zero case 1: res.Set(&x[0]) - case 2: + default: res.Add(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Add(&res, &x[2]) + res.Add(&res, &x[i]) } } return @@ -909,7 +909,7 @@ func (g MulGate) Evaluate(x ...fr.Element) (res fr.Element) { default: res.Mul(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Mul(&res, &x[2]) + res.Mul(&res, &x[i]) } } return diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/doc.go index d527ead9ef..78837e1c80 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/doc.go @@ -15,4 +15,46 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT // Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// # Hash input format +// +// The MiMC hash function is defined over a field. The input to the hash +// function is a byte slice. The byte slice is interpreted as a sequence of +// field elements. Due to this interpretation, the input byte slice length must +// be multiple of the field modulus size. And every secuence of byte slice for a +// single field element must be strictly less than the field modulus. package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/mimc.go index d393f0d742..ea08f11742 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/mimc.go @@ -41,8 +41,9 @@ var ( // digest represents the partial evaluation of the checksum // along with the params of the mimc function type digest struct { - h fr.Element - data []fr.Element // data to hash + h fr.Element + data []fr.Element // data to hash + byteOrder fr.ByteOrder } // GetConstants exposed to be used in gnark @@ -56,9 +57,11 @@ func GetConstants() []big.Int { } // NewMiMC returns a MiMCImpl object, pure-go reference implementation -func NewMiMC() hash.Hash { +func NewMiMC(opts ...Option) hash.Hash { d := new(digest) d.Reset() + cfg := mimcOptions(opts...) + d.byteOrder = cfg.byteOrder return d } @@ -111,7 +114,7 @@ func (d *digest) Write(p []byte) (int, error) { var start int for start = 0; start < len(p); start += BlockSize { - if elem, err := fr.BigEndian.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { + if elem, err := d.byteOrder.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { d.data = append(d.data, elem) } else { return 0, err diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/options.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/options.go new file mode 100644 index 0000000000..be68e4b58f --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/mimc/options.go @@ -0,0 +1,50 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package mimc + +import ( + "github.com/consensys/gnark-crypto/ecc/bls12-377/fr" +) + +// Option defines option for altering the behavior of the MiMC hasher. +// See the descriptions of functions returning instances of this type for +// particular options. +type Option func(*mimcConfig) + +type mimcConfig struct { + byteOrder fr.ByteOrder +} + +// default options +func mimcOptions(opts ...Option) mimcConfig { + // apply options + opt := mimcConfig{ + byteOrder: fr.BigEndian, + } + for _, option := range opts { + option(&opt) + } + return opt +} + +// WithByteOrder sets the byte order used to decode the input +// in the Write method. Default is BigEndian. +func WithByteOrder(byteOrder fr.ByteOrder) Option { + return func(opt *mimcConfig) { + opt.byteOrder = byteOrder + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/pedersen/pedersen.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/pedersen/pedersen.go index 31130283a0..1bbf3a0a24 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/pedersen/pedersen.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/pedersen/pedersen.go @@ -30,13 +30,13 @@ import ( // ProvingKey for committing and proofs of knowledge type ProvingKey struct { - basis []curve.G1Affine - basisExpSigma []curve.G1Affine + Basis []curve.G1Affine + BasisExpSigma []curve.G1Affine } type VerifyingKey struct { - g curve.G2Affine // TODO @tabaie: does this really have to be randomized? - gRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} + G curve.G2Affine // TODO @tabaie: does this really have to be randomized? + GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} } func randomFrSizedBytes() ([]byte, error) { @@ -55,7 +55,7 @@ func randomOnG2() (curve.G2Affine, error) { // TODO: Add to G2.go? func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error) { - if vk.g, err = randomOnG2(); err != nil { + if vk.G, err = randomOnG2(); err != nil { return } @@ -70,21 +70,21 @@ func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err err var sigmaInvNeg big.Int sigmaInvNeg.ModInverse(sigma, fr.Modulus()) sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) - vk.gRootSigmaNeg.ScalarMultiplication(&vk.g, &sigmaInvNeg) + vk.GRootSigmaNeg.ScalarMultiplication(&vk.G, &sigmaInvNeg) pk = make([]ProvingKey, len(bases)) for i := range bases { - pk[i].basisExpSigma = make([]curve.G1Affine, len(bases[i])) + pk[i].BasisExpSigma = make([]curve.G1Affine, len(bases[i])) for j := range bases[i] { - pk[i].basisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) + pk[i].BasisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) } - pk[i].basis = bases[i] + pk[i].Basis = bases[i] } return } func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -95,13 +95,13 @@ func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, e NbTasks: 1, // TODO Experiment } - _, err = pok.MultiExp(pk.basisExpSigma, values, config) + _, err = pok.MultiExp(pk.BasisExpSigma, values, config) return } func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -111,7 +111,7 @@ func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, er config := ecc.MultiExpConfig{ NbTasks: 1, } - _, err = commitment.MultiExp(pk.basis, values, config) + _, err = commitment.MultiExp(pk.Basis, values, config) return } @@ -131,7 +131,7 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt offset := 0 for i := range pk { - if len(values[i]) != len(pk[i].basis) { + if len(values[i]) != len(pk[i].Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -147,14 +147,14 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt scaledValues := make([]fr.Element, offset) basis := make([]curve.G1Affine, offset) - copy(basis, pk[0].basisExpSigma) + copy(basis, pk[0].BasisExpSigma) copy(scaledValues, values[0]) offset = len(values[0]) rI := r for i := 1; i < len(pk); i++ { - copy(basis[offset:], pk[i].basisExpSigma) - for j := range pk[i].basis { + copy(basis[offset:], pk[i].BasisExpSigma) + for j := range pk[i].Basis { scaledValues[offset].Mul(&values[i][j], &rI) offset++ } @@ -215,7 +215,7 @@ func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G return fmt.Errorf("subgroup check failed") } - if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.g, vk.gRootSigmaNeg}); err != nil { + if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.G, vk.GRootSigmaNeg}); err != nil { return err } else if !isOne { return fmt.Errorf("proof rejected") @@ -245,11 +245,11 @@ func getChallenge(fiatshamirSeeds [][]byte) (r fr.Element, err error) { // Marshal func (pk *ProvingKey) writeTo(enc *curve.Encoder) (int64, error) { - if err := enc.Encode(pk.basis); err != nil { + if err := enc.Encode(pk.Basis); err != nil { return enc.BytesWritten(), err } - err := enc.Encode(pk.basisExpSigma) + err := enc.Encode(pk.BasisExpSigma) return enc.BytesWritten(), err } @@ -265,14 +265,14 @@ func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error) { func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error) { dec := curve.NewDecoder(r) - if err := dec.Decode(&pk.basis); err != nil { + if err := dec.Decode(&pk.Basis); err != nil { return dec.BytesRead(), err } - if err := dec.Decode(&pk.basisExpSigma); err != nil { + if err := dec.Decode(&pk.BasisExpSigma); err != nil { return dec.BytesRead(), err } - if cL, pL := len(pk.basis), len(pk.basisExpSigma); cL != pL { + if cL, pL := len(pk.Basis), len(pk.BasisExpSigma); cL != pL { return dec.BytesRead(), fmt.Errorf("commitment basis size (%d) doesn't match proof basis size (%d)", cL, pL) } @@ -290,10 +290,10 @@ func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error) { func (vk *VerifyingKey) writeTo(enc *curve.Encoder) (int64, error) { var err error - if err = enc.Encode(&vk.g); err != nil { + if err = enc.Encode(&vk.G); err != nil { return enc.BytesWritten(), err } - err = enc.Encode(&vk.gRootSigmaNeg) + err = enc.Encode(&vk.GRootSigmaNeg) return enc.BytesWritten(), err } @@ -309,9 +309,9 @@ func (vk *VerifyingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder) dec := curve.NewDecoder(r, decOptions...) var err error - if err = dec.Decode(&vk.g); err != nil { + if err = dec.Decode(&vk.G); err != nil { return dec.BytesRead(), err } - err = dec.Decode(&vk.gRootSigmaNeg) + err = dec.Decode(&vk.GRootSigmaNeg) return dec.BytesRead(), err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go index a851779471..b0c8bcb523 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,50 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=1 (nothing to do) right.Add(&right, &tmp) return left.Equal(&right) } @@ -433,13 +501,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -466,17 +535,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -484,11 +554,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -501,7 +571,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -557,23 +627,23 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { // cf https://eprint.iacr.org/2019/403.pdf, 5 var res G1Jac - res.ScalarMultiplication(a, &xGen).Neg(&res).AddAssign(a) + res.ScalarMultiplication(q, &xGen).Neg(&res).AddAssign(q) p.Set(&res) return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -637,16 +707,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -655,43 +732,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -747,10 +826,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -760,7 +840,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -775,9 +855,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -786,7 +867,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -799,12 +880,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -831,9 +911,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -842,7 +923,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -855,11 +936,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -886,21 +968,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -913,21 +995,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -941,7 +1024,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -991,7 +1074,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1073,9 +1156,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go index 2c9bc5a6ae..cb01cf6b3c 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fptower.E2 } -// G2Jac is a point with fptower.E2 coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fptower.E2 } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fptower.E2 } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E2 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fptower.E2 @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fptower.E2 pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fptower.E2 lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) - return p -} - -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fptower.E2 - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E2 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,50 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E2 + var left, right, tmp, ZZ fptower.E2 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -418,13 +499,14 @@ func (p *G2Jac) IsInSubGroup() bool { return res.IsOnCurve() && res.Z.IsZero() } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -451,26 +533,27 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ψ(p) = u o π o u⁻¹ where u:E'→E iso from the twist to E -func (p *G2Jac) psi(a *G2Jac) *G2Jac { - p.Set(a) +// psi sets p to ψ(q) = u o π o u⁻¹ where u:E'→E is the isomorphism from the twist to the curve E and π is the Frobenius map. +func (p *G2Jac) psi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Conjugate(&p.X).Mul(&p.X, &endo.u) p.Y.Conjugate(&p.Y).Mul(&p.Y, &endo.v) p.Z.Conjugate(&p.Z) return p } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.MulByElement(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -478,11 +561,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -495,7 +578,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -551,23 +634,23 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { // https://eprint.iacr.org/2017/419.pdf, 4.1 var xg, xxg, res, t G2Jac - xg.ScalarMultiplication(a, &xGen) + xg.ScalarMultiplication(q, &xGen) xxg.ScalarMultiplication(&xg, &xGen) res.Set(&xxg). SubAssign(&xg). - SubAssign(a) + SubAssign(q) t.Set(&xg). - SubAssign(a). + SubAssign(q). psi(&t) res.AddAssign(&t) - t.Double(a) + t.Double(q) t.X.MulByElement(&t.X, &thirdRootOneG1) res.SubAssign(&t) @@ -579,15 +662,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -596,43 +679,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fptower.E2{} p.Y = fptower.E2{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -688,10 +773,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fptower.E2 @@ -701,7 +787,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -716,9 +802,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -727,7 +814,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -740,12 +827,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fptower.E2{} @@ -772,9 +858,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -783,7 +870,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -796,11 +883,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fptower.E2{} @@ -827,21 +915,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -854,21 +942,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -882,38 +971,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -992,9 +1081,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12.go index 4505624732..ca7aef9edb 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12.go @@ -67,14 +67,14 @@ func (z *E12) SetOne() *E12 { return z } -// Add set z=x+y in E12 and return z +// Add sets z=x+y in E12 and returns z func (z *E12) Add(x, y *E12) *E12 { z.C0.Add(&x.C0, &y.C0) z.C1.Add(&x.C1, &y.C1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E12) Sub(x, y *E12) *E12 { z.C0.Sub(&x.C0, &y.C0) z.C1.Sub(&x.C1, &y.C1) @@ -99,16 +99,17 @@ func (z *E12) SetRandom() (*E12, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E12) IsZero() bool { return z.C0.IsZero() && z.C1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E12) IsOne() bool { return z.C0.IsOne() && z.C1.IsZero() } -// Mul set z=x*y in E12 and return z +// Mul sets z=x*y in E12 and returns z func (z *E12) Mul(x, y *E12) *E12 { var a, b, c E6 a.Add(&x.C0, &x.C1) @@ -121,7 +122,7 @@ func (z *E12) Mul(x, y *E12) *E12 { return z } -// Square set z=x*x in E12 and return z +// Square sets z=x*x in E12 and returns z func (z *E12) Square(x *E12) *E12 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -406,7 +407,7 @@ func (z *E12) CyclotomicSquare(x *E12) *E12 { return z } -// Inverse set z to the inverse of x in E12 and return z +// Inverse sets z to the inverse of x in E12 and returns z // // if x == 0, sets and returns z = x func (z *E12) Inverse(x *E12) *E12 { @@ -424,8 +425,8 @@ func (z *E12) Inverse(x *E12) *E12 { return z } -// BatchInvertE12 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE12 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE12(a []E12) []E12 { @@ -635,12 +636,12 @@ func (z *E12) ExpGLV(x E12, k *big.Int) *E12 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E12) InverseUnitary(x *E12) *E12 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E12) Conjugate(x *E12) *E12 { *z = *x z.C1.Neg(&z.C1) @@ -846,6 +847,8 @@ func BatchDecompressTorus(x []E6) ([]E12, error) { return res, nil } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -855,6 +858,7 @@ func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { return z } +// Div divides an element in E12 by an element in E12 func (z *E12) Div(x *E12, y *E12) *E12 { var r E12 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e2.go index 874802d743..c5f7aaaa26 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e2.go @@ -101,11 +101,12 @@ func (z *E2) SetRandom() (*E2, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E2) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E2) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() } @@ -116,7 +117,7 @@ func (z *E2) Add(x, y *E2) *E2 { return z } -// Sub two elements of E2 +// Sub subtracts two elements of E2 func (z *E2) Sub(x, y *E2) *E2 { subE2(z, x, y) return z @@ -155,7 +156,7 @@ func (z *E2) Conjugate(x *E2) *E2 { return z } -// Halve sets z = z / 2 +// Halve sets z to z / 2 func (z *E2) Halve() { z.A0.Halve() z.A1.Halve() @@ -242,8 +243,8 @@ func (z *E2) Sqrt(x *E2) *E2 { return z } -// BatchInvertE2 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE2 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE2(a []E2) []E2 { @@ -278,6 +279,8 @@ func BatchInvertE2(a []E2) []E2 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -287,6 +290,7 @@ func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { return z } +// Div divides an element in E2 by an element in E2 func (z *E2) Div(x *E2, y *E2) *E2 { var r E2 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e6.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e6.go index 128007df27..1867470a88 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e6.go @@ -63,11 +63,12 @@ func (z *E6) SetRandom() (*E6, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E6) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() && z.B2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E6) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() && z.B2.IsZero() } @@ -88,7 +89,7 @@ func (z *E6) Neg(x *E6) *E6 { return z } -// Sub two elements of E6 +// Sub subtracts two elements of E6 func (z *E6) Sub(x, y *E6) *E6 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -286,8 +287,8 @@ func (z *E6) Inverse(x *E6) *E6 { return z } -// BatchInvertE6 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE6 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE6(a []E6) []E6 { @@ -322,6 +323,8 @@ func BatchInvertE6(a []E6) []E6 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -332,6 +335,7 @@ func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { return z } +// Div divides an element in E6 by an element in E6 func (z *E6) Div(x *E6, y *E6) *E6 { var r E6 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/kzg.go index 3458d655ef..592858d9e9 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bls12377.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bls12377.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bls12377.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bls12377.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bls12377.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bls12377.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bls12377.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bls12377.PairingCheckFixedQ( - []bls12377.G1Affine{totalG1Aff, negH}, + []bls12377.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/marshal.go index 7640734b35..64e344ee4e 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bls12-377" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bls12377.Encoder)) return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bls12377.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bls12377.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_affine.go index 422862c77a..0711888e0f 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_affine.go @@ -226,7 +226,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -554,7 +554,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_jacobian.go index 0df516f5b9..9b2c3d2e2e 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -145,7 +145,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g1.go index 0ae5e7ba2f..c484bfa141 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,50 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=1 (nothing to do) right.Add(&right, &tmp) return left.Equal(&right) } @@ -433,13 +501,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -466,17 +535,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -484,11 +554,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -501,7 +571,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -557,23 +627,23 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { // cf https://eprint.iacr.org/2019/403.pdf, 5 var res G1Jac - res.ScalarMultiplication(a, &xGen).Neg(&res).AddAssign(a) + res.ScalarMultiplication(q, &xGen).Neg(&res).AddAssign(q) p.Set(&res) return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -637,16 +707,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -655,43 +732,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -747,10 +826,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -760,7 +840,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -775,9 +855,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -786,7 +867,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -799,12 +880,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -831,9 +911,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -842,7 +923,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -855,11 +936,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -886,21 +968,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -913,21 +995,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -941,7 +1024,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -991,7 +1074,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1073,9 +1156,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g2.go index e22847a0c3..7e1eecbc97 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fptower.E2 } -// G2Jac is a point with fptower.E2 coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fptower.E2 } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fptower.E2 } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E2 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fptower.E2 @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fptower.E2 pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fptower.E2 lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) - return p -} - -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fptower.E2 - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E2 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,50 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E2 + var left, right, tmp, ZZ fptower.E2 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.Mul(&tmp, &bTwistCurveCoeff) right.Add(&right, &tmp) return left.Equal(&right) } @@ -418,13 +499,14 @@ func (p *G2Jac) IsInSubGroup() bool { return res.IsOnCurve() && res.Z.IsZero() } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -451,26 +533,27 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ψ(p) = u o π o u⁻¹ where u:E'→E iso from the twist to E -func (p *G2Jac) psi(a *G2Jac) *G2Jac { - p.Set(a) +// psi sets p to ψ(q) = u o π o u⁻¹ where u:E'→E is the isomorphism from the twist to the curve E and π is the Frobenius map. +func (p *G2Jac) psi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Conjugate(&p.X).Mul(&p.X, &endo.u) p.Y.Conjugate(&p.Y).Mul(&p.Y, &endo.v) p.Z.Conjugate(&p.Z) return p } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.MulByElement(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -478,11 +561,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -495,7 +578,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -551,23 +634,23 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { // https://eprint.iacr.org/2017/419.pdf, 4.1 var xg, xxg, res, t G2Jac - xg.ScalarMultiplication(a, &xGen) + xg.ScalarMultiplication(q, &xGen) xxg.ScalarMultiplication(&xg, &xGen) res.Set(&xxg). SubAssign(&xg). - SubAssign(a) + SubAssign(q) t.Set(&xg). - SubAssign(a). + SubAssign(q). psi(&t) res.AddAssign(&t) - t.Double(a) + t.Double(q) t.X.MulByElement(&t.X, &thirdRootOneG1) res.SubAssign(&t) @@ -579,15 +662,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -596,43 +679,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fptower.E2{} p.Y = fptower.E2{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -688,10 +773,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fptower.E2 @@ -701,7 +787,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -716,9 +802,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -727,7 +814,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -740,12 +827,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fptower.E2{} @@ -772,9 +858,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -783,7 +870,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -796,11 +883,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fptower.E2{} @@ -827,21 +915,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -854,21 +942,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -882,38 +971,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -992,9 +1081,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e12.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e12.go index a904866113..72b6664565 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e12.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e12.go @@ -67,14 +67,14 @@ func (z *E12) SetOne() *E12 { return z } -// Add set z=x+y in E12 and return z +// Add sets z=x+y in E12 and returns z func (z *E12) Add(x, y *E12) *E12 { z.C0.Add(&x.C0, &y.C0) z.C1.Add(&x.C1, &y.C1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E12) Sub(x, y *E12) *E12 { z.C0.Sub(&x.C0, &y.C0) z.C1.Sub(&x.C1, &y.C1) @@ -99,16 +99,17 @@ func (z *E12) SetRandom() (*E12, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E12) IsZero() bool { return z.C0.IsZero() && z.C1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E12) IsOne() bool { return z.C0.IsOne() && z.C1.IsZero() } -// Mul set z=x*y in E12 and return z +// Mul sets z=x*y in E12 and returns z func (z *E12) Mul(x, y *E12) *E12 { var a, b, c E6 a.Add(&x.C0, &x.C1) @@ -121,7 +122,7 @@ func (z *E12) Mul(x, y *E12) *E12 { return z } -// Square set z=x*x in E12 and return z +// Square sets z=x*x in E12 and returns z func (z *E12) Square(x *E12) *E12 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -406,7 +407,7 @@ func (z *E12) CyclotomicSquare(x *E12) *E12 { return z } -// Inverse set z to the inverse of x in E12 and return z +// Inverse sets z to the inverse of x in E12 and returns z // // if x == 0, sets and returns z = x func (z *E12) Inverse(x *E12) *E12 { @@ -424,8 +425,8 @@ func (z *E12) Inverse(x *E12) *E12 { return z } -// BatchInvertE12 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE12 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE12(a []E12) []E12 { @@ -635,12 +636,12 @@ func (z *E12) ExpGLV(x E12, k *big.Int) *E12 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E12) InverseUnitary(x *E12) *E12 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E12) Conjugate(x *E12) *E12 { *z = *x z.C1.Neg(&z.C1) @@ -846,6 +847,8 @@ func BatchDecompressTorus(x []E6) ([]E12, error) { return res, nil } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -855,6 +858,7 @@ func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { return z } +// Div divides an element in E12 by an element in E12 func (z *E12) Div(x *E12, y *E12) *E12 { var r E12 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e2.go index ff031c8d8e..e6a6c350c8 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e2.go @@ -101,11 +101,12 @@ func (z *E2) SetRandom() (*E2, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E2) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E2) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() } @@ -116,7 +117,7 @@ func (z *E2) Add(x, y *E2) *E2 { return z } -// Sub two elements of E2 +// Sub subtracts two elements of E2 func (z *E2) Sub(x, y *E2) *E2 { subE2(z, x, y) return z @@ -155,7 +156,7 @@ func (z *E2) Conjugate(x *E2) *E2 { return z } -// Halve sets z = z / 2 +// Halve sets z to z / 2 func (z *E2) Halve() { z.A0.Halve() z.A1.Halve() @@ -242,8 +243,8 @@ func (z *E2) Sqrt(x *E2) *E2 { return z } -// BatchInvertE2 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE2 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE2(a []E2) []E2 { @@ -278,6 +279,8 @@ func BatchInvertE2(a []E2) []E2 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -287,6 +290,7 @@ func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { return z } +// Div divides an element in E2 by an element in E2 func (z *E2) Div(x *E2, y *E2) *E2 { var r E2 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e6.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e6.go index 128007df27..1867470a88 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/internal/fptower/e6.go @@ -63,11 +63,12 @@ func (z *E6) SetRandom() (*E6, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E6) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() && z.B2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E6) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() && z.B2.IsZero() } @@ -88,7 +89,7 @@ func (z *E6) Neg(x *E6) *E6 { return z } -// Sub two elements of E6 +// Sub subtracts two elements of E6 func (z *E6) Sub(x, y *E6) *E6 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -286,8 +287,8 @@ func (z *E6) Inverse(x *E6) *E6 { return z } -// BatchInvertE6 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE6 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE6(a []E6) []E6 { @@ -322,6 +323,8 @@ func BatchInvertE6(a []E6) []E6 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -332,6 +335,7 @@ func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { return z } +// Div divides an element in E6 by an element in E6 func (z *E6) Div(x *E6, y *E6) *E6 { var r E6 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/kzg.go index 3624d41e07..1a2b7f26e7 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bls12378.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bls12378.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bls12378.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bls12378.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bls12378.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bls12378.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bls12378.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bls12378.PairingCheckFixedQ( - []bls12378.G1Affine{totalG1Aff, negH}, + []bls12378.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/marshal.go index 9203b44fc3..f3349849c9 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bls12-378" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bls12378.Encoder)) return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bls12378.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bls12378.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_affine.go index 276ef2e4d5..53459815f6 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_affine.go @@ -226,7 +226,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -554,7 +554,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_jacobian.go index 866b5b98f7..952a76711c 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-378/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -147,7 +147,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/doc.go index 2391a9f63b..b5dd44e642 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/doc.go @@ -14,5 +14,6 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT -// Package fft provides in-place discrete Fourier transform. +// Package fft provides in-place discrete Fourier transform on powers-of-two subgroups +// of 𝔽ᵣˣ (the multiplicative group (ℤ/rℤ, x) ). package fft diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/domain.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/domain.go index 30113b4667..3bc21d6f86 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/domain.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft/domain.go @@ -64,6 +64,15 @@ type Domain struct { cosetTableInv []fr.Element } +// GeneratorFullMultiplicativeGroup returns a generator of 𝔽ᵣˣ +func GeneratorFullMultiplicativeGroup() fr.Element { + var res fr.Element + + res.SetUint64(7) + + return res +} + // NewDomain returns a subgroup with a power of 2 cardinality // cardinality >= m // shift: when specified, it's the element by which the set of root of unity is shifted. @@ -72,10 +81,7 @@ func NewDomain(m uint64, opts ...DomainOption) *Domain { domain := &Domain{} x := ecc.NextPowerOfTwo(m) domain.Cardinality = uint64(x) - - // generator of the largest 2-adic subgroup - - domain.FrMultiplicativeGen.SetUint64(7) + domain.FrMultiplicativeGen = GeneratorFullMultiplicativeGroup() if opt.shift != nil { domain.FrMultiplicativeGen.Set(opt.shift) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/gkr/gkr.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/gkr/gkr.go index 64b48da067..b4d322ad16 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/gkr/gkr.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/gkr/gkr.go @@ -884,10 +884,10 @@ func (g AddGate) Evaluate(x ...fr.Element) (res fr.Element) { // set zero case 1: res.Set(&x[0]) - case 2: + default: res.Add(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Add(&res, &x[2]) + res.Add(&res, &x[i]) } } return @@ -909,7 +909,7 @@ func (g MulGate) Evaluate(x ...fr.Element) (res fr.Element) { default: res.Mul(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Mul(&res, &x[2]) + res.Mul(&res, &x[i]) } } return diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/doc.go index d527ead9ef..78837e1c80 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/doc.go @@ -15,4 +15,46 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT // Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// # Hash input format +// +// The MiMC hash function is defined over a field. The input to the hash +// function is a byte slice. The byte slice is interpreted as a sequence of +// field elements. Due to this interpretation, the input byte slice length must +// be multiple of the field modulus size. And every secuence of byte slice for a +// single field element must be strictly less than the field modulus. package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/mimc.go index 716a655b45..f492cadf96 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/mimc.go @@ -41,8 +41,9 @@ var ( // digest represents the partial evaluation of the checksum // along with the params of the mimc function type digest struct { - h fr.Element - data []fr.Element // data to hash + h fr.Element + data []fr.Element // data to hash + byteOrder fr.ByteOrder } // GetConstants exposed to be used in gnark @@ -56,9 +57,11 @@ func GetConstants() []big.Int { } // NewMiMC returns a MiMCImpl object, pure-go reference implementation -func NewMiMC() hash.Hash { +func NewMiMC(opts ...Option) hash.Hash { d := new(digest) d.Reset() + cfg := mimcOptions(opts...) + d.byteOrder = cfg.byteOrder return d } @@ -111,7 +114,7 @@ func (d *digest) Write(p []byte) (int, error) { var start int for start = 0; start < len(p); start += BlockSize { - if elem, err := fr.BigEndian.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { + if elem, err := d.byteOrder.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { d.data = append(d.data, elem) } else { return 0, err diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/options.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/options.go new file mode 100644 index 0000000000..20d1dafba8 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc/options.go @@ -0,0 +1,50 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package mimc + +import ( + "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" +) + +// Option defines option for altering the behavior of the MiMC hasher. +// See the descriptions of functions returning instances of this type for +// particular options. +type Option func(*mimcConfig) + +type mimcConfig struct { + byteOrder fr.ByteOrder +} + +// default options +func mimcOptions(opts ...Option) mimcConfig { + // apply options + opt := mimcConfig{ + byteOrder: fr.BigEndian, + } + for _, option := range opts { + option(&opt) + } + return opt +} + +// WithByteOrder sets the byte order used to decode the input +// in the Write method. Default is BigEndian. +func WithByteOrder(byteOrder fr.ByteOrder) Option { + return func(opt *mimcConfig) { + opt.byteOrder = byteOrder + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/pedersen/pedersen.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/pedersen/pedersen.go index 204c6f13b6..32bc01043f 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/pedersen/pedersen.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/pedersen/pedersen.go @@ -30,13 +30,13 @@ import ( // ProvingKey for committing and proofs of knowledge type ProvingKey struct { - basis []curve.G1Affine - basisExpSigma []curve.G1Affine + Basis []curve.G1Affine + BasisExpSigma []curve.G1Affine } type VerifyingKey struct { - g curve.G2Affine // TODO @tabaie: does this really have to be randomized? - gRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} + G curve.G2Affine // TODO @tabaie: does this really have to be randomized? + GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} } func randomFrSizedBytes() ([]byte, error) { @@ -55,7 +55,7 @@ func randomOnG2() (curve.G2Affine, error) { // TODO: Add to G2.go? func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error) { - if vk.g, err = randomOnG2(); err != nil { + if vk.G, err = randomOnG2(); err != nil { return } @@ -70,21 +70,21 @@ func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err err var sigmaInvNeg big.Int sigmaInvNeg.ModInverse(sigma, fr.Modulus()) sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) - vk.gRootSigmaNeg.ScalarMultiplication(&vk.g, &sigmaInvNeg) + vk.GRootSigmaNeg.ScalarMultiplication(&vk.G, &sigmaInvNeg) pk = make([]ProvingKey, len(bases)) for i := range bases { - pk[i].basisExpSigma = make([]curve.G1Affine, len(bases[i])) + pk[i].BasisExpSigma = make([]curve.G1Affine, len(bases[i])) for j := range bases[i] { - pk[i].basisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) + pk[i].BasisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) } - pk[i].basis = bases[i] + pk[i].Basis = bases[i] } return } func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -95,13 +95,13 @@ func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, e NbTasks: 1, // TODO Experiment } - _, err = pok.MultiExp(pk.basisExpSigma, values, config) + _, err = pok.MultiExp(pk.BasisExpSigma, values, config) return } func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -111,7 +111,7 @@ func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, er config := ecc.MultiExpConfig{ NbTasks: 1, } - _, err = commitment.MultiExp(pk.basis, values, config) + _, err = commitment.MultiExp(pk.Basis, values, config) return } @@ -131,7 +131,7 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt offset := 0 for i := range pk { - if len(values[i]) != len(pk[i].basis) { + if len(values[i]) != len(pk[i].Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -147,14 +147,14 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt scaledValues := make([]fr.Element, offset) basis := make([]curve.G1Affine, offset) - copy(basis, pk[0].basisExpSigma) + copy(basis, pk[0].BasisExpSigma) copy(scaledValues, values[0]) offset = len(values[0]) rI := r for i := 1; i < len(pk); i++ { - copy(basis[offset:], pk[i].basisExpSigma) - for j := range pk[i].basis { + copy(basis[offset:], pk[i].BasisExpSigma) + for j := range pk[i].Basis { scaledValues[offset].Mul(&values[i][j], &rI) offset++ } @@ -215,7 +215,7 @@ func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G return fmt.Errorf("subgroup check failed") } - if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.g, vk.gRootSigmaNeg}); err != nil { + if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.G, vk.GRootSigmaNeg}); err != nil { return err } else if !isOne { return fmt.Errorf("proof rejected") @@ -245,11 +245,11 @@ func getChallenge(fiatshamirSeeds [][]byte) (r fr.Element, err error) { // Marshal func (pk *ProvingKey) writeTo(enc *curve.Encoder) (int64, error) { - if err := enc.Encode(pk.basis); err != nil { + if err := enc.Encode(pk.Basis); err != nil { return enc.BytesWritten(), err } - err := enc.Encode(pk.basisExpSigma) + err := enc.Encode(pk.BasisExpSigma) return enc.BytesWritten(), err } @@ -265,14 +265,14 @@ func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error) { func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error) { dec := curve.NewDecoder(r) - if err := dec.Decode(&pk.basis); err != nil { + if err := dec.Decode(&pk.Basis); err != nil { return dec.BytesRead(), err } - if err := dec.Decode(&pk.basisExpSigma); err != nil { + if err := dec.Decode(&pk.BasisExpSigma); err != nil { return dec.BytesRead(), err } - if cL, pL := len(pk.basis), len(pk.basisExpSigma); cL != pL { + if cL, pL := len(pk.Basis), len(pk.BasisExpSigma); cL != pL { return dec.BytesRead(), fmt.Errorf("commitment basis size (%d) doesn't match proof basis size (%d)", cL, pL) } @@ -290,10 +290,10 @@ func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error) { func (vk *VerifyingKey) writeTo(enc *curve.Encoder) (int64, error) { var err error - if err = enc.Encode(&vk.g); err != nil { + if err = enc.Encode(&vk.G); err != nil { return enc.BytesWritten(), err } - err = enc.Encode(&vk.gRootSigmaNeg) + err = enc.Encode(&vk.GRootSigmaNeg) return enc.BytesWritten(), err } @@ -309,9 +309,9 @@ func (vk *VerifyingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder) dec := curve.NewDecoder(r, decOptions...) var err error - if err = dec.Decode(&vk.g); err != nil { + if err = dec.Decode(&vk.G); err != nil { return dec.BytesRead(), err } - err = dec.Decode(&vk.gRootSigmaNeg) + err = dec.Decode(&vk.GRootSigmaNeg) return dec.BytesRead(), err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go index d3bb865673..50ab4713e3 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,51 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=4 + tmp.Double(&tmp).Double(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -433,13 +502,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -466,17 +536,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -484,11 +555,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -501,7 +572,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -557,23 +628,23 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { // cf https://eprint.iacr.org/2019/403.pdf, 5 var res G1Jac - res.ScalarMultiplication(a, &xGen).AddAssign(a) + res.ScalarMultiplication(q, &xGen).AddAssign(q) p.Set(&res) return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -637,16 +708,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -655,43 +733,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -747,10 +827,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -760,7 +841,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -775,9 +856,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -786,7 +868,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -799,12 +881,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -831,9 +912,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -842,7 +924,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -855,11 +937,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -886,21 +969,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -913,21 +996,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -941,7 +1025,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -991,7 +1075,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1073,9 +1157,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go index 69056f9b37..827566d084 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fptower.E2 } -// G2Jac is a point with fptower.E2 coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fptower.E2 } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fptower.E2 } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E2 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fptower.E2 @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fptower.E2 pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fptower.E2 lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) - return p -} - -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fptower.E2 - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E2 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,50 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E2 + var left, right, tmp, ZZ fptower.E2 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -419,13 +500,14 @@ func (p *G2Jac) IsInSubGroup() bool { return res.IsOnCurve() && res.Z.IsZero() } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -452,26 +534,27 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ψ(p) = u o π o u⁻¹ where u:E'→E iso from the twist to E -func (p *G2Jac) psi(a *G2Jac) *G2Jac { - p.Set(a) +// psi sets p to ψ(q) = u o π o u⁻¹ where u:E'→E is the isomorphism from the twist to the curve E and π is the Frobenius map. +func (p *G2Jac) psi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Conjugate(&p.X).Mul(&p.X, &endo.u) p.Y.Conjugate(&p.Y).Mul(&p.Y, &endo.v) p.Z.Conjugate(&p.Z) return p } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.MulByElement(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -479,11 +562,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -496,7 +579,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -552,23 +635,23 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { // https://eprint.iacr.org/2017/419.pdf, 4.1 var xg, xxg, res, t G2Jac - xg.ScalarMultiplication(a, &xGen).Neg(&xg) + xg.ScalarMultiplication(q, &xGen).Neg(&xg) xxg.ScalarMultiplication(&xg, &xGen).Neg(&xxg) res.Set(&xxg). SubAssign(&xg). - SubAssign(a) + SubAssign(q) t.Set(&xg). - SubAssign(a). + SubAssign(q). psi(&t) res.AddAssign(&t) - t.Double(a) + t.Double(q) t.X.MulByElement(&t.X, &thirdRootOneG1) res.SubAssign(&t) @@ -580,15 +663,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -597,43 +680,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fptower.E2{} p.Y = fptower.E2{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -689,10 +774,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fptower.E2 @@ -702,7 +788,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -717,9 +803,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -728,7 +815,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -741,12 +828,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fptower.E2{} @@ -773,9 +859,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -784,7 +871,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -797,11 +884,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fptower.E2{} @@ -828,21 +916,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -855,21 +943,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -883,38 +972,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -993,9 +1082,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12.go index 095a79a4c0..65945c3d9d 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12.go @@ -67,14 +67,14 @@ func (z *E12) SetOne() *E12 { return z } -// Add set z=x+y in E12 and return z +// Add sets z=x+y in E12 and returns z func (z *E12) Add(x, y *E12) *E12 { z.C0.Add(&x.C0, &y.C0) z.C1.Add(&x.C1, &y.C1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E12) Sub(x, y *E12) *E12 { z.C0.Sub(&x.C0, &y.C0) z.C1.Sub(&x.C1, &y.C1) @@ -99,16 +99,17 @@ func (z *E12) SetRandom() (*E12, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E12) IsZero() bool { return z.C0.IsZero() && z.C1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E12) IsOne() bool { return z.C0.IsOne() && z.C1.IsZero() } -// Mul set z=x*y in E12 and return z +// Mul sets z=x*y in E12 and returns z func (z *E12) Mul(x, y *E12) *E12 { var a, b, c E6 a.Add(&x.C0, &x.C1) @@ -121,7 +122,7 @@ func (z *E12) Mul(x, y *E12) *E12 { return z } -// Square set z=x*x in E12 and return z +// Square sets z=x*x in E12 and returns z func (z *E12) Square(x *E12) *E12 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -406,7 +407,7 @@ func (z *E12) CyclotomicSquare(x *E12) *E12 { return z } -// Inverse set z to the inverse of x in E12 and return z +// Inverse sets z to the inverse of x in E12 and returns z // // if x == 0, sets and returns z = x func (z *E12) Inverse(x *E12) *E12 { @@ -424,8 +425,8 @@ func (z *E12) Inverse(x *E12) *E12 { return z } -// BatchInvertE12 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE12 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE12(a []E12) []E12 { @@ -635,12 +636,12 @@ func (z *E12) ExpGLV(x E12, k *big.Int) *E12 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E12) InverseUnitary(x *E12) *E12 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E12) Conjugate(x *E12) *E12 { *z = *x z.C1.Neg(&z.C1) @@ -846,6 +847,8 @@ func BatchDecompressTorus(x []E6) ([]E12, error) { return res, nil } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -855,6 +858,7 @@ func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { return z } +// Div divides an element in E12 by an element in E12 func (z *E12) Div(x *E12, y *E12) *E12 { var r E12 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e2.go index 0390e7e4b3..75fd711c78 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e2.go @@ -101,11 +101,12 @@ func (z *E2) SetRandom() (*E2, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E2) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E2) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() } @@ -116,7 +117,7 @@ func (z *E2) Add(x, y *E2) *E2 { return z } -// Sub two elements of E2 +// Sub subtracts two elements of E2 func (z *E2) Sub(x, y *E2) *E2 { subE2(z, x, y) return z @@ -155,7 +156,7 @@ func (z *E2) Conjugate(x *E2) *E2 { return z } -// Halve sets z = z / 2 +// Halve sets z to z / 2 func (z *E2) Halve() { z.A0.Halve() z.A1.Halve() @@ -213,7 +214,7 @@ func init() { var sqrtExp1, sqrtExp2 big.Int -// Sqrt sets z to the square root of and returns z +// Sqrt sets z to the square root of x and returns z // The function does not test whether the square root // exists or not, it's up to the caller to call // Legendre beforehand. @@ -243,8 +244,8 @@ func (z *E2) Sqrt(x *E2) *E2 { return z } -// BatchInvertE2 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE2 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE2(a []E2) []E2 { @@ -279,6 +280,8 @@ func BatchInvertE2(a []E2) []E2 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -288,6 +291,7 @@ func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { return z } +// Div divides an element in E2 by an element in E2 func (z *E2) Div(x *E2, y *E2) *E2 { var r E2 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e6.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e6.go index 128007df27..1867470a88 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e6.go @@ -63,11 +63,12 @@ func (z *E6) SetRandom() (*E6, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E6) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() && z.B2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E6) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() && z.B2.IsZero() } @@ -88,7 +89,7 @@ func (z *E6) Neg(x *E6) *E6 { return z } -// Sub two elements of E6 +// Sub subtracts two elements of E6 func (z *E6) Sub(x, y *E6) *E6 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -286,8 +287,8 @@ func (z *E6) Inverse(x *E6) *E6 { return z } -// BatchInvertE6 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE6 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE6(a []E6) []E6 { @@ -322,6 +323,8 @@ func BatchInvertE6(a []E6) []E6 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -332,6 +335,7 @@ func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { return z } +// Div divides an element in E6 by an element in E6 func (z *E6) Div(x *E6, y *E6) *E6 { var r E6 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/kzg.go index 42540cd288..9813880c0a 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bls12381.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bls12381.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bls12381.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bls12381.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bls12381.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bls12381.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bls12381.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bls12381.PairingCheckFixedQ( - []bls12381.G1Affine{totalG1Aff, negH}, + []bls12381.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/marshal.go index 5583906193..bbfe032976 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bls12-381" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bls12381.Encoder)) return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bls12381.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bls12381.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_affine.go index 937a43c9d1..3b3fa855fd 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_affine.go @@ -226,7 +226,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -554,7 +554,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_jacobian.go index 1b8c0e79aa..80b042d8d3 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -145,7 +145,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/doc.go index 2391a9f63b..b5dd44e642 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/doc.go @@ -14,5 +14,6 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT -// Package fft provides in-place discrete Fourier transform. +// Package fft provides in-place discrete Fourier transform on powers-of-two subgroups +// of 𝔽ᵣˣ (the multiplicative group (ℤ/rℤ, x) ). package fft diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/domain.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/domain.go index de895ab37d..765f4a8276 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/domain.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft/domain.go @@ -64,6 +64,15 @@ type Domain struct { cosetTableInv []fr.Element } +// GeneratorFullMultiplicativeGroup returns a generator of 𝔽ᵣˣ +func GeneratorFullMultiplicativeGroup() fr.Element { + var res fr.Element + + res.SetUint64(7) + + return res +} + // NewDomain returns a subgroup with a power of 2 cardinality // cardinality >= m // shift: when specified, it's the element by which the set of root of unity is shifted. @@ -72,10 +81,7 @@ func NewDomain(m uint64, opts ...DomainOption) *Domain { domain := &Domain{} x := ecc.NextPowerOfTwo(m) domain.Cardinality = uint64(x) - - // generator of the largest 2-adic subgroup - - domain.FrMultiplicativeGen.SetUint64(7) + domain.FrMultiplicativeGen = GeneratorFullMultiplicativeGroup() if opt.shift != nil { domain.FrMultiplicativeGen.Set(opt.shift) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/gkr/gkr.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/gkr/gkr.go index ca1f4c833c..49d6a05543 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/gkr/gkr.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/gkr/gkr.go @@ -884,10 +884,10 @@ func (g AddGate) Evaluate(x ...fr.Element) (res fr.Element) { // set zero case 1: res.Set(&x[0]) - case 2: + default: res.Add(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Add(&res, &x[2]) + res.Add(&res, &x[i]) } } return @@ -909,7 +909,7 @@ func (g MulGate) Evaluate(x ...fr.Element) (res fr.Element) { default: res.Mul(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Mul(&res, &x[2]) + res.Mul(&res, &x[i]) } } return diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/doc.go index d527ead9ef..78837e1c80 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/doc.go @@ -15,4 +15,46 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT // Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// # Hash input format +// +// The MiMC hash function is defined over a field. The input to the hash +// function is a byte slice. The byte slice is interpreted as a sequence of +// field elements. Due to this interpretation, the input byte slice length must +// be multiple of the field modulus size. And every secuence of byte slice for a +// single field element must be strictly less than the field modulus. package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/mimc.go index 1912d66dfe..289944edc4 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/mimc.go @@ -41,8 +41,9 @@ var ( // digest represents the partial evaluation of the checksum // along with the params of the mimc function type digest struct { - h fr.Element - data []fr.Element // data to hash + h fr.Element + data []fr.Element // data to hash + byteOrder fr.ByteOrder } // GetConstants exposed to be used in gnark @@ -56,9 +57,11 @@ func GetConstants() []big.Int { } // NewMiMC returns a MiMCImpl object, pure-go reference implementation -func NewMiMC() hash.Hash { +func NewMiMC(opts ...Option) hash.Hash { d := new(digest) d.Reset() + cfg := mimcOptions(opts...) + d.byteOrder = cfg.byteOrder return d } @@ -111,7 +114,7 @@ func (d *digest) Write(p []byte) (int, error) { var start int for start = 0; start < len(p); start += BlockSize { - if elem, err := fr.BigEndian.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { + if elem, err := d.byteOrder.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { d.data = append(d.data, elem) } else { return 0, err diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/options.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/options.go new file mode 100644 index 0000000000..e25f3cce22 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/mimc/options.go @@ -0,0 +1,50 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package mimc + +import ( + "github.com/consensys/gnark-crypto/ecc/bls24-315/fr" +) + +// Option defines option for altering the behavior of the MiMC hasher. +// See the descriptions of functions returning instances of this type for +// particular options. +type Option func(*mimcConfig) + +type mimcConfig struct { + byteOrder fr.ByteOrder +} + +// default options +func mimcOptions(opts ...Option) mimcConfig { + // apply options + opt := mimcConfig{ + byteOrder: fr.BigEndian, + } + for _, option := range opts { + option(&opt) + } + return opt +} + +// WithByteOrder sets the byte order used to decode the input +// in the Write method. Default is BigEndian. +func WithByteOrder(byteOrder fr.ByteOrder) Option { + return func(opt *mimcConfig) { + opt.byteOrder = byteOrder + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/pedersen/pedersen.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/pedersen/pedersen.go index 9616162110..8c9a5cc87d 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/pedersen/pedersen.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/fr/pedersen/pedersen.go @@ -30,13 +30,13 @@ import ( // ProvingKey for committing and proofs of knowledge type ProvingKey struct { - basis []curve.G1Affine - basisExpSigma []curve.G1Affine + Basis []curve.G1Affine + BasisExpSigma []curve.G1Affine } type VerifyingKey struct { - g curve.G2Affine // TODO @tabaie: does this really have to be randomized? - gRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} + G curve.G2Affine // TODO @tabaie: does this really have to be randomized? + GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} } func randomFrSizedBytes() ([]byte, error) { @@ -55,7 +55,7 @@ func randomOnG2() (curve.G2Affine, error) { // TODO: Add to G2.go? func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error) { - if vk.g, err = randomOnG2(); err != nil { + if vk.G, err = randomOnG2(); err != nil { return } @@ -70,21 +70,21 @@ func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err err var sigmaInvNeg big.Int sigmaInvNeg.ModInverse(sigma, fr.Modulus()) sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) - vk.gRootSigmaNeg.ScalarMultiplication(&vk.g, &sigmaInvNeg) + vk.GRootSigmaNeg.ScalarMultiplication(&vk.G, &sigmaInvNeg) pk = make([]ProvingKey, len(bases)) for i := range bases { - pk[i].basisExpSigma = make([]curve.G1Affine, len(bases[i])) + pk[i].BasisExpSigma = make([]curve.G1Affine, len(bases[i])) for j := range bases[i] { - pk[i].basisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) + pk[i].BasisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) } - pk[i].basis = bases[i] + pk[i].Basis = bases[i] } return } func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -95,13 +95,13 @@ func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, e NbTasks: 1, // TODO Experiment } - _, err = pok.MultiExp(pk.basisExpSigma, values, config) + _, err = pok.MultiExp(pk.BasisExpSigma, values, config) return } func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -111,7 +111,7 @@ func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, er config := ecc.MultiExpConfig{ NbTasks: 1, } - _, err = commitment.MultiExp(pk.basis, values, config) + _, err = commitment.MultiExp(pk.Basis, values, config) return } @@ -131,7 +131,7 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt offset := 0 for i := range pk { - if len(values[i]) != len(pk[i].basis) { + if len(values[i]) != len(pk[i].Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -147,14 +147,14 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt scaledValues := make([]fr.Element, offset) basis := make([]curve.G1Affine, offset) - copy(basis, pk[0].basisExpSigma) + copy(basis, pk[0].BasisExpSigma) copy(scaledValues, values[0]) offset = len(values[0]) rI := r for i := 1; i < len(pk); i++ { - copy(basis[offset:], pk[i].basisExpSigma) - for j := range pk[i].basis { + copy(basis[offset:], pk[i].BasisExpSigma) + for j := range pk[i].Basis { scaledValues[offset].Mul(&values[i][j], &rI) offset++ } @@ -215,7 +215,7 @@ func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G return fmt.Errorf("subgroup check failed") } - if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.g, vk.gRootSigmaNeg}); err != nil { + if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.G, vk.GRootSigmaNeg}); err != nil { return err } else if !isOne { return fmt.Errorf("proof rejected") @@ -245,11 +245,11 @@ func getChallenge(fiatshamirSeeds [][]byte) (r fr.Element, err error) { // Marshal func (pk *ProvingKey) writeTo(enc *curve.Encoder) (int64, error) { - if err := enc.Encode(pk.basis); err != nil { + if err := enc.Encode(pk.Basis); err != nil { return enc.BytesWritten(), err } - err := enc.Encode(pk.basisExpSigma) + err := enc.Encode(pk.BasisExpSigma) return enc.BytesWritten(), err } @@ -265,14 +265,14 @@ func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error) { func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error) { dec := curve.NewDecoder(r) - if err := dec.Decode(&pk.basis); err != nil { + if err := dec.Decode(&pk.Basis); err != nil { return dec.BytesRead(), err } - if err := dec.Decode(&pk.basisExpSigma); err != nil { + if err := dec.Decode(&pk.BasisExpSigma); err != nil { return dec.BytesRead(), err } - if cL, pL := len(pk.basis), len(pk.basisExpSigma); cL != pL { + if cL, pL := len(pk.Basis), len(pk.BasisExpSigma); cL != pL { return dec.BytesRead(), fmt.Errorf("commitment basis size (%d) doesn't match proof basis size (%d)", cL, pL) } @@ -290,10 +290,10 @@ func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error) { func (vk *VerifyingKey) writeTo(enc *curve.Encoder) (int64, error) { var err error - if err = enc.Encode(&vk.g); err != nil { + if err = enc.Encode(&vk.G); err != nil { return enc.BytesWritten(), err } - err = enc.Encode(&vk.gRootSigmaNeg) + err = enc.Encode(&vk.GRootSigmaNeg) return enc.BytesWritten(), err } @@ -309,9 +309,9 @@ func (vk *VerifyingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder) dec := curve.NewDecoder(r, decOptions...) var err error - if err = dec.Decode(&vk.g); err != nil { + if err = dec.Decode(&vk.G); err != nil { return dec.BytesRead(), err } - err = dec.Decode(&vk.gRootSigmaNeg) + err = dec.Decode(&vk.GRootSigmaNeg) return dec.BytesRead(), err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g1.go index 38a506268e..52de0e1d6e 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,50 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=1 (nothing to do) right.Add(&right, &tmp) return left.Equal(&right) } @@ -435,13 +503,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -468,17 +537,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -486,11 +556,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -503,7 +573,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -559,23 +629,23 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { // cf https://eprint.iacr.org/2019/403.pdf, 5 var res G1Jac - res.ScalarMultiplication(a, &xGen).AddAssign(a) + res.ScalarMultiplication(q, &xGen).AddAssign(q) p.Set(&res) return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -639,16 +709,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -657,43 +734,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -749,10 +828,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -762,7 +842,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -777,9 +857,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -788,7 +869,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -801,12 +882,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -833,9 +913,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -844,7 +925,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -857,11 +938,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -888,21 +970,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -915,21 +997,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -943,7 +1026,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -993,7 +1076,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1075,9 +1158,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g2.go index 5d0974a0a4..a4483774ff 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fptower.E4 } -// G2Jac is a point with fptower.E4 coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fptower.E4 } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fptower.E4 } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E4 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fptower.E4 @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fptower.E4 pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fptower.E4 lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) - return p -} - -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fptower.E4 - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E4 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,50 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E4 + var left, right, tmp, ZZ fptower.E4 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -420,13 +501,14 @@ func (p *G2Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -453,26 +535,27 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ψ(p) = u o π o u⁻¹ where u:E'→E iso from the twist to E -func (p *G2Jac) psi(a *G2Jac) *G2Jac { - p.Set(a) +// psi sets p to ψ(q) = u o π o u⁻¹ where u:E'→E is the isomorphism from the twist to the curve E and π is the Frobenius map. +func (p *G2Jac) psi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Frobenius(&p.X).Mul(&p.X, &endo.u) p.Y.Frobenius(&p.Y).Mul(&p.Y, &endo.v) p.Z.Frobenius(&p.Z) return p } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.MulByElement(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -480,11 +563,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -497,7 +580,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -553,18 +636,18 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { // https://eprint.iacr.org/2017/419.pdf, section 4.2 // multiply by (3x⁴-3)*cofacor var xg, xxg, xxxg, xxxxg, res, t G2Jac - xg.ScalarMultiplication(a, &xGen).Neg(&xg).SubAssign(a) + xg.ScalarMultiplication(q, &xGen).Neg(&xg).SubAssign(q) xxg.ScalarMultiplication(&xg, &xGen).Neg(&xxg) xxxg.ScalarMultiplication(&xxg, &xGen).Neg(&xxxg) xxxxg.ScalarMultiplication(&xxxg, &xGen).Neg(&xxxxg) res.Set(&xxxxg). - SubAssign(a) + SubAssign(q) t.Set(&xxxg). psi(&t). @@ -581,7 +664,7 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { psi(&t). AddAssign(&res) - res.Double(a). + res.Double(q). psi(&res). psi(&res). psi(&res). @@ -595,15 +678,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -612,43 +695,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fptower.E4{} p.Y = fptower.E4{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -704,10 +789,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fptower.E4 @@ -717,7 +803,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -732,9 +818,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -743,7 +830,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -756,12 +843,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fptower.E4{} @@ -788,9 +874,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -799,7 +886,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -812,11 +899,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fptower.E4{} @@ -843,21 +931,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E4 - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -870,21 +958,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E4 - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -898,38 +987,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1008,9 +1097,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e12.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e12.go index f2c3922011..ca0f092167 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e12.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e12.go @@ -70,11 +70,12 @@ func (z *E12) SetRandom() (*E12, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E12) IsZero() bool { return z.C0.IsZero() && z.C1.IsZero() && z.C2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E12) IsOne() bool { return z.C0.IsOne() && z.C1.IsZero() && z.C2.IsZero() } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e2.go index a23c0ebb99..2c1d53fbbb 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e2.go @@ -91,11 +91,12 @@ func (z *E2) SetRandom() (*E2, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E2) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E2) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e24.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e24.go index 3cefb71948..22b7183b15 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e24.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e24.go @@ -97,11 +97,12 @@ func (z *E24) SetRandom() (*E24, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E24) IsZero() bool { return z.D0.IsZero() && z.D1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E24) IsOne() bool { return z.D0.IsOne() && z.D1.IsZero() } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e4.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e4.go index 204cf5bd3e..3eb683b782 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e4.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/internal/fptower/e4.go @@ -133,11 +133,12 @@ func (z *E4) SetRandom() (*E4, error) { return z, nil } -// IsZero returns true if the element is zero, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E4) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E4) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/kzg.go index 43e16d9c01..0cd7cfbbf9 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bls24315.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bls24315.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bls24315.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bls24315.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bls24315.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bls24315.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bls24315.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bls24315.PairingCheckFixedQ( - []bls24315.G1Affine{totalG1Aff, negH}, + []bls24315.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/marshal.go index a492a7f4ca..2d5c4ead9f 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bls24-315" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bls24315.Encoder)) return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bls24315.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bls24315.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_affine.go index 65c4785704..ebe85c7510 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_affine.go @@ -226,7 +226,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -554,7 +554,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_jacobian.go index c55478337c..76d08a460c 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-315/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -145,7 +145,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/doc.go index 2391a9f63b..b5dd44e642 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/doc.go @@ -14,5 +14,6 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT -// Package fft provides in-place discrete Fourier transform. +// Package fft provides in-place discrete Fourier transform on powers-of-two subgroups +// of 𝔽ᵣˣ (the multiplicative group (ℤ/rℤ, x) ). package fft diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/domain.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/domain.go index 54d98c2918..6fcdd4f337 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/domain.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft/domain.go @@ -64,6 +64,15 @@ type Domain struct { cosetTableInv []fr.Element } +// GeneratorFullMultiplicativeGroup returns a generator of 𝔽ᵣˣ +func GeneratorFullMultiplicativeGroup() fr.Element { + var res fr.Element + + res.SetUint64(7) + + return res +} + // NewDomain returns a subgroup with a power of 2 cardinality // cardinality >= m // shift: when specified, it's the element by which the set of root of unity is shifted. @@ -72,10 +81,7 @@ func NewDomain(m uint64, opts ...DomainOption) *Domain { domain := &Domain{} x := ecc.NextPowerOfTwo(m) domain.Cardinality = uint64(x) - - // generator of the largest 2-adic subgroup - - domain.FrMultiplicativeGen.SetUint64(7) + domain.FrMultiplicativeGen = GeneratorFullMultiplicativeGroup() if opt.shift != nil { domain.FrMultiplicativeGen.Set(opt.shift) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/gkr/gkr.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/gkr/gkr.go index 0dc5b48832..fde5babfd4 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/gkr/gkr.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/gkr/gkr.go @@ -884,10 +884,10 @@ func (g AddGate) Evaluate(x ...fr.Element) (res fr.Element) { // set zero case 1: res.Set(&x[0]) - case 2: + default: res.Add(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Add(&res, &x[2]) + res.Add(&res, &x[i]) } } return @@ -909,7 +909,7 @@ func (g MulGate) Evaluate(x ...fr.Element) (res fr.Element) { default: res.Mul(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Mul(&res, &x[2]) + res.Mul(&res, &x[i]) } } return diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/doc.go index d527ead9ef..78837e1c80 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/doc.go @@ -15,4 +15,46 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT // Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// # Hash input format +// +// The MiMC hash function is defined over a field. The input to the hash +// function is a byte slice. The byte slice is interpreted as a sequence of +// field elements. Due to this interpretation, the input byte slice length must +// be multiple of the field modulus size. And every secuence of byte slice for a +// single field element must be strictly less than the field modulus. package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/mimc.go index c0050e0568..b9024e7e5b 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/mimc.go @@ -41,8 +41,9 @@ var ( // digest represents the partial evaluation of the checksum // along with the params of the mimc function type digest struct { - h fr.Element - data []fr.Element // data to hash + h fr.Element + data []fr.Element // data to hash + byteOrder fr.ByteOrder } // GetConstants exposed to be used in gnark @@ -56,9 +57,11 @@ func GetConstants() []big.Int { } // NewMiMC returns a MiMCImpl object, pure-go reference implementation -func NewMiMC() hash.Hash { +func NewMiMC(opts ...Option) hash.Hash { d := new(digest) d.Reset() + cfg := mimcOptions(opts...) + d.byteOrder = cfg.byteOrder return d } @@ -111,7 +114,7 @@ func (d *digest) Write(p []byte) (int, error) { var start int for start = 0; start < len(p); start += BlockSize { - if elem, err := fr.BigEndian.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { + if elem, err := d.byteOrder.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { d.data = append(d.data, elem) } else { return 0, err diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/options.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/options.go new file mode 100644 index 0000000000..2ef5de3f57 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/mimc/options.go @@ -0,0 +1,50 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package mimc + +import ( + "github.com/consensys/gnark-crypto/ecc/bls24-317/fr" +) + +// Option defines option for altering the behavior of the MiMC hasher. +// See the descriptions of functions returning instances of this type for +// particular options. +type Option func(*mimcConfig) + +type mimcConfig struct { + byteOrder fr.ByteOrder +} + +// default options +func mimcOptions(opts ...Option) mimcConfig { + // apply options + opt := mimcConfig{ + byteOrder: fr.BigEndian, + } + for _, option := range opts { + option(&opt) + } + return opt +} + +// WithByteOrder sets the byte order used to decode the input +// in the Write method. Default is BigEndian. +func WithByteOrder(byteOrder fr.ByteOrder) Option { + return func(opt *mimcConfig) { + opt.byteOrder = byteOrder + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/pedersen/pedersen.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/pedersen/pedersen.go index 684498ef1a..4585c6be32 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/pedersen/pedersen.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/fr/pedersen/pedersen.go @@ -30,13 +30,13 @@ import ( // ProvingKey for committing and proofs of knowledge type ProvingKey struct { - basis []curve.G1Affine - basisExpSigma []curve.G1Affine + Basis []curve.G1Affine + BasisExpSigma []curve.G1Affine } type VerifyingKey struct { - g curve.G2Affine // TODO @tabaie: does this really have to be randomized? - gRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} + G curve.G2Affine // TODO @tabaie: does this really have to be randomized? + GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} } func randomFrSizedBytes() ([]byte, error) { @@ -55,7 +55,7 @@ func randomOnG2() (curve.G2Affine, error) { // TODO: Add to G2.go? func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error) { - if vk.g, err = randomOnG2(); err != nil { + if vk.G, err = randomOnG2(); err != nil { return } @@ -70,21 +70,21 @@ func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err err var sigmaInvNeg big.Int sigmaInvNeg.ModInverse(sigma, fr.Modulus()) sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) - vk.gRootSigmaNeg.ScalarMultiplication(&vk.g, &sigmaInvNeg) + vk.GRootSigmaNeg.ScalarMultiplication(&vk.G, &sigmaInvNeg) pk = make([]ProvingKey, len(bases)) for i := range bases { - pk[i].basisExpSigma = make([]curve.G1Affine, len(bases[i])) + pk[i].BasisExpSigma = make([]curve.G1Affine, len(bases[i])) for j := range bases[i] { - pk[i].basisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) + pk[i].BasisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) } - pk[i].basis = bases[i] + pk[i].Basis = bases[i] } return } func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -95,13 +95,13 @@ func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, e NbTasks: 1, // TODO Experiment } - _, err = pok.MultiExp(pk.basisExpSigma, values, config) + _, err = pok.MultiExp(pk.BasisExpSigma, values, config) return } func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -111,7 +111,7 @@ func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, er config := ecc.MultiExpConfig{ NbTasks: 1, } - _, err = commitment.MultiExp(pk.basis, values, config) + _, err = commitment.MultiExp(pk.Basis, values, config) return } @@ -131,7 +131,7 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt offset := 0 for i := range pk { - if len(values[i]) != len(pk[i].basis) { + if len(values[i]) != len(pk[i].Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -147,14 +147,14 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt scaledValues := make([]fr.Element, offset) basis := make([]curve.G1Affine, offset) - copy(basis, pk[0].basisExpSigma) + copy(basis, pk[0].BasisExpSigma) copy(scaledValues, values[0]) offset = len(values[0]) rI := r for i := 1; i < len(pk); i++ { - copy(basis[offset:], pk[i].basisExpSigma) - for j := range pk[i].basis { + copy(basis[offset:], pk[i].BasisExpSigma) + for j := range pk[i].Basis { scaledValues[offset].Mul(&values[i][j], &rI) offset++ } @@ -215,7 +215,7 @@ func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G return fmt.Errorf("subgroup check failed") } - if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.g, vk.gRootSigmaNeg}); err != nil { + if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.G, vk.GRootSigmaNeg}); err != nil { return err } else if !isOne { return fmt.Errorf("proof rejected") @@ -245,11 +245,11 @@ func getChallenge(fiatshamirSeeds [][]byte) (r fr.Element, err error) { // Marshal func (pk *ProvingKey) writeTo(enc *curve.Encoder) (int64, error) { - if err := enc.Encode(pk.basis); err != nil { + if err := enc.Encode(pk.Basis); err != nil { return enc.BytesWritten(), err } - err := enc.Encode(pk.basisExpSigma) + err := enc.Encode(pk.BasisExpSigma) return enc.BytesWritten(), err } @@ -265,14 +265,14 @@ func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error) { func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error) { dec := curve.NewDecoder(r) - if err := dec.Decode(&pk.basis); err != nil { + if err := dec.Decode(&pk.Basis); err != nil { return dec.BytesRead(), err } - if err := dec.Decode(&pk.basisExpSigma); err != nil { + if err := dec.Decode(&pk.BasisExpSigma); err != nil { return dec.BytesRead(), err } - if cL, pL := len(pk.basis), len(pk.basisExpSigma); cL != pL { + if cL, pL := len(pk.Basis), len(pk.BasisExpSigma); cL != pL { return dec.BytesRead(), fmt.Errorf("commitment basis size (%d) doesn't match proof basis size (%d)", cL, pL) } @@ -290,10 +290,10 @@ func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error) { func (vk *VerifyingKey) writeTo(enc *curve.Encoder) (int64, error) { var err error - if err = enc.Encode(&vk.g); err != nil { + if err = enc.Encode(&vk.G); err != nil { return enc.BytesWritten(), err } - err = enc.Encode(&vk.gRootSigmaNeg) + err = enc.Encode(&vk.GRootSigmaNeg) return enc.BytesWritten(), err } @@ -309,9 +309,9 @@ func (vk *VerifyingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder) dec := curve.NewDecoder(r, decOptions...) var err error - if err = dec.Decode(&vk.g); err != nil { + if err = dec.Decode(&vk.G); err != nil { return dec.BytesRead(), err } - err = dec.Decode(&vk.gRootSigmaNeg) + err = dec.Decode(&vk.GRootSigmaNeg) return dec.BytesRead(), err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g1.go index 5630e3c217..18585821f1 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,51 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=4 + tmp.Double(&tmp).Double(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -435,13 +504,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -468,17 +538,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -486,11 +557,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -503,7 +574,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -559,23 +630,23 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { // cf https://eprint.iacr.org/2019/403.pdf, 5 var res G1Jac - res.ScalarMultiplication(a, &xGen).Neg(&res).AddAssign(a) + res.ScalarMultiplication(q, &xGen).Neg(&res).AddAssign(q) p.Set(&res) return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -639,16 +710,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -657,43 +735,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -749,10 +829,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -762,7 +843,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -777,9 +858,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -788,7 +870,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -801,12 +883,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -833,9 +914,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -844,7 +926,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -857,11 +939,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -888,21 +971,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -915,21 +998,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -943,7 +1027,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -993,7 +1077,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1075,9 +1159,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g2.go index 9ba79f552c..b87ad79f76 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fptower.E4 } -// G2Jac is a point with fptower.E4 coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fptower.E4 } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fptower.E4 } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E4 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fptower.E4 @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fptower.E4 pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fptower.E4 lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) - return p -} - -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fptower.E4 - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E4 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,50 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E4 + var left, right, tmp, ZZ fptower.E4 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -420,13 +501,14 @@ func (p *G2Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -453,26 +535,27 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ψ(p) = u o π o u⁻¹ where u:E'→E iso from the twist to E -func (p *G2Jac) psi(a *G2Jac) *G2Jac { - p.Set(a) +// psi sets p to ψ(q) = u o π o u⁻¹ where u:E'→E is the isomorphism from the twist to the curve E and π is the Frobenius map. +func (p *G2Jac) psi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Frobenius(&p.X).Mul(&p.X, &endo.u) p.Y.Frobenius(&p.Y).Mul(&p.Y, &endo.v) p.Z.Frobenius(&p.Z) return p } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.MulByElement(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -480,11 +563,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -497,7 +580,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -553,18 +636,18 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { // https://eprint.iacr.org/2017/419.pdf, section 4.2 // multiply by (3x⁴-3)*cofacor var xg, xxg, xxxg, xxxxg, res, t G2Jac - xg.ScalarMultiplication(a, &xGen).SubAssign(a) + xg.ScalarMultiplication(q, &xGen).SubAssign(q) xxg.ScalarMultiplication(&xg, &xGen) xxxg.ScalarMultiplication(&xxg, &xGen) xxxxg.ScalarMultiplication(&xxxg, &xGen) res.Set(&xxxxg). - SubAssign(a) + SubAssign(q) t.Set(&xxxg). psi(&t). @@ -581,7 +664,7 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { psi(&t). AddAssign(&res) - res.Double(a). + res.Double(q). psi(&res). psi(&res). psi(&res). @@ -595,15 +678,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -612,43 +695,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fptower.E4{} p.Y = fptower.E4{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -704,10 +789,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fptower.E4 @@ -717,7 +803,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -732,9 +818,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -743,7 +830,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -756,12 +843,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fptower.E4{} @@ -788,9 +874,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -799,7 +886,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -812,11 +899,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fptower.E4{} @@ -843,21 +931,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E4 - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -870,21 +958,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E4 - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -898,38 +987,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1008,9 +1097,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e12.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e12.go index 5d33f44aa6..9d48e0d727 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e12.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e12.go @@ -56,7 +56,7 @@ func (z *E12) SetOne() *E12 { return z } -// SetRandom set z to a random elmt +// SetRandom sets z to a random elmt func (z *E12) SetRandom() (*E12, error) { if _, err := z.C0.SetRandom(); err != nil { return nil, err @@ -70,11 +70,12 @@ func (z *E12) SetRandom() (*E12, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E12) IsZero() bool { return z.C0.IsZero() && z.C1.IsZero() && z.C2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E12) IsOne() bool { return z.C0.IsOne() && z.C1.IsZero() && z.C2.IsZero() } @@ -95,7 +96,7 @@ func (z *E12) Neg(x *E12) *E12 { return z } -// Sub two elements of E12 +// Sub subtracts two elements of E12 func (z *E12) Sub(x, y *E12) *E12 { z.C0.Sub(&x.C0, &y.C0) z.C1.Sub(&x.C1, &y.C1) @@ -196,8 +197,8 @@ func (z *E12) Inverse(x *E12) *E12 { return z } -// BatchInvertE12 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE12 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE12(a []E12) []E12 { @@ -283,7 +284,7 @@ func (z *E12) InverseUnitary(x *E12) *E12 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E12) Conjugate(x *E12) *E12 { z.C0.Conjugate(&x.C0) z.C1.Conjugate(&x.C1).Neg(&z.C1) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e2.go index e88426e598..b2195608f9 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e2.go @@ -91,11 +91,12 @@ func (z *E2) SetRandom() (*E2, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E2) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E2) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() } @@ -106,7 +107,7 @@ func (z *E2) Add(x, y *E2) *E2 { return z } -// Sub two elements of E2 +// Sub subtracts two elements of E2 func (z *E2) Sub(x, y *E2) *E2 { subE2(z, x, y) return z @@ -227,6 +228,8 @@ func (z *E2) Sqrt(x *E2) *E2 { return z } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -236,6 +239,7 @@ func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { return z } +// Div divides an element in E2 by an element in E2 func (z *E2) Div(x *E2, y *E2) *E2 { var r E2 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e24.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e24.go index e2a9a09462..b0a4e99b90 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e24.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e24.go @@ -65,14 +65,14 @@ func (z *E24) SetOne() *E24 { return z } -// Add set z=x+y in E24 and return z +// Add sets z=x+y in E24 and return z func (z *E24) Add(x, y *E24) *E24 { z.D0.Add(&x.D0, &y.D0) z.D1.Add(&x.D1, &y.D1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and return z func (z *E24) Sub(x, y *E24) *E24 { z.D0.Sub(&x.D0, &y.D0) z.D1.Sub(&x.D1, &y.D1) @@ -97,16 +97,17 @@ func (z *E24) SetRandom() (*E24, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E24) IsZero() bool { return z.D0.IsZero() && z.D1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E24) IsOne() bool { return z.D0.IsOne() && z.D1.IsZero() } -// Mul set z=x*y in E24 and return z +// Mul sets z=x*y in E24 and return z func (z *E24) Mul(x, y *E24) *E24 { var a, b, c E12 a.Add(&x.D0, &x.D1) @@ -119,7 +120,7 @@ func (z *E24) Mul(x, y *E24) *E24 { return z } -// Square set z=x*x in E24 and return z +// Square sets z=x*x in E24 and return z func (z *E24) Square(x *E24) *E24 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -317,7 +318,7 @@ func (z *E24) CyclotomicSquare(x *E24) *E24 { return z } -// Inverse set z to the inverse of x in E24 and return z +// Inverse sets z to the inverse of x in E24 and return z // // if x == 0, sets and returns z = x func (z *E24) Inverse(x *E24) *E24 { @@ -335,8 +336,8 @@ func (z *E24) Inverse(x *E24) *E24 { return z } -// BatchInvertE24 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE24 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE24(a []E24) []E24 { @@ -546,12 +547,12 @@ func (z *E24) ExpGLV(x E24, k *big.Int) *E24 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E24) InverseUnitary(x *E24) *E24 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and return z func (z *E24) Conjugate(x *E24) *E24 { *z = *x z.D1.Neg(&z.D1) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e4.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e4.go index 3569253c71..3641625120 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e4.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/internal/fptower/e4.go @@ -94,14 +94,14 @@ func (z *E4) MulByElement(x *E4, y *fp.Element) *E4 { return z } -// Add set z=x+y in E4 and return z +// Add sets z=x+y in E4 and returns z func (z *E4) Add(x, y *E4) *E4 { z.B0.Add(&x.B0, &y.B0) z.B1.Add(&x.B1, &y.B1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E4) Sub(x, y *E4) *E4 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -133,11 +133,12 @@ func (z *E4) SetRandom() (*E4, error) { return z, nil } -// IsZero returns true if the element is zero, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E4) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E4) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() } @@ -160,7 +161,7 @@ func (z *E4) MulByNonResidueInv(x *E4) *E4 { return z } -// Mul set z=x*y in E4 and return z +// Mul sets z=x*y in E4 and returns z func (z *E4) Mul(x, y *E4) *E4 { var a, b, c E2 a.Add(&x.B0, &x.B1) @@ -173,7 +174,7 @@ func (z *E4) Mul(x, y *E4) *E4 { return z } -// Square set z=x*x in E4 and return z +// Square sets z=x*x in E4 and returns z func (z *E4) Square(x *E4) *E4 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -189,7 +190,7 @@ func (z *E4) Square(x *E4) *E4 { return z } -// Inverse set z to the inverse of x in E4 and return z +// Inverse sets z to the inverse of x in E4 and returns z // // if x == 0, sets and returns z = x func (z *E4) Inverse(x *E4) *E4 { @@ -241,7 +242,7 @@ func (z *E4) Exp(x E4, k *big.Int) *E4 { return z } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E4) Conjugate(x *E4) *E4 { z.B0 = x.B0 z.B1.Neg(&x.B1) @@ -312,8 +313,8 @@ func (z *E4) Sqrt(x *E4) *E4 { return z } -// BatchInvertE4 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE4 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE4(a []E4) []E4 { @@ -348,6 +349,7 @@ func BatchInvertE4(a []E4) []E4 { return res } +// Div divides an element in E4 by an element in E4 func (z *E4) Div(x *E4, y *E4) *E4 { var r E4 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/kzg.go index 791e3d1f88..fc4d67762e 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bls24317.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bls24317.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bls24317.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bls24317.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bls24317.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bls24317.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bls24317.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bls24317.PairingCheckFixedQ( - []bls24317.G1Affine{totalG1Aff, negH}, + []bls24317.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/marshal.go index bd85227f6d..3bab6e0062 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bls24-317" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bls24317.Encoder)) return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bls24317.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bls24317.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_affine.go index 7affe92ae4..ffae06cc21 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_affine.go @@ -226,7 +226,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -554,7 +554,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_jacobian.go index 9eda05280d..c7178af022 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bls24-317/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -145,7 +145,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/doc.go index 2391a9f63b..b5dd44e642 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/doc.go @@ -14,5 +14,6 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT -// Package fft provides in-place discrete Fourier transform. +// Package fft provides in-place discrete Fourier transform on powers-of-two subgroups +// of 𝔽ᵣˣ (the multiplicative group (ℤ/rℤ, x) ). package fft diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/domain.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/domain.go index 6ac79bf0ab..409ff7e4ff 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/domain.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/fft/domain.go @@ -64,6 +64,15 @@ type Domain struct { cosetTableInv []fr.Element } +// GeneratorFullMultiplicativeGroup returns a generator of 𝔽ᵣˣ +func GeneratorFullMultiplicativeGroup() fr.Element { + var res fr.Element + + res.SetUint64(5) + + return res +} + // NewDomain returns a subgroup with a power of 2 cardinality // cardinality >= m // shift: when specified, it's the element by which the set of root of unity is shifted. @@ -72,10 +81,7 @@ func NewDomain(m uint64, opts ...DomainOption) *Domain { domain := &Domain{} x := ecc.NextPowerOfTwo(m) domain.Cardinality = uint64(x) - - // generator of the largest 2-adic subgroup - - domain.FrMultiplicativeGen.SetUint64(5) + domain.FrMultiplicativeGen = GeneratorFullMultiplicativeGroup() if opt.shift != nil { domain.FrMultiplicativeGen.Set(opt.shift) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/gkr/gkr.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/gkr/gkr.go index df189b19de..94a2735b91 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/gkr/gkr.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/gkr/gkr.go @@ -884,10 +884,10 @@ func (g AddGate) Evaluate(x ...fr.Element) (res fr.Element) { // set zero case 1: res.Set(&x[0]) - case 2: + default: res.Add(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Add(&res, &x[2]) + res.Add(&res, &x[i]) } } return @@ -909,7 +909,7 @@ func (g MulGate) Evaluate(x ...fr.Element) (res fr.Element) { default: res.Mul(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Mul(&res, &x[2]) + res.Mul(&res, &x[i]) } } return diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/doc.go index d527ead9ef..78837e1c80 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/doc.go @@ -15,4 +15,46 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT // Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// # Hash input format +// +// The MiMC hash function is defined over a field. The input to the hash +// function is a byte slice. The byte slice is interpreted as a sequence of +// field elements. Due to this interpretation, the input byte slice length must +// be multiple of the field modulus size. And every secuence of byte slice for a +// single field element must be strictly less than the field modulus. package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/mimc.go index 719ed4e8a9..c0158fc3a8 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/mimc.go @@ -41,8 +41,9 @@ var ( // digest represents the partial evaluation of the checksum // along with the params of the mimc function type digest struct { - h fr.Element - data []fr.Element // data to hash + h fr.Element + data []fr.Element // data to hash + byteOrder fr.ByteOrder } // GetConstants exposed to be used in gnark @@ -56,9 +57,11 @@ func GetConstants() []big.Int { } // NewMiMC returns a MiMCImpl object, pure-go reference implementation -func NewMiMC() hash.Hash { +func NewMiMC(opts ...Option) hash.Hash { d := new(digest) d.Reset() + cfg := mimcOptions(opts...) + d.byteOrder = cfg.byteOrder return d } @@ -111,7 +114,7 @@ func (d *digest) Write(p []byte) (int, error) { var start int for start = 0; start < len(p); start += BlockSize { - if elem, err := fr.BigEndian.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { + if elem, err := d.byteOrder.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { d.data = append(d.data, elem) } else { return 0, err diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/options.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/options.go new file mode 100644 index 0000000000..ae82317a1a --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc/options.go @@ -0,0 +1,50 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package mimc + +import ( + "github.com/consensys/gnark-crypto/ecc/bn254/fr" +) + +// Option defines option for altering the behavior of the MiMC hasher. +// See the descriptions of functions returning instances of this type for +// particular options. +type Option func(*mimcConfig) + +type mimcConfig struct { + byteOrder fr.ByteOrder +} + +// default options +func mimcOptions(opts ...Option) mimcConfig { + // apply options + opt := mimcConfig{ + byteOrder: fr.BigEndian, + } + for _, option := range opts { + option(&opt) + } + return opt +} + +// WithByteOrder sets the byte order used to decode the input +// in the Write method. Default is BigEndian. +func WithByteOrder(byteOrder fr.ByteOrder) Option { + return func(opt *mimcConfig) { + opt.byteOrder = byteOrder + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen/pedersen.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen/pedersen.go index 7c6bf8c2cd..e550177cba 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen/pedersen.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen/pedersen.go @@ -30,13 +30,13 @@ import ( // ProvingKey for committing and proofs of knowledge type ProvingKey struct { - basis []curve.G1Affine - basisExpSigma []curve.G1Affine + Basis []curve.G1Affine + BasisExpSigma []curve.G1Affine } type VerifyingKey struct { - g curve.G2Affine // TODO @tabaie: does this really have to be randomized? - gRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} + G curve.G2Affine // TODO @tabaie: does this really have to be randomized? + GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} } func randomFrSizedBytes() ([]byte, error) { @@ -55,7 +55,7 @@ func randomOnG2() (curve.G2Affine, error) { // TODO: Add to G2.go? func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error) { - if vk.g, err = randomOnG2(); err != nil { + if vk.G, err = randomOnG2(); err != nil { return } @@ -70,21 +70,21 @@ func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err err var sigmaInvNeg big.Int sigmaInvNeg.ModInverse(sigma, fr.Modulus()) sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) - vk.gRootSigmaNeg.ScalarMultiplication(&vk.g, &sigmaInvNeg) + vk.GRootSigmaNeg.ScalarMultiplication(&vk.G, &sigmaInvNeg) pk = make([]ProvingKey, len(bases)) for i := range bases { - pk[i].basisExpSigma = make([]curve.G1Affine, len(bases[i])) + pk[i].BasisExpSigma = make([]curve.G1Affine, len(bases[i])) for j := range bases[i] { - pk[i].basisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) + pk[i].BasisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) } - pk[i].basis = bases[i] + pk[i].Basis = bases[i] } return } func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -95,13 +95,13 @@ func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, e NbTasks: 1, // TODO Experiment } - _, err = pok.MultiExp(pk.basisExpSigma, values, config) + _, err = pok.MultiExp(pk.BasisExpSigma, values, config) return } func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -111,7 +111,7 @@ func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, er config := ecc.MultiExpConfig{ NbTasks: 1, } - _, err = commitment.MultiExp(pk.basis, values, config) + _, err = commitment.MultiExp(pk.Basis, values, config) return } @@ -131,7 +131,7 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt offset := 0 for i := range pk { - if len(values[i]) != len(pk[i].basis) { + if len(values[i]) != len(pk[i].Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -147,14 +147,14 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt scaledValues := make([]fr.Element, offset) basis := make([]curve.G1Affine, offset) - copy(basis, pk[0].basisExpSigma) + copy(basis, pk[0].BasisExpSigma) copy(scaledValues, values[0]) offset = len(values[0]) rI := r for i := 1; i < len(pk); i++ { - copy(basis[offset:], pk[i].basisExpSigma) - for j := range pk[i].basis { + copy(basis[offset:], pk[i].BasisExpSigma) + for j := range pk[i].Basis { scaledValues[offset].Mul(&values[i][j], &rI) offset++ } @@ -215,7 +215,7 @@ func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G return fmt.Errorf("subgroup check failed") } - if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.g, vk.gRootSigmaNeg}); err != nil { + if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.G, vk.GRootSigmaNeg}); err != nil { return err } else if !isOne { return fmt.Errorf("proof rejected") @@ -245,11 +245,11 @@ func getChallenge(fiatshamirSeeds [][]byte) (r fr.Element, err error) { // Marshal func (pk *ProvingKey) writeTo(enc *curve.Encoder) (int64, error) { - if err := enc.Encode(pk.basis); err != nil { + if err := enc.Encode(pk.Basis); err != nil { return enc.BytesWritten(), err } - err := enc.Encode(pk.basisExpSigma) + err := enc.Encode(pk.BasisExpSigma) return enc.BytesWritten(), err } @@ -265,14 +265,14 @@ func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error) { func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error) { dec := curve.NewDecoder(r) - if err := dec.Decode(&pk.basis); err != nil { + if err := dec.Decode(&pk.Basis); err != nil { return dec.BytesRead(), err } - if err := dec.Decode(&pk.basisExpSigma); err != nil { + if err := dec.Decode(&pk.BasisExpSigma); err != nil { return dec.BytesRead(), err } - if cL, pL := len(pk.basis), len(pk.basisExpSigma); cL != pL { + if cL, pL := len(pk.Basis), len(pk.BasisExpSigma); cL != pL { return dec.BytesRead(), fmt.Errorf("commitment basis size (%d) doesn't match proof basis size (%d)", cL, pL) } @@ -290,10 +290,10 @@ func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error) { func (vk *VerifyingKey) writeTo(enc *curve.Encoder) (int64, error) { var err error - if err = enc.Encode(&vk.g); err != nil { + if err = enc.Encode(&vk.G); err != nil { return enc.BytesWritten(), err } - err = enc.Encode(&vk.gRootSigmaNeg) + err = enc.Encode(&vk.GRootSigmaNeg) return enc.BytesWritten(), err } @@ -309,9 +309,9 @@ func (vk *VerifyingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder) dec := curve.NewDecoder(r, decOptions...) var err error - if err = dec.Decode(&vk.g); err != nil { + if err = dec.Decode(&vk.G); err != nil { return dec.BytesRead(), err } - err = dec.Decode(&vk.gRootSigmaNeg) + err = dec.Decode(&vk.GRootSigmaNeg) return dec.BytesRead(), err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go index b4ab2369a7..fc484aac95 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,51 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=3 + fp.MulBy3(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -423,13 +492,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -456,17 +526,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -474,11 +545,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -491,7 +562,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -537,14 +608,14 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -608,16 +679,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -626,43 +704,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -718,10 +798,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -731,7 +812,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -746,9 +827,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -757,7 +839,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -770,12 +852,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -802,9 +883,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -813,7 +895,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -826,11 +908,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -857,21 +940,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -884,21 +967,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -912,7 +996,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -962,7 +1046,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1044,9 +1128,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go index b97563067b..bab4bce83b 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fptower.E2 } -// G2Jac is a point with fptower.E2 coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fptower.E2 } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fptower.E2 } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E2 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fptower.E2 @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fptower.E2 pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fptower.E2 lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) - return p -} - -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fptower.E2 - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E2 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,50 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E2 + var left, right, tmp, ZZ fptower.E2 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -425,13 +506,14 @@ func (p *G2Jac) IsInSubGroup() bool { return res.IsOnCurve() && res.Z.IsZero() } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -458,26 +540,27 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ψ(p) = u o π o u⁻¹ where u:E'→E iso from the twist to E -func (p *G2Jac) psi(a *G2Jac) *G2Jac { - p.Set(a) +// psi sets p to ψ(q) = u o π o u⁻¹ where u:E'→E is the isomorphism from the twist to the curve E and π is the Frobenius map. +func (p *G2Jac) psi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Conjugate(&p.X).Mul(&p.X, &endo.u) p.Y.Conjugate(&p.Y).Mul(&p.Y, &endo.v) p.Z.Conjugate(&p.Z) return p } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.MulByElement(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -485,11 +568,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -502,7 +585,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -558,11 +641,11 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { // cf http://cacr.uwaterloo.ca/techreports/2011/cacr2011-26.pdf, 6.1 var points [4]G2Jac - points[0].ScalarMultiplication(a, &xGen) + points[0].ScalarMultiplication(q, &xGen) points[1].Double(&points[0]). AddAssign(&points[0]). @@ -571,7 +654,7 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { points[2].psi(&points[0]). psi(&points[2]) - points[3].psi(a).psi(&points[3]).psi(&points[3]) + points[3].psi(q).psi(&points[3]).psi(&points[3]) var res G2Jac res.Set(&g2Infinity) @@ -584,15 +667,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -601,43 +684,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fptower.E2{} p.Y = fptower.E2{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -693,10 +778,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fptower.E2 @@ -706,7 +792,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -721,9 +807,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -732,7 +819,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -745,12 +832,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fptower.E2{} @@ -777,9 +863,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -788,7 +875,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -801,11 +888,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fptower.E2{} @@ -832,21 +920,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -859,21 +947,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fptower.E2 - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -887,38 +976,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -997,9 +1086,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12.go index a9f6d28e9b..d2d7893104 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12.go @@ -67,14 +67,14 @@ func (z *E12) SetOne() *E12 { return z } -// Add set z=x+y in E12 and return z +// Add sets z=x+y in E12 and returns z func (z *E12) Add(x, y *E12) *E12 { z.C0.Add(&x.C0, &y.C0) z.C1.Add(&x.C1, &y.C1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E12) Sub(x, y *E12) *E12 { z.C0.Sub(&x.C0, &y.C0) z.C1.Sub(&x.C1, &y.C1) @@ -99,16 +99,17 @@ func (z *E12) SetRandom() (*E12, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E12) IsZero() bool { return z.C0.IsZero() && z.C1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E12) IsOne() bool { return z.C0.IsOne() && z.C1.IsZero() } -// Mul set z=x*y in E12 and return z +// Mul sets z=x*y in E12 and returns z func (z *E12) Mul(x, y *E12) *E12 { var a, b, c E6 a.Add(&x.C0, &x.C1) @@ -121,7 +122,7 @@ func (z *E12) Mul(x, y *E12) *E12 { return z } -// Square set z=x*x in E12 and return z +// Square sets z=x*x in E12 and returns z func (z *E12) Square(x *E12) *E12 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -406,7 +407,7 @@ func (z *E12) CyclotomicSquare(x *E12) *E12 { return z } -// Inverse set z to the inverse of x in E12 and return z +// Inverse sets z to the inverse of x in E12 and returns z // // if x == 0, sets and returns z = x func (z *E12) Inverse(x *E12) *E12 { @@ -424,8 +425,8 @@ func (z *E12) Inverse(x *E12) *E12 { return z } -// BatchInvertE12 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE12 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE12(a []E12) []E12 { @@ -635,12 +636,12 @@ func (z *E12) ExpGLV(x E12, k *big.Int) *E12 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E12) InverseUnitary(x *E12) *E12 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E12) Conjugate(x *E12) *E12 { *z = *x z.C1.Neg(&z.C1) @@ -841,6 +842,8 @@ func BatchDecompressTorus(x []E6) ([]E12, error) { return res, nil } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -850,6 +853,7 @@ func (z *E12) Select(cond int, caseZ *E12, caseNz *E12) *E12 { return z } +// Div divides an element in E12 by an element in E12 func (z *E12) Div(x *E12, y *E12) *E12 { var r E12 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e2.go index 8c16efc937..d227087563 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e2.go @@ -101,11 +101,12 @@ func (z *E2) SetRandom() (*E2, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E2) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E2) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() } @@ -116,7 +117,7 @@ func (z *E2) Add(x, y *E2) *E2 { return z } -// Sub two elements of E2 +// Sub subtracts two elements of E2 func (z *E2) Sub(x, y *E2) *E2 { subE2(z, x, y) return z @@ -155,7 +156,7 @@ func (z *E2) Conjugate(x *E2) *E2 { return z } -// Halve sets z = z / 2 +// Halve sets z to z / 2 func (z *E2) Halve() { z.A0.Halve() z.A1.Halve() @@ -213,7 +214,7 @@ func init() { var sqrtExp1, sqrtExp2 big.Int -// Sqrt sets z to the square root of and returns z +// Sqrt sets z to the square root of x and returns z // The function does not test whether the square root // exists or not, it's up to the caller to call // Legendre beforehand. @@ -243,8 +244,8 @@ func (z *E2) Sqrt(x *E2) *E2 { return z } -// BatchInvertE2 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE2 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE2(a []E2) []E2 { @@ -279,6 +280,8 @@ func BatchInvertE2(a []E2) []E2 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -288,6 +291,7 @@ func (z *E2) Select(cond int, caseZ *E2, caseNz *E2) *E2 { return z } +// Div divides an element in E2 by an element in E2 func (z *E2) Div(x *E2, y *E2) *E2 { var r E2 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e6.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e6.go index 128007df27..1867470a88 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e6.go @@ -63,11 +63,12 @@ func (z *E6) SetRandom() (*E6, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E6) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() && z.B2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E6) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() && z.B2.IsZero() } @@ -88,7 +89,7 @@ func (z *E6) Neg(x *E6) *E6 { return z } -// Sub two elements of E6 +// Sub subtracts two elements of E6 func (z *E6) Sub(x, y *E6) *E6 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -286,8 +287,8 @@ func (z *E6) Inverse(x *E6) *E6 { return z } -// BatchInvertE6 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE6 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE6(a []E6) []E6 { @@ -322,6 +323,8 @@ func BatchInvertE6(a []E6) []E6 { return res } +// Select is conditional move. +// If cond = 0, it sets z to caseZ and returns it. otherwise caseNz. func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { //Might be able to save a nanosecond or two by an aggregate implementation @@ -332,6 +335,7 @@ func (z *E6) Select(cond int, caseZ *E6, caseNz *E6) *E6 { return z } +// Div divides an element in E6 by an element in E6 func (z *E6) Div(x *E6, y *E6) *E6 { var r E6 r.Inverse(y).Mul(x, &r) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/kzg.go index 067894ab5e..2689f970dc 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bn254.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bn254.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bn254.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bn254.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bn254.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bn254.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bn254.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bn254.PairingCheckFixedQ( - []bn254.G1Affine{totalG1Aff, negH}, + []bn254.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/marshal.go index c9b019c5a0..b633b9bcbd 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bn254" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bn254.Encoder)) (i return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bn254.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bn254.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_affine.go index 0958526ea7..5b1b7ecbdf 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_affine.go @@ -226,7 +226,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -554,7 +554,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_jacobian.go index 32f728fc05..f9a3df9d30 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -147,7 +147,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go index a0d39da70c..675eebedf3 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go @@ -439,13 +439,15 @@ func PrecomputeLines(Q G2Affine) (PrecomputedLines [2][len(LoopCounter)]LineEval n := len(LoopCounter) for i := n - 2; i >= 0; i-- { - accQ.doubleStep(&PrecomputedLines[0][i]) - if LoopCounter[i] == 1 { - accQ.addStep(&PrecomputedLines[1][i], &Q) - } else if LoopCounter[i] == -1 { - accQ.addStep(&PrecomputedLines[1][i], &negQ) - } else { - continue + switch LoopCounter[i] { + case 0: + accQ.doubleStep(&PrecomputedLines[0][i]) + case 1: + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &Q) + case -1: + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &negQ) + default: + return [2][len(LoopCounter)]LineEvaluationAff{} } } @@ -673,3 +675,49 @@ func (p *G2Affine) addStep(evaluations *LineEvaluationAff, a *G2Affine) { p.X.Set(&xr) p.Y.Set(&yr) } + +func (p *G2Affine) doubleAndAddStep(evaluations1, evaluations2 *LineEvaluationAff, a *G2Affine) { + var n, d, l1, x3, l2, x4, y4 fptower.E2 + + // compute λ1 = (y2-y1)/(x2-x1) + n.Sub(&p.Y, &a.Y) + d.Sub(&p.X, &a.X) + l1.Div(&n, &d) + + // compute x3 =λ1²-x1-x2 + x3.Square(&l1) + x3.Sub(&x3, &p.X) + x3.Sub(&x3, &a.X) + + // omit y3 computation + + // compute line1 + evaluations1.R0.Set(&l1) + evaluations1.R1.Mul(&l1, &p.X) + evaluations1.R1.Sub(&evaluations1.R1, &p.Y) + + // compute λ2 = -λ1-2y1/(x3-x1) + n.Double(&p.Y) + d.Sub(&x3, &p.X) + l2.Div(&n, &d) + l2.Add(&l2, &l1) + l2.Neg(&l2) + + // compute x4 = λ2²-x1-x3 + x4.Square(&l2) + x4.Sub(&x4, &p.X) + x4.Sub(&x4, &x3) + + // compute y4 = λ2(x1 - x4)-y1 + y4.Sub(&p.X, &x4) + y4.Mul(&l2, &y4) + y4.Sub(&y4, &p.Y) + + // compute line2 + evaluations2.R0.Set(&l2) + evaluations2.R1.Mul(&l2, &p.X) + evaluations2.R1.Sub(&evaluations2.R1, &p.Y) + + p.X.Set(&x4) + p.Y.Set(&y4) +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/bw6-633.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/bw6-633.go index 4bf35e9455..07f25ecba9 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/bw6-633.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/bw6-633.go @@ -13,7 +13,7 @@ // Extension fields tower: // // 𝔽p³[u] = 𝔽p/u³-2 -// 𝔽p⁶[v] = 𝔽p²/v²-u +// 𝔽p⁶[v] = 𝔽p³/v²-u // // case t % r % u = 0 // diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/doc.go index 2391a9f63b..b5dd44e642 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/doc.go @@ -14,5 +14,6 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT -// Package fft provides in-place discrete Fourier transform. +// Package fft provides in-place discrete Fourier transform on powers-of-two subgroups +// of 𝔽ᵣˣ (the multiplicative group (ℤ/rℤ, x) ). package fft diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/domain.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/domain.go index 7951722084..c36dfe4a27 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/domain.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft/domain.go @@ -64,6 +64,15 @@ type Domain struct { cosetTableInv []fr.Element } +// GeneratorFullMultiplicativeGroup returns a generator of 𝔽ᵣˣ +func GeneratorFullMultiplicativeGroup() fr.Element { + var res fr.Element + + res.SetUint64(13) + + return res +} + // NewDomain returns a subgroup with a power of 2 cardinality // cardinality >= m // shift: when specified, it's the element by which the set of root of unity is shifted. @@ -72,10 +81,7 @@ func NewDomain(m uint64, opts ...DomainOption) *Domain { domain := &Domain{} x := ecc.NextPowerOfTwo(m) domain.Cardinality = uint64(x) - - // generator of the largest 2-adic subgroup - - domain.FrMultiplicativeGen.SetUint64(13) + domain.FrMultiplicativeGen = GeneratorFullMultiplicativeGroup() if opt.shift != nil { domain.FrMultiplicativeGen.Set(opt.shift) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/gkr/gkr.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/gkr/gkr.go index 888c2c3c55..8997297237 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/gkr/gkr.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/gkr/gkr.go @@ -884,10 +884,10 @@ func (g AddGate) Evaluate(x ...fr.Element) (res fr.Element) { // set zero case 1: res.Set(&x[0]) - case 2: + default: res.Add(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Add(&res, &x[2]) + res.Add(&res, &x[i]) } } return @@ -909,7 +909,7 @@ func (g MulGate) Evaluate(x ...fr.Element) (res fr.Element) { default: res.Mul(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Mul(&res, &x[2]) + res.Mul(&res, &x[i]) } } return diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/doc.go index d527ead9ef..78837e1c80 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/doc.go @@ -15,4 +15,46 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT // Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// # Hash input format +// +// The MiMC hash function is defined over a field. The input to the hash +// function is a byte slice. The byte slice is interpreted as a sequence of +// field elements. Due to this interpretation, the input byte slice length must +// be multiple of the field modulus size. And every secuence of byte slice for a +// single field element must be strictly less than the field modulus. package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/mimc.go index 9cce55e360..bbf620172b 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/mimc.go @@ -41,8 +41,9 @@ var ( // digest represents the partial evaluation of the checksum // along with the params of the mimc function type digest struct { - h fr.Element - data []fr.Element // data to hash + h fr.Element + data []fr.Element // data to hash + byteOrder fr.ByteOrder } // GetConstants exposed to be used in gnark @@ -56,9 +57,11 @@ func GetConstants() []big.Int { } // NewMiMC returns a MiMCImpl object, pure-go reference implementation -func NewMiMC() hash.Hash { +func NewMiMC(opts ...Option) hash.Hash { d := new(digest) d.Reset() + cfg := mimcOptions(opts...) + d.byteOrder = cfg.byteOrder return d } @@ -111,7 +114,7 @@ func (d *digest) Write(p []byte) (int, error) { var start int for start = 0; start < len(p); start += BlockSize { - if elem, err := fr.BigEndian.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { + if elem, err := d.byteOrder.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { d.data = append(d.data, elem) } else { return 0, err diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/options.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/options.go new file mode 100644 index 0000000000..420ddbd064 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/mimc/options.go @@ -0,0 +1,50 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package mimc + +import ( + "github.com/consensys/gnark-crypto/ecc/bw6-633/fr" +) + +// Option defines option for altering the behavior of the MiMC hasher. +// See the descriptions of functions returning instances of this type for +// particular options. +type Option func(*mimcConfig) + +type mimcConfig struct { + byteOrder fr.ByteOrder +} + +// default options +func mimcOptions(opts ...Option) mimcConfig { + // apply options + opt := mimcConfig{ + byteOrder: fr.BigEndian, + } + for _, option := range opts { + option(&opt) + } + return opt +} + +// WithByteOrder sets the byte order used to decode the input +// in the Write method. Default is BigEndian. +func WithByteOrder(byteOrder fr.ByteOrder) Option { + return func(opt *mimcConfig) { + opt.byteOrder = byteOrder + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/pedersen/pedersen.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/pedersen/pedersen.go index 0dd39010d3..cf2e80f9f7 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/pedersen/pedersen.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/fr/pedersen/pedersen.go @@ -30,13 +30,13 @@ import ( // ProvingKey for committing and proofs of knowledge type ProvingKey struct { - basis []curve.G1Affine - basisExpSigma []curve.G1Affine + Basis []curve.G1Affine + BasisExpSigma []curve.G1Affine } type VerifyingKey struct { - g curve.G2Affine // TODO @tabaie: does this really have to be randomized? - gRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} + G curve.G2Affine // TODO @tabaie: does this really have to be randomized? + GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} } func randomFrSizedBytes() ([]byte, error) { @@ -55,7 +55,7 @@ func randomOnG2() (curve.G2Affine, error) { // TODO: Add to G2.go? func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error) { - if vk.g, err = randomOnG2(); err != nil { + if vk.G, err = randomOnG2(); err != nil { return } @@ -70,21 +70,21 @@ func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err err var sigmaInvNeg big.Int sigmaInvNeg.ModInverse(sigma, fr.Modulus()) sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) - vk.gRootSigmaNeg.ScalarMultiplication(&vk.g, &sigmaInvNeg) + vk.GRootSigmaNeg.ScalarMultiplication(&vk.G, &sigmaInvNeg) pk = make([]ProvingKey, len(bases)) for i := range bases { - pk[i].basisExpSigma = make([]curve.G1Affine, len(bases[i])) + pk[i].BasisExpSigma = make([]curve.G1Affine, len(bases[i])) for j := range bases[i] { - pk[i].basisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) + pk[i].BasisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) } - pk[i].basis = bases[i] + pk[i].Basis = bases[i] } return } func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -95,13 +95,13 @@ func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, e NbTasks: 1, // TODO Experiment } - _, err = pok.MultiExp(pk.basisExpSigma, values, config) + _, err = pok.MultiExp(pk.BasisExpSigma, values, config) return } func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -111,7 +111,7 @@ func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, er config := ecc.MultiExpConfig{ NbTasks: 1, } - _, err = commitment.MultiExp(pk.basis, values, config) + _, err = commitment.MultiExp(pk.Basis, values, config) return } @@ -131,7 +131,7 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt offset := 0 for i := range pk { - if len(values[i]) != len(pk[i].basis) { + if len(values[i]) != len(pk[i].Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -147,14 +147,14 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt scaledValues := make([]fr.Element, offset) basis := make([]curve.G1Affine, offset) - copy(basis, pk[0].basisExpSigma) + copy(basis, pk[0].BasisExpSigma) copy(scaledValues, values[0]) offset = len(values[0]) rI := r for i := 1; i < len(pk); i++ { - copy(basis[offset:], pk[i].basisExpSigma) - for j := range pk[i].basis { + copy(basis[offset:], pk[i].BasisExpSigma) + for j := range pk[i].Basis { scaledValues[offset].Mul(&values[i][j], &rI) offset++ } @@ -215,7 +215,7 @@ func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G return fmt.Errorf("subgroup check failed") } - if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.g, vk.gRootSigmaNeg}); err != nil { + if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.G, vk.GRootSigmaNeg}); err != nil { return err } else if !isOne { return fmt.Errorf("proof rejected") @@ -245,11 +245,11 @@ func getChallenge(fiatshamirSeeds [][]byte) (r fr.Element, err error) { // Marshal func (pk *ProvingKey) writeTo(enc *curve.Encoder) (int64, error) { - if err := enc.Encode(pk.basis); err != nil { + if err := enc.Encode(pk.Basis); err != nil { return enc.BytesWritten(), err } - err := enc.Encode(pk.basisExpSigma) + err := enc.Encode(pk.BasisExpSigma) return enc.BytesWritten(), err } @@ -265,14 +265,14 @@ func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error) { func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error) { dec := curve.NewDecoder(r) - if err := dec.Decode(&pk.basis); err != nil { + if err := dec.Decode(&pk.Basis); err != nil { return dec.BytesRead(), err } - if err := dec.Decode(&pk.basisExpSigma); err != nil { + if err := dec.Decode(&pk.BasisExpSigma); err != nil { return dec.BytesRead(), err } - if cL, pL := len(pk.basis), len(pk.basisExpSigma); cL != pL { + if cL, pL := len(pk.Basis), len(pk.BasisExpSigma); cL != pL { return dec.BytesRead(), fmt.Errorf("commitment basis size (%d) doesn't match proof basis size (%d)", cL, pL) } @@ -290,10 +290,10 @@ func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error) { func (vk *VerifyingKey) writeTo(enc *curve.Encoder) (int64, error) { var err error - if err = enc.Encode(&vk.g); err != nil { + if err = enc.Encode(&vk.G); err != nil { return enc.BytesWritten(), err } - err = enc.Encode(&vk.gRootSigmaNeg) + err = enc.Encode(&vk.GRootSigmaNeg) return enc.BytesWritten(), err } @@ -309,9 +309,9 @@ func (vk *VerifyingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder) dec := curve.NewDecoder(r, decOptions...) var err error - if err = dec.Decode(&vk.g); err != nil { + if err = dec.Decode(&vk.G); err != nil { return dec.BytesRead(), err } - err = dec.Decode(&vk.gRootSigmaNeg) + err = dec.Decode(&vk.GRootSigmaNeg) return dec.BytesRead(), err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g1.go index b3793b4de6..b1673bccdd 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,51 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=4 + tmp.Double(&tmp).Double(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -433,13 +502,14 @@ func (p *G1Jac) IsInSubGroup() bool { return r.IsOnCurve() && r.Z.IsZero() } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -466,17 +536,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -484,11 +555,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -501,7 +572,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -557,7 +628,7 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { var uP, vP, wP, L0, L1, tmp G1Jac var v, one, uPlusOne, uMinusOne, d1, d2, ht big.Int @@ -569,20 +640,20 @@ func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { ht.SetInt64(7) v.Mul(&xGen, &xGen).Add(&v, &one).Mul(&v, &uPlusOne) - uP.ScalarMultiplication(a, &xGen).Neg(&uP) - vP.Set(a).SubAssign(&uP). + uP.ScalarMultiplication(q, &xGen).Neg(&uP) + vP.Set(q).SubAssign(&uP). ScalarMultiplication(&vP, &v) wP.ScalarMultiplication(&vP, &uMinusOne).Neg(&wP). AddAssign(&uP) L0.ScalarMultiplication(&wP, &d1) tmp.ScalarMultiplication(&vP, &ht) L0.AddAssign(&tmp) - tmp.Double(a) + tmp.Double(q) L0.AddAssign(&tmp) - L1.Set(&uP).AddAssign(a).ScalarMultiplication(&L1, &d1) + L1.Set(&uP).AddAssign(q).ScalarMultiplication(&L1, &d1) tmp.ScalarMultiplication(&vP, &d2) L1.AddAssign(&tmp) - tmp.ScalarMultiplication(a, &ht) + tmp.ScalarMultiplication(q, &ht) L1.AddAssign(&tmp) p.phi(&L1).AddAssign(&L0) @@ -591,14 +662,14 @@ func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -662,16 +733,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -680,43 +758,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -772,10 +852,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -785,7 +866,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -800,9 +881,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -811,7 +893,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -824,12 +906,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -856,9 +937,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -867,7 +949,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -880,11 +962,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -911,21 +994,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -938,21 +1021,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -966,7 +1050,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -1016,7 +1100,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1098,9 +1182,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g2.go index e91b5ffb27..c9e6211896 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fp.Element } -// G2Jac is a point with fp.Element coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fp.Element } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fp.Element } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fp.Element @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,51 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) +} + +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + } -// String returns canonical representation of the point in affine coordinates +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bTwistCurveCoeff=8 + tmp.Double(&tmp).Double(&tmp).Double(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -425,13 +507,14 @@ func (p *G2Jac) IsInSubGroup() bool { return r.IsOnCurve() && r.Z.IsZero() } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -458,17 +541,18 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -476,11 +560,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -493,7 +577,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -549,14 +633,14 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { var uP, u2P, u3P, u4P, u5P, xP, vP, wP, L0, L1, tmp G2Jac var ht, d1, d3 big.Int ht.SetInt64(7) // negative d1.SetInt64(13) d3.SetInt64(5) // negative - uP.ScalarMultiplication(a, &xGen) // negative + uP.ScalarMultiplication(q, &xGen) // negative u2P.ScalarMultiplication(&uP, &xGen) u3P.ScalarMultiplication(&u2P, &xGen) // negative u4P.ScalarMultiplication(&u3P, &xGen) @@ -565,18 +649,18 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { AddAssign(&u3P). Double(&vP). AddAssign(&u4P). - AddAssign(a) + AddAssign(q) wP.Set(&uP).SubAssign(&u4P).SubAssign(&u5P) - xP.Set(a).AddAssign(&vP) - L0.Set(&uP).SubAssign(a).ScalarMultiplication(&L0, &d1) + xP.Set(q).AddAssign(&vP) + L0.Set(&uP).SubAssign(q).ScalarMultiplication(&L0, &d1) tmp.ScalarMultiplication(&xP, &d3) L0.AddAssign(&tmp) - tmp.ScalarMultiplication(a, &ht) // negative + tmp.ScalarMultiplication(q, &ht) // negative L0.SubAssign(&tmp) L1.ScalarMultiplication(&wP, &d1) tmp.ScalarMultiplication(&vP, &ht) L1.AddAssign(&tmp) - tmp.ScalarMultiplication(a, &d3) + tmp.ScalarMultiplication(q, &d3) L1.AddAssign(&tmp) p.phi(&L1).AddAssign(&L0) @@ -586,15 +670,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -603,43 +687,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -695,10 +781,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fp.Element @@ -708,7 +795,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -723,9 +810,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -734,7 +822,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -747,12 +835,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -779,9 +866,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -790,7 +878,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -803,11 +891,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -834,21 +923,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -861,21 +950,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -889,38 +979,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -999,9 +1089,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e3.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e3.go index 03f65c0046..64f0bdb619 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e3.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e3.go @@ -68,7 +68,7 @@ func (z *E3) SetOne() *E3 { return z } -// SetRandom set z to a random elmt +// SetRandom sets z to a random elmt func (z *E3) SetRandom() (*E3, error) { if _, err := z.A0.SetRandom(); err != nil { return nil, err @@ -82,11 +82,12 @@ func (z *E3) SetRandom() (*E3, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E3) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() && z.A2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E3) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() && z.A2.IsZero() } @@ -107,7 +108,7 @@ func (z *E3) Add(x, y *E3) *E3 { return z } -// Sub two elements of E3 +// Sub subtracts two elements of E3 func (z *E3) Sub(x, y *E3) *E3 { z.A0.Sub(&x.A0, &y.A0) z.A1.Sub(&x.A1, &y.A1) @@ -128,14 +129,6 @@ func (z *E3) String() string { return (z.A0.String() + "+(" + z.A1.String() + ")*u+(" + z.A2.String() + ")*u**2") } -// Conjugate conjugates an element in E3 -func (z *E3) Conjugate(x *E3) *E3 { - z.A0.Set(&x.A0) - z.A1.Neg(&x.A1) - z.A2.Set(&x.A2) - return z -} - // MulByElement multiplies an element in E3 by an element in fp func (z *E3) MulByElement(x *E3, y *fp.Element) *E3 { var yCopy fp.Element @@ -230,7 +223,8 @@ func (z *E3) MulBy1(c1 *fp.Element) *E3 { // Mul sets z to the E3-product of x,y, returns z func (z *E3) Mul(x, y *E3) *E3 { - // Algorithm 13 from https://eprint.iacr.org/2010/354.pdf + // Karatsuba method for cubic extensions + // https://eprint.iacr.org/2006/471.pdf (section 4) var t0, t1, t2, c0, c1, c2, tmp fp.Element t0.Mul(&x.A0, &y.A0) t1.Mul(&x.A1, &y.A1) @@ -319,8 +313,8 @@ func (z *E3) Inverse(x *E3) *E3 { return z } -// BatchInvertE3 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE3 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE3(a []E3) []E3 { diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e6.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e6.go index fe757a19c0..a618ea2ef8 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/internal/fptower/e6.go @@ -66,14 +66,14 @@ func (z *E6) SetOne() *E6 { return z } -// Add set z=x+y in E6 and return z +// Add sets z=x+y in E6 and returns z func (z *E6) Add(x, y *E6) *E6 { z.B0.Add(&x.B0, &y.B0) z.B1.Add(&x.B1, &y.B1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E6) Sub(x, y *E6) *E6 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -98,16 +98,17 @@ func (z *E6) SetRandom() (*E6, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E6) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E6) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() } -// Mul set z=x*y in E6 and return z +// Mul sets z=x*y in E6 and returns z func (z *E6) Mul(x, y *E6) *E6 { var a, b, c E3 a.Add(&x.B0, &x.B1) @@ -120,7 +121,7 @@ func (z *E6) Mul(x, y *E6) *E6 { return z } -// Square set z=x*x in E6 and return z +// Square sets z=x*x in E6 and returns z func (z *E6) Square(x *E6) *E6 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -395,7 +396,7 @@ func (z *E6) CyclotomicSquare(x *E6) *E6 { return z } -// Inverse set z to the inverse of x in E6 and return z +// Inverse sets z to the inverse of x in E6 and returns z // // if x == 0, sets and returns z = x func (z *E6) Inverse(x *E6) *E6 { @@ -413,8 +414,8 @@ func (z *E6) Inverse(x *E6) *E6 { return z } -// BatchInvertE6 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE6 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE6(a []E6) []E6 { @@ -624,12 +625,12 @@ func (z *E6) ExpGLV(x E6, k *big.Int) *E6 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E6) InverseUnitary(x *E6) *E6 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E6) Conjugate(x *E6) *E6 { *z = *x z.B1.Neg(&z.B1) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/kzg.go index cf59dff0fa..041f45b3d1 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bw6633.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bw6633.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bw6633.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bw6633.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bw6633.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bw6633.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bw6633.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bw6633.PairingCheckFixedQ( - []bw6633.G1Affine{totalG1Aff, negH}, + []bw6633.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/marshal.go index 2b6a44034f..8cbce1f179 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bw6-633" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bw6633.Encoder)) ( return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bw6633.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bw6633.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_affine.go index 97342412cf..459d7cdc7e 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_affine.go @@ -225,7 +225,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -493,7 +493,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_jacobian.go index 5f2e6906d8..ffd7d0a5cc 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -129,7 +129,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/pairing.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/pairing.go index 574c74e4f5..5e8c3d9902 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/pairing.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-633/pairing.go @@ -320,7 +320,7 @@ func (p *g2Proj) doubleStep(evaluations *lineEvaluation) { C.Square(&p.z) D.Double(&C). Add(&D, &C) - E.Mul(&D, &bTwistCurveCoeff) + E.Double(&D).Double(&E).Double(&E) F.Double(&E). Add(&F, &E) G.Add(&B, &F) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/bw6-756.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/bw6-756.go index d1e01e3946..8161ced274 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/bw6-756.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/bw6-756.go @@ -15,7 +15,7 @@ // Extension fields tower: // // 𝔽p³[u] = 𝔽p/u³-33 -// 𝔽p⁶[v] = 𝔽p²/v²-u +// 𝔽p⁶[v] = 𝔽p³/v²-u // // optimal Ate loops: // diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g1.go index c22ea97af9..ff42d69f40 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,50 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=1 (nothing to do) right.Add(&right, &tmp) return left.Equal(&right) } @@ -437,13 +505,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -470,17 +539,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -488,11 +558,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -505,7 +575,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -561,29 +631,29 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { var L0, L1, uP, u2P, u3P, tmp G1Jac - uP.ScalarMultiplication(a, &xGen) + uP.ScalarMultiplication(q, &xGen) u2P.ScalarMultiplication(&uP, &xGen) u3P.ScalarMultiplication(&u2P, &xGen) - L0.Set(a).AddAssign(&u3P). + L0.Set(q).AddAssign(&u3P). SubAssign(&u2P) - tmp.Set(a).AddAssign(&u2P). + tmp.Set(q).AddAssign(&u2P). SubAssign(&uP). SubAssign(&uP). Double(&tmp) L0.SubAssign(&tmp). - SubAssign(a) + SubAssign(q) - L1.Set(a).AddAssign(&uP) - tmp.Set(&uP).SubAssign(a). + L1.Set(q).AddAssign(&uP) + tmp.Set(&uP).SubAssign(q). Double(&tmp). SubAssign(&u2P) L1.AddAssign(&tmp). - SubAssign(a) + SubAssign(q) p.phi(&L1). AddAssign(&L0) @@ -591,14 +661,14 @@ func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -662,16 +732,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -680,43 +757,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -772,10 +851,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -785,7 +865,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -800,9 +880,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -811,7 +892,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -824,12 +905,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -856,9 +936,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -867,7 +948,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -880,11 +961,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -911,21 +993,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -938,21 +1020,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -966,7 +1049,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -1016,7 +1099,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1098,9 +1181,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g2.go index aefd084993..823ac37cca 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fp.Element } -// G2Jac is a point with fp.Element coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fp.Element } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fp.Element } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fp.Element @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,50 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) +} + +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + } -// String returns canonical representation of the point in affine coordinates +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.Mul(&tmp, &bTwistCurveCoeff) right.Add(&right, &tmp) return left.Equal(&right) } @@ -429,13 +510,14 @@ func (p *G2Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -462,17 +544,18 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -480,11 +563,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -497,7 +580,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -553,20 +636,20 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { var L0, L1, uP, u2P, u3P, tmp G2Jac - uP.ScalarMultiplication(a, &xGen) + uP.ScalarMultiplication(q, &xGen) u2P.ScalarMultiplication(&uP, &xGen) u3P.ScalarMultiplication(&u2P, &xGen) // ht=-2, hy=0 // d1=1, d2=-1, d3=-1 - L0.Set(a). + L0.Set(q). AddAssign(&u2P). SubAssign(&uP) tmp.Set(&u2P). - AddAssign(a). + AddAssign(q). SubAssign(&uP). Double(&tmp) L1.Set(&u3P). @@ -579,15 +662,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -596,43 +679,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -688,10 +773,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fp.Element @@ -701,7 +787,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -716,9 +802,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -727,7 +814,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -740,12 +827,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -772,9 +858,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -783,7 +870,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -796,11 +883,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -827,21 +915,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -854,21 +942,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -882,38 +971,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -992,9 +1081,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e3.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e3.go index 15fc2d4bbe..089101ebdc 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e3.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e3.go @@ -64,7 +64,7 @@ func (z *E3) SetOne() *E3 { return z } -// SetRandom set z to a random elmt +// SetRandom sets z to a random elmt func (z *E3) SetRandom() (*E3, error) { if _, err := z.A0.SetRandom(); err != nil { return nil, err @@ -78,11 +78,12 @@ func (z *E3) SetRandom() (*E3, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E3) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() && z.A2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E3) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() && z.A2.IsZero() } @@ -103,7 +104,7 @@ func (z *E3) Add(x, y *E3) *E3 { return z } -// Sub two elements of E3 +// Sub subtracts two elements of E3 func (z *E3) Sub(x, y *E3) *E3 { z.A0.Sub(&x.A0, &y.A0) z.A1.Sub(&x.A1, &y.A1) @@ -124,13 +125,6 @@ func (z *E3) String() string { return (z.A0.String() + "+(" + z.A1.String() + ")*u+(" + z.A2.String() + ")*u**2") } -// Conjugate conjugates an element in E3 -func (z *E3) Conjugate(x *E3) *E3 { - *z = *x - z.A1.Neg(&z.A1) - return z -} - // MulByElement multiplies an element in E3 by an element in fp func (z *E3) MulByElement(x *E3, y *fp.Element) *E3 { _y := *y @@ -224,7 +218,8 @@ func (z *E3) MulBy1(c1 *fp.Element) *E3 { // Mul sets z to the E3-product of x,y, returns z func (z *E3) Mul(x, y *E3) *E3 { - // Algorithm 13 from https://eprint.iacr.org/2010/354.pdf + // Karatsuba method for cubic extensions + // https://eprint.iacr.org/2006/471.pdf (section 4) var t0, t1, t2, c0, c1, c2, tmp fp.Element t0.Mul(&x.A0, &y.A0) t1.Mul(&x.A1, &y.A1) @@ -316,8 +311,8 @@ func (z *E3) Inverse(x *E3) *E3 { return z } -// BatchInvertE3 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE3 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE3(a []E3) []E3 { diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e6.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e6.go index 06f572ea8c..afb5ecc59b 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/internal/fptower/e6.go @@ -65,14 +65,14 @@ func (z *E6) SetOne() *E6 { return z } -// Add set z=x+y in E6 and return z +// Add sets z=x+y in E6 and returns z func (z *E6) Add(x, y *E6) *E6 { z.B0.Add(&x.B0, &y.B0) z.B1.Add(&x.B1, &y.B1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E6) Sub(x, y *E6) *E6 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -97,16 +97,17 @@ func (z *E6) SetRandom() (*E6, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E6) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E6) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() } -// Mul set z=x*y in E6 and return z +// Mul sets z=x*y in E6 and returns z func (z *E6) Mul(x, y *E6) *E6 { var a, b, c E3 a.Add(&x.B0, &x.B1) @@ -119,7 +120,7 @@ func (z *E6) Mul(x, y *E6) *E6 { return z } -// Square set z=x*x in E6 and return z +// Square sets z=x*x in E6 and returns z func (z *E6) Square(x *E6) *E6 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -318,7 +319,7 @@ func (z *E6) CyclotomicSquare(x *E6) *E6 { return z } -// Inverse set z to the inverse of x in E6 and return z +// Inverse sets z to the inverse of x in E6 and returns z // // if x == 0, sets and returns z = x func (z *E6) Inverse(x *E6) *E6 { @@ -336,8 +337,8 @@ func (z *E6) Inverse(x *E6) *E6 { return z } -// BatchInvertE6 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE6 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE6(a []E6) []E6 { @@ -547,12 +548,12 @@ func (z *E6) ExpGLV(x E6, k *big.Int) *E6 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E6) InverseUnitary(x *E6) *E6 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E6) Conjugate(x *E6) *E6 { *z = *x z.B1.Neg(&z.B1) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/kzg.go index 42539e691a..9002613d45 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bw6756.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bw6756.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bw6756.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bw6756.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bw6756.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bw6756.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bw6756.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bw6756.PairingCheckFixedQ( - []bw6756.G1Affine{totalG1Aff, negH}, + []bw6756.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/marshal.go index da7706c50c..b74a955e20 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bw6-756" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bw6756.Encoder)) ( return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bw6756.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bw6756.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_affine.go index f2ab304721..a3dcf88cbb 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_affine.go @@ -225,7 +225,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -493,7 +493,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_jacobian.go index 13c370337a..5dc50140fc 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-756/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -129,7 +129,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/bw6-761.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/bw6-761.go index 62bdb23901..493df2f029 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/bw6-761.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/bw6-761.go @@ -15,7 +15,7 @@ // Extension fields tower: // // 𝔽p³[u] = 𝔽p/u³+4 -// 𝔽p⁶[v] = 𝔽p²/v²-u +// 𝔽p⁶[v] = 𝔽p³/v²-u // // optimal Ate loops: // diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/doc.go index 2391a9f63b..b5dd44e642 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/doc.go @@ -14,5 +14,6 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT -// Package fft provides in-place discrete Fourier transform. +// Package fft provides in-place discrete Fourier transform on powers-of-two subgroups +// of 𝔽ᵣˣ (the multiplicative group (ℤ/rℤ, x) ). package fft diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/domain.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/domain.go index faac86a337..276f1467d5 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/domain.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft/domain.go @@ -64,6 +64,15 @@ type Domain struct { cosetTableInv []fr.Element } +// GeneratorFullMultiplicativeGroup returns a generator of 𝔽ᵣˣ +func GeneratorFullMultiplicativeGroup() fr.Element { + var res fr.Element + + res.SetUint64(15) + + return res +} + // NewDomain returns a subgroup with a power of 2 cardinality // cardinality >= m // shift: when specified, it's the element by which the set of root of unity is shifted. @@ -72,10 +81,7 @@ func NewDomain(m uint64, opts ...DomainOption) *Domain { domain := &Domain{} x := ecc.NextPowerOfTwo(m) domain.Cardinality = uint64(x) - - // generator of the largest 2-adic subgroup - - domain.FrMultiplicativeGen.SetUint64(15) + domain.FrMultiplicativeGen = GeneratorFullMultiplicativeGroup() if opt.shift != nil { domain.FrMultiplicativeGen.Set(opt.shift) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/gkr/gkr.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/gkr/gkr.go index c98a8ab05c..fda1028698 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/gkr/gkr.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/gkr/gkr.go @@ -884,10 +884,10 @@ func (g AddGate) Evaluate(x ...fr.Element) (res fr.Element) { // set zero case 1: res.Set(&x[0]) - case 2: + default: res.Add(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Add(&res, &x[2]) + res.Add(&res, &x[i]) } } return @@ -909,7 +909,7 @@ func (g MulGate) Evaluate(x ...fr.Element) (res fr.Element) { default: res.Mul(&x[0], &x[1]) for i := 2; i < len(x); i++ { - res.Mul(&res, &x[2]) + res.Mul(&res, &x[i]) } } return diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/doc.go index d527ead9ef..78837e1c80 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/doc.go @@ -15,4 +15,46 @@ // Code generated by consensys/gnark-crypto DO NOT EDIT // Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// # Hash input format +// +// The MiMC hash function is defined over a field. The input to the hash +// function is a byte slice. The byte slice is interpreted as a sequence of +// field elements. Due to this interpretation, the input byte slice length must +// be multiple of the field modulus size. And every secuence of byte slice for a +// single field element must be strictly less than the field modulus. package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/mimc.go index d93fe32f29..b53d52abfb 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/mimc.go @@ -41,8 +41,9 @@ var ( // digest represents the partial evaluation of the checksum // along with the params of the mimc function type digest struct { - h fr.Element - data []fr.Element // data to hash + h fr.Element + data []fr.Element // data to hash + byteOrder fr.ByteOrder } // GetConstants exposed to be used in gnark @@ -56,9 +57,11 @@ func GetConstants() []big.Int { } // NewMiMC returns a MiMCImpl object, pure-go reference implementation -func NewMiMC() hash.Hash { +func NewMiMC(opts ...Option) hash.Hash { d := new(digest) d.Reset() + cfg := mimcOptions(opts...) + d.byteOrder = cfg.byteOrder return d } @@ -111,7 +114,7 @@ func (d *digest) Write(p []byte) (int, error) { var start int for start = 0; start < len(p); start += BlockSize { - if elem, err := fr.BigEndian.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { + if elem, err := d.byteOrder.Element((*[BlockSize]byte)(p[start : start+BlockSize])); err == nil { d.data = append(d.data, elem) } else { return 0, err diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/options.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/options.go new file mode 100644 index 0000000000..996bb8862e --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/mimc/options.go @@ -0,0 +1,50 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package mimc + +import ( + "github.com/consensys/gnark-crypto/ecc/bw6-761/fr" +) + +// Option defines option for altering the behavior of the MiMC hasher. +// See the descriptions of functions returning instances of this type for +// particular options. +type Option func(*mimcConfig) + +type mimcConfig struct { + byteOrder fr.ByteOrder +} + +// default options +func mimcOptions(opts ...Option) mimcConfig { + // apply options + opt := mimcConfig{ + byteOrder: fr.BigEndian, + } + for _, option := range opts { + option(&opt) + } + return opt +} + +// WithByteOrder sets the byte order used to decode the input +// in the Write method. Default is BigEndian. +func WithByteOrder(byteOrder fr.ByteOrder) Option { + return func(opt *mimcConfig) { + opt.byteOrder = byteOrder + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/pedersen/pedersen.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/pedersen/pedersen.go index c1ca758aa1..a9a6e56498 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/pedersen/pedersen.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/fr/pedersen/pedersen.go @@ -30,13 +30,13 @@ import ( // ProvingKey for committing and proofs of knowledge type ProvingKey struct { - basis []curve.G1Affine - basisExpSigma []curve.G1Affine + Basis []curve.G1Affine + BasisExpSigma []curve.G1Affine } type VerifyingKey struct { - g curve.G2Affine // TODO @tabaie: does this really have to be randomized? - gRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} + G curve.G2Affine // TODO @tabaie: does this really have to be randomized? + GRootSigmaNeg curve.G2Affine //gRootSigmaNeg = g^{-1/σ} } func randomFrSizedBytes() ([]byte, error) { @@ -55,7 +55,7 @@ func randomOnG2() (curve.G2Affine, error) { // TODO: Add to G2.go? func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err error) { - if vk.g, err = randomOnG2(); err != nil { + if vk.G, err = randomOnG2(); err != nil { return } @@ -70,21 +70,21 @@ func Setup(bases ...[]curve.G1Affine) (pk []ProvingKey, vk VerifyingKey, err err var sigmaInvNeg big.Int sigmaInvNeg.ModInverse(sigma, fr.Modulus()) sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) - vk.gRootSigmaNeg.ScalarMultiplication(&vk.g, &sigmaInvNeg) + vk.GRootSigmaNeg.ScalarMultiplication(&vk.G, &sigmaInvNeg) pk = make([]ProvingKey, len(bases)) for i := range bases { - pk[i].basisExpSigma = make([]curve.G1Affine, len(bases[i])) + pk[i].BasisExpSigma = make([]curve.G1Affine, len(bases[i])) for j := range bases[i] { - pk[i].basisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) + pk[i].BasisExpSigma[j].ScalarMultiplication(&bases[i][j], sigma) } - pk[i].basis = bases[i] + pk[i].Basis = bases[i] } return } func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -95,13 +95,13 @@ func (pk *ProvingKey) ProveKnowledge(values []fr.Element) (pok curve.G1Affine, e NbTasks: 1, // TODO Experiment } - _, err = pok.MultiExp(pk.basisExpSigma, values, config) + _, err = pok.MultiExp(pk.BasisExpSigma, values, config) return } func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, err error) { - if len(values) != len(pk.basis) { + if len(values) != len(pk.Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -111,7 +111,7 @@ func (pk *ProvingKey) Commit(values []fr.Element) (commitment curve.G1Affine, er config := ecc.MultiExpConfig{ NbTasks: 1, } - _, err = commitment.MultiExp(pk.basis, values, config) + _, err = commitment.MultiExp(pk.Basis, values, config) return } @@ -131,7 +131,7 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt offset := 0 for i := range pk { - if len(values[i]) != len(pk[i].basis) { + if len(values[i]) != len(pk[i].Basis) { err = fmt.Errorf("must have as many values as basis elements") return } @@ -147,14 +147,14 @@ func BatchProve(pk []ProvingKey, values [][]fr.Element, fiatshamirSeeds ...[]byt scaledValues := make([]fr.Element, offset) basis := make([]curve.G1Affine, offset) - copy(basis, pk[0].basisExpSigma) + copy(basis, pk[0].BasisExpSigma) copy(scaledValues, values[0]) offset = len(values[0]) rI := r for i := 1; i < len(pk); i++ { - copy(basis[offset:], pk[i].basisExpSigma) - for j := range pk[i].basis { + copy(basis[offset:], pk[i].BasisExpSigma) + for j := range pk[i].Basis { scaledValues[offset].Mul(&values[i][j], &rI) offset++ } @@ -215,7 +215,7 @@ func (vk *VerifyingKey) Verify(commitment curve.G1Affine, knowledgeProof curve.G return fmt.Errorf("subgroup check failed") } - if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.g, vk.gRootSigmaNeg}); err != nil { + if isOne, err := curve.PairingCheck([]curve.G1Affine{commitment, knowledgeProof}, []curve.G2Affine{vk.G, vk.GRootSigmaNeg}); err != nil { return err } else if !isOne { return fmt.Errorf("proof rejected") @@ -245,11 +245,11 @@ func getChallenge(fiatshamirSeeds [][]byte) (r fr.Element, err error) { // Marshal func (pk *ProvingKey) writeTo(enc *curve.Encoder) (int64, error) { - if err := enc.Encode(pk.basis); err != nil { + if err := enc.Encode(pk.Basis); err != nil { return enc.BytesWritten(), err } - err := enc.Encode(pk.basisExpSigma) + err := enc.Encode(pk.BasisExpSigma) return enc.BytesWritten(), err } @@ -265,14 +265,14 @@ func (pk *ProvingKey) WriteRawTo(w io.Writer) (int64, error) { func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error) { dec := curve.NewDecoder(r) - if err := dec.Decode(&pk.basis); err != nil { + if err := dec.Decode(&pk.Basis); err != nil { return dec.BytesRead(), err } - if err := dec.Decode(&pk.basisExpSigma); err != nil { + if err := dec.Decode(&pk.BasisExpSigma); err != nil { return dec.BytesRead(), err } - if cL, pL := len(pk.basis), len(pk.basisExpSigma); cL != pL { + if cL, pL := len(pk.Basis), len(pk.BasisExpSigma); cL != pL { return dec.BytesRead(), fmt.Errorf("commitment basis size (%d) doesn't match proof basis size (%d)", cL, pL) } @@ -290,10 +290,10 @@ func (vk *VerifyingKey) WriteRawTo(w io.Writer) (int64, error) { func (vk *VerifyingKey) writeTo(enc *curve.Encoder) (int64, error) { var err error - if err = enc.Encode(&vk.g); err != nil { + if err = enc.Encode(&vk.G); err != nil { return enc.BytesWritten(), err } - err = enc.Encode(&vk.gRootSigmaNeg) + err = enc.Encode(&vk.GRootSigmaNeg) return enc.BytesWritten(), err } @@ -309,9 +309,9 @@ func (vk *VerifyingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder) dec := curve.NewDecoder(r, decOptions...) var err error - if err = dec.Decode(&vk.g); err != nil { + if err = dec.Decode(&vk.G); err != nil { return dec.BytesRead(), err } - err = dec.Decode(&vk.gRootSigmaNeg) + err = dec.Decode(&vk.GRootSigmaNeg) return dec.BytesRead(), err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g1.go index 1d39e26583..d1939254c9 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,51 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=-1 + tmp.Neg(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -437,13 +506,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -470,17 +540,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -488,11 +559,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -505,7 +576,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -561,12 +632,12 @@ func (p *G1Affine) ClearCofactor(a *G1Affine) *G1Affine { } // ClearCofactor maps a point in E(Fp) to E(Fp)[r] -func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { +func (p *G1Jac) ClearCofactor(q *G1Jac) *G1Jac { // https://eprint.iacr.org/2020/351.pdf var points [4]G1Jac - points[0].Set(a) - points[1].ScalarMultiplication(a, &xGen) + points[0].Set(q) + points[1].ScalarMultiplication(q, &xGen) points[2].ScalarMultiplication(&points[1], &xGen) points[3].ScalarMultiplication(&points[2], &xGen) @@ -602,14 +673,14 @@ func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -673,16 +744,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -691,43 +769,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -783,10 +863,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -796,7 +877,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -811,9 +892,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -822,7 +904,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -835,12 +917,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -867,9 +948,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -878,7 +960,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -891,11 +973,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -922,21 +1005,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -949,21 +1032,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -977,7 +1061,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -1027,7 +1111,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1109,9 +1193,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g2.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g2.go index c0c40763fb..513cc5f611 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/g2.go @@ -25,17 +25,17 @@ import ( "runtime" ) -// G2Affine point in affine coordinates +// G2Affine is a point in affine coordinates (x,y) type G2Affine struct { X, Y fp.Element } -// G2Jac is a point with fp.Element coordinates +// G2Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G2Jac struct { X, Y, Z fp.Element } -// g2JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g2JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g2JacExtended struct { X, Y, ZZ, ZZZ fp.Element } @@ -46,22 +46,24 @@ type g2Proj struct { } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G2Affine) Set(a *G2Affine) *G2Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) setInfinity() *G2Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { var _p G2Jac _p.FromAffine(a) @@ -70,7 +72,8 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { var _p G2Jac _p.mulGLV(&g2Gen, s) @@ -78,51 +81,88 @@ func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G2Affine) Equal(a *G2Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G2Affine) Neg(a *G2Affine) *G2Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { var a, b fp.Element @@ -141,7 +181,7 @@ func (p *G2Affine) FromJacobian(p1 *G2Jac) *G2Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G2Affine) String() string { if p.IsInfinity() { return "O" @@ -149,21 +189,20 @@ func (p *G2Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G2Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G2Affine) IsOnCurve() bool { var point G2Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G2Affine) IsInSubGroup() bool { var _p G2Jac _p.FromAffine(p) @@ -171,84 +210,76 @@ func (p *G2Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G2Jac) Set(a *G2Jac) *G2Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G2Jac) Set(q *G2Jac) *G2Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G2Jac) Equal(a *G2Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G2Jac) Equal(q *G2Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G2Jac) Neg(a *G2Jac) *G2Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G2Jac) SubAssign(a *G2Jac) *G2Jac { - var tmp G2Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G2Jac) Neg(q *G2Jac) *G2Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { +func (p *G2Jac) AddAssign(q *G2Jac) *G2Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -267,7 +298,7 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -276,7 +307,48 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G2Jac) SubAssign(q *G2Jac) *G2Jac { + var tmp G2Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -300,7 +372,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -325,7 +397,8 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) Double(q *G2Jac) *G2Jac { p.Set(q) @@ -333,7 +406,8 @@ func (p *G2Jac) Double(q *G2Jac) *G2Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G2Jac) DoubleAssign() *G2Jac { @@ -365,43 +439,51 @@ func (p *G2Jac) DoubleAssign() *G2Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { - return p.mulGLV(a, s) +func (p *G2Jac) ScalarMultiplication(q *G2Jac, s *big.Int) *G2Jac { + return p.mulGLV(q, s) +} + +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) + } -// String returns canonical representation of the point in affine coordinates +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G2Jac) String() string { _p := G2Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G2Jac) FromAffine(a *G2Affine) *G2Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bTwistCurveCoeff=4 + tmp.Double(&tmp).Double(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -429,13 +511,14 @@ func (p *G2Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G2Jac) mulWindowed(q *G2Jac, s *big.Int) *G2Jac { var res G2Jac var ops [3]G2Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -462,17 +545,18 @@ func (p *G2Jac) mulWindowed(a *G2Jac, s *big.Int) *G2Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G2Jac) phi(a *G2Jac) *G2Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G2Jac) phi(q *G2Jac) *G2Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG2) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { +func (p *G2Jac) mulGLV(q *G2Jac, s *big.Int) *G2Jac { var table [15]G2Jac var res G2Jac @@ -480,11 +564,11 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { res.Set(&g2Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -497,7 +581,7 @@ func (p *G2Jac) mulGLV(a *G2Jac, s *big.Int) *G2Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -553,10 +637,10 @@ func (p *G2Affine) ClearCofactor(a *G2Affine) *G2Affine { } // ClearCofactor maps a point in curve to r-torsion -func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { +func (p *G2Jac) ClearCofactor(q *G2Jac) *G2Jac { var points [4]G2Jac - points[0].Set(a) - points[1].ScalarMultiplication(a, &xGen) + points[0].Set(q) + points[1].ScalarMultiplication(q, &xGen) points[2].ScalarMultiplication(&points[1], &xGen) points[3].ScalarMultiplication(&points[2], &xGen) @@ -593,15 +677,15 @@ func (p *G2Jac) ClearCofactor(a *G2Jac) *G2Jac { } // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g2JacExtended) Set(a *g2JacExtended) *g2JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g2JacExtended) Set(q *g2JacExtended) *g2JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g2JacExtended) setInfinity() *g2JacExtended { p.X.SetOne() p.Y.SetOne() @@ -610,43 +694,45 @@ func (p *g2JacExtended) setInfinity() *g2JacExtended { return p } -func (p *g2JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g2JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G2Affine) fromJacExtended(Q *g2JacExtended) *G2Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G2Affine) fromJacExtended(q *g2JacExtended) *G2Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G2Jac) fromJacExtended(Q *g2JacExtended) *G2Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G2Jac) fromJacExtended(q *g2JacExtended) *G2Jac { + if q.ZZ.IsZero() { p.Set(&g2Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G2Jac) unsafeFromJacExtended(Q *g2JacExtended) *G2Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G2Jac) unsafeFromJacExtended(q *g2JacExtended) *G2Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { //if q is infinity return p @@ -702,10 +788,11 @@ func (p *g2JacExtended) add(q *g2JacExtended) *g2JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { var U, V, W, S, XX, M fp.Element @@ -715,7 +802,7 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -730,9 +817,10 @@ func (p *g2JacExtended) double(q *g2JacExtended) *g2JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -741,7 +829,7 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -754,12 +842,11 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -786,9 +873,10 @@ func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { +func (p *g2JacExtended) subMixed(a *G2Affine) *g2JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -797,7 +885,7 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -810,11 +898,12 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -841,21 +930,21 @@ func (p *g2JacExtended) addMixed(a *G2Affine) *g2JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g2JacExtended) doubleNegMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -868,21 +957,22 @@ func (p *g2JacExtended) doubleNegMixed(q *G2Affine) *g2JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { +func (p *g2JacExtended) doubleMixed(a *G2Affine) *g2JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -896,38 +986,38 @@ func (p *g2JacExtended) doubleMixed(q *G2Affine) *g2JacExtended { } // ------------------------------------------------------------------------------------------------- -// Homogenous projective +// Homogenous projective coordinates -// Set sets p to the provided point -func (p *g2Proj) Set(a *g2Proj) *g2Proj { - p.x, p.y, p.z = a.x, a.y, a.z +// Set sets p to a in projective coordinates. +func (p *g2Proj) Set(q *g2Proj) *g2Proj { + p.x, p.y, p.z = q.x, q.y, q.z return p } -// Neg computes -G -func (p *g2Proj) Neg(a *g2Proj) *g2Proj { - *p = *a - p.y.Neg(&a.y) +// Neg sets p to the projective negative point -q = (q.X, -q.Y). +func (p *g2Proj) Neg(q *g2Proj) *g2Proj { + *p = *q + p.y.Neg(&q.y) return p } -// FromAffine sets p = Q, p in homogenous projective, Q in affine -func (p *g2Proj) FromAffine(Q *G2Affine) *g2Proj { - if Q.X.IsZero() && Q.Y.IsZero() { +// FromAffine converts q in affine to p in projective coordinates. +func (p *g2Proj) FromAffine(a *G2Affine) *g2Proj { + if a.X.IsZero() && a.Y.IsZero() { p.z.SetZero() p.x.SetOne() p.y.SetOne() return p } p.z.SetOne() - p.x.Set(&Q.X) - p.y.Set(&Q.Y) + p.x.Set(&a.X) + p.y.Set(&a.Y) return p } // BatchScalarMultiplicationG2 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1006,9 +1096,8 @@ func BatchScalarMultiplicationG2(base *G2Affine, scalars []fr.Element) []G2Affin return toReturn } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG2Affine[TP pG2Affine, TPP ppG2Affine, TC cG2Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e3.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e3.go index 29e7fd7ff7..e933a2825a 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e3.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e3.go @@ -64,7 +64,7 @@ func (z *E3) SetOne() *E3 { return z } -// SetRandom set z to a random elmt +// SetRandom sets z to a random elmt func (z *E3) SetRandom() (*E3, error) { if _, err := z.A0.SetRandom(); err != nil { return nil, err @@ -78,11 +78,12 @@ func (z *E3) SetRandom() (*E3, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E3) IsZero() bool { return z.A0.IsZero() && z.A1.IsZero() && z.A2.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E3) IsOne() bool { return z.A0.IsOne() && z.A1.IsZero() && z.A2.IsZero() } @@ -103,7 +104,7 @@ func (z *E3) Add(x, y *E3) *E3 { return z } -// Sub two elements of E3 +// Sub subtracts two elements of E3 func (z *E3) Sub(x, y *E3) *E3 { z.A0.Sub(&x.A0, &y.A0) z.A1.Sub(&x.A1, &y.A1) @@ -124,13 +125,6 @@ func (z *E3) String() string { return (z.A0.String() + "+(" + z.A1.String() + ")*u+(" + z.A2.String() + ")*u**2") } -// Conjugate conjugates an element in E3 -func (z *E3) Conjugate(x *E3) *E3 { - *z = *x - z.A1.Neg(&z.A1) - return z -} - // MulByElement multiplies an element in E3 by an element in fp func (z *E3) MulByElement(x *E3, y *fp.Element) *E3 { _y := *y @@ -224,7 +218,8 @@ func (z *E3) MulBy1(c1 *fp.Element) *E3 { // Mul sets z to the E3-product of x,y, returns z func (z *E3) Mul(x, y *E3) *E3 { - // Algorithm 13 from https://eprint.iacr.org/2010/354.pdf + // Karatsuba method for cubic extensions + // https://eprint.iacr.org/2006/471.pdf (section 4) var t0, t1, t2, c0, c1, c2, tmp fp.Element t0.Mul(&x.A0, &y.A0) t1.Mul(&x.A1, &y.A1) @@ -316,8 +311,8 @@ func (z *E3) Inverse(x *E3) *E3 { return z } -// BatchInvertE3 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE3 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE3(a []E3) []E3 { diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e6.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e6.go index 76e63b34ef..508fc30690 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/internal/fptower/e6.go @@ -65,14 +65,14 @@ func (z *E6) SetOne() *E6 { return z } -// Add set z=x+y in E6 and return z +// Add sets z=x+y in E6 and returns z func (z *E6) Add(x, y *E6) *E6 { z.B0.Add(&x.B0, &y.B0) z.B1.Add(&x.B1, &y.B1) return z } -// Sub sets z to x sub y and return z +// Sub sets z to x-y and returns z func (z *E6) Sub(x, y *E6) *E6 { z.B0.Sub(&x.B0, &y.B0) z.B1.Sub(&x.B1, &y.B1) @@ -97,16 +97,17 @@ func (z *E6) SetRandom() (*E6, error) { return z, nil } -// IsZero returns true if the two elements are equal, false otherwise +// IsZero returns true if z is zero, false otherwise func (z *E6) IsZero() bool { return z.B0.IsZero() && z.B1.IsZero() } +// IsOne returns true if z is one, false otherwise func (z *E6) IsOne() bool { return z.B0.IsOne() && z.B1.IsZero() } -// Mul set z=x*y in E6 and return z +// Mul sets z=x*y in E6 and returns z func (z *E6) Mul(x, y *E6) *E6 { var a, b, c E3 a.Add(&x.B0, &x.B1) @@ -119,7 +120,7 @@ func (z *E6) Mul(x, y *E6) *E6 { return z } -// Square set z=x*x in E6 and return z +// Square sets z=x*x in E6 and returns z func (z *E6) Square(x *E6) *E6 { //Algorithm 22 from https://eprint.iacr.org/2010/354.pdf @@ -318,7 +319,7 @@ func (z *E6) CyclotomicSquare(x *E6) *E6 { return z } -// Inverse set z to the inverse of x in E6 and return z +// Inverse sets z to the inverse of x in E6 and returns z // // if x == 0, sets and returns z = x func (z *E6) Inverse(x *E6) *E6 { @@ -336,8 +337,8 @@ func (z *E6) Inverse(x *E6) *E6 { return z } -// BatchInvertE6 returns a new slice with every element inverted. -// Uses Montgomery batch inversion trick +// BatchInvertE6 returns a new slice with every element in a inverted. +// It uses Montgomery batch inversion trick. // // if a[i] == 0, returns result[i] = a[i] func BatchInvertE6(a []E6) []E6 { @@ -547,12 +548,12 @@ func (z *E6) ExpGLV(x E6, k *big.Int) *E6 { return z } -// InverseUnitary inverse a unitary element +// InverseUnitary inverses a unitary element func (z *E6) InverseUnitary(x *E6) *E6 { return z.Conjugate(x) } -// Conjugate set z to x conjugated and return z +// Conjugate sets z to x conjugated and returns z func (z *E6) Conjugate(x *E6) *E6 { *z = *x z.B1.Neg(&z.B1) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/kzg.go index 8984c2ef72..1ee2f5009b 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/kzg.go @@ -217,35 +217,27 @@ func Open(p []fr.Element, point fr.Element, pk ProvingKey) (OpeningProof, error) // Verify verifies a KZG opening proof at a single point func Verify(commitment *Digest, proof *OpeningProof, point fr.Element, vk VerifyingKey) error { - // [f(a)]G₁ - var claimedValueG1Aff bw6761.G1Jac - var claimedValueBigInt big.Int - proof.ClaimedValue.BigInt(&claimedValueBigInt) - claimedValueG1Aff.ScalarMultiplicationAffine(&vk.G1, &claimedValueBigInt) - - // [f(α) - f(a)]G₁ - var fminusfaG1Jac bw6761.G1Jac - fminusfaG1Jac.FromAffine(commitment) - fminusfaG1Jac.SubAssign(&claimedValueG1Aff) - - // [-H(α)]G₁ - var negH bw6761.G1Affine - negH.Neg(&proof.H) - - // [f(α) - f(a) + a*H(α)]G₁ + // [f(a)]G₁ + [-a]([H(α)]G₁) = [f(a) - a*H(α)]G₁ var totalG1 bw6761.G1Jac - var pointBigInt big.Int - point.BigInt(&pointBigInt) - totalG1.ScalarMultiplicationAffine(&proof.H, &pointBigInt) - totalG1.AddAssign(&fminusfaG1Jac) - var totalG1Aff bw6761.G1Affine - totalG1Aff.FromJacobian(&totalG1) + var pointNeg fr.Element + var cmInt, pointInt big.Int + proof.ClaimedValue.BigInt(&cmInt) + pointNeg.Neg(&point).BigInt(&pointInt) + totalG1.JointScalarMultiplication(&vk.G1, &proof.H, &cmInt, &pointInt) + + // [f(a) - a*H(α)]G₁ + [-f(α)]G₁ = [f(a) - f(α) - a*H(α)]G₁ + var commitmentJac bw6761.G1Jac + commitmentJac.FromAffine(commitment) + totalG1.SubAssign(&commitmentJac) // e([f(α)-f(a)+aH(α)]G₁], G₂).e([-H(α)]G₁, [α]G₂) == 1 + var totalG1Aff bw6761.G1Affine + totalG1Aff.FromJacobian(&totalG1) check, err := bw6761.PairingCheckFixedQ( - []bw6761.G1Affine{totalG1Aff, negH}, + []bw6761.G1Affine{totalG1Aff, proof.H}, vk.Lines[:], ) + if err != nil { return err } diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/marshal.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/marshal.go index 5f6c431866..ca9e1452bb 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/kzg/marshal.go @@ -19,6 +19,8 @@ package kzg import ( "github.com/consensys/gnark-crypto/ecc/bw6-761" "io" + + "github.com/consensys/gnark-crypto/utils/unsafe" ) // WriteTo writes binary encoding of the ProvingKey @@ -76,6 +78,51 @@ func (vk *VerifyingKey) writeTo(w io.Writer, options ...func(*bw6761.Encoder)) ( return enc.BytesWritten(), nil } +// WriteDump writes the binary encoding of the entire SRS memory representation +// It is meant to be use to achieve fast serialization/deserialization and +// is not compatible with WriteTo / ReadFrom. It does not do any validation +// and doesn't encode points in a canonical form. +// @unsafe: this is platform dependent and may not be compatible with other platforms +// @unstable: the format may change in the future +// If maxPkPoints is provided, the number of points in the ProvingKey will be limited to maxPkPoints +func (srs *SRS) WriteDump(w io.Writer, maxPkPoints ...int) error { + maxG1 := len(srs.Pk.G1) + if len(maxPkPoints) > 0 && maxPkPoints[0] < maxG1 && maxPkPoints[0] > 0 { + maxG1 = maxPkPoints[0] + } + // first we write the VerifyingKey; it is small so we re-use WriteTo + + if _, err := srs.Vk.writeTo(w, bw6761.RawEncoding()); err != nil { + return err + } + + // write the marker + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + // write the slice + return unsafe.WriteSlice(w, srs.Pk.G1[:maxG1]) +} + +// ReadDump deserializes the SRS from a reader, as written by WriteDump +func (srs *SRS) ReadDump(r io.Reader, maxPkPoints ...int) error { + // first we read the VerifyingKey; it is small so we re-use ReadFrom + _, err := srs.Vk.ReadFrom(r) + if err != nil { + return err + } + + // read the marker + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + // read the slice + srs.Pk.G1, _, err = unsafe.ReadSlice[[]bw6761.G1Affine](r, maxPkPoints...) + return err +} + // WriteTo writes binary encoding of the entire SRS func (srs *SRS) WriteTo(w io.Writer) (int64, error) { // encode the SRS diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_affine.go index 8aee61aeb2..09fe09a9dc 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_affine.go @@ -225,7 +225,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) @@ -493,7 +493,7 @@ func processChunkG2BatchAffine[BJE ibg2JacExtended, B ibG2Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_jacobian.go index 21c669647c..cb9b215db5 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) @@ -131,7 +131,7 @@ func processChunkG2Jacobian[B ibg2JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/pairing.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/pairing.go index 15a8c4ee71..ce141e076b 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/pairing.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/bw6-761/pairing.go @@ -284,7 +284,7 @@ func (p *g2Proj) doubleStep(evaluations *lineEvaluation) { C.Square(&p.z) D.Double(&C). Add(&D, &C) - E.Mul(&D, &bTwistCurveCoeff) + E.Double(&D).Double(&E) F.Double(&E). Add(&F, &E) G.Add(&B, &F) @@ -411,31 +411,32 @@ func PrecomputeLines(Q G2Affine) (PrecomputedLines [2][len(LoopCounter) - 1]Line // precomputations var accQ, imQ, imQneg, negQ G2Affine imQ.Y.Neg(&Q.Y) + imQ.X.Mul(&Q.X, &thirdRootOneG1) negQ.X.Set(&Q.X) negQ.Y.Set(&imQ.Y) - imQ.X.Mul(&Q.X, &thirdRootOneG1) accQ.Set(&imQ) - imQneg.Neg(&imQ) + imQneg.X.Set(&imQ.X) + imQneg.Y.Set(&Q.Y) - for i := len(LoopCounter) - 2; i >= 0; i-- { - accQ.doubleStep(&PrecomputedLines[0][i]) + for i := len(LoopCounter) - 2; i > 0; i-- { switch LoopCounter1[i]*3 + LoopCounter[i] { // cases -4, -2, 2, 4 do not occur, given the static LoopCounters case -3: - accQ.addStep(&PrecomputedLines[1][i], &imQneg) + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &imQneg) case -1: - accQ.addStep(&PrecomputedLines[1][i], &negQ) + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &negQ) case 0: - continue + accQ.doubleStep(&PrecomputedLines[0][i]) case 1: - accQ.addStep(&PrecomputedLines[1][i], &Q) + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &Q) case 3: - accQ.addStep(&PrecomputedLines[1][i], &imQ) + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &imQ) default: return [2][len(LoopCounter) - 1]LineEvaluationAff{} } } + accQ.tangentCompute(&PrecomputedLines[0][0]) return PrecomputedLines } @@ -578,3 +579,64 @@ func (p *G2Affine) addStep(evaluations *LineEvaluationAff, a *G2Affine) { p.X.Set(&xr) p.Y.Set(&yr) } + +func (p *G2Affine) doubleAndAddStep(evaluations1, evaluations2 *LineEvaluationAff, a *G2Affine) { + var n, d, l1, x3, l2, x4, y4 fp.Element + + // compute λ1 = (y2-y1)/(x2-x1) + n.Sub(&p.Y, &a.Y) + d.Sub(&p.X, &a.X) + l1.Div(&n, &d) + + // compute x3 =λ1²-x1-x2 + x3.Square(&l1) + x3.Sub(&x3, &p.X) + x3.Sub(&x3, &a.X) + + // omit y3 computation + + // compute line1 + evaluations1.R0.Set(&l1) + evaluations1.R1.Mul(&l1, &p.X) + evaluations1.R1.Sub(&evaluations1.R1, &p.Y) + + // compute λ2 = -λ1-2y1/(x3-x1) + n.Double(&p.Y) + d.Sub(&x3, &p.X) + l2.Div(&n, &d) + l2.Add(&l2, &l1) + l2.Neg(&l2) + + // compute x4 = λ2²-x1-x3 + x4.Square(&l2) + x4.Sub(&x4, &p.X) + x4.Sub(&x4, &x3) + + // compute y4 = λ2(x1 - x4)-y1 + y4.Sub(&p.X, &x4) + y4.Mul(&l2, &y4) + y4.Sub(&y4, &p.Y) + + // compute line2 + evaluations2.R0.Set(&l2) + evaluations2.R1.Mul(&l2, &p.X) + evaluations2.R1.Sub(&evaluations2.R1, &p.Y) + + p.X.Set(&x4) + p.Y.Set(&y4) +} + +func (p *G2Affine) tangentCompute(evaluations *LineEvaluationAff) { + + var n, d, λ fp.Element + // λ = 3x²/2y + n.Square(&p.X) + λ.Double(&n). + Add(&λ, &n) + d.Double(&p.Y) + λ.Div(&λ, &d) + + evaluations.R0.Set(&λ) + evaluations.R1.Mul(&λ, &p.X). + Sub(&evaluations.R1, &p.Y) +} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/g1.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/g1.go index 79ea044101..625e4f5f0a 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/g1.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/g1.go @@ -25,38 +25,40 @@ import ( "runtime" ) -// G1Affine point in affine coordinates +// G1Affine is a point in affine coordinates (x,y) type G1Affine struct { X, Y fp.Element } -// G1Jac is a point with fp.Element coordinates +// G1Jac is a point in Jacobian coordinates (x=X/Z², y=Y/Z³) type G1Jac struct { X, Y, Z fp.Element } -// g1JacExtended parameterized Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) +// g1JacExtended is a point in extended Jacobian coordinates (x=X/ZZ, y=Y/ZZZ, ZZ³=ZZZ²) type g1JacExtended struct { X, Y, ZZ, ZZZ fp.Element } // ------------------------------------------------------------------------------------------------- -// Affine +// Affine coordinates -// Set sets p to the provided point +// Set sets p to a in affine coordinates. func (p *G1Affine) Set(a *G1Affine) *G1Affine { p.X, p.Y = a.X, a.Y return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) setInfinity() *G1Affine { p.X.SetZero() p.Y.SetZero() return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are affine points. func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { var _p G1Jac _p.FromAffine(a) @@ -65,20 +67,8 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator -func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { - return p.mulGLV(&g1Gen, s) -} - -// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the affine point generating the prime subgroup. func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac _p.mulGLV(&g1Gen, s) @@ -86,51 +76,88 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { return p } -// Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Add adds two points in affine coordinates. +// It uses the Jacobian addition with a.Z=b.Z=1 and converts the result to affine coordinates. +// +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// It converts the point to Jacobian coordinates, doubles it using Jacobian +// addition with a.Z=1, and converts it back to affine coordinates. +// +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } -// Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Sub subtracts two points in affine coordinates. +// It uses a similar approach to Add, but negates the second point before adding. func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } -// Equal tests if two points (in Affine coordinates) are equal +// Equal tests if two points in affine coordinates are equal. func (p *G1Affine) Equal(a *G1Affine) bool { return p.X.Equal(&a.X) && p.Y.Equal(&a.Y) } -// Neg computes -G +// Neg sets p to the affine negative point -a = (a.X, -a.Y). func (p *G1Affine) Neg(a *G1Affine) *G1Affine { p.X = a.X p.Y.Neg(&a.Y) return p } -// FromJacobian rescales a point in Jacobian coord in z=1 plane +// FromJacobian converts a point p1 from Jacobian to affine coordinates. func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { var a, b fp.Element @@ -149,7 +176,7 @@ func (p *G1Affine) FromJacobian(p1 *G1Jac) *G1Affine { return p } -// String returns the string representation of the point or "O" if it is infinity +// String returns the string representation E(x,y) of the affine point p or "O" if it is infinity. func (p *G1Affine) String() string { if p.IsInfinity() { return "O" @@ -157,21 +184,20 @@ func (p *G1Affine) String() string { return "E([" + p.X.String() + "," + p.Y.String() + "])" } -// IsInfinity checks if the point is infinity -// in affine, it's encoded as (0,0) -// (0,0) is never on the curve for j=0 curves +// IsInfinity checks if the affine point p is infinity, which is encoded as (0,0). +// N.B.: (0,0) is never on the curve for j=0 curves (Y²=X³+B). func (p *G1Affine) IsInfinity() bool { return p.X.IsZero() && p.Y.IsZero() } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the affine point p in on the curve. func (p *G1Affine) IsOnCurve() bool { var point G1Jac point.FromAffine(p) return point.IsOnCurve() // call this function to handle infinity point } -// IsInSubGroup returns true if p is in the correct subgroup, false otherwise +// IsInSubGroup returns true if the affine point p is in the correct subgroup, false otherwise. func (p *G1Affine) IsInSubGroup() bool { var _p G1Jac _p.FromAffine(p) @@ -179,84 +205,76 @@ func (p *G1Affine) IsInSubGroup() bool { } // ------------------------------------------------------------------------------------------------- -// Jacobian +// Jacobian coordinates -// Set sets p to the provided point -func (p *G1Jac) Set(a *G1Jac) *G1Jac { - p.X, p.Y, p.Z = a.X, a.Y, a.Z +// Set sets p to a in Jacobian coordinates. +func (p *G1Jac) Set(q *G1Jac) *G1Jac { + p.X, p.Y, p.Z = q.X, q.Y, q.Z return p } -// Equal tests if two points (in Jacobian coordinates) are equal -func (p *G1Jac) Equal(a *G1Jac) bool { +// Equal tests if two points in Jacobian coordinates are equal. +func (p *G1Jac) Equal(q *G1Jac) bool { // If one point is infinity, the other must also be infinity. if p.Z.IsZero() { - return a.Z.IsZero() + return q.Z.IsZero() } // If the other point is infinity, return false since we can't // the following checks would be incorrect. - if a.Z.IsZero() { + if q.Z.IsZero() { return false } var pZSquare, aZSquare fp.Element pZSquare.Square(&p.Z) - aZSquare.Square(&a.Z) + aZSquare.Square(&q.Z) var lhs, rhs fp.Element lhs.Mul(&p.X, &aZSquare) - rhs.Mul(&a.X, &pZSquare) + rhs.Mul(&q.X, &pZSquare) if !lhs.Equal(&rhs) { return false } - lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &a.Z) - rhs.Mul(&a.Y, &pZSquare).Mul(&rhs, &p.Z) + lhs.Mul(&p.Y, &aZSquare).Mul(&lhs, &q.Z) + rhs.Mul(&q.Y, &pZSquare).Mul(&rhs, &p.Z) return lhs.Equal(&rhs) } -// Neg computes -G -func (p *G1Jac) Neg(a *G1Jac) *G1Jac { - *p = *a - p.Y.Neg(&a.Y) - return p -} - -// SubAssign subtracts two points on the curve -func (p *G1Jac) SubAssign(a *G1Jac) *G1Jac { - var tmp G1Jac - tmp.Set(a) - tmp.Y.Neg(&tmp.Y) - p.AddAssign(&tmp) +// Neg sets p to the Jacobian negative point -q = (q.X, -q.Y, q.Z). +func (p *G1Jac) Neg(q *G1Jac) *G1Jac { + *p = *q + p.Y.Neg(&q.Y) return p } -// AddAssign point addition in montgomery form +// AddAssign sets p to p+a in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl -func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { +func (p *G1Jac) AddAssign(q *G1Jac) *G1Jac { - // p is infinity, return a + // p is infinity, return q if p.Z.IsZero() { - p.Set(a) + p.Set(q) return p } - // a is infinity, return p - if a.Z.IsZero() { + // q is infinity, return p + if q.Z.IsZero() { return p } var Z1Z1, Z2Z2, U1, U2, S1, S2, H, I, J, r, V fp.Element - Z1Z1.Square(&a.Z) + Z1Z1.Square(&q.Z) Z2Z2.Square(&p.Z) - U1.Mul(&a.X, &Z2Z2) + U1.Mul(&q.X, &Z2Z2) U2.Mul(&p.X, &Z1Z1) - S1.Mul(&a.Y, &p.Z). + S1.Mul(&q.Y, &p.Z). Mul(&S1, &Z2Z2) - S2.Mul(&p.Y, &a.Z). + S2.Mul(&p.Y, &q.Z). Mul(&S2, &Z1Z1) - // if p == a, we double instead + // if p == q, we double instead if U1.Equal(&U2) && S1.Equal(&S2) { return p.DoubleAssign() } @@ -275,7 +293,7 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { Mul(&p.Y, &r) S1.Mul(&S1, &J).Double(&S1) p.Y.Sub(&p.Y, &S1) - p.Z.Add(&p.Z, &a.Z) + p.Z.Add(&p.Z, &q.Z) p.Z.Square(&p.Z). Sub(&p.Z, &Z1Z1). Sub(&p.Z, &Z2Z2). @@ -284,7 +302,48 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } -// AddMixed point addition +// SubAssign sets p to p-a in Jacobian coordinates. +// It uses a similar approach to AddAssign, but negates the point a before adding. +func (p *G1Jac) SubAssign(q *G1Jac) *G1Jac { + var tmp G1Jac + tmp.Set(q) + tmp.Y.Neg(&tmp.Y) + p.AddAssign(&tmp) + return p +} + +// Double sets p to [2]q in Jacobian coordinates. +// +// https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + A, but A=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + +// AddMixed sets p to p+a in Jacobian coordinates, where a.Z = 1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -308,7 +367,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -333,7 +392,8 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { return p } -// Double doubles a point in Jacobian coordinates +// Double sets p to [2]q in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) Double(q *G1Jac) *G1Jac { p.Set(q) @@ -341,7 +401,8 @@ func (p *G1Jac) Double(q *G1Jac) *G1Jac { return p } -// DoubleAssign doubles a point in Jacobian coordinates +// DoubleAssign doubles p in Jacobian coordinates. +// // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl func (p *G1Jac) DoubleAssign() *G1Jac { @@ -373,43 +434,50 @@ func (p *G1Jac) DoubleAssign() *G1Jac { return p } -// ScalarMultiplication computes and returns p = a ⋅ s +// ScalarMultiplication computes and returns p = [s]a +// where p and a are Jacobian points. +// using the GLV technique. // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { - return p.mulGLV(a, s) +func (p *G1Jac) ScalarMultiplication(q *G1Jac, s *big.Int) *G1Jac { + return p.mulGLV(q, s) } -// String returns canonical representation of the point in affine coordinates +// ScalarMultiplicationBase computes and returns p = [s]g +// where g is the prime subgroup generator. +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) + +} + +// String converts p to affine coordinates and returns its string representation E(x,y) or "O" if it is infinity. func (p *G1Jac) String() string { _p := G1Affine{} _p.FromJacobian(p) return _p.String() } -// FromAffine sets p = Q, p in Jacobian, Q in affine -func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { - if Q.IsInfinity() { +// FromAffine converts a point a from affine to Jacobian coordinates. +func (p *G1Jac) FromAffine(a *G1Affine) *G1Jac { + if a.IsInfinity() { p.Z.SetZero() p.X.SetOne() p.Y.SetOne() return p } p.Z.SetOne() - p.X.Set(&Q.X) - p.Y.Set(&Q.Y) + p.X.Set(&a.X) + p.Y.Set(&a.Y) return p } -// IsOnCurve returns true if p in on the curve +// IsOnCurve returns true if the Jacobian point p in on the curve. func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.Mul(&tmp, &bCurveCoeff) right.Add(&right, &tmp) return left.Equal(&right) } @@ -423,13 +491,14 @@ func (p *G1Jac) IsInSubGroup() bool { } -// mulWindowed computes a 2-bits windowed scalar multiplication -func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { +// mulWindowed computes the 2-bits windowed double-and-add scalar +// multiplication p=[s]q in Jacobian coordinates. +func (p *G1Jac) mulWindowed(q *G1Jac, s *big.Int) *G1Jac { var res G1Jac var ops [3]G1Jac - ops[0].Set(a) + ops[0].Set(q) if s.Sign() == -1 { ops[0].Neg(&ops[0]) } @@ -456,17 +525,18 @@ func (p *G1Jac) mulWindowed(a *G1Jac, s *big.Int) *G1Jac { } -// ϕ assigns p to ϕ(a) where ϕ: (x,y) → (w x,y), and returns p -// where w is a third root of unity in 𝔽p -func (p *G1Jac) phi(a *G1Jac) *G1Jac { - p.Set(a) +// phi sets p to ϕ(a) where ϕ: (x,y) → (w x,y), +// where w is a third root of unity. +func (p *G1Jac) phi(q *G1Jac) *G1Jac { + p.Set(q) p.X.Mul(&p.X, &thirdRootOneG1) return p } // mulGLV computes the scalar multiplication using a windowed-GLV method +// // see https://www.iacr.org/archive/crypto2001/21390189.pdf -func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { +func (p *G1Jac) mulGLV(q *G1Jac, s *big.Int) *G1Jac { var table [15]G1Jac var res G1Jac @@ -474,11 +544,11 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { res.Set(&g1Infinity) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0*a - table[0].Set(a) - table[3].phi(a) + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0*q + table[0].Set(q) + table[3].phi(q) - // split the scalar, modifies ±a, ϕ(a) accordingly + // split the scalar, modifies ±q, ϕ(q) accordingly k := ecc.SplitScalar(s, &glvBasis) if k[0].Sign() == -1 { @@ -491,7 +561,7 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { } // precompute table (2 bits sliding window) - // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(a) + b1b0 ⋅ a if b3b2b1b0 != 0 + // table[b3b2b1b0-1] = b3b2 ⋅ ϕ(q) + b1b0 ⋅ q if b3b2b1b0 != 0 table[1].Double(&table[0]) table[2].Set(&table[1]).AddAssign(&table[0]) table[4].Set(&table[3]).AddAssign(&table[0]) @@ -537,14 +607,14 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Strauss-Shamir technique +// where a1 and a2 are affine points. +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -608,16 +678,23 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator. +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) + +} + // ------------------------------------------------------------------------------------------------- -// Jacobian extended +// extended Jacobian coordinates -// Set sets p to the provided point -func (p *g1JacExtended) Set(a *g1JacExtended) *g1JacExtended { - p.X, p.Y, p.ZZ, p.ZZZ = a.X, a.Y, a.ZZ, a.ZZZ +// Set sets p to a in extended Jacobian coordinates. +func (p *g1JacExtended) Set(q *g1JacExtended) *g1JacExtended { + p.X, p.Y, p.ZZ, p.ZZZ = q.X, q.Y, q.ZZ, q.ZZZ return p } -// setInfinity sets p to O +// setInfinity sets p to the infinity point (1,1,0,0). func (p *g1JacExtended) setInfinity() *g1JacExtended { p.X.SetOne() p.Y.SetOne() @@ -626,43 +703,45 @@ func (p *g1JacExtended) setInfinity() *g1JacExtended { return p } -func (p *g1JacExtended) IsZero() bool { +// IsInfinity checks if the p is infinity, i.e. p.ZZ=0. +func (p *g1JacExtended) IsInfinity() bool { return p.ZZ.IsZero() } -// fromJacExtended sets Q in affine coordinates -func (p *G1Affine) fromJacExtended(Q *g1JacExtended) *G1Affine { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to an affine point. +func (p *G1Affine) fromJacExtended(q *g1JacExtended) *G1Affine { + if q.ZZ.IsZero() { p.X = fp.Element{} p.Y = fp.Element{} return p } - p.X.Inverse(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Inverse(&Q.ZZZ).Mul(&p.Y, &Q.Y) + p.X.Inverse(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Inverse(&q.ZZZ).Mul(&p.Y, &q.Y) return p } -// fromJacExtended sets Q in Jacobian coordinates -func (p *G1Jac) fromJacExtended(Q *g1JacExtended) *G1Jac { - if Q.ZZ.IsZero() { +// fromJacExtended converts an extended Jacobian point to a Jacobian point. +func (p *G1Jac) fromJacExtended(q *g1JacExtended) *G1Jac { + if q.ZZ.IsZero() { p.Set(&g1Infinity) return p } - p.X.Mul(&Q.ZZ, &Q.X).Mul(&p.X, &Q.ZZ) - p.Y.Mul(&Q.ZZZ, &Q.Y).Mul(&p.Y, &Q.ZZZ) - p.Z.Set(&Q.ZZZ) + p.X.Mul(&q.ZZ, &q.X).Mul(&p.X, &q.ZZ) + p.Y.Mul(&q.ZZZ, &q.Y).Mul(&p.Y, &q.ZZZ) + p.Z.Set(&q.ZZZ) return p } -// unsafeFromJacExtended sets p in Jacobian coordinates, but don't check for infinity -func (p *G1Jac) unsafeFromJacExtended(Q *g1JacExtended) *G1Jac { - p.X.Square(&Q.ZZ).Mul(&p.X, &Q.X) - p.Y.Square(&Q.ZZZ).Mul(&p.Y, &Q.Y) - p.Z = Q.ZZZ +// unsafeFromJacExtended converts an extended Jacobian point, distinct from Infinity, to a Jacobian point. +func (p *G1Jac) unsafeFromJacExtended(q *g1JacExtended) *G1Jac { + p.X.Square(&q.ZZ).Mul(&p.X, &q.X) + p.Y.Square(&q.ZZZ).Mul(&p.Y, &q.Y) + p.Z = q.ZZZ return p } -// add point in Jacobian extended coordinates +// add sets p to p+q in extended Jacobian coordinates. +// // https://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-add-2008-s func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { //if q is infinity return p @@ -718,10 +797,11 @@ func (p *g1JacExtended) add(q *g1JacExtended) *g1JacExtended { return p } -// double point in Jacobian extended coordinates +// double sets p to [2]q in Jacobian extended coordinates. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -// since we consider any point on Z=0 as the point at infinity -// this doubling formula works for infinity points as well +// N.B.: since we consider any point on Z=0 as the point at infinity +// this doubling formula works for infinity points as well. func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { var U, V, W, S, XX, M fp.Element @@ -731,7 +811,7 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { S.Mul(&q.X, &V) XX.Square(&q.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here U.Mul(&W, &q.Y) p.X.Square(&M). @@ -746,9 +826,10 @@ func (p *g1JacExtended) double(q *g1JacExtended) *g1JacExtended { return p } -// subMixed same as addMixed, but will negate a.Y +// addMixed sets p to p+q in extended Jacobian coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -757,7 +838,7 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y.Neg(&a.Y) + p.Y = a.Y p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -770,12 +851,11 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) - R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleNegMixed(a) + return p.doubleMixed(a) } p.ZZ = fp.Element{} @@ -802,9 +882,10 @@ func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { } -// addMixed +// subMixed works the same as addMixed, but negates a.Y. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#addition-madd-2008-s -func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { +func (p *g1JacExtended) subMixed(a *G1Affine) *g1JacExtended { //if a is infinity return p if a.IsInfinity() { @@ -813,7 +894,7 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { // p is infinity, return a if p.ZZ.IsZero() { p.X = a.X - p.Y = a.Y + p.Y.Neg(&a.Y) p.ZZ.SetOne() p.ZZZ.SetOne() return p @@ -826,11 +907,12 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { P.Sub(&P, &p.X) R.Mul(&a.Y, &p.ZZZ) + R.Neg(&R) R.Sub(&R, &p.Y) if P.IsZero() { if R.IsZero() { - return p.doubleMixed(a) + return p.doubleNegMixed(a) } p.ZZ = fp.Element{} @@ -857,21 +939,21 @@ func (p *g1JacExtended) addMixed(a *G1Affine) *g1JacExtended { } -// doubleNegMixed same as double, but will negate q.Y -func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { +// doubleNegMixed works the same as double, but negates q.Y. +func (p *g1JacExtended) doubleNegMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) U.Neg(&U) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -884,21 +966,22 @@ func (p *g1JacExtended) doubleNegMixed(q *G1Affine) *g1JacExtended { return p } -// doubleMixed point in Jacobian extended coordinates +// doubleMixed sets p to [2]a in Jacobian extended coordinates, where a.ZZ=1. +// // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-xyzz.html#doubling-dbl-2008-s-1 -func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { +func (p *g1JacExtended) doubleMixed(a *G1Affine) *g1JacExtended { var U, V, W, S, XX, M, S2, L fp.Element - U.Double(&q.Y) + U.Double(&a.Y) V.Square(&U) W.Mul(&U, &V) - S.Mul(&q.X, &V) - XX.Square(&q.X) + S.Mul(&a.X, &V) + XX.Square(&a.X) M.Double(&XX). - Add(&M, &XX) // -> + a, but a=0 here + Add(&M, &XX) // -> + A, but A=0 here S2.Double(&S) - L.Mul(&W, &q.Y) + L.Mul(&W, &a.Y) p.X.Square(&M). Sub(&p.X, &S2) @@ -912,7 +995,7 @@ func (p *g1JacExtended) doubleMixed(q *G1Affine) *g1JacExtended { } // BatchJacobianToAffineG1 converts points in Jacobian coordinates to Affine coordinates -// performing a single field inversion (Montgomery batch inversion trick). +// performing a single field inversion using the Montgomery batch inversion trick. func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { result := make([]G1Affine, len(points)) zeroes := make([]bool, len(points)) @@ -962,7 +1045,7 @@ func BatchJacobianToAffineG1(points []G1Jac) []G1Affine { // BatchScalarMultiplicationG1 multiplies the same base by all scalars // and return resulting points in affine coordinates -// uses a simple windowed-NAF like exponentiation algorithm +// uses a simple windowed-NAF-like multiplication algorithm. func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affine { // approximate cost in group ops is // cost = 2^{c-1} + n(scalar.nbBits+nbChunks) @@ -1044,9 +1127,8 @@ func BatchScalarMultiplicationG1(base *G1Affine, scalars []fr.Element) []G1Affin return toReturnAff } -// batch add affine coordinates -// using batch inversion -// special cases (doubling, infinity) must be filtered out before this call +// batchAddG1Affine adds affine points using the Montgomery batch inversion trick. +// Special cases (doubling, infinity) must be filtered out before this call. func batchAddG1Affine[TP pG1Affine, TPP ppG1Affine, TC cG1Affine](R *TPP, P *TP, batchSize int) { var lambda, lambdain TC diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_affine.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_affine.go index b7bcb93302..83da182a00 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_affine.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_affine.go @@ -225,7 +225,7 @@ func processChunkG1BatchAffine[BJE ibg1JacExtended, B ibG1Affine, BS bitSet, TP total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { runningSum.addMixed(&buckets[k]) - if !bucketsJE[k].IsZero() { + if !bucketsJE[k].IsInfinity() { runningSum.add(&bucketsJE[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_jacobian.go b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_jacobian.go index a63c09e410..bbbc17b0d0 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_jacobian.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/ecc/secp256k1/multiexp_jacobian.go @@ -56,7 +56,7 @@ func processChunkG1Jacobian[B ibg1JacExtended](chunk uint64, runningSum.setInfinity() total.setInfinity() for k := len(buckets) - 1; k >= 0; k-- { - if !buckets[k].IsZero() { + if !buckets[k].IsInfinity() { runningSum.add(&buckets[k]) } total.add(&runningSum) diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go b/galoisd/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go index db7cff3e13..7c3b970686 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go @@ -6,8 +6,8 @@ import ( ) // ExpandMsgXmd expands msg to a slice of lenInBytes bytes. -// https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5 -// https://tools.ietf.org/html/rfc8017#section-4.1 (I2OSP/O2ISP) +// https://datatracker.ietf.org/doc/html/rfc9380#name-expand_message_xmd +// https://datatracker.ietf.org/doc/html/rfc9380#name-utility-functions (I2OSP/O2ISP) func ExpandMsgXmd(msg, dst []byte, lenInBytes int) ([]byte, error) { h := sha256.New() @@ -22,7 +22,7 @@ func ExpandMsgXmd(msg, dst []byte, lenInBytes int) ([]byte, error) { // Z_pad = I2OSP(0, r_in_bytes) // l_i_b_str = I2OSP(len_in_bytes, 2) - // DST_prime = I2OSP(len(DST), 1) ∥ DST + // DST_prime = DST ∥ I2OSP(len(DST), 1) // b₀ = H(Z_pad ∥ msg ∥ l_i_b_str ∥ I2OSP(0, 1) ∥ DST_prime) h.Reset() if _, err := h.Write(make([]byte, h.BlockSize())); err != nil { diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/kzg/kzg.go b/galoisd/vendor/github.com/consensys/gnark-crypto/kzg/kzg.go index bab9896e80..134b11576d 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/kzg/kzg.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/kzg/kzg.go @@ -22,11 +22,17 @@ import ( type Serializable interface { io.ReaderFrom io.WriterTo + BinaryDumper WriteRawTo(w io.Writer) (n int64, err error) UnsafeReadFrom(r io.Reader) (int64, error) } +type BinaryDumper interface { + WriteDump(w io.Writer, maxPkPoints ...int) error + ReadDump(r io.Reader, maxPkPoints ...int) error +} + type SRS Serializable // NewSRS returns an empty curved-typed SRS object diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/utils/arith.go b/galoisd/vendor/github.com/consensys/gnark-crypto/utils/arith.go index 521497da2b..d3562eadb7 100644 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/utils/arith.go +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/utils/arith.go @@ -1,28 +1,5 @@ package utils -// DivCeiling (a, b) = ⌈a/b⌉ -func DivCeiling(a, b uint) uint { - q := a / b - if q*b == a { - return q - } - return q + 1 -} - -func MinU(a, b uint) uint { - if a < b { - return a - } - return b -} - -func Min(a, b int) int { - if a < b { - return a - } - return b -} - func Max(a, b int) int { if a > b { return a diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/utils/testing.go b/galoisd/vendor/github.com/consensys/gnark-crypto/utils/testing.go deleted file mode 100644 index 247ec63d5d..0000000000 --- a/galoisd/vendor/github.com/consensys/gnark-crypto/utils/testing.go +++ /dev/null @@ -1,52 +0,0 @@ -package utils - -import ( - "bytes" - "github.com/stretchr/testify/assert" - "io" - "reflect" - "testing" -) - -type Serializable interface { - io.ReaderFrom - io.WriterTo -} - -type RawSerializable interface { - WriteRawTo(io.Writer) (int64, error) -} - -func SerializationRoundTrip(o Serializable) func(*testing.T) { - return func(t *testing.T) { - // serialize it... - var buf bytes.Buffer - _, err := o.WriteTo(&buf) - assert.NoError(t, err) - - // reconstruct the object - _o := reflect.New(reflect.TypeOf(o).Elem()).Interface().(Serializable) - _, err = _o.ReadFrom(&buf) - assert.NoError(t, err) - - // compare - assert.Equal(t, o, _o) - } -} - -func SerializationRoundTripRaw(o RawSerializable) func(*testing.T) { - return func(t *testing.T) { - // serialize it... - var buf bytes.Buffer - _, err := o.WriteRawTo(&buf) - assert.NoError(t, err) - - // reconstruct the object - _o := reflect.New(reflect.TypeOf(o).Elem()).Interface().(Serializable) - _, err = _o.ReadFrom(&buf) - assert.NoError(t, err) - - // compare - assert.Equal(t, o, _o) - } -} diff --git a/galoisd/vendor/github.com/consensys/gnark-crypto/utils/unsafe/dump_slice.go b/galoisd/vendor/github.com/consensys/gnark-crypto/utils/unsafe/dump_slice.go new file mode 100644 index 0000000000..7a14c61c13 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark-crypto/utils/unsafe/dump_slice.go @@ -0,0 +1,102 @@ +package unsafe + +import ( + "bytes" + "encoding/binary" + "errors" + "io" + "unsafe" +) + +// WriteSlice writes a slice of arbitrary objects to the writer. +// Use with caution, as it writes the raw memory representation of the slice; +// In particular you do not want to use this with slices that contain pointers. +// This architecture dependent and will not work across different architectures +// (e.g. 32 vs 64 bit, big endian vs little endian). +func WriteSlice[S ~[]E, E any](w io.Writer, s S) error { + var e E + size := int(unsafe.Sizeof(e)) + if err := binary.Write(w, binary.LittleEndian, uint64(len(s))); err != nil { + return err + } + + if len(s) == 0 { + return nil + } + + data := unsafe.Slice((*byte)(unsafe.Pointer(&s[0])), size*len(s)) + if _, err := w.Write(data); err != nil { + return err + } + return nil +} + +// ReadSlice reads a slice of arbitrary objects from the reader, written by WriteSlice. +func ReadSlice[S ~[]E, E any](r io.Reader, maxElements ...int) (s S, read int, err error) { + var buf [8]byte + if _, err := io.ReadFull(r, buf[:]); err != nil { + return nil, 0, err + } + read += 8 + + // decode length of the slice + length := binary.LittleEndian.Uint64(buf[:]) + + var e E + size := int(unsafe.Sizeof(e)) + limit := length + if len(maxElements) == 1 && maxElements[0] > 0 && int(length) > maxElements[0] { + limit = uint64(maxElements[0]) + } + + if limit == 0 { + return make(S, 0), read, nil + } + + toReturn := make(S, limit) + + // directly read the bytes from reader into the target memory area + // (slice data) + data := unsafe.Slice((*byte)(unsafe.Pointer(&toReturn[0])), size*int(limit)) + if _, err := io.ReadFull(r, data); err != nil { + return nil, read, err + } + + read += size * int(limit) + + // advance the reader if we had more elements than we wanted + if length > limit { + advance := int(length-limit) * size + if _, err := io.CopyN(io.Discard, r, int64(advance)); err != nil { + return nil, read, err + } + read += advance + } + + return toReturn, read, nil +} + +const marker uint64 = 0xdeadbeef + +// WriteMarker writes the raw memory representation of a fixed marker to the writer. +// This is used to ensure that the dump was written on the same architecture. +func WriteMarker(w io.Writer) error { + marker := marker + _, err := w.Write(unsafe.Slice((*byte)(unsafe.Pointer(&marker)), 8)) + return err +} + +// ReadMarker reads the raw memory representation of a fixed marker from the reader. +// This is used to ensure that the dump was written on the same architecture. +func ReadMarker(r io.Reader) error { + var buf [8]byte + if _, err := io.ReadFull(r, buf[:]); err != nil { + return err + } + marker := marker + d := unsafe.Slice((*byte)(unsafe.Pointer(&marker)), 8) + if !bytes.Equal(d, buf[:]) { + return errors.New("marker mismatch: dump was not written on the same architecture") + } + return nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark/README.md b/galoisd/vendor/github.com/consensys/gnark/README.md index e222cd5411..294be110f3 100644 --- a/galoisd/vendor/github.com/consensys/gnark/README.md +++ b/galoisd/vendor/github.com/consensys/gnark/README.md @@ -120,7 +120,7 @@ func main() { #### Icicle Library -The following schemes and curves support experimental use of Ingomyama's Icicle GPU library for low level zk-SNARK primitives such as MSM, NTT, and polynomial operations: +The following schemes and curves support experimental use of Ingonyama's Icicle GPU library for low level zk-SNARK primitives such as MSM, NTT, and polynomial operations: - [x] [Groth16](https://eprint.iacr.org/2016/260) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/backend.go b/galoisd/vendor/github.com/consensys/gnark/backend/backend.go index 7ee17d6793..7c427e5825 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/backend.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/backend.go @@ -60,6 +60,7 @@ type ProverConfig struct { ChallengeHash hash.Hash KZGFoldingHash hash.Hash Accelerator string + StatisticalZK bool } // NewProverConfig returns a default ProverConfig with given prover options opts @@ -133,6 +134,16 @@ func WithIcicleAcceleration() ProverOption { } } +// WithStatisticalZeroKnowledge ensures that statistical zero knowledgeness is achieved. +// This option makes the prover more memory costly, as there are 3 more size n (size of the circuit) +// allocations. +func WithStatisticalZeroKnowledge() ProverOption { + return func(pc *ProverConfig) error { + pc.StatisticalZK = true + return nil + } +} + // VerifierOption defines option for altering the behavior of the verifier. See // the descriptions of functions returning instances of this type for // implemented options. diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/marshal.go index 525315efc2..ee8facd1e6 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/marshal.go @@ -20,6 +20,7 @@ import ( curve "github.com/consensys/gnark-crypto/ecc/bls12-377" "github.com/consensys/gnark-crypto/ecc/bls12-377/fr/pedersen" + "github.com/consensys/gnark-crypto/utils/unsafe" "github.com/consensys/gnark/internal/utils" "io" ) @@ -372,3 +373,165 @@ func (pk *ProvingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder)) return n + dec.BytesRead(), nil } + +// WriteDump behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe +// Output is compatible with ReadDump, with the caveat that, not only the points are not checked for +// correctness, but the raw bytes are platform dependent (endianness, etc.) +func (pk *ProvingKey) WriteDump(w io.Writer) error { + // it behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe + + // start by writing an unsafe marker to fail early. + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + if _, err := pk.Domain.WriteTo(w); err != nil { + return err + } + + enc := curve.NewEncoder(w, curve.RawEncoding()) + nbWires := uint64(len(pk.InfinityA)) + + toEncode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // pk.G1.A, + // pk.G1.B, + // pk.G1.Z, + // pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // pk.G2.B, + nbWires, + pk.NbInfinityA, + pk.NbInfinityB, + pk.InfinityA, + pk.InfinityB, + uint32(len(pk.CommitmentKeys)), + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return err + } + } + + // dump slices of points + if err := unsafe.WriteSlice(w, pk.G1.A); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.B); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.Z); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.K); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G2.B); err != nil { + return err + } + + for i := range pk.CommitmentKeys { + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].Basis); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].BasisExpSigma); err != nil { + return err + } + } + + return nil +} + +// ReadDump reads a ProvingKey from a dump written by WriteDump. +// This is platform dependent and very unsafe (no checks, no endianness translation, etc.) +func (pk *ProvingKey) ReadDump(r io.Reader) error { + // read the marker to fail early in case of malformed input + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + if _, err := pk.Domain.ReadFrom(r); err != nil { + return err + } + + dec := curve.NewDecoder(r, curve.NoSubgroupChecks()) + + var nbWires uint64 + var nbCommitments uint32 + + toDecode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // &pk.G1.A, + // &pk.G1.B, + // &pk.G1.Z, + // &pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // &pk.G2.B, + &nbWires, + &pk.NbInfinityA, + &pk.NbInfinityB, + } + + for _, v := range toDecode { + if err := dec.Decode(v); err != nil { + return err + } + } + pk.InfinityA = make([]bool, nbWires) + pk.InfinityB = make([]bool, nbWires) + + if err := dec.Decode(&pk.InfinityA); err != nil { + return err + } + if err := dec.Decode(&pk.InfinityB); err != nil { + return err + } + if err := dec.Decode(&nbCommitments); err != nil { + return err + } + + // read slices of points + var err error + pk.G1.A, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.B, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.Z, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.K, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G2.B, _, err = unsafe.ReadSlice[[]curve.G2Affine](r) + if err != nil { + return err + } + + pk.CommitmentKeys = make([]pedersen.ProvingKey, nbCommitments) + for i := range pk.CommitmentKeys { + pk.CommitmentKeys[i].Basis, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.CommitmentKeys[i].BasisExpSigma, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + } + + return nil + +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/verify.go index 867ce56708..e4fbc2d27b 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-377/verify.go @@ -29,6 +29,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls12-377/fr/pedersen" "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/logger" ) @@ -140,6 +141,6 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac } // ExportSolidity not implemented for BLS12-377 -func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { +func (vk *VerifyingKey) ExportSolidity(w io.Writer, exportOpts ...solidity.ExportOption) error { return errors.New("not implemented") } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/marshal.go index 9b0e59446b..ff47b52ad4 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/marshal.go @@ -20,6 +20,7 @@ import ( curve "github.com/consensys/gnark-crypto/ecc/bls12-381" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/pedersen" + "github.com/consensys/gnark-crypto/utils/unsafe" "github.com/consensys/gnark/internal/utils" "io" ) @@ -372,3 +373,165 @@ func (pk *ProvingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder)) return n + dec.BytesRead(), nil } + +// WriteDump behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe +// Output is compatible with ReadDump, with the caveat that, not only the points are not checked for +// correctness, but the raw bytes are platform dependent (endianness, etc.) +func (pk *ProvingKey) WriteDump(w io.Writer) error { + // it behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe + + // start by writing an unsafe marker to fail early. + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + if _, err := pk.Domain.WriteTo(w); err != nil { + return err + } + + enc := curve.NewEncoder(w, curve.RawEncoding()) + nbWires := uint64(len(pk.InfinityA)) + + toEncode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // pk.G1.A, + // pk.G1.B, + // pk.G1.Z, + // pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // pk.G2.B, + nbWires, + pk.NbInfinityA, + pk.NbInfinityB, + pk.InfinityA, + pk.InfinityB, + uint32(len(pk.CommitmentKeys)), + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return err + } + } + + // dump slices of points + if err := unsafe.WriteSlice(w, pk.G1.A); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.B); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.Z); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.K); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G2.B); err != nil { + return err + } + + for i := range pk.CommitmentKeys { + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].Basis); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].BasisExpSigma); err != nil { + return err + } + } + + return nil +} + +// ReadDump reads a ProvingKey from a dump written by WriteDump. +// This is platform dependent and very unsafe (no checks, no endianness translation, etc.) +func (pk *ProvingKey) ReadDump(r io.Reader) error { + // read the marker to fail early in case of malformed input + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + if _, err := pk.Domain.ReadFrom(r); err != nil { + return err + } + + dec := curve.NewDecoder(r, curve.NoSubgroupChecks()) + + var nbWires uint64 + var nbCommitments uint32 + + toDecode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // &pk.G1.A, + // &pk.G1.B, + // &pk.G1.Z, + // &pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // &pk.G2.B, + &nbWires, + &pk.NbInfinityA, + &pk.NbInfinityB, + } + + for _, v := range toDecode { + if err := dec.Decode(v); err != nil { + return err + } + } + pk.InfinityA = make([]bool, nbWires) + pk.InfinityB = make([]bool, nbWires) + + if err := dec.Decode(&pk.InfinityA); err != nil { + return err + } + if err := dec.Decode(&pk.InfinityB); err != nil { + return err + } + if err := dec.Decode(&nbCommitments); err != nil { + return err + } + + // read slices of points + var err error + pk.G1.A, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.B, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.Z, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.K, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G2.B, _, err = unsafe.ReadSlice[[]curve.G2Affine](r) + if err != nil { + return err + } + + pk.CommitmentKeys = make([]pedersen.ProvingKey, nbCommitments) + for i := range pk.CommitmentKeys { + pk.CommitmentKeys[i].Basis, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.CommitmentKeys[i].BasisExpSigma, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + } + + return nil + +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/verify.go index 0bf293f1d3..497009bdf4 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls12-381/verify.go @@ -29,6 +29,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/pedersen" "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/logger" ) @@ -140,6 +141,6 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac } // ExportSolidity not implemented for BLS12-381 -func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { +func (vk *VerifyingKey) ExportSolidity(w io.Writer, exportOpts ...solidity.ExportOption) error { return errors.New("not implemented") } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/marshal.go index efbb31d620..614647c775 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/marshal.go @@ -20,6 +20,7 @@ import ( curve "github.com/consensys/gnark-crypto/ecc/bls24-315" "github.com/consensys/gnark-crypto/ecc/bls24-315/fr/pedersen" + "github.com/consensys/gnark-crypto/utils/unsafe" "github.com/consensys/gnark/internal/utils" "io" ) @@ -372,3 +373,165 @@ func (pk *ProvingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder)) return n + dec.BytesRead(), nil } + +// WriteDump behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe +// Output is compatible with ReadDump, with the caveat that, not only the points are not checked for +// correctness, but the raw bytes are platform dependent (endianness, etc.) +func (pk *ProvingKey) WriteDump(w io.Writer) error { + // it behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe + + // start by writing an unsafe marker to fail early. + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + if _, err := pk.Domain.WriteTo(w); err != nil { + return err + } + + enc := curve.NewEncoder(w, curve.RawEncoding()) + nbWires := uint64(len(pk.InfinityA)) + + toEncode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // pk.G1.A, + // pk.G1.B, + // pk.G1.Z, + // pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // pk.G2.B, + nbWires, + pk.NbInfinityA, + pk.NbInfinityB, + pk.InfinityA, + pk.InfinityB, + uint32(len(pk.CommitmentKeys)), + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return err + } + } + + // dump slices of points + if err := unsafe.WriteSlice(w, pk.G1.A); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.B); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.Z); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.K); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G2.B); err != nil { + return err + } + + for i := range pk.CommitmentKeys { + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].Basis); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].BasisExpSigma); err != nil { + return err + } + } + + return nil +} + +// ReadDump reads a ProvingKey from a dump written by WriteDump. +// This is platform dependent and very unsafe (no checks, no endianness translation, etc.) +func (pk *ProvingKey) ReadDump(r io.Reader) error { + // read the marker to fail early in case of malformed input + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + if _, err := pk.Domain.ReadFrom(r); err != nil { + return err + } + + dec := curve.NewDecoder(r, curve.NoSubgroupChecks()) + + var nbWires uint64 + var nbCommitments uint32 + + toDecode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // &pk.G1.A, + // &pk.G1.B, + // &pk.G1.Z, + // &pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // &pk.G2.B, + &nbWires, + &pk.NbInfinityA, + &pk.NbInfinityB, + } + + for _, v := range toDecode { + if err := dec.Decode(v); err != nil { + return err + } + } + pk.InfinityA = make([]bool, nbWires) + pk.InfinityB = make([]bool, nbWires) + + if err := dec.Decode(&pk.InfinityA); err != nil { + return err + } + if err := dec.Decode(&pk.InfinityB); err != nil { + return err + } + if err := dec.Decode(&nbCommitments); err != nil { + return err + } + + // read slices of points + var err error + pk.G1.A, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.B, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.Z, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.K, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G2.B, _, err = unsafe.ReadSlice[[]curve.G2Affine](r) + if err != nil { + return err + } + + pk.CommitmentKeys = make([]pedersen.ProvingKey, nbCommitments) + for i := range pk.CommitmentKeys { + pk.CommitmentKeys[i].Basis, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.CommitmentKeys[i].BasisExpSigma, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + } + + return nil + +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/verify.go index 2c95a54d0d..b832adec1e 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-315/verify.go @@ -29,6 +29,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls24-315/fr/pedersen" "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/logger" ) @@ -140,6 +141,6 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac } // ExportSolidity not implemented for BLS24-315 -func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { +func (vk *VerifyingKey) ExportSolidity(w io.Writer, exportOpts ...solidity.ExportOption) error { return errors.New("not implemented") } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/marshal.go index b16d681254..00e0222422 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/marshal.go @@ -20,6 +20,7 @@ import ( curve "github.com/consensys/gnark-crypto/ecc/bls24-317" "github.com/consensys/gnark-crypto/ecc/bls24-317/fr/pedersen" + "github.com/consensys/gnark-crypto/utils/unsafe" "github.com/consensys/gnark/internal/utils" "io" ) @@ -372,3 +373,165 @@ func (pk *ProvingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder)) return n + dec.BytesRead(), nil } + +// WriteDump behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe +// Output is compatible with ReadDump, with the caveat that, not only the points are not checked for +// correctness, but the raw bytes are platform dependent (endianness, etc.) +func (pk *ProvingKey) WriteDump(w io.Writer) error { + // it behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe + + // start by writing an unsafe marker to fail early. + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + if _, err := pk.Domain.WriteTo(w); err != nil { + return err + } + + enc := curve.NewEncoder(w, curve.RawEncoding()) + nbWires := uint64(len(pk.InfinityA)) + + toEncode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // pk.G1.A, + // pk.G1.B, + // pk.G1.Z, + // pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // pk.G2.B, + nbWires, + pk.NbInfinityA, + pk.NbInfinityB, + pk.InfinityA, + pk.InfinityB, + uint32(len(pk.CommitmentKeys)), + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return err + } + } + + // dump slices of points + if err := unsafe.WriteSlice(w, pk.G1.A); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.B); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.Z); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.K); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G2.B); err != nil { + return err + } + + for i := range pk.CommitmentKeys { + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].Basis); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].BasisExpSigma); err != nil { + return err + } + } + + return nil +} + +// ReadDump reads a ProvingKey from a dump written by WriteDump. +// This is platform dependent and very unsafe (no checks, no endianness translation, etc.) +func (pk *ProvingKey) ReadDump(r io.Reader) error { + // read the marker to fail early in case of malformed input + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + if _, err := pk.Domain.ReadFrom(r); err != nil { + return err + } + + dec := curve.NewDecoder(r, curve.NoSubgroupChecks()) + + var nbWires uint64 + var nbCommitments uint32 + + toDecode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // &pk.G1.A, + // &pk.G1.B, + // &pk.G1.Z, + // &pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // &pk.G2.B, + &nbWires, + &pk.NbInfinityA, + &pk.NbInfinityB, + } + + for _, v := range toDecode { + if err := dec.Decode(v); err != nil { + return err + } + } + pk.InfinityA = make([]bool, nbWires) + pk.InfinityB = make([]bool, nbWires) + + if err := dec.Decode(&pk.InfinityA); err != nil { + return err + } + if err := dec.Decode(&pk.InfinityB); err != nil { + return err + } + if err := dec.Decode(&nbCommitments); err != nil { + return err + } + + // read slices of points + var err error + pk.G1.A, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.B, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.Z, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.K, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G2.B, _, err = unsafe.ReadSlice[[]curve.G2Affine](r) + if err != nil { + return err + } + + pk.CommitmentKeys = make([]pedersen.ProvingKey, nbCommitments) + for i := range pk.CommitmentKeys { + pk.CommitmentKeys[i].Basis, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.CommitmentKeys[i].BasisExpSigma, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + } + + return nil + +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/verify.go index f4c92dc687..79d828492b 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bls24-317/verify.go @@ -29,6 +29,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls24-317/fr/pedersen" "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/logger" ) @@ -140,6 +141,6 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac } // ExportSolidity not implemented for BLS24-317 -func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { +func (vk *VerifyingKey) ExportSolidity(w io.Writer, exportOpts ...solidity.ExportOption) error { return errors.New("not implemented") } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/marshal.go index c6539a7ba2..90dd38d8ad 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/marshal.go @@ -20,6 +20,7 @@ import ( curve "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen" + "github.com/consensys/gnark-crypto/utils/unsafe" "github.com/consensys/gnark/internal/utils" "io" ) @@ -372,3 +373,165 @@ func (pk *ProvingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder)) return n + dec.BytesRead(), nil } + +// WriteDump behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe +// Output is compatible with ReadDump, with the caveat that, not only the points are not checked for +// correctness, but the raw bytes are platform dependent (endianness, etc.) +func (pk *ProvingKey) WriteDump(w io.Writer) error { + // it behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe + + // start by writing an unsafe marker to fail early. + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + if _, err := pk.Domain.WriteTo(w); err != nil { + return err + } + + enc := curve.NewEncoder(w, curve.RawEncoding()) + nbWires := uint64(len(pk.InfinityA)) + + toEncode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // pk.G1.A, + // pk.G1.B, + // pk.G1.Z, + // pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // pk.G2.B, + nbWires, + pk.NbInfinityA, + pk.NbInfinityB, + pk.InfinityA, + pk.InfinityB, + uint32(len(pk.CommitmentKeys)), + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return err + } + } + + // dump slices of points + if err := unsafe.WriteSlice(w, pk.G1.A); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.B); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.Z); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.K); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G2.B); err != nil { + return err + } + + for i := range pk.CommitmentKeys { + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].Basis); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].BasisExpSigma); err != nil { + return err + } + } + + return nil +} + +// ReadDump reads a ProvingKey from a dump written by WriteDump. +// This is platform dependent and very unsafe (no checks, no endianness translation, etc.) +func (pk *ProvingKey) ReadDump(r io.Reader) error { + // read the marker to fail early in case of malformed input + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + if _, err := pk.Domain.ReadFrom(r); err != nil { + return err + } + + dec := curve.NewDecoder(r, curve.NoSubgroupChecks()) + + var nbWires uint64 + var nbCommitments uint32 + + toDecode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // &pk.G1.A, + // &pk.G1.B, + // &pk.G1.Z, + // &pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // &pk.G2.B, + &nbWires, + &pk.NbInfinityA, + &pk.NbInfinityB, + } + + for _, v := range toDecode { + if err := dec.Decode(v); err != nil { + return err + } + } + pk.InfinityA = make([]bool, nbWires) + pk.InfinityB = make([]bool, nbWires) + + if err := dec.Decode(&pk.InfinityA); err != nil { + return err + } + if err := dec.Decode(&pk.InfinityB); err != nil { + return err + } + if err := dec.Decode(&nbCommitments); err != nil { + return err + } + + // read slices of points + var err error + pk.G1.A, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.B, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.Z, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.K, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G2.B, _, err = unsafe.ReadSlice[[]curve.G2Affine](r) + if err != nil { + return err + } + + pk.CommitmentKeys = make([]pedersen.ProvingKey, nbCommitments) + for i := range pk.CommitmentKeys { + pk.CommitmentKeys[i].Basis, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.CommitmentKeys[i].BasisExpSigma, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + } + + return nil + +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/lagrange.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/lagrange.go new file mode 100644 index 0000000000..886e489248 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/lagrange.go @@ -0,0 +1,220 @@ +// Copyright 2020 ConsenSys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gnark DO NOT EDIT + +package mpcsetup + +import ( + "math/big" + "math/bits" + "runtime" + + "github.com/consensys/gnark-crypto/ecc" + curve "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fr" + "github.com/consensys/gnark-crypto/ecc/bn254/fr/fft" + "github.com/consensys/gnark/internal/utils" +) + +// TODO use gnark-crypto for this op +func lagrangeCoeffsG1(powers []curve.G1Affine, size int) []curve.G1Affine { + coeffs := make([]curve.G1Affine, size) + copy(coeffs, powers[:size]) + domain := fft.NewDomain(uint64(size)) + numCPU := uint64(runtime.NumCPU()) + maxSplits := bits.TrailingZeros64(ecc.NextPowerOfTwo(numCPU)) + + twiddlesInv, _ := domain.TwiddlesInv() + difFFTG1(coeffs, twiddlesInv, 0, maxSplits, nil) + bitReverse(coeffs) + + var invBigint big.Int + domain.CardinalityInv.BigInt(&invBigint) + + utils.Parallelize(size, func(start, end int) { + for i := start; i < end; i++ { + coeffs[i].ScalarMultiplication(&coeffs[i], &invBigint) + } + }) + return coeffs +} + +// TODO use gnark-crypto for this op +func lagrangeCoeffsG2(powers []curve.G2Affine, size int) []curve.G2Affine { + coeffs := make([]curve.G2Affine, size) + copy(coeffs, powers[:size]) + domain := fft.NewDomain(uint64(size)) + numCPU := uint64(runtime.NumCPU()) + maxSplits := bits.TrailingZeros64(ecc.NextPowerOfTwo(numCPU)) + + twiddlesInv, _ := domain.TwiddlesInv() + difFFTG2(coeffs, twiddlesInv, 0, maxSplits, nil) + bitReverse(coeffs) + + var invBigint big.Int + domain.CardinalityInv.BigInt(&invBigint) + + utils.Parallelize(size, func(start, end int) { + for i := start; i < end; i++ { + coeffs[i].ScalarMultiplication(&coeffs[i], &invBigint) + } + }) + return coeffs +} + +func butterflyG1(a *curve.G1Affine, b *curve.G1Affine) { + t := *a + a.Add(a, b) + b.Sub(&t, b) +} + +func butterflyG2(a *curve.G2Affine, b *curve.G2Affine) { + t := *a + a.Add(a, b) + b.Sub(&t, b) +} + +// kerDIF8 is a kernel that process a FFT of size 8 +func kerDIF8G1(a []curve.G1Affine, twiddles [][]fr.Element, stage int) { + butterflyG1(&a[0], &a[4]) + butterflyG1(&a[1], &a[5]) + butterflyG1(&a[2], &a[6]) + butterflyG1(&a[3], &a[7]) + + var twiddle big.Int + twiddles[stage+0][1].BigInt(&twiddle) + a[5].ScalarMultiplication(&a[5], &twiddle) + twiddles[stage+0][2].BigInt(&twiddle) + a[6].ScalarMultiplication(&a[6], &twiddle) + twiddles[stage+0][3].BigInt(&twiddle) + a[7].ScalarMultiplication(&a[7], &twiddle) + butterflyG1(&a[0], &a[2]) + butterflyG1(&a[1], &a[3]) + butterflyG1(&a[4], &a[6]) + butterflyG1(&a[5], &a[7]) + twiddles[stage+1][1].BigInt(&twiddle) + a[3].ScalarMultiplication(&a[3], &twiddle) + twiddles[stage+1][1].BigInt(&twiddle) + a[7].ScalarMultiplication(&a[7], &twiddle) + butterflyG1(&a[0], &a[1]) + butterflyG1(&a[2], &a[3]) + butterflyG1(&a[4], &a[5]) + butterflyG1(&a[6], &a[7]) +} + +// kerDIF8 is a kernel that process a FFT of size 8 +func kerDIF8G2(a []curve.G2Affine, twiddles [][]fr.Element, stage int) { + butterflyG2(&a[0], &a[4]) + butterflyG2(&a[1], &a[5]) + butterflyG2(&a[2], &a[6]) + butterflyG2(&a[3], &a[7]) + + var twiddle big.Int + twiddles[stage+0][1].BigInt(&twiddle) + a[5].ScalarMultiplication(&a[5], &twiddle) + twiddles[stage+0][2].BigInt(&twiddle) + a[6].ScalarMultiplication(&a[6], &twiddle) + twiddles[stage+0][3].BigInt(&twiddle) + a[7].ScalarMultiplication(&a[7], &twiddle) + butterflyG2(&a[0], &a[2]) + butterflyG2(&a[1], &a[3]) + butterflyG2(&a[4], &a[6]) + butterflyG2(&a[5], &a[7]) + twiddles[stage+1][1].BigInt(&twiddle) + a[3].ScalarMultiplication(&a[3], &twiddle) + twiddles[stage+1][1].BigInt(&twiddle) + a[7].ScalarMultiplication(&a[7], &twiddle) + butterflyG2(&a[0], &a[1]) + butterflyG2(&a[2], &a[3]) + butterflyG2(&a[4], &a[5]) + butterflyG2(&a[6], &a[7]) +} + +func difFFTG1(a []curve.G1Affine, twiddles [][]fr.Element, stage, maxSplits int, chDone chan struct{}) { + if chDone != nil { + defer close(chDone) + } + + n := len(a) + if n == 1 { + return + } else if n == 8 { + kerDIF8G1(a, twiddles, stage) + return + } + m := n >> 1 + + butterflyG1(&a[0], &a[m]) + + var twiddle big.Int + for i := 1; i < m; i++ { + butterflyG1(&a[i], &a[i+m]) + twiddles[stage][i].BigInt(&twiddle) + a[i+m].ScalarMultiplication(&a[i+m], &twiddle) + } + + if m == 1 { + return + } + + nextStage := stage + 1 + if stage < maxSplits { + chDone := make(chan struct{}, 1) + go difFFTG1(a[m:n], twiddles, nextStage, maxSplits, chDone) + difFFTG1(a[0:m], twiddles, nextStage, maxSplits, nil) + <-chDone + } else { + difFFTG1(a[0:m], twiddles, nextStage, maxSplits, nil) + difFFTG1(a[m:n], twiddles, nextStage, maxSplits, nil) + } +} +func difFFTG2(a []curve.G2Affine, twiddles [][]fr.Element, stage, maxSplits int, chDone chan struct{}) { + if chDone != nil { + defer close(chDone) + } + + n := len(a) + if n == 1 { + return + } else if n == 8 { + kerDIF8G2(a, twiddles, stage) + return + } + m := n >> 1 + + butterflyG2(&a[0], &a[m]) + + var twiddle big.Int + for i := 1; i < m; i++ { + butterflyG2(&a[i], &a[i+m]) + twiddles[stage][i].BigInt(&twiddle) + a[i+m].ScalarMultiplication(&a[i+m], &twiddle) + } + + if m == 1 { + return + } + + nextStage := stage + 1 + if stage < maxSplits { + chDone := make(chan struct{}, 1) + go difFFTG2(a[m:n], twiddles, nextStage, maxSplits, chDone) + difFFTG2(a[0:m], twiddles, nextStage, maxSplits, nil) + <-chDone + } else { + difFFTG2(a[0:m], twiddles, nextStage, maxSplits, nil) + difFFTG2(a[m:n], twiddles, nextStage, maxSplits, nil) + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/marshal.go new file mode 100644 index 0000000000..a187342e7f --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/marshal.go @@ -0,0 +1,223 @@ +// Copyright 2020 ConsenSys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gnark DO NOT EDIT + +package mpcsetup + +import ( + "io" + + curve "github.com/consensys/gnark-crypto/ecc/bn254" +) + +// WriteTo implements io.WriterTo +func (phase1 *Phase1) WriteTo(writer io.Writer) (int64, error) { + n, err := phase1.writeTo(writer) + if err != nil { + return n, err + } + nBytes, err := writer.Write(phase1.Hash) + return int64(nBytes) + n, err +} + +func (phase1 *Phase1) writeTo(writer io.Writer) (int64, error) { + toEncode := []interface{}{ + &phase1.PublicKeys.Tau.SG, + &phase1.PublicKeys.Tau.SXG, + &phase1.PublicKeys.Tau.XR, + &phase1.PublicKeys.Alpha.SG, + &phase1.PublicKeys.Alpha.SXG, + &phase1.PublicKeys.Alpha.XR, + &phase1.PublicKeys.Beta.SG, + &phase1.PublicKeys.Beta.SXG, + &phase1.PublicKeys.Beta.XR, + phase1.Parameters.G1.Tau, + phase1.Parameters.G1.AlphaTau, + phase1.Parameters.G1.BetaTau, + phase1.Parameters.G2.Tau, + &phase1.Parameters.G2.Beta, + } + + enc := curve.NewEncoder(writer) + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return enc.BytesWritten(), err + } + } + return enc.BytesWritten(), nil +} + +// ReadFrom implements io.ReaderFrom +func (phase1 *Phase1) ReadFrom(reader io.Reader) (int64, error) { + toEncode := []interface{}{ + &phase1.PublicKeys.Tau.SG, + &phase1.PublicKeys.Tau.SXG, + &phase1.PublicKeys.Tau.XR, + &phase1.PublicKeys.Alpha.SG, + &phase1.PublicKeys.Alpha.SXG, + &phase1.PublicKeys.Alpha.XR, + &phase1.PublicKeys.Beta.SG, + &phase1.PublicKeys.Beta.SXG, + &phase1.PublicKeys.Beta.XR, + &phase1.Parameters.G1.Tau, + &phase1.Parameters.G1.AlphaTau, + &phase1.Parameters.G1.BetaTau, + &phase1.Parameters.G2.Tau, + &phase1.Parameters.G2.Beta, + } + + dec := curve.NewDecoder(reader) + for _, v := range toEncode { + if err := dec.Decode(v); err != nil { + return dec.BytesRead(), err + } + } + phase1.Hash = make([]byte, 32) + nBytes, err := reader.Read(phase1.Hash) + return dec.BytesRead() + int64(nBytes), err +} + +// WriteTo implements io.WriterTo +func (phase2 *Phase2) WriteTo(writer io.Writer) (int64, error) { + n, err := phase2.writeTo(writer) + if err != nil { + return n, err + } + nBytes, err := writer.Write(phase2.Hash) + return int64(nBytes) + n, err +} + +func (c *Phase2) writeTo(writer io.Writer) (int64, error) { + enc := curve.NewEncoder(writer) + toEncode := []interface{}{ + &c.PublicKey.SG, + &c.PublicKey.SXG, + &c.PublicKey.XR, + &c.Parameters.G1.Delta, + c.Parameters.G1.L, + c.Parameters.G1.Z, + &c.Parameters.G2.Delta, + &c.Parameters.G2.GRootSigmaNeg, + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return enc.BytesWritten(), err + } + } + + enc.Encode(uint64(len(c.Parameters.G1.BasisExpSigma))) + for _, h := range c.Parameters.G1.BasisExpSigma { + if err := enc.Encode(h); err != nil { + return enc.BytesWritten(), err + } + } + + return enc.BytesWritten(), nil +} + +// ReadFrom implements io.ReaderFrom +func (c *Phase2) ReadFrom(reader io.Reader) (int64, error) { + dec := curve.NewDecoder(reader) + toEncode := []interface{}{ + &c.PublicKey.SG, + &c.PublicKey.SXG, + &c.PublicKey.XR, + &c.Parameters.G1.Delta, + &c.Parameters.G1.L, + &c.Parameters.G1.Z, + &c.Parameters.G2.Delta, + &c.Parameters.G2.GRootSigmaNeg, + } + + for _, v := range toEncode { + if err := dec.Decode(v); err != nil { + return dec.BytesRead(), err + } + } + + var basisExpSigmanLen uint64 + if err := dec.Decode(&basisExpSigmanLen); err != nil { + return dec.BytesRead(), err + } + + c.Parameters.G1.BasisExpSigma = make([][]curve.G1Affine, basisExpSigmanLen) + for i := 0; i < int(basisExpSigmanLen); i++ { + if err := dec.Decode(&c.Parameters.G1.BasisExpSigma[i]); err != nil { + return dec.BytesRead(), err + } + } + + c.Hash = make([]byte, 32) + n, err := reader.Read(c.Hash) + return int64(n) + dec.BytesRead(), err +} + +// WriteTo implements io.WriterTo +func (c *Phase2Evaluations) WriteTo(writer io.Writer) (int64, error) { + enc := curve.NewEncoder(writer) + toEncode := []interface{}{ + c.G1.A, + c.G1.B, + c.G1.VKK, + c.G2.B, + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return enc.BytesWritten(), err + } + } + + enc.Encode(uint64(len(c.G1.Basis))) + for _, h := range c.G1.Basis { + if err := enc.Encode(h); err != nil { + return enc.BytesWritten(), err + } + } + + return enc.BytesWritten(), nil +} + +// ReadFrom implements io.ReaderFrom +func (c *Phase2Evaluations) ReadFrom(reader io.Reader) (int64, error) { + dec := curve.NewDecoder(reader) + toEncode := []interface{}{ + &c.G1.A, + &c.G1.B, + &c.G1.VKK, + &c.G2.B, + } + + for _, v := range toEncode { + if err := dec.Decode(v); err != nil { + return dec.BytesRead(), err + } + } + + var basisLen uint64 + if err := dec.Decode(&basisLen); err != nil { + return dec.BytesRead(), err + } + + c.G1.Basis = make([][]curve.G1Affine, basisLen) + for i := 0; i < int(basisLen); i++ { + if err := dec.Decode(&c.G1.Basis[i]); err != nil { + return dec.BytesRead(), err + } + } + + return dec.BytesRead(), nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase1.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase1.go new file mode 100644 index 0000000000..a912a473aa --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase1.go @@ -0,0 +1,203 @@ +// Copyright 2020 ConsenSys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gnark DO NOT EDIT + +package mpcsetup + +import ( + "crypto/sha256" + "errors" + curve "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fr" + "math" + "math/big" +) + +// Phase1 represents the Phase1 of the MPC described in +// https://eprint.iacr.org/2017/1050.pdf +// +// Also known as "Powers of Tau" +type Phase1 struct { + Parameters struct { + G1 struct { + Tau []curve.G1Affine // {[τ⁰]₁, [τ¹]₁, [τ²]₁, …, [τ²ⁿ⁻²]₁} + AlphaTau []curve.G1Affine // {α[τ⁰]₁, α[τ¹]₁, α[τ²]₁, …, α[τⁿ⁻¹]₁} + BetaTau []curve.G1Affine // {β[τ⁰]₁, β[τ¹]₁, β[τ²]₁, …, β[τⁿ⁻¹]₁} + } + G2 struct { + Tau []curve.G2Affine // {[τ⁰]₂, [τ¹]₂, [τ²]₂, …, [τⁿ⁻¹]₂} + Beta curve.G2Affine // [β]₂ + } + } + PublicKeys struct { + Tau, Alpha, Beta PublicKey + } + Hash []byte // sha256 hash +} + +// InitPhase1 initialize phase 1 of the MPC. This is called once by the coordinator before +// any randomness contribution is made (see Contribute()). +func InitPhase1(power int) (phase1 Phase1) { + N := int(math.Pow(2, float64(power))) + + // Generate key pairs + var tau, alpha, beta fr.Element + tau.SetOne() + alpha.SetOne() + beta.SetOne() + phase1.PublicKeys.Tau = newPublicKey(tau, nil, 1) + phase1.PublicKeys.Alpha = newPublicKey(alpha, nil, 2) + phase1.PublicKeys.Beta = newPublicKey(beta, nil, 3) + + // First contribution use generators + _, _, g1, g2 := curve.Generators() + phase1.Parameters.G2.Beta.Set(&g2) + phase1.Parameters.G1.Tau = make([]curve.G1Affine, 2*N-1) + phase1.Parameters.G2.Tau = make([]curve.G2Affine, N) + phase1.Parameters.G1.AlphaTau = make([]curve.G1Affine, N) + phase1.Parameters.G1.BetaTau = make([]curve.G1Affine, N) + for i := 0; i < len(phase1.Parameters.G1.Tau); i++ { + phase1.Parameters.G1.Tau[i].Set(&g1) + } + for i := 0; i < len(phase1.Parameters.G2.Tau); i++ { + phase1.Parameters.G2.Tau[i].Set(&g2) + phase1.Parameters.G1.AlphaTau[i].Set(&g1) + phase1.Parameters.G1.BetaTau[i].Set(&g1) + } + + phase1.Parameters.G2.Beta.Set(&g2) + + // Compute hash of Contribution + phase1.Hash = phase1.hash() + + return +} + +// Contribute contributes randomness to the phase1 object. This mutates phase1. +func (phase1 *Phase1) Contribute() { + N := len(phase1.Parameters.G2.Tau) + + // Generate key pairs + var tau, alpha, beta fr.Element + tau.SetRandom() + alpha.SetRandom() + beta.SetRandom() + phase1.PublicKeys.Tau = newPublicKey(tau, phase1.Hash[:], 1) + phase1.PublicKeys.Alpha = newPublicKey(alpha, phase1.Hash[:], 2) + phase1.PublicKeys.Beta = newPublicKey(beta, phase1.Hash[:], 3) + + // Compute powers of τ, ατ, and βτ + taus := powers(tau, 2*N-1) + alphaTau := make([]fr.Element, N) + betaTau := make([]fr.Element, N) + for i := 0; i < N; i++ { + alphaTau[i].Mul(&taus[i], &alpha) + betaTau[i].Mul(&taus[i], &beta) + } + + // Update using previous parameters + // TODO @gbotrel working with jacobian points here will help with perf. + scaleG1InPlace(phase1.Parameters.G1.Tau, taus) + scaleG2InPlace(phase1.Parameters.G2.Tau, taus[0:N]) + scaleG1InPlace(phase1.Parameters.G1.AlphaTau, alphaTau) + scaleG1InPlace(phase1.Parameters.G1.BetaTau, betaTau) + var betaBI big.Int + beta.BigInt(&betaBI) + phase1.Parameters.G2.Beta.ScalarMultiplication(&phase1.Parameters.G2.Beta, &betaBI) + + // Compute hash of Contribution + phase1.Hash = phase1.hash() +} + +func VerifyPhase1(c0, c1 *Phase1, c ...*Phase1) error { + contribs := append([]*Phase1{c0, c1}, c...) + for i := 0; i < len(contribs)-1; i++ { + if err := verifyPhase1(contribs[i], contribs[i+1]); err != nil { + return err + } + } + return nil +} + +// verifyPhase1 checks that a contribution is based on a known previous Phase1 state. +func verifyPhase1(current, contribution *Phase1) error { + // Compute R for τ, α, β + tauR := genR(contribution.PublicKeys.Tau.SG, contribution.PublicKeys.Tau.SXG, current.Hash[:], 1) + alphaR := genR(contribution.PublicKeys.Alpha.SG, contribution.PublicKeys.Alpha.SXG, current.Hash[:], 2) + betaR := genR(contribution.PublicKeys.Beta.SG, contribution.PublicKeys.Beta.SXG, current.Hash[:], 3) + + // Check for knowledge of toxic parameters + if !sameRatio(contribution.PublicKeys.Tau.SG, contribution.PublicKeys.Tau.SXG, contribution.PublicKeys.Tau.XR, tauR) { + return errors.New("couldn't verify public key of τ") + } + if !sameRatio(contribution.PublicKeys.Alpha.SG, contribution.PublicKeys.Alpha.SXG, contribution.PublicKeys.Alpha.XR, alphaR) { + return errors.New("couldn't verify public key of α") + } + if !sameRatio(contribution.PublicKeys.Beta.SG, contribution.PublicKeys.Beta.SXG, contribution.PublicKeys.Beta.XR, betaR) { + return errors.New("couldn't verify public key of β") + } + + // Check for valid updates using previous parameters + if !sameRatio(contribution.Parameters.G1.Tau[1], current.Parameters.G1.Tau[1], tauR, contribution.PublicKeys.Tau.XR) { + return errors.New("couldn't verify that [τ]₁ is based on previous contribution") + } + if !sameRatio(contribution.Parameters.G1.AlphaTau[0], current.Parameters.G1.AlphaTau[0], alphaR, contribution.PublicKeys.Alpha.XR) { + return errors.New("couldn't verify that [α]₁ is based on previous contribution") + } + if !sameRatio(contribution.Parameters.G1.BetaTau[0], current.Parameters.G1.BetaTau[0], betaR, contribution.PublicKeys.Beta.XR) { + return errors.New("couldn't verify that [β]₁ is based on previous contribution") + } + if !sameRatio(contribution.PublicKeys.Tau.SG, contribution.PublicKeys.Tau.SXG, contribution.Parameters.G2.Tau[1], current.Parameters.G2.Tau[1]) { + return errors.New("couldn't verify that [τ]₂ is based on previous contribution") + } + if !sameRatio(contribution.PublicKeys.Beta.SG, contribution.PublicKeys.Beta.SXG, contribution.Parameters.G2.Beta, current.Parameters.G2.Beta) { + return errors.New("couldn't verify that [β]₂ is based on previous contribution") + } + + // Check for valid updates using powers of τ + _, _, g1, g2 := curve.Generators() + tauL1, tauL2 := linearCombinationG1(contribution.Parameters.G1.Tau) + if !sameRatio(tauL1, tauL2, contribution.Parameters.G2.Tau[1], g2) { + return errors.New("couldn't verify valid powers of τ in G₁") + } + alphaL1, alphaL2 := linearCombinationG1(contribution.Parameters.G1.AlphaTau) + if !sameRatio(alphaL1, alphaL2, contribution.Parameters.G2.Tau[1], g2) { + return errors.New("couldn't verify valid powers of α(τ) in G₁") + } + betaL1, betaL2 := linearCombinationG1(contribution.Parameters.G1.BetaTau) + if !sameRatio(betaL1, betaL2, contribution.Parameters.G2.Tau[1], g2) { + return errors.New("couldn't verify valid powers of α(τ) in G₁") + } + tau2L1, tau2L2 := linearCombinationG2(contribution.Parameters.G2.Tau) + if !sameRatio(contribution.Parameters.G1.Tau[1], g1, tau2L1, tau2L2) { + return errors.New("couldn't verify valid powers of τ in G₂") + } + + // Check hash of the contribution + h := contribution.hash() + for i := 0; i < len(h); i++ { + if h[i] != contribution.Hash[i] { + return errors.New("couldn't verify hash of contribution") + } + } + + return nil +} + +func (phase1 *Phase1) hash() []byte { + sha := sha256.New() + phase1.writeTo(sha) + return sha.Sum(nil) +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase2.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase2.go new file mode 100644 index 0000000000..50eefc533c --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/phase2.go @@ -0,0 +1,381 @@ +// Copyright 2020 ConsenSys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gnark DO NOT EDIT + +package mpcsetup + +import ( + "crypto/sha256" + "errors" + "math/big" + + curve "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fr" + + utils "github.com/consensys/gnark/backend/groth16/internal" + "github.com/consensys/gnark/constraint" + cs "github.com/consensys/gnark/constraint/bn254" +) + +type Phase2Evaluations struct { + G1 struct { + A, B, VKK []curve.G1Affine + Basis [][]curve.G1Affine + } + G2 struct { + B []curve.G2Affine + } +} + +type Phase2 struct { + Parameters struct { + G1 struct { + Delta curve.G1Affine + L, Z []curve.G1Affine + BasisExpSigma [][]curve.G1Affine + } + G2 struct { + Delta, GRootSigmaNeg curve.G2Affine + } + } + PublicKey PublicKey + Hash []byte +} + +func InitPhase2(r1cs *cs.R1CS, srs1 *Phase1) (Phase2, Phase2Evaluations) { + srs := srs1.Parameters + size := len(srs.G1.AlphaTau) + if size < r1cs.GetNbConstraints() { + panic("Number of constraints is larger than expected") + } + + c2 := Phase2{} + + accumulateG1 := func(res *curve.G1Affine, t constraint.Term, value *curve.G1Affine) { + cID := t.CoeffID() + switch cID { + case constraint.CoeffIdZero: + return + case constraint.CoeffIdOne: + res.Add(res, value) + case constraint.CoeffIdMinusOne: + res.Sub(res, value) + case constraint.CoeffIdTwo: + res.Add(res, value).Add(res, value) + default: + var tmp curve.G1Affine + var vBi big.Int + r1cs.Coefficients[cID].BigInt(&vBi) + tmp.ScalarMultiplication(value, &vBi) + res.Add(res, &tmp) + } + } + + accumulateG2 := func(res *curve.G2Affine, t constraint.Term, value *curve.G2Affine) { + cID := t.CoeffID() + switch cID { + case constraint.CoeffIdZero: + return + case constraint.CoeffIdOne: + res.Add(res, value) + case constraint.CoeffIdMinusOne: + res.Sub(res, value) + case constraint.CoeffIdTwo: + res.Add(res, value).Add(res, value) + default: + var tmp curve.G2Affine + var vBi big.Int + r1cs.Coefficients[cID].BigInt(&vBi) + tmp.ScalarMultiplication(value, &vBi) + res.Add(res, &tmp) + } + } + + // Prepare Lagrange coefficients of [τ...]₁, [τ...]₂, [ατ...]₁, [βτ...]₁ + coeffTau1 := lagrangeCoeffsG1(srs.G1.Tau, size) + coeffTau2 := lagrangeCoeffsG2(srs.G2.Tau, size) + coeffAlphaTau1 := lagrangeCoeffsG1(srs.G1.AlphaTau, size) + coeffBetaTau1 := lagrangeCoeffsG1(srs.G1.BetaTau, size) + + // a commitment is itself defined by a hint so the prover considers it private + // but the verifier will need to inject the value itself so on the groth16 + // level it must be considered public + nbWires := r1cs.NbInternalVariables + r1cs.GetNbPublicVariables() + r1cs.GetNbSecretVariables() + commitmentInfo := r1cs.CommitmentInfo.(constraint.Groth16Commitments) + commitmentWires := commitmentInfo.CommitmentIndexes() + privateCommitted := commitmentInfo.GetPrivateCommitted() + nbPrivateCommittedWires := utils.NbElements(privateCommitted) + + nbPublicWires := r1cs.GetNbPublicVariables() + len(commitmentInfo) + nbPrivateWires := r1cs.GetNbSecretVariables() + r1cs.NbInternalVariables - nbPrivateCommittedWires - len(commitmentInfo) + + var evals Phase2Evaluations + evals.G1.A = make([]curve.G1Affine, nbWires) + evals.G1.B = make([]curve.G1Affine, nbWires) + evals.G1.Basis = make([][]curve.G1Affine, nbPrivateCommittedWires) + evals.G2.B = make([]curve.G2Affine, nbWires) + bA := make([]curve.G1Affine, nbWires) + aB := make([]curve.G1Affine, nbWires) + C := make([]curve.G1Affine, nbWires) + + // TODO @gbotrel use constraint iterator when available. + + i := 0 + it := r1cs.GetR1CIterator() + for c := it.Next(); c != nil; c = it.Next() { + // A + for _, t := range c.L { + accumulateG1(&evals.G1.A[t.WireID()], t, &coeffTau1[i]) + accumulateG1(&bA[t.WireID()], t, &coeffBetaTau1[i]) + } + // B + for _, t := range c.R { + accumulateG1(&evals.G1.B[t.WireID()], t, &coeffTau1[i]) + accumulateG2(&evals.G2.B[t.WireID()], t, &coeffTau2[i]) + accumulateG1(&aB[t.WireID()], t, &coeffAlphaTau1[i]) + } + // C + for _, t := range c.O { + accumulateG1(&C[t.WireID()], t, &coeffTau1[i]) + } + i++ + } + + // Prepare default contribution + _, _, g1, g2 := curve.Generators() + c2.Parameters.G1.Delta = g1 + c2.Parameters.G2.Delta = g2 + + // Build Z in PK as τⁱ(τⁿ - 1) = τ⁽ⁱ⁺ⁿ⁾ - τⁱ for i ∈ [0, n-2] + // τⁱ(τⁿ - 1) = τ⁽ⁱ⁺ⁿ⁾ - τⁱ for i ∈ [0, n-2] + n := len(srs.G1.AlphaTau) + c2.Parameters.G1.Z = make([]curve.G1Affine, n) + for i := 0; i < n-1; i++ { + c2.Parameters.G1.Z[i].Sub(&srs.G1.Tau[i+n], &srs.G1.Tau[i]) + } + bitReverse(c2.Parameters.G1.Z) + c2.Parameters.G1.Z = c2.Parameters.G1.Z[:n-1] + + c2.Parameters.G1.L = make([]curve.G1Affine, nbPrivateWires) + evals.G1.VKK = make([]curve.G1Affine, nbPublicWires) + evals.G1.Basis = make([][]curve.G1Affine, len(commitmentInfo)) + for i := range commitmentInfo { + evals.G1.Basis[i] = make([]curve.G1Affine, len(privateCommitted[i])) + } + + vI := 0 // number of public wires seen so far + cI := make([]int, len(commitmentInfo)) // number of private committed wires seen so far for each commitment + nbPrivateCommittedSeen := 0 // = ∑ᵢ cI[i] + nbCommitmentsSeen := 0 + + for i := range bA { + var tmp curve.G1Affine + tmp.Add(&bA[i], &aB[i]) + tmp.Add(&tmp, &C[i]) + commitment := -1 // index of the commitment that commits to this variable as a private or commitment value + var isCommitment, isPublic bool + if isPublic = i < r1cs.GetNbPublicVariables(); !isPublic { + if nbCommitmentsSeen < len(commitmentWires) && commitmentWires[nbCommitmentsSeen] == i { + isCommitment = true + nbCommitmentsSeen++ + } + + for j := range commitmentInfo { // does commitment j commit to i? + if cI[j] < len(privateCommitted[j]) && privateCommitted[j][cI[j]] == i { + commitment = j + break // frontend guarantees that no private variable is committed to more than once + } + } + } + + if isPublic || commitment != -1 || isCommitment { + if isPublic || isCommitment { + evals.G1.VKK[vI] = tmp + vI++ + } else { // committed and private + evals.G1.Basis[commitment][cI[commitment]] = tmp + cI[commitment]++ + nbPrivateCommittedSeen++ + } + } else { + c2.Parameters.G1.L[i-vI-nbPrivateCommittedSeen] = tmp // vI = nbPublicSeen + nbCommitmentsSeen + } + } + + basisExpSigma, gRootSigmaNeg := InitPedersen(evals.G1.Basis...) + c2.Parameters.G1.BasisExpSigma = basisExpSigma + c2.Parameters.G2.GRootSigmaNeg = gRootSigmaNeg + + // Set δ public key + var delta fr.Element + delta.SetOne() + c2.PublicKey = newPublicKey(delta, nil, 1) + + // Hash initial contribution + c2.Hash = c2.hash() + return c2, evals +} + +func (c *Phase2) Contribute() { + // Sample toxic δ + var delta, deltaInv fr.Element + var deltaBI, deltaInvBI big.Int + delta.SetRandom() + deltaInv.Inverse(&delta) + + delta.BigInt(&deltaBI) + deltaInv.BigInt(&deltaInvBI) + + // Set δ public key + c.PublicKey = newPublicKey(delta, c.Hash, 1) + + // Update δ + c.Parameters.G1.Delta.ScalarMultiplication(&c.Parameters.G1.Delta, &deltaBI) + c.Parameters.G2.Delta.ScalarMultiplication(&c.Parameters.G2.Delta, &deltaBI) + + // Update GRootSigmaNeg using δ + c.Parameters.G2.GRootSigmaNeg.ScalarMultiplication(&c.Parameters.G2.GRootSigmaNeg, &deltaBI) + + // Update BasisExpSigma with δ⁻¹ + // TODO: Is it sound to use the same δ⁻¹ for all basis? + for i := 0; i < len(c.Parameters.G1.BasisExpSigma); i++ { + for j := 0; j < len(c.Parameters.G1.BasisExpSigma[i]); j++ { + c.Parameters.G1.BasisExpSigma[i][j].ScalarMultiplication( + &c.Parameters.G1.BasisExpSigma[i][j], + &deltaInvBI, + ) + } + } + + // Update Z using δ⁻¹ + for i := 0; i < len(c.Parameters.G1.Z); i++ { + c.Parameters.G1.Z[i].ScalarMultiplication(&c.Parameters.G1.Z[i], &deltaInvBI) + } + + // Update L using δ⁻¹ + for i := 0; i < len(c.Parameters.G1.L); i++ { + c.Parameters.G1.L[i].ScalarMultiplication(&c.Parameters.G1.L[i], &deltaInvBI) + } + + // 4. Hash contribution + c.Hash = c.hash() +} + +func VerifyPhase2(c0, c1 *Phase2, c ...*Phase2) error { + contribs := append([]*Phase2{c0, c1}, c...) + for i := 0; i < len(contribs)-1; i++ { + if err := verifyPhase2(contribs[i], contribs[i+1]); err != nil { + return err + } + } + return nil +} + +func verifyPhase2(current, contribution *Phase2) error { + // Check hash of the contribution + h := contribution.hash() + for i := 0; i < len(h); i++ { + if h[i] != contribution.Hash[i] { + return errors.New("couldn't verify hash of contribution") + } + } + + // Compute R for δ + deltaR := genR(contribution.PublicKey.SG, contribution.PublicKey.SXG, current.Hash[:], 1) + + // Check for knowledge of δ + if !sameRatio(contribution.PublicKey.SG, contribution.PublicKey.SXG, contribution.PublicKey.XR, deltaR) { + return errors.New("couldn't verify knowledge of δ") + } + + // Check for valid updates using previous parameters + if !sameRatio(contribution.Parameters.G1.Delta, current.Parameters.G1.Delta, deltaR, contribution.PublicKey.XR) { + return errors.New("couldn't verify that [δ]₁ is based on previous contribution") + } + if !sameRatio( + contribution.PublicKey.SG, + contribution.PublicKey.SXG, + contribution.Parameters.G2.Delta, + current.Parameters.G2.Delta, + ) { + return errors.New("couldn't verify that [δ]₂ is based on previous contribution") + } + + // Check for valid updates of L and Z using + L, prevL := merge(contribution.Parameters.G1.L, current.Parameters.G1.L) + if !sameRatio(L, prevL, contribution.Parameters.G2.Delta, current.Parameters.G2.Delta) { + return errors.New("couldn't verify valid updates of L using δ⁻¹") + } + Z, prevZ := merge(contribution.Parameters.G1.Z, current.Parameters.G1.Z) + if !sameRatio(Z, prevZ, contribution.Parameters.G2.Delta, current.Parameters.G2.Delta) { + return errors.New("couldn't verify valid updates of L using δ⁻¹") + } + + // Check for valid update of the pedersen key + if !sameRatio( + current.Parameters.G1.Delta, + contribution.Parameters.G1.Delta, + contribution.Parameters.G2.GRootSigmaNeg, + current.Parameters.G2.GRootSigmaNeg, + ) { + return errors.New("couldn't verify that GRootSigmaNeg is based on previous contribution") + } + for i := 0; i < len(current.Parameters.G1.BasisExpSigma); i++ { + basisExpSigma, prevBasisExpSigma := merge( + contribution.Parameters.G1.BasisExpSigma[i], + current.Parameters.G1.BasisExpSigma[i], + ) + if !sameRatio( + basisExpSigma, + prevBasisExpSigma, + contribution.Parameters.G2.Delta, current.Parameters.G2.Delta, + ) { + return errors.New("couldn't verify valid updates of BasisExpSigma using δ⁻¹") + } + } + + return nil +} + +func (c *Phase2) hash() []byte { + sha := sha256.New() + c.writeTo(sha) + return sha.Sum(nil) +} + +func InitPedersen(bases ...[]curve.G1Affine) (BasisExpSigma [][]curve.G1Affine, GRootSigmaNeg curve.G2Affine) { + _, _, _, g2 := curve.Generators() + + var modMinusOne big.Int + modMinusOne.Sub(fr.Modulus(), big.NewInt(1)) + + // set sigma to 1 + sigma := big.NewInt(1) + + // Todo: simplify + var sigmaInvNeg big.Int + sigmaInvNeg.ModInverse(sigma, fr.Modulus()) + sigmaInvNeg.Sub(fr.Modulus(), &sigmaInvNeg) + GRootSigmaNeg.ScalarMultiplication(&g2, &sigmaInvNeg) + + BasisExpSigma = make([][]curve.G1Affine, len(bases)) + for i := range bases { + BasisExpSigma[i] = make([]curve.G1Affine, len(bases[i])) + for j := range bases[i] { + BasisExpSigma[i][j].ScalarMultiplication(&bases[i][j], sigma) + } + } + return +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/setup.go new file mode 100644 index 0000000000..3357f711d5 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/setup.go @@ -0,0 +1,112 @@ +// Copyright 2020 ConsenSys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gnark DO NOT EDIT + +package mpcsetup + +import ( + curve "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fr/fft" + "github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen" + groth16 "github.com/consensys/gnark/backend/groth16/bn254" + "github.com/consensys/gnark/constraint" + cs "github.com/consensys/gnark/constraint/bn254" +) + +func ExtractKeys(r1cs *cs.R1CS, srs1 *Phase1, srs2 *Phase2, evals *Phase2Evaluations) (pk groth16.ProvingKey, vk groth16.VerifyingKey) { + _, _, _, g2 := curve.Generators() + + commitmentInfo := r1cs.CommitmentInfo.(constraint.Groth16Commitments) + commitmentWires := commitmentInfo.CommitmentIndexes() + + // Initialize PK + pk.Domain = *fft.NewDomain(uint64(r1cs.NbConstraints)) + pk.G1.Alpha.Set(&srs1.Parameters.G1.AlphaTau[0]) + pk.G1.Beta.Set(&srs1.Parameters.G1.BetaTau[0]) + pk.G1.Delta.Set(&srs2.Parameters.G1.Delta) + pk.G1.Z = srs2.Parameters.G1.Z + bitReverse(pk.G1.Z) + + pk.G1.K = srs2.Parameters.G1.L + pk.G2.Beta.Set(&srs1.Parameters.G2.Beta) + pk.G2.Delta.Set(&srs2.Parameters.G2.Delta) + + pk.CommitmentKeys = make([]pedersen.ProvingKey, len(evals.G1.Basis)) + for i := range evals.G1.Basis { + pk.CommitmentKeys[i].Basis = evals.G1.Basis[i] + pk.CommitmentKeys[i].BasisExpSigma = srs2.Parameters.G1.BasisExpSigma[i] + } + + // Filter out infinity points + nWires := len(evals.G1.A) + pk.InfinityA = make([]bool, nWires) + A := make([]curve.G1Affine, nWires) + j := 0 + for i, e := range evals.G1.A { + if e.IsInfinity() { + pk.InfinityA[i] = true + continue + } + A[j] = evals.G1.A[i] + j++ + } + pk.G1.A = A[:j] + pk.NbInfinityA = uint64(nWires - j) + + pk.InfinityB = make([]bool, nWires) + B := make([]curve.G1Affine, nWires) + j = 0 + for i, e := range evals.G1.B { + if e.IsInfinity() { + pk.InfinityB[i] = true + continue + } + B[j] = evals.G1.B[i] + j++ + } + pk.G1.B = B[:j] + pk.NbInfinityB = uint64(nWires - j) + + B2 := make([]curve.G2Affine, nWires) + j = 0 + for i, e := range evals.G2.B { + if e.IsInfinity() { + // pk.InfinityB[i] = true should be the same as in B + continue + } + B2[j] = evals.G2.B[i] + j++ + } + pk.G2.B = B2[:j] + + // Initialize VK + vk.G1.Alpha.Set(&srs1.Parameters.G1.AlphaTau[0]) + vk.G1.Beta.Set(&srs1.Parameters.G1.BetaTau[0]) + vk.G1.Delta.Set(&srs2.Parameters.G1.Delta) + vk.G2.Beta.Set(&srs1.Parameters.G2.Beta) + vk.G2.Delta.Set(&srs2.Parameters.G2.Delta) + vk.G2.Gamma.Set(&g2) + vk.G1.K = evals.G1.VKK + vk.CommitmentKey.G = g2 + vk.CommitmentKey.GRootSigmaNeg = srs2.Parameters.G2.GRootSigmaNeg + vk.PublicAndCommitmentCommitted = commitmentInfo.GetPublicAndCommitmentCommitted(commitmentWires, r1cs.GetNbPublicVariables()) + + // sets e, -[δ]2, -[γ]2 + if err := vk.Precompute(); err != nil { + panic(err) + } + + return pk, vk +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/utils.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/utils.go new file mode 100644 index 0000000000..e3b47d1121 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/mpcsetup/utils.go @@ -0,0 +1,170 @@ +// Copyright 2020 ConsenSys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gnark DO NOT EDIT + +package mpcsetup + +import ( + "bytes" + "math/big" + "math/bits" + "runtime" + + "github.com/consensys/gnark-crypto/ecc" + curve "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fr" + "github.com/consensys/gnark/internal/utils" +) + +type PublicKey struct { + SG curve.G1Affine + SXG curve.G1Affine + XR curve.G2Affine +} + +func newPublicKey(x fr.Element, challenge []byte, dst byte) PublicKey { + var pk PublicKey + _, _, g1, _ := curve.Generators() + + var s fr.Element + var sBi big.Int + s.SetRandom() + s.BigInt(&sBi) + pk.SG.ScalarMultiplication(&g1, &sBi) + + // compute x*sG1 + var xBi big.Int + x.BigInt(&xBi) + pk.SXG.ScalarMultiplication(&pk.SG, &xBi) + + // generate R based on sG1, sxG1, challenge, and domain separation tag (tau, alpha or beta) + R := genR(pk.SG, pk.SXG, challenge, dst) + + // compute x*spG2 + pk.XR.ScalarMultiplication(&R, &xBi) + return pk +} + +func bitReverse[T any](a []T) { + n := uint64(len(a)) + nn := uint64(64 - bits.TrailingZeros64(n)) + + for i := uint64(0); i < n; i++ { + irev := bits.Reverse64(i) >> nn + if irev > i { + a[i], a[irev] = a[irev], a[i] + } + } +} + +// Returns [1, a, a², ..., aⁿ⁻¹ ] in Montgomery form +func powers(a fr.Element, n int) []fr.Element { + result := make([]fr.Element, n) + result[0] = fr.NewElement(1) + for i := 1; i < n; i++ { + result[i].Mul(&result[i-1], &a) + } + return result +} + +// Returns [aᵢAᵢ, ...] in G1 +func scaleG1InPlace(A []curve.G1Affine, a []fr.Element) { + utils.Parallelize(len(A), func(start, end int) { + var tmp big.Int + for i := start; i < end; i++ { + a[i].BigInt(&tmp) + A[i].ScalarMultiplication(&A[i], &tmp) + } + }) +} + +// Returns [aᵢAᵢ, ...] in G2 +func scaleG2InPlace(A []curve.G2Affine, a []fr.Element) { + utils.Parallelize(len(A), func(start, end int) { + var tmp big.Int + for i := start; i < end; i++ { + a[i].BigInt(&tmp) + A[i].ScalarMultiplication(&A[i], &tmp) + } + }) +} + +// Check e(a₁, a₂) = e(b₁, b₂) +func sameRatio(a1, b1 curve.G1Affine, a2, b2 curve.G2Affine) bool { + if !a1.IsInSubGroup() || !b1.IsInSubGroup() || !a2.IsInSubGroup() || !b2.IsInSubGroup() { + panic("invalid point not in subgroup") + } + var na2 curve.G2Affine + na2.Neg(&a2) + res, err := curve.PairingCheck( + []curve.G1Affine{a1, b1}, + []curve.G2Affine{na2, b2}) + if err != nil { + panic(err) + } + return res +} + +// returns a = ∑ rᵢAᵢ, b = ∑ rᵢBᵢ +func merge(A, B []curve.G1Affine) (a, b curve.G1Affine) { + nc := runtime.NumCPU() + r := make([]fr.Element, len(A)) + for i := 0; i < len(A); i++ { + r[i].SetRandom() + } + a.MultiExp(A, r, ecc.MultiExpConfig{NbTasks: nc / 2}) + b.MultiExp(B, r, ecc.MultiExpConfig{NbTasks: nc / 2}) + return +} + +// L1 = ∑ rᵢAᵢ, L2 = ∑ rᵢAᵢ₊₁ in G1 +func linearCombinationG1(A []curve.G1Affine) (L1, L2 curve.G1Affine) { + nc := runtime.NumCPU() + n := len(A) + r := make([]fr.Element, n-1) + for i := 0; i < n-1; i++ { + r[i].SetRandom() + } + L1.MultiExp(A[:n-1], r, ecc.MultiExpConfig{NbTasks: nc / 2}) + L2.MultiExp(A[1:], r, ecc.MultiExpConfig{NbTasks: nc / 2}) + return +} + +// L1 = ∑ rᵢAᵢ, L2 = ∑ rᵢAᵢ₊₁ in G2 +func linearCombinationG2(A []curve.G2Affine) (L1, L2 curve.G2Affine) { + nc := runtime.NumCPU() + n := len(A) + r := make([]fr.Element, n-1) + for i := 0; i < n-1; i++ { + r[i].SetRandom() + } + L1.MultiExp(A[:n-1], r, ecc.MultiExpConfig{NbTasks: nc / 2}) + L2.MultiExp(A[1:], r, ecc.MultiExpConfig{NbTasks: nc / 2}) + return +} + +// Generate R in G₂ as Hash(gˢ, gˢˣ, challenge, dst) +func genR(sG1, sxG1 curve.G1Affine, challenge []byte, dst byte) curve.G2Affine { + var buf bytes.Buffer + buf.Grow(len(challenge) + curve.SizeOfG1AffineUncompressed*2) + buf.Write(sG1.Marshal()) + buf.Write(sxG1.Marshal()) + buf.Write(challenge) + spG2, err := curve.HashToG2(buf.Bytes(), []byte{dst}) + if err != nil { + panic(err) + } + return spG2 +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/solidity.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/solidity.go index a7fef49d10..5ec3e8bcb7 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/solidity.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/solidity.go @@ -1,12 +1,21 @@ package groth16 +import ( + "bytes" + + "github.com/consensys/gnark-crypto/ecc/bn254/fr" +) + // solidityTemplate // this is an experimental feature and gnark solidity generator as not been thoroughly tested const solidityTemplate = ` -{{- $numPublic := sub (len .G1.K) 1 }} +{{- $numPublic := sub (len .Vk.G1.K) 1 }} +{{- $numCommitments := len .Vk.PublicAndCommitmentCommitted }} +{{- $numWitness := sub $numPublic $numCommitments }} +{{- $PublicAndCommitmentCommitted := .Vk.PublicAndCommitmentCommitted }} // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity {{ .Cfg.PragmaVersion }}; /// @title Groth16 verifier template. /// @author Remco Bloemen @@ -15,7 +24,7 @@ pragma solidity ^0.8.0; /// to compress proofs. /// @notice See for further explanation. contract Verifier { - + /// Some of the provided public input values are larger than the field modulus. /// @dev Public input elements are not automatically reduced, as this is can be /// a dangerous source of bugs. @@ -27,6 +36,14 @@ contract Verifier { /// provided public input. error ProofInvalid(); + {{- if gt $numCommitments 0 }} + /// The commitment is invalid + /// @dev This can mean that provided commitment points and/or proof of knowledge are not on their + /// curves, that pairing equation fails, or that the commitment and/or proof of knowledge is not for the + /// commitment key. + error CommitmentInvalid(); + {{- end }} + // Addresses of precompiles uint256 constant PRECOMPILE_MODEXP = 0x05; uint256 constant PRECOMPILE_ADD = 0x06; @@ -58,35 +75,49 @@ contract Verifier { uint256 constant EXP_SQRT_FP = 0xC19139CB84C680A6E14116DA060561765E05AA45A1C72A34F082305B61F3F52; // (P + 1) / 4; // Groth16 alpha point in G1 - uint256 constant ALPHA_X = {{.G1.Alpha.X.String}}; - uint256 constant ALPHA_Y = {{.G1.Alpha.Y.String}}; + uint256 constant ALPHA_X = {{ (fpstr .Vk.G1.Alpha.X) }}; + uint256 constant ALPHA_Y = {{ (fpstr .Vk.G1.Alpha.Y) }}; // Groth16 beta point in G2 in powers of i - uint256 constant BETA_NEG_X_0 = {{.G2.Beta.X.A0.String}}; - uint256 constant BETA_NEG_X_1 = {{.G2.Beta.X.A1.String}}; - uint256 constant BETA_NEG_Y_0 = {{.G2.Beta.Y.A0.String}}; - uint256 constant BETA_NEG_Y_1 = {{.G2.Beta.Y.A1.String}}; + uint256 constant BETA_NEG_X_0 = {{ (fpstr .Vk.G2.Beta.X.A0) }}; + uint256 constant BETA_NEG_X_1 = {{ (fpstr .Vk.G2.Beta.X.A1) }}; + uint256 constant BETA_NEG_Y_0 = {{ (fpstr .Vk.G2.Beta.Y.A0) }}; + uint256 constant BETA_NEG_Y_1 = {{ (fpstr .Vk.G2.Beta.Y.A1) }}; // Groth16 gamma point in G2 in powers of i - uint256 constant GAMMA_NEG_X_0 = {{.G2.Gamma.X.A0.String}}; - uint256 constant GAMMA_NEG_X_1 = {{.G2.Gamma.X.A1.String}}; - uint256 constant GAMMA_NEG_Y_0 = {{.G2.Gamma.Y.A0.String}}; - uint256 constant GAMMA_NEG_Y_1 = {{.G2.Gamma.Y.A1.String}}; + uint256 constant GAMMA_NEG_X_0 = {{ (fpstr .Vk.G2.Gamma.X.A0) }}; + uint256 constant GAMMA_NEG_X_1 = {{ (fpstr .Vk.G2.Gamma.X.A1) }}; + uint256 constant GAMMA_NEG_Y_0 = {{ (fpstr .Vk.G2.Gamma.Y.A0) }}; + uint256 constant GAMMA_NEG_Y_1 = {{ (fpstr .Vk.G2.Gamma.Y.A1) }}; // Groth16 delta point in G2 in powers of i - uint256 constant DELTA_NEG_X_0 = {{.G2.Delta.X.A0.String}}; - uint256 constant DELTA_NEG_X_1 = {{.G2.Delta.X.A1.String}}; - uint256 constant DELTA_NEG_Y_0 = {{.G2.Delta.Y.A0.String}}; - uint256 constant DELTA_NEG_Y_1 = {{.G2.Delta.Y.A1.String}}; + uint256 constant DELTA_NEG_X_0 = {{ (fpstr .Vk.G2.Delta.X.A0) }}; + uint256 constant DELTA_NEG_X_1 = {{ (fpstr .Vk.G2.Delta.X.A1) }}; + uint256 constant DELTA_NEG_Y_0 = {{ (fpstr .Vk.G2.Delta.Y.A0) }}; + uint256 constant DELTA_NEG_Y_1 = {{ (fpstr .Vk.G2.Delta.Y.A1) }}; + + {{- if gt $numCommitments 0 }} + // Pedersen G point in G2 in powers of i + uint256 constant PEDERSEN_G_X_0 = {{ (fpstr .Vk.CommitmentKey.G.X.A0) }}; + uint256 constant PEDERSEN_G_X_1 = {{ (fpstr .Vk.CommitmentKey.G.X.A1) }}; + uint256 constant PEDERSEN_G_Y_0 = {{ (fpstr .Vk.CommitmentKey.G.Y.A0) }}; + uint256 constant PEDERSEN_G_Y_1 = {{ (fpstr .Vk.CommitmentKey.G.Y.A1) }}; + + // Pedersen GRootSigmaNeg point in G2 in powers of i + uint256 constant PEDERSEN_GROOTSIGMANEG_X_0 = {{ (fpstr .Vk.CommitmentKey.GRootSigmaNeg.X.A0) }}; + uint256 constant PEDERSEN_GROOTSIGMANEG_X_1 = {{ (fpstr .Vk.CommitmentKey.GRootSigmaNeg.X.A1) }}; + uint256 constant PEDERSEN_GROOTSIGMANEG_Y_0 = {{ (fpstr .Vk.CommitmentKey.GRootSigmaNeg.Y.A0) }}; + uint256 constant PEDERSEN_GROOTSIGMANEG_Y_1 = {{ (fpstr .Vk.CommitmentKey.GRootSigmaNeg.Y.A1) }}; + {{- end }} // Constant and public input points - {{- $k0 := index .G1.K 0}} - uint256 constant CONSTANT_X = {{$k0.X.String}}; - uint256 constant CONSTANT_Y = {{$k0.Y.String}}; - {{- range $i, $ki := .G1.K }} + {{- $k0 := index .Vk.G1.K 0}} + uint256 constant CONSTANT_X = {{ (fpstr $k0.X) }}; + uint256 constant CONSTANT_Y = {{ (fpstr $k0.Y) }}; + {{- range $i, $ki := .Vk.G1.K }} {{- if gt $i 0 }} - uint256 constant PUB_{{sub $i 1}}_X = {{$ki.X.String}}; - uint256 constant PUB_{{sub $i 1}}_Y = {{$ki.Y.String}}; + uint256 constant PUB_{{sub $i 1}}_X = {{ (fpstr $ki.X) }}; + uint256 constant PUB_{{sub $i 1}}_Y = {{ (fpstr $ki.Y) }}; {{- end }} {{- end }} @@ -124,7 +155,7 @@ contract Verifier { // Exponentiation failed. // Should not happen. revert ProofInvalid(); - } + } } /// Invertsion in Fp. @@ -214,7 +245,7 @@ contract Verifier { // Point at infinity return 0; } - + // Note: sqrt_Fp reverts if there is no solution, i.e. the x coordinate is invalid. uint256 y_pos = sqrt_Fp(addmod(mulmod(mulmod(x, x, P), x, P), 3, P)); if (y == y_pos) { @@ -260,7 +291,7 @@ contract Verifier { /// @notice Reverts with InvalidProof if the coefficients are not reduced /// or if the point is not on the curve. /// @notice The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1) - /// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). + /// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). /// @notice The point at infinity is encoded as (0,0,0,0) and compressed to (0,0). /// @param x0 The real part of the X coordinate. /// @param x1 The imaginary poart of the X coordinate. @@ -316,7 +347,7 @@ contract Verifier { /// Decompress a G2 point. /// @notice Reverts with InvalidProof if the input does not represent a valid point. /// @notice The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1) - /// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). + /// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i). /// @notice The point at infinity is encoded as (0,0,0,0) and compressed to (0,0). /// @param c0 The first half of the compresed point (x0 with two signal bits). /// @param c1 The second half of the compressed point (x1 unmodified). @@ -363,15 +394,28 @@ contract Verifier { /// @notice Computes the multi-scalar-multiplication of the public input /// elements and the verification key including the constant term. /// @param input The public inputs. These are elements of the scalar field Fr. + {{- if gt $numCommitments 0 }} + /// @param publicCommitments public inputs generated from pedersen commitments. + /// @param commitments The Pedersen commitments from the proof. + {{- end }} /// @return x The X coordinate of the resulting G1 point. /// @return y The Y coordinate of the resulting G1 point. - function publicInputMSM(uint256[{{$numPublic}}] calldata input) + {{- if eq $numCommitments 0 }} + function publicInputMSM(uint256[{{$numWitness}}] calldata input) + {{- else }} + function publicInputMSM( + uint256[{{$numWitness}}] calldata input, + uint256[{{$numCommitments}}] memory publicCommitments, + uint256[{{mul 2 $numCommitments}}] memory commitments + ) + {{- end }} internal view returns (uint256 x, uint256 y) { // Note: The ECMUL precompile does not reject unreduced values, so we check this. // Note: Unrolling this loop does not cost much extra in code-size, the bulk of the // code-size is in the PUB_ constants. // ECMUL has input (x, y, scalar) and output (x', y'). // ECADD has input (x1, y1, x2, y2) and output (x', y'). + // We reduce commitments(if any) with constants as the first point argument to ECADD. // We call them such that ecmul output is already in the second point // argument to ECADD so we can have a tight loop. bool success = true; @@ -381,19 +425,33 @@ contract Verifier { let s mstore(f, CONSTANT_X) mstore(add(f, 0x20), CONSTANT_Y) + {{- if gt $numCommitments 0 }} + {{- if eq $numWitness 1 }} + mstore(g, mload(commitments)) + mstore(add(g, 0x20), mload(add(commitments, 0x20))) + {{- else }} + success := and(success, staticcall(gas(), PRECOMPILE_ADD, commitments, {{mul 0x40 $numCommitments}}, g, 0x40)) + {{- end }} + success := and(success, staticcall(gas(), PRECOMPILE_ADD, f, 0x80, f, 0x40)) + {{- end }} {{- range $i := intRange $numPublic }} mstore(g, PUB_{{$i}}_X) mstore(add(g, 0x20), PUB_{{$i}}_Y) {{- if eq $i 0 }} s := calldataload(input) - {{- else }} + {{- else if lt $i $numWitness }} s := calldataload(add(input, {{mul $i 0x20}})) + {{- else if eq $i $numWitness }} + s := mload(publicCommitments) + {{- else}} + s := mload(add(publicCommitments, {{mul 0x20 (sub $i $numWitness)}})) {{- end }} mstore(add(g, 0x40), s) success := and(success, lt(s, R)) success := and(success, staticcall(gas(), PRECOMPILE_MUL, g, 0x60, g, 0x40)) success := and(success, staticcall(gas(), PRECOMPILE_ADD, f, 0x80, f, 0x40)) {{- end }} + x := mload(f) y := mload(add(f, 0x20)) } @@ -409,13 +467,40 @@ contract Verifier { /// but does not verify the proof itself. /// @param proof The uncompressed Groth16 proof. Elements are in the same order as for /// verifyProof. I.e. Groth16 points (A, B, C) encoded as in EIP-197. + {{- if gt $numCommitments 0 }} + /// @param commitments Pedersen commitments from the proof. + /// @param commitmentPok proof of knowledge for the Pedersen commitments. + {{- end }} /// @return compressed The compressed proof. Elements are in the same order as for /// verifyCompressedProof. I.e. points (A, B, C) in compressed format. + {{- if gt $numCommitments 0 }} + /// @return compressedCommitments compressed Pedersen commitments from the proof. + /// @return compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. + {{- end }} + {{- if eq $numCommitments 0 }} function compressProof(uint256[8] calldata proof) public view returns (uint256[4] memory compressed) { + {{- else }} + function compressProof( + uint256[8] calldata proof, + uint256[{{mul 2 $numCommitments}}] calldata commitments, + uint256[2] calldata commitmentPok + ) + public view returns ( + uint256[4] memory compressed, + uint256[{{$numCommitments}}] memory compressedCommitments, + uint256 compressedCommitmentPok + ) { + {{- end }} compressed[0] = compress_g1(proof[0], proof[1]); (compressed[2], compressed[1]) = compress_g2(proof[3], proof[2], proof[5], proof[4]); compressed[3] = compress_g1(proof[6], proof[7]); + {{- if gt $numCommitments 0 }} + {{- range $i := intRange $numCommitments }} + compressedCommitments[{{$i}}] = compress_g1(commitments[{{mul 2 $i}}], commitments[{{sum (mul 2 $i) 1}}]); + {{- end }} + compressedCommitmentPok = compress_g1(commitmentPok[0], commitmentPok[1]); + {{- end }} } /// Verify a Groth16 proof with compressed points. @@ -425,61 +510,156 @@ contract Verifier { /// proof was successfully verified. /// @param compressedProof the points (A, B, C) in compressed format /// matching the output of compressProof. + {{- if gt $numCommitments 0 }} + /// @param compressedCommitments compressed Pedersen commitments from the proof. + /// @param compressedCommitmentPok compressed proof of knowledge for the Pedersen commitments. + {{- end }} /// @param input the public input field elements in the scalar field Fr. /// Elements must be reduced. function verifyCompressedProof( uint256[4] calldata compressedProof, - uint256[{{$numPublic}}] calldata input + {{- if gt $numCommitments 0}} + uint256[{{$numCommitments}}] calldata compressedCommitments, + uint256 compressedCommitmentPok, + {{- end }} + uint256[{{$numWitness}}] calldata input ) public view { - (uint256 Ax, uint256 Ay) = decompress_g1(compressedProof[0]); - (uint256 Bx0, uint256 Bx1, uint256 By0, uint256 By1) = decompress_g2( - compressedProof[2], compressedProof[1]); - (uint256 Cx, uint256 Cy) = decompress_g1(compressedProof[3]); - (uint256 Lx, uint256 Ly) = publicInputMSM(input); - - // Verify the pairing - // Note: The precompile expects the F2 coefficients in big-endian order. - // Note: The pairing precompile rejects unreduced values, so we won't check that here. + {{- if gt $numCommitments 0 }} + uint256[{{$numCommitments}}] memory publicCommitments; + uint256[{{mul 2 $numCommitments}}] memory commitments; + {{- end }} uint256[24] memory pairings; - // e(A, B) - pairings[ 0] = Ax; - pairings[ 1] = Ay; - pairings[ 2] = Bx1; - pairings[ 3] = Bx0; - pairings[ 4] = By1; - pairings[ 5] = By0; - // e(C, -δ) - pairings[ 6] = Cx; - pairings[ 7] = Cy; - pairings[ 8] = DELTA_NEG_X_1; - pairings[ 9] = DELTA_NEG_X_0; - pairings[10] = DELTA_NEG_Y_1; - pairings[11] = DELTA_NEG_Y_0; - // e(α, -β) - pairings[12] = ALPHA_X; - pairings[13] = ALPHA_Y; - pairings[14] = BETA_NEG_X_1; - pairings[15] = BETA_NEG_X_0; - pairings[16] = BETA_NEG_Y_1; - pairings[17] = BETA_NEG_Y_0; - // e(L_pub, -γ) - pairings[18] = Lx; - pairings[19] = Ly; - pairings[20] = GAMMA_NEG_X_1; - pairings[21] = GAMMA_NEG_X_0; - pairings[22] = GAMMA_NEG_Y_1; - pairings[23] = GAMMA_NEG_Y_0; - - // Check pairing equation. - bool success; - uint256[1] memory output; - assembly ("memory-safe") { - success := staticcall(gas(), PRECOMPILE_VERIFY, pairings, 0x300, output, 0x20) + + {{- if gt $numCommitments 0 }} + { + {{- if eq $numCommitments 1 }} + (commitments[0], commitments[1]) = decompress_g1(compressedCommitments[0]); + {{- else }} + // TODO: We can fold commitments into a single point for more efficient verification (https://github.com/Consensys/gnark/issues/1095) + for (uint256 i = 0; i < {{$numCommitments}}; i++) { + (commitments[2*i], commitments[2*i+1]) = decompress_g1(compressedCommitments[i]); + } + {{- end}} + (uint256 Px, uint256 Py) = decompress_g1(compressedCommitmentPok); + + uint256[] memory publicAndCommitmentCommitted; + {{- range $i := intRange $numCommitments }} + {{- $pcIndex := index $PublicAndCommitmentCommitted $i }} + {{- if gt (len $pcIndex) 0 }} + publicAndCommitmentCommitted = new uint256[]({{(len $pcIndex)}}); + assembly ("memory-safe") { + let publicAndCommitmentCommittedOffset := add(publicAndCommitmentCommitted, 0x20) + {{- $segment_start := index $pcIndex 0 }} + {{- $segment_end := index $pcIndex 0 }} + {{- $l := 0 }} + {{- range $k := intRange (sub (len $pcIndex) 1) }} + {{- $next := index $pcIndex (sum $k 1) }} + {{- if ne $next (sum $segment_end 1) }} + calldatacopy(add(publicAndCommitmentCommittedOffset, {{mul $l 0x20}}), add(input, {{mul 0x20 (sub $segment_start 1)}}), {{mul 0x20 (sum 1 (sub $segment_end $segment_start))}}) + {{- $segment_start = $next }} + {{- $l = (sum $k 1) }} + {{- end }} + {{- $segment_end = $next }} + {{- end }} + calldatacopy(add(publicAndCommitmentCommittedOffset, {{mul $l 0x20}}), add(input, {{mul 0x20 (sub $segment_start 1)}}), {{mul 0x20 (sum 1 (sub $segment_end $segment_start))}}) + } + {{- end }} + + publicCommitments[{{$i}}] = uint256( + sha256( + abi.encodePacked( + commitments[{{mul $i 2}}], + commitments[{{sum (mul $i 2) 1}}], + publicAndCommitmentCommitted + ) + ) + ) % R; + {{- end }} + // Commitments + pairings[ 0] = commitments[0]; + pairings[ 1] = commitments[1]; + pairings[ 2] = PEDERSEN_G_X_1; + pairings[ 3] = PEDERSEN_G_X_0; + pairings[ 4] = PEDERSEN_G_Y_1; + pairings[ 5] = PEDERSEN_G_Y_0; + pairings[ 6] = Px; + pairings[ 7] = Py; + pairings[ 8] = PEDERSEN_GROOTSIGMANEG_X_1; + pairings[ 9] = PEDERSEN_GROOTSIGMANEG_X_0; + pairings[10] = PEDERSEN_GROOTSIGMANEG_Y_1; + pairings[11] = PEDERSEN_GROOTSIGMANEG_Y_0; + + // Verify pedersen commitments + bool success; + assembly ("memory-safe") { + let f := mload(0x40) + + success := staticcall(gas(), PRECOMPILE_VERIFY, pairings, 0x180, f, 0x20) + success := and(success, mload(f)) + } + if (!success) { + revert CommitmentInvalid(); + } } - if (!success || output[0] != 1) { - // Either proof or verification key invalid. - // We assume the contract is correctly generated, so the verification key is valid. - revert ProofInvalid(); + {{- end }} + + { + (uint256 Ax, uint256 Ay) = decompress_g1(compressedProof[0]); + (uint256 Bx0, uint256 Bx1, uint256 By0, uint256 By1) = decompress_g2(compressedProof[2], compressedProof[1]); + (uint256 Cx, uint256 Cy) = decompress_g1(compressedProof[3]); + {{- if eq $numCommitments 0 }} + (uint256 Lx, uint256 Ly) = publicInputMSM(input); + {{- else }} + (uint256 Lx, uint256 Ly) = publicInputMSM( + input, + publicCommitments, + commitments + ); + {{- end}} + + // Verify the pairing + // Note: The precompile expects the F2 coefficients in big-endian order. + // Note: The pairing precompile rejects unreduced values, so we won't check that here. + // e(A, B) + pairings[ 0] = Ax; + pairings[ 1] = Ay; + pairings[ 2] = Bx1; + pairings[ 3] = Bx0; + pairings[ 4] = By1; + pairings[ 5] = By0; + // e(C, -δ) + pairings[ 6] = Cx; + pairings[ 7] = Cy; + pairings[ 8] = DELTA_NEG_X_1; + pairings[ 9] = DELTA_NEG_X_0; + pairings[10] = DELTA_NEG_Y_1; + pairings[11] = DELTA_NEG_Y_0; + // e(α, -β) + pairings[12] = ALPHA_X; + pairings[13] = ALPHA_Y; + pairings[14] = BETA_NEG_X_1; + pairings[15] = BETA_NEG_X_0; + pairings[16] = BETA_NEG_Y_1; + pairings[17] = BETA_NEG_Y_0; + // e(L_pub, -γ) + pairings[18] = Lx; + pairings[19] = Ly; + pairings[20] = GAMMA_NEG_X_1; + pairings[21] = GAMMA_NEG_X_0; + pairings[22] = GAMMA_NEG_Y_1; + pairings[23] = GAMMA_NEG_Y_0; + + // Check pairing equation. + bool success; + uint256[1] memory output; + assembly ("memory-safe") { + success := staticcall(gas(), PRECOMPILE_VERIFY, pairings, 0x300, output, 0x20) + } + if (!success || output[0] != 1) { + // Either proof or verification key invalid. + // We assume the contract is correctly generated, so the verification key is valid. + revert ProofInvalid(); + } } } @@ -490,18 +670,95 @@ contract Verifier { /// proof was successfully verified. /// @param proof the points (A, B, C) in EIP-197 format matching the output /// of compressProof. + {{- if gt $numCommitments 0 }} + /// @param commitments the Pedersen commitments from the proof. + /// @param commitmentPok the proof of knowledge for the Pedersen commitments. + {{- end }} /// @param input the public input field elements in the scalar field Fr. /// Elements must be reduced. function verifyProof( uint256[8] calldata proof, - uint256[{{$numPublic}}] calldata input + {{- if gt $numCommitments 0}} + uint256[{{mul 2 $numCommitments}}] calldata commitments, + uint256[2] calldata commitmentPok, + {{- end }} + uint256[{{$numWitness}}] calldata input ) public view { + {{- if eq $numCommitments 0 }} (uint256 x, uint256 y) = publicInputMSM(input); + {{- else }} + // HashToField + uint256[{{$numCommitments}}] memory publicCommitments; + uint256[] memory publicAndCommitmentCommitted; + {{- range $i := intRange $numCommitments }} + {{- $pcIndex := index $PublicAndCommitmentCommitted $i }} + {{- if gt (len $pcIndex) 0 }} + publicAndCommitmentCommitted = new uint256[]({{(len $pcIndex)}}); + assembly ("memory-safe") { + let publicAndCommitmentCommittedOffset := add(publicAndCommitmentCommitted, 0x20) + {{- $segment_start := index $pcIndex 0 }} + {{- $segment_end := index $pcIndex 0 }} + {{- $l := 0 }} + {{- range $k := intRange (sub (len $pcIndex) 1) }} + {{- $next := index $pcIndex (sum $k 1) }} + {{- if ne $next (sum $segment_end 1) }} + calldatacopy(add(publicAndCommitmentCommittedOffset, {{mul $l 0x20}}), add(input, {{mul 0x20 (sub $segment_start 1)}}), {{mul 0x20 (sum 1 (sub $segment_end $segment_start))}}) + {{- $segment_start = $next }} + {{- $l = (sum $k 1) }} + {{- end }} + {{- $segment_end = $next }} + {{- end }} + calldatacopy(add(publicAndCommitmentCommittedOffset, {{mul $l 0x20}}), add(input, {{mul 0x20 (sub $segment_start 1)}}), {{mul 0x20 (sum 1 (sub $segment_end $segment_start))}}) + } + {{- end }} + + publicCommitments[{{$i}}] = uint256( + sha256( + abi.encodePacked( + commitments[{{mul $i 2}}], + commitments[{{sum (mul $i 2) 1}}], + publicAndCommitmentCommitted + ) + ) + ) % R; + {{- end }} + + // Verify pedersen commitments + bool success; + assembly ("memory-safe") { + let f := mload(0x40) + + calldatacopy(f, commitments, 0x40) // Copy Commitments + mstore(add(f, 0x40), PEDERSEN_G_X_1) + mstore(add(f, 0x60), PEDERSEN_G_X_0) + mstore(add(f, 0x80), PEDERSEN_G_Y_1) + mstore(add(f, 0xa0), PEDERSEN_G_Y_0) + calldatacopy(add(f, 0xc0), commitmentPok, 0x40) + mstore(add(f, 0x100), PEDERSEN_GROOTSIGMANEG_X_1) + mstore(add(f, 0x120), PEDERSEN_GROOTSIGMANEG_X_0) + mstore(add(f, 0x140), PEDERSEN_GROOTSIGMANEG_Y_1) + mstore(add(f, 0x160), PEDERSEN_GROOTSIGMANEG_Y_0) + + success := staticcall(gas(), PRECOMPILE_VERIFY, f, 0x180, f, 0x20) + success := and(success, mload(f)) + } + if (!success) { + revert CommitmentInvalid(); + } + + (uint256 x, uint256 y) = publicInputMSM( + input, + publicCommitments, + commitments + ); + {{- end }} // Note: The precompile expects the F2 coefficients in big-endian order. // Note: The pairing precompile rejects unreduced values, so we won't check that here. - + + {{- if eq $numCommitments 0 }} bool success; + {{- end }} assembly ("memory-safe") { let f := mload(0x40) // Free memory pointer. @@ -543,3 +800,20 @@ contract Verifier { } } ` + +// MarshalSolidity converts a proof to a byte array that can be used in a +// Solidity contract. +func (proof *Proof) MarshalSolidity() []byte { + var buf bytes.Buffer + _, err := proof.WriteRawTo(&buf) + if err != nil { + panic(err) + } + + // If there are no commitments, we can return only Ar | Bs | Krs + if len(proof.Commitments) > 0 { + return buf.Bytes() + } else { + return buf.Bytes()[:8*fr.Bytes] + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/verify.go index 14eda65ed6..00914c003d 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bn254/verify.go @@ -19,7 +19,9 @@ package groth16 import ( "errors" "fmt" + "github.com/consensys/gnark-crypto/ecc/bn254/fp" "io" + "math/big" "text/template" "time" @@ -30,6 +32,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen" "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/logger" ) @@ -144,8 +147,11 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac // This is an experimental feature and gnark solidity generator as not been thoroughly tested. // // See https://github.com/ConsenSys/gnark-tests for example usage. -func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { +func (vk *VerifyingKey) ExportSolidity(w io.Writer, exportOpts ...solidity.ExportOption) error { helpers := template.FuncMap{ + "sum": func(a, b int) int { + return a + b + }, "sub": func(a, b int) int { return a - b }, @@ -159,6 +165,18 @@ func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { } return out }, + "fpstr": func(x fp.Element) string { + bv := new(big.Int) + x.BigInt(bv) + return bv.String() + }, + } + + log := logger.Logger() + if len(vk.PublicAndCommitmentCommitted) > 1 { + log.Warn().Msg("exporting solidity verifier with more than one commitment is not supported") + } else if len(vk.PublicAndCommitmentCommitted) == 1 { + log.Warn().Msg("exporting solidity verifier only supports `sha256` as `HashToField`. The generated contract may not work for proofs generated with other hash functions.") } tmpl, err := template.New("").Funcs(helpers).Parse(solidityTemplate) @@ -174,8 +192,19 @@ func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { vk.G2.Gamma, vk.G2.gammaNeg = vk.G2.gammaNeg, vk.G2.Gamma vk.G2.Delta, vk.G2.deltaNeg = vk.G2.deltaNeg, vk.G2.Delta + cfg, err := solidity.NewExportConfig(exportOpts...) + if err != nil { + return err + } + // execute template - err = tmpl.Execute(w, vk) + err = tmpl.Execute(w, struct { + Cfg solidity.ExportConfig + Vk VerifyingKey + }{ + Cfg: cfg, + Vk: *vk, + }) // restore Beta, Gamma and Delta vk.G2.Beta = beta diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/marshal.go index d5c2339407..a801462c9f 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/marshal.go @@ -20,6 +20,7 @@ import ( curve "github.com/consensys/gnark-crypto/ecc/bw6-633" "github.com/consensys/gnark-crypto/ecc/bw6-633/fr/pedersen" + "github.com/consensys/gnark-crypto/utils/unsafe" "github.com/consensys/gnark/internal/utils" "io" ) @@ -372,3 +373,165 @@ func (pk *ProvingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder)) return n + dec.BytesRead(), nil } + +// WriteDump behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe +// Output is compatible with ReadDump, with the caveat that, not only the points are not checked for +// correctness, but the raw bytes are platform dependent (endianness, etc.) +func (pk *ProvingKey) WriteDump(w io.Writer) error { + // it behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe + + // start by writing an unsafe marker to fail early. + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + if _, err := pk.Domain.WriteTo(w); err != nil { + return err + } + + enc := curve.NewEncoder(w, curve.RawEncoding()) + nbWires := uint64(len(pk.InfinityA)) + + toEncode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // pk.G1.A, + // pk.G1.B, + // pk.G1.Z, + // pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // pk.G2.B, + nbWires, + pk.NbInfinityA, + pk.NbInfinityB, + pk.InfinityA, + pk.InfinityB, + uint32(len(pk.CommitmentKeys)), + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return err + } + } + + // dump slices of points + if err := unsafe.WriteSlice(w, pk.G1.A); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.B); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.Z); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.K); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G2.B); err != nil { + return err + } + + for i := range pk.CommitmentKeys { + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].Basis); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].BasisExpSigma); err != nil { + return err + } + } + + return nil +} + +// ReadDump reads a ProvingKey from a dump written by WriteDump. +// This is platform dependent and very unsafe (no checks, no endianness translation, etc.) +func (pk *ProvingKey) ReadDump(r io.Reader) error { + // read the marker to fail early in case of malformed input + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + if _, err := pk.Domain.ReadFrom(r); err != nil { + return err + } + + dec := curve.NewDecoder(r, curve.NoSubgroupChecks()) + + var nbWires uint64 + var nbCommitments uint32 + + toDecode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // &pk.G1.A, + // &pk.G1.B, + // &pk.G1.Z, + // &pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // &pk.G2.B, + &nbWires, + &pk.NbInfinityA, + &pk.NbInfinityB, + } + + for _, v := range toDecode { + if err := dec.Decode(v); err != nil { + return err + } + } + pk.InfinityA = make([]bool, nbWires) + pk.InfinityB = make([]bool, nbWires) + + if err := dec.Decode(&pk.InfinityA); err != nil { + return err + } + if err := dec.Decode(&pk.InfinityB); err != nil { + return err + } + if err := dec.Decode(&nbCommitments); err != nil { + return err + } + + // read slices of points + var err error + pk.G1.A, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.B, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.Z, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.K, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G2.B, _, err = unsafe.ReadSlice[[]curve.G2Affine](r) + if err != nil { + return err + } + + pk.CommitmentKeys = make([]pedersen.ProvingKey, nbCommitments) + for i := range pk.CommitmentKeys { + pk.CommitmentKeys[i].Basis, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.CommitmentKeys[i].BasisExpSigma, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + } + + return nil + +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/verify.go index 3bfaaffd39..cb2389f7e3 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-633/verify.go @@ -29,6 +29,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bw6-633/fr/pedersen" "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/logger" ) @@ -140,6 +141,6 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac } // ExportSolidity not implemented for BW6-633 -func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { +func (vk *VerifyingKey) ExportSolidity(w io.Writer, exportOpts ...solidity.ExportOption) error { return errors.New("not implemented") } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/marshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/marshal.go index b9de7f8d90..b89105e280 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/marshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/marshal.go @@ -20,6 +20,7 @@ import ( curve "github.com/consensys/gnark-crypto/ecc/bw6-761" "github.com/consensys/gnark-crypto/ecc/bw6-761/fr/pedersen" + "github.com/consensys/gnark-crypto/utils/unsafe" "github.com/consensys/gnark/internal/utils" "io" ) @@ -372,3 +373,165 @@ func (pk *ProvingKey) readFrom(r io.Reader, decOptions ...func(*curve.Decoder)) return n + dec.BytesRead(), nil } + +// WriteDump behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe +// Output is compatible with ReadDump, with the caveat that, not only the points are not checked for +// correctness, but the raw bytes are platform dependent (endianness, etc.) +func (pk *ProvingKey) WriteDump(w io.Writer) error { + // it behaves like WriteRawTo, excepts, the slices of points are "dumped" using gnark-crypto/utils/unsafe + + // start by writing an unsafe marker to fail early. + if err := unsafe.WriteMarker(w); err != nil { + return err + } + + if _, err := pk.Domain.WriteTo(w); err != nil { + return err + } + + enc := curve.NewEncoder(w, curve.RawEncoding()) + nbWires := uint64(len(pk.InfinityA)) + + toEncode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // pk.G1.A, + // pk.G1.B, + // pk.G1.Z, + // pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // pk.G2.B, + nbWires, + pk.NbInfinityA, + pk.NbInfinityB, + pk.InfinityA, + pk.InfinityB, + uint32(len(pk.CommitmentKeys)), + } + + for _, v := range toEncode { + if err := enc.Encode(v); err != nil { + return err + } + } + + // dump slices of points + if err := unsafe.WriteSlice(w, pk.G1.A); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.B); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.Z); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G1.K); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.G2.B); err != nil { + return err + } + + for i := range pk.CommitmentKeys { + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].Basis); err != nil { + return err + } + if err := unsafe.WriteSlice(w, pk.CommitmentKeys[i].BasisExpSigma); err != nil { + return err + } + } + + return nil +} + +// ReadDump reads a ProvingKey from a dump written by WriteDump. +// This is platform dependent and very unsafe (no checks, no endianness translation, etc.) +func (pk *ProvingKey) ReadDump(r io.Reader) error { + // read the marker to fail early in case of malformed input + if err := unsafe.ReadMarker(r); err != nil { + return err + } + + if _, err := pk.Domain.ReadFrom(r); err != nil { + return err + } + + dec := curve.NewDecoder(r, curve.NoSubgroupChecks()) + + var nbWires uint64 + var nbCommitments uint32 + + toDecode := []interface{}{ + &pk.G1.Alpha, + &pk.G1.Beta, + &pk.G1.Delta, + // &pk.G1.A, + // &pk.G1.B, + // &pk.G1.Z, + // &pk.G1.K, + &pk.G2.Beta, + &pk.G2.Delta, + // &pk.G2.B, + &nbWires, + &pk.NbInfinityA, + &pk.NbInfinityB, + } + + for _, v := range toDecode { + if err := dec.Decode(v); err != nil { + return err + } + } + pk.InfinityA = make([]bool, nbWires) + pk.InfinityB = make([]bool, nbWires) + + if err := dec.Decode(&pk.InfinityA); err != nil { + return err + } + if err := dec.Decode(&pk.InfinityB); err != nil { + return err + } + if err := dec.Decode(&nbCommitments); err != nil { + return err + } + + // read slices of points + var err error + pk.G1.A, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.B, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.Z, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G1.K, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.G2.B, _, err = unsafe.ReadSlice[[]curve.G2Affine](r) + if err != nil { + return err + } + + pk.CommitmentKeys = make([]pedersen.ProvingKey, nbCommitments) + for i := range pk.CommitmentKeys { + pk.CommitmentKeys[i].Basis, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + pk.CommitmentKeys[i].BasisExpSigma, _, err = unsafe.ReadSlice[[]curve.G1Affine](r) + if err != nil { + return err + } + } + + return nil + +} diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/verify.go index f08d631d62..6204909127 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/bw6-761/verify.go @@ -29,6 +29,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bw6-761/fr/pedersen" "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/logger" ) @@ -140,6 +141,6 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac } // ExportSolidity not implemented for BW6-761 -func (vk *VerifyingKey) ExportSolidity(w io.Writer) error { +func (vk *VerifyingKey) ExportSolidity(w io.Writer, exportOpts ...solidity.ExportOption) error { return errors.New("not implemented") } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/groth16.go b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/groth16.go index ca5b8bdc61..9cdf99eba7 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/groth16/groth16.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/groth16/groth16.go @@ -24,6 +24,7 @@ import ( "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/backend/witness" "github.com/consensys/gnark/constraint" cs_bls12377 "github.com/consensys/gnark/constraint/bls12-377" @@ -74,6 +75,7 @@ type Proof interface { type ProvingKey interface { groth16Object gnarkio.UnsafeReaderFrom + gnarkio.BinaryDumper // NbG1 returns the number of G1 elements in the ProvingKey NbG1() int @@ -92,6 +94,10 @@ type ProvingKey interface { type VerifyingKey interface { groth16Object gnarkio.UnsafeReaderFrom + // VerifyingKey are the methods required for generating the Solidity + // verifier contract from the VerifyingKey. This will return an error if not + // supported on the CurveID(). + solidity.VerifyingKey // NbPublicWitness returns number of elements expected in the public witness NbPublicWitness() int @@ -102,10 +108,6 @@ type VerifyingKey interface { // NbG2 returns the number of G2 elements in the VerifyingKey NbG2() int - // ExportSolidity writes a solidity Verifier contract from the VerifyingKey - // this will return an error if not supported on the CurveID() - ExportSolidity(w io.Writer) error - IsDifferent(interface{}) bool } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/prove.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/prove.go index 924b04f21e..c5380230ea 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/prove.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/prove.go @@ -52,11 +52,6 @@ import ( "github.com/consensys/gnark/logger" ) -// TODO in gnark-crypto: -// * remove everything linked to the blinding -// * add SetCoeff method -// * modify GetCoeff -> if the poly is shifted and in canonical form the index is computed differently - const ( id_L int = iota id_R @@ -101,12 +96,12 @@ type Proof struct { // Commitment to Z, the permutation polynomial Z kzg.Digest - // Commitments to h1, h2, h3 such that h = h1 + Xh2 + X**2h3 is the quotient polynomial + // Commitments to h1, h2, h3 such that h = h1 + Xⁿ⁺²*h2 + X²⁽ⁿ⁺²⁾*h3 is the quotient polynomial H [3]kzg.Digest Bsb22Commitments []kzg.Digest - // Batch opening proof of h1 + zeta*h2 + zeta**2h3, linearizedPolynomial, l, r, o, s1, s2, qCPrime + // Batch opening proof of linearizedPolynomial, l, r, o, s1, s2, qCPrime BatchedProof kzg.BatchOpeningProof // Opening proof of Z at zeta*mu @@ -151,14 +146,11 @@ func Prove(spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts g.Go(instance.buildRatioCopyConstraint) // compute h - g.Go(instance.evaluateConstraints) + g.Go(instance.computeQuotient) // open Z (blinded) at ωζ (proof.ZShiftedOpening) g.Go(instance.openZ) - // fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) - g.Go(instance.foldH) - // linearized polynomial g.Go(instance.computeLinearizedPolynomial) @@ -187,13 +179,11 @@ type instance struct { htfFunc hash.Hash // hash to field function // polynomials - x []*iop.Polynomial // x stores tracks the polynomial we need - bp []*iop.Polynomial // blinding polynomials - h *iop.Polynomial // h is the quotient polynomial - blindedZ []fr.Element // blindedZ is the blinded version of Z - - foldedH []fr.Element // foldedH is the folded version of H - foldedHDigest kzg.Digest // foldedHDigest is the kzg commitment of foldedH + x []*iop.Polynomial // x stores tracks the polynomial we need + bp []*iop.Polynomial // blinding polynomials + h *iop.Polynomial // h is the quotient polynomial + blindedZ []fr.Element // blindedZ is the blinded version of Z + quotientShardsRandomizers [2]fr.Element // random elements for blinding the shards of the quotient linearizedPolynomial []fr.Element linearizedPolynomialDigest kzg.Digest @@ -217,7 +207,6 @@ type instance struct { chRestoreLRO, chZOpening, chLinearizedPolynomial, - chFoldedH, chGammaBeta chan struct{} domain0, domain1 *fft.Domain @@ -248,7 +237,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi chH: make(chan struct{}, 1), chZOpening: make(chan struct{}, 1), chLinearizedPolynomial: make(chan struct{}, 1), - chFoldedH: make(chan struct{}, 1), chRestoreLRO: make(chan struct{}, 1), } s.initBSB22Commitments() @@ -259,6 +247,12 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi sizeSystem := uint64(nbConstraints + len(spr.Public)) // len(spr.Public) is for the placeholder constraints s.domain0 = fft.NewDomain(sizeSystem) + // sampling random numbers for blinding the quotient + if opts.StatisticalZK { + s.quotientShardsRandomizers[0].SetRandom() + s.quotientShardsRandomizers[1].SetRandom() + } + // h, the quotient polynomial is of degree 3(n+1)+2, so it's in a 3(n+2) dim vector space, // the domain is the next power of 2 superior to 3(n+2). 4*domainNum is enough in all cases // except when n<6. @@ -267,8 +261,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi } else { s.domain1 = fft.NewDomain(4*sizeSystem, fft.WithoutPrecompute()) } - // TODO @gbotrel domain1 is used for only 1 FFT --> precomputing the twiddles - // and storing them in memory is costly given its size. --> do a FFT on the fly // build trace s.trace = NewTrace(spr, s.domain0) @@ -335,7 +327,7 @@ func (s *instance) bsb22Hint(_ *big.Int, ins, outs []*big.Int) error { } // solveConstraints computes the evaluation of the polynomials L, R, O -// and sets x[id_L], x[id_R], x[id_O] in canonical form +// and sets x[id_L], x[id_R], x[id_O] in Lagrange form func (s *instance) solveConstraints() error { _solution, err := s.spr.Solve(s.fullWitness, s.opt.SolverOpts...) if err != nil { @@ -490,8 +482,8 @@ func (s *instance) deriveZeta() (err error) { return } -// evaluateConstraints computes H -func (s *instance) evaluateConstraints() (err error) { +// computeQuotient computes H +func (s *instance) computeQuotient() (err error) { s.x[id_Ql] = s.trace.Ql s.x[id_Qr] = s.trace.Qr s.x[id_Qm] = s.trace.Qm @@ -544,7 +536,7 @@ func (s *instance) evaluateConstraints() (err error) { return err } - s.h, err = divideByXMinusOne(numerator, [2]*fft.Domain{s.domain0, s.domain1}) + s.h, err = divideByZH(numerator, [2]*fft.Domain{s.domain0, s.domain1}) if err != nil { return err } @@ -625,56 +617,40 @@ func (s *instance) openZ() (err error) { } func (s *instance) h1() []fr.Element { - h1 := s.h.Coefficients()[:s.domain0.Cardinality+2] + var h1 []fr.Element + if !s.opt.StatisticalZK { + h1 = s.h.Coefficients()[:s.domain0.Cardinality+2] + } else { + h1 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h1, s.h.Coefficients()[:s.domain0.Cardinality+2]) + h1[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[0]) + } return h1 } func (s *instance) h2() []fr.Element { - h2 := s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + var h2 []fr.Element + if !s.opt.StatisticalZK { + h2 = s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + } else { + h2 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h2, s.h.Coefficients()[s.domain0.Cardinality+2:2*(s.domain0.Cardinality+2)]) + h2[0].Sub(&h2[0], &s.quotientShardsRandomizers[0]) + h2[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[1]) + } return h2 } func (s *instance) h3() []fr.Element { - h3 := s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] - return h3 -} - -// fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) -func (s *instance) foldH() error { - // wait for H to be committed and zeta to be derived (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chH: - } - var n big.Int - n.SetUint64(s.domain0.Cardinality + 2) - - var zetaPowerNplusTwo fr.Element - zetaPowerNplusTwo.Exp(s.zeta, &n) - zetaPowerNplusTwo.BigInt(&n) - - s.foldedHDigest.ScalarMultiplication(&s.proof.H[2], &n) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[1]) // ζᵐ⁺²*Comm(h3) - s.foldedHDigest.ScalarMultiplication(&s.foldedHDigest, &n) // ζ²⁽ᵐ⁺²⁾*Comm(h3) + ζᵐ⁺²*Comm(h2) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[0]) - - // fold H (H₀ + ζᵐ⁺²*H₁ + ζ²⁽ᵐ⁺²⁾H₂)) - h1 := s.h1() - h2 := s.h2() - s.foldedH = s.h3() - - for i := 0; i < int(s.domain0.Cardinality)+2; i++ { - s.foldedH[i]. - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h2[i]). - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h1[i]) + var h3 []fr.Element + if !s.opt.StatisticalZK { + h3 = s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] + } else { + h3 = make([]fr.Element, s.domain0.Cardinality+2) + copy(h3, s.h.Coefficients()[2*(s.domain0.Cardinality+2):3*(s.domain0.Cardinality+2)]) + h3[0].Sub(&h3[0], &s.quotientShardsRandomizers[1]) } - - close(s.chFoldedH) - - return nil + return h3 } func (s *instance) computeLinearizedPolynomial() error { @@ -749,20 +725,6 @@ func (s *instance) computeLinearizedPolynomial() error { func (s *instance) batchOpening() error { - // wait for LRO to be committed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chLRO: - } - - // wait for foldedH to be computed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chFoldedH: - } - // wait for linearizedPolynomial to be computed (or ctx.Done()) select { case <-s.ctx.Done(): @@ -771,27 +733,25 @@ func (s *instance) batchOpening() error { } polysQcp := coefficients(s.trace.Qcp) - polysToOpen := make([][]fr.Element, 7+len(polysQcp)) - copy(polysToOpen[7:], polysQcp) - - polysToOpen[0] = s.foldedH - polysToOpen[1] = s.linearizedPolynomial - polysToOpen[2] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) - polysToOpen[3] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) - polysToOpen[4] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) - polysToOpen[5] = s.trace.S1.Coefficients() - polysToOpen[6] = s.trace.S2.Coefficients() - - digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+7) - copy(digestsToOpen[7:], s.pk.Vk.Qcp) - - digestsToOpen[0] = s.foldedHDigest - digestsToOpen[1] = s.linearizedPolynomialDigest - digestsToOpen[2] = s.proof.LRO[0] - digestsToOpen[3] = s.proof.LRO[1] - digestsToOpen[4] = s.proof.LRO[2] - digestsToOpen[5] = s.pk.Vk.S[0] - digestsToOpen[6] = s.pk.Vk.S[1] + polysToOpen := make([][]fr.Element, 6+len(polysQcp)) + copy(polysToOpen[6:], polysQcp) + + polysToOpen[0] = s.linearizedPolynomial + polysToOpen[1] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) + polysToOpen[2] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) + polysToOpen[3] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) + polysToOpen[4] = s.trace.S1.Coefficients() + polysToOpen[5] = s.trace.S2.Coefficients() + + digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+6) + copy(digestsToOpen[6:], s.pk.Vk.Qcp) + + digestsToOpen[0] = s.linearizedPolynomialDigest + digestsToOpen[1] = s.proof.LRO[0] + digestsToOpen[2] = s.proof.LRO[1] + digestsToOpen[3] = s.proof.LRO[2] + digestsToOpen[4] = s.pk.Vk.S[0] + digestsToOpen[5] = s.pk.Vk.S[1] var err error s.proof.BatchedProof, err = kzg.BatchOpenSinglePoint( @@ -834,7 +794,7 @@ func (s *instance) computeNumerator() (*iop.Polynomial, error) { case <-s.chQk: } - nbBsbGates := (len(s.x) - id_Qci + 1) >> 1 + nbBsbGates := len(s.proof.Bsb22Commitments) gateConstraint := func(u ...fr.Element) fr.Element { @@ -1139,7 +1099,7 @@ func evaluateBlinded(p, bp *iop.Polynomial, zeta fr.Element) fr.Element { return pEvaluatedAtZeta } -// /!\ modifies p's underlying array of coefficients, in particular the size changes +// /!\ modifies the size func getBlindedCoefficients(p, bp *iop.Polynomial) []fr.Element { cp := p.Coefficients() cbp := bp.Coefficients() @@ -1212,10 +1172,10 @@ func commitToQuotient(h1, h2, h3 []fr.Element, proof *Proof, kzgPk kzg.ProvingKe return g.Wait() } -// divideByXMinusOne +// divideByZH // The input must be in LagrangeCoset. // The result is in Canonical Regular. (in place using a) -func divideByXMinusOne(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { +func divideByZH(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { // check that the basis is LagrangeCoset if a.Basis != iop.LagrangeCoset || a.Layout != iop.BitReverse { @@ -1255,7 +1215,7 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { res[0].Exp(domains[1].FrMultiplicativeGen, expo) var t fr.Element - t.Exp(domains[1].Generator, big.NewInt(int64(domains[0].Cardinality))) + t.Exp(domains[1].Generator, expo) one := fr.One() @@ -1279,16 +1239,24 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { // The Linearized polynomial is: // // α²*L₁(ζ)*Z(X) -// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) -// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) +// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(β*s3(X))*Z(μζ) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) +// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) +// - Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) +// +// /!\ blindedZCanonical is modified func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, gamma, zeta, zu fr.Element, qcpZeta, blindedZCanonical []fr.Element, pi2Canonical [][]fr.Element, pk *ProvingKey) []fr.Element { - // TODO @gbotrel rename - // first part: individual constraints + + // l(ζ)r(ζ) var rl fr.Element rl.Mul(&rZeta, &lZeta) - // second part: - // Z(μζ)(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*s3(X)-Z(X)(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ) + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + // the linearised polynomial is + // α²*L₁(ζ)*Z(X) + + // s1*s3(X)+s2*Z(X) + l(ζ)*Ql(X) + + // l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) - + // Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) var s1, s2 fr.Element chS1 := make(chan struct{}, 1) go func() { @@ -1296,11 +1264,11 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s1.Mul(&s1, &beta).Add(&s1, &lZeta).Add(&s1, &gamma) // (l(ζ)+β*s1(ζ)+γ) close(chS1) }() - // ps2 := iop.NewPolynomial(&pk.S2Canonical, iop.Form{Basis: iop.Canonical, Layout: iop.Regular}) + tmp := s.trace.S2.Evaluate(zeta) // s2(ζ) tmp.Mul(&tmp, &beta).Add(&tmp, &rZeta).Add(&tmp, &gamma) // (r(ζ)+β*s2(ζ)+γ) <-chS1 - s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta) // (l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta).Mul(&s1, &alpha) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*Z(μζ)*α var uzeta, uuzeta fr.Element uzeta.Mul(&zeta, &pk.Vk.CosetShift) @@ -1311,27 +1279,36 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ) tmp.Mul(&beta, &uuzeta).Add(&tmp, &oZeta).Add(&tmp, &gamma) // (o(ζ)+β*u²*ζ+γ) s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - s2.Neg(&s2) // -(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + s2.Neg(&s2).Mul(&s2, &alpha) - // third part L₁(ζ)*α²*Z - var lagrangeZeta, one, den, frNbElmt fr.Element + // Z_h(ζ), ζⁿ⁺², L₁(ζ)*α²*Z + var zhZeta, zetaNPlusTwo, alphaSquareLagrangeZero, one, den, frNbElmt fr.Element one.SetOne() nbElmt := int64(s.domain0.Cardinality) - lagrangeZeta.Set(&zeta). - Exp(lagrangeZeta, big.NewInt(nbElmt)). - Sub(&lagrangeZeta, &one) + alphaSquareLagrangeZero.Set(&zeta).Exp(alphaSquareLagrangeZero, big.NewInt(nbElmt)) // ζⁿ + zetaNPlusTwo.Mul(&alphaSquareLagrangeZero, &zeta).Mul(&zetaNPlusTwo, &zeta) // ζⁿ⁺² + alphaSquareLagrangeZero.Sub(&alphaSquareLagrangeZero, &one) // ζⁿ - 1 + zhZeta.Set(&alphaSquareLagrangeZero) // Z_h(ζ) = ζⁿ - 1 frNbElmt.SetUint64(uint64(nbElmt)) - den.Sub(&zeta, &one). - Inverse(&den) - lagrangeZeta.Mul(&lagrangeZeta, &den). // L₁ = (ζⁿ⁻¹)/(ζ-1) - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &s.domain0.CardinalityInv) // (1/n)*α²*L₁(ζ) + den.Sub(&zeta, &one).Inverse(&den) // 1/(ζ-1) + alphaSquareLagrangeZero.Mul(&alphaSquareLagrangeZero, &den). // L₁ = (ζⁿ - 1)/(ζ-1) + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &s.domain0.CardinalityInv) // α²*L₁(ζ) s3canonical := s.trace.S3.Coefficients() s.trace.Qk.ToCanonical(s.domain0).ToRegular() + // len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 when Statistical ZK is activated + // len(h1)=len(h2)=len(h3)=len(blindedZCanonical)-1 when Statistical ZK is deactivated + h1 := s.h1() + h2 := s.h2() + h3 := s.h3() + + // at this stage we have + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) utils.Parallelize(len(blindedZCanonical), func(start, end int) { cql := s.trace.Ql.Coefficients() @@ -1343,45 +1320,50 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, var t, t0, t1 fr.Element for i := start; i < end; i++ { - - t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - + t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) if i < len(s3canonical) { - - t0.Mul(&s3canonical[i], &s1) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*β*s3(X) - + t0.Mul(&s3canonical[i], &s1) // α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ)*β*s3(X) t.Add(&t, &t0) } - - t.Mul(&t, &alpha) // α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ)) - if i < len(cqm) { - - t1.Mul(&cqm[i], &rl) // linPol = linPol + l(ζ)r(ζ)*Qm(X) - - t0.Mul(&cql[i], &lZeta) - t0.Add(&t0, &t1) - - t.Add(&t, &t0) // linPol = linPol + l(ζ)*Ql(X) - - t0.Mul(&cqr[i], &rZeta) - t.Add(&t, &t0) // linPol = linPol + r(ζ)*Qr(X) - - t0.Mul(&cqo[i], &oZeta) - t0.Add(&t0, &cqk[i]) - - t.Add(&t, &t0) // linPol = linPol + o(ζ)*Qo(X) + Qk(X) - - for j := range qcpZeta { + t1.Mul(&cqm[i], &rl) // l(ζ)r(ζ)*Qm(X) + t.Add(&t, &t1) // linPol += l(ζ)r(ζ)*Qm(X) + t0.Mul(&cql[i], &lZeta) // l(ζ)Q_l(X) + t.Add(&t, &t0) // linPol += l(ζ)*Ql(X) + t0.Mul(&cqr[i], &rZeta) //r(ζ)*Qr(X) + t.Add(&t, &t0) // linPol += r(ζ)*Qr(X) + t0.Mul(&cqo[i], &oZeta) // o(ζ)*Qo(X) + t.Add(&t, &t0) // linPol += o(ζ)*Qo(X) + t.Add(&t, &cqk[i]) // linPol += Qk(X) + for j := range qcpZeta { // linPol += ∑ᵢQcp_(ζ)Pi_(X) t0.Mul(&pi2Canonical[j][i], &qcpZeta[j]) t.Add(&t, &t0) } } - t0.Mul(&blindedZCanonical[i], &lagrangeZeta) - blindedZCanonical[i].Add(&t, &t0) // finish the computation + t0.Mul(&blindedZCanonical[i], &alphaSquareLagrangeZero) // α²L₁(ζ)Z(X) + blindedZCanonical[i].Add(&t, &t0) // linPol += α²L₁(ζ)Z(X) + + // if statistical zeroknowledge is deactivated, len(h1)=len(h2)=len(h3)=len(blindedZ)-1. + // Else len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 + if i < len(h3) { + t.Mul(&h3[i], &zetaNPlusTwo). + Add(&t, &h2[i]). + Mul(&t, &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } else { + if s.opt.StatisticalZK { + t.Mul(&h2[i], &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } + } } }) + return blindedZCanonical } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/setup.go index 0b9158e9a5..933d0e9038 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/setup.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/setup.go @@ -18,7 +18,6 @@ package plonk import ( "fmt" - "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bls12-377/fr" "github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft" "github.com/consensys/gnark-crypto/ecc/bls12-377/fr/iop" @@ -96,7 +95,7 @@ func Setup(spr *cs.SparseR1CS, srs, srsLagrange kzg.SRS) (*ProvingKey, *Verifyin // step 0: set the fft domains domain := initFFTDomain(spr) if domain.Cardinality < 2 { - return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", spr.GetNbConstraints()) + return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", len(spr.Public)+spr.GetNbConstraints()) } // check the size of the kzg srs. @@ -154,9 +153,7 @@ func (pk *ProvingKey) VerifyingKey() interface{} { func NewTrace(spr *cs.SparseR1CS, domain *fft.Domain) *Trace { var trace Trace - nbConstraints := spr.GetNbConstraints() - sizeSystem := uint64(nbConstraints + len(spr.Public)) - size := ecc.NextPowerOfTwo(sizeSystem) + size := int(domain.Cardinality) commitmentInfo := spr.CommitmentInfo.(constraint.PlonkCommitments) ql := make([]fr.Element, size) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/verify.go index 6234beb7a3..9dd652cc0e 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-377/verify.go @@ -22,6 +22,7 @@ import ( "io" "math/big" + "github.com/consensys/gnark/backend/solidity" "time" "github.com/consensys/gnark-crypto/ecc" @@ -39,11 +40,13 @@ import ( ) var ( - errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") - errInvalidWitness = errors.New("witness length is invalid") + errAlgebraicRelation = errors.New("algebraic relation does not hold") + errInvalidWitness = errors.New("witness length is invalid") + errInvalidPoint = errors.New("point is not on the curve") ) func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { + log := logger.Logger().With().Str("curve", "bls12-377").Str("backend", "plonk").Logger() start := time.Now() cfg, err := backend.NewVerifierConfig(opts...) @@ -59,6 +62,32 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return errInvalidWitness } + // check that the points in the proof are on the curve + for i := 0; i < len(proof.LRO); i++ { + if !proof.LRO[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.Z.IsInSubGroup() { + return errInvalidPoint + } + for i := 0; i < len(proof.H); i++ { + if !proof.H[i].IsInSubGroup() { + return errInvalidPoint + } + } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + if !proof.Bsb22Commitments[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.BatchedProof.H.IsInSubGroup() { + return errInvalidPoint + } + if !proof.ZShiftedOpening.H.IsInSubGroup() { + return errInvalidPoint + } + // transcript to derive the challenge fs := fiatshamir.NewTranscript(cfg.ChallengeHash, "gamma", "beta", "alpha", "zeta") @@ -79,7 +108,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // derive alpha from Comm(l), Comm(r), Comm(o), Com(Z), Bsb22Commitments + // derive alpha from Com(Z), Bsb22Commitments alphaDeps := make([]*curve.G1Affine, len(proof.Bsb22Commitments)+1) for i := range proof.Bsb22Commitments { alphaDeps[i] = &proof.Bsb22Commitments[i] @@ -96,37 +125,42 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // evaluation of Z=Xⁿ⁻¹ at ζ - var zetaPowerM, zzeta fr.Element + // evaluation of zhZeta=ζⁿ-1 + var zetaPowerM, zhZeta, lagrangeZero fr.Element var bExpo big.Int one := fr.One() bExpo.SetUint64(vk.Size) zetaPowerM.Exp(zeta, &bExpo) - zzeta.Sub(&zetaPowerM, &one) + zhZeta.Sub(&zetaPowerM, &one) // ζⁿ-1 + lagrangeZero.Sub(&zeta, &one). // ζ-1 + Inverse(&lagrangeZero). // 1/(ζ-1) + Mul(&lagrangeZero, &zhZeta). // (ζ^n-1)/(ζ-1) + Mul(&lagrangeZero, &vk.SizeInv) // 1/n * (ζ^n-1)/(ζ-1) // compute PI = ∑_{i if the poly is shifted and in canonical form the index is computed differently - const ( id_L int = iota id_R @@ -101,12 +96,12 @@ type Proof struct { // Commitment to Z, the permutation polynomial Z kzg.Digest - // Commitments to h1, h2, h3 such that h = h1 + Xh2 + X**2h3 is the quotient polynomial + // Commitments to h1, h2, h3 such that h = h1 + Xⁿ⁺²*h2 + X²⁽ⁿ⁺²⁾*h3 is the quotient polynomial H [3]kzg.Digest Bsb22Commitments []kzg.Digest - // Batch opening proof of h1 + zeta*h2 + zeta**2h3, linearizedPolynomial, l, r, o, s1, s2, qCPrime + // Batch opening proof of linearizedPolynomial, l, r, o, s1, s2, qCPrime BatchedProof kzg.BatchOpeningProof // Opening proof of Z at zeta*mu @@ -151,14 +146,11 @@ func Prove(spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts g.Go(instance.buildRatioCopyConstraint) // compute h - g.Go(instance.evaluateConstraints) + g.Go(instance.computeQuotient) // open Z (blinded) at ωζ (proof.ZShiftedOpening) g.Go(instance.openZ) - // fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) - g.Go(instance.foldH) - // linearized polynomial g.Go(instance.computeLinearizedPolynomial) @@ -187,13 +179,11 @@ type instance struct { htfFunc hash.Hash // hash to field function // polynomials - x []*iop.Polynomial // x stores tracks the polynomial we need - bp []*iop.Polynomial // blinding polynomials - h *iop.Polynomial // h is the quotient polynomial - blindedZ []fr.Element // blindedZ is the blinded version of Z - - foldedH []fr.Element // foldedH is the folded version of H - foldedHDigest kzg.Digest // foldedHDigest is the kzg commitment of foldedH + x []*iop.Polynomial // x stores tracks the polynomial we need + bp []*iop.Polynomial // blinding polynomials + h *iop.Polynomial // h is the quotient polynomial + blindedZ []fr.Element // blindedZ is the blinded version of Z + quotientShardsRandomizers [2]fr.Element // random elements for blinding the shards of the quotient linearizedPolynomial []fr.Element linearizedPolynomialDigest kzg.Digest @@ -217,7 +207,6 @@ type instance struct { chRestoreLRO, chZOpening, chLinearizedPolynomial, - chFoldedH, chGammaBeta chan struct{} domain0, domain1 *fft.Domain @@ -248,7 +237,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi chH: make(chan struct{}, 1), chZOpening: make(chan struct{}, 1), chLinearizedPolynomial: make(chan struct{}, 1), - chFoldedH: make(chan struct{}, 1), chRestoreLRO: make(chan struct{}, 1), } s.initBSB22Commitments() @@ -259,6 +247,12 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi sizeSystem := uint64(nbConstraints + len(spr.Public)) // len(spr.Public) is for the placeholder constraints s.domain0 = fft.NewDomain(sizeSystem) + // sampling random numbers for blinding the quotient + if opts.StatisticalZK { + s.quotientShardsRandomizers[0].SetRandom() + s.quotientShardsRandomizers[1].SetRandom() + } + // h, the quotient polynomial is of degree 3(n+1)+2, so it's in a 3(n+2) dim vector space, // the domain is the next power of 2 superior to 3(n+2). 4*domainNum is enough in all cases // except when n<6. @@ -267,8 +261,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi } else { s.domain1 = fft.NewDomain(4*sizeSystem, fft.WithoutPrecompute()) } - // TODO @gbotrel domain1 is used for only 1 FFT --> precomputing the twiddles - // and storing them in memory is costly given its size. --> do a FFT on the fly // build trace s.trace = NewTrace(spr, s.domain0) @@ -335,7 +327,7 @@ func (s *instance) bsb22Hint(_ *big.Int, ins, outs []*big.Int) error { } // solveConstraints computes the evaluation of the polynomials L, R, O -// and sets x[id_L], x[id_R], x[id_O] in canonical form +// and sets x[id_L], x[id_R], x[id_O] in Lagrange form func (s *instance) solveConstraints() error { _solution, err := s.spr.Solve(s.fullWitness, s.opt.SolverOpts...) if err != nil { @@ -490,8 +482,8 @@ func (s *instance) deriveZeta() (err error) { return } -// evaluateConstraints computes H -func (s *instance) evaluateConstraints() (err error) { +// computeQuotient computes H +func (s *instance) computeQuotient() (err error) { s.x[id_Ql] = s.trace.Ql s.x[id_Qr] = s.trace.Qr s.x[id_Qm] = s.trace.Qm @@ -544,7 +536,7 @@ func (s *instance) evaluateConstraints() (err error) { return err } - s.h, err = divideByXMinusOne(numerator, [2]*fft.Domain{s.domain0, s.domain1}) + s.h, err = divideByZH(numerator, [2]*fft.Domain{s.domain0, s.domain1}) if err != nil { return err } @@ -625,56 +617,40 @@ func (s *instance) openZ() (err error) { } func (s *instance) h1() []fr.Element { - h1 := s.h.Coefficients()[:s.domain0.Cardinality+2] + var h1 []fr.Element + if !s.opt.StatisticalZK { + h1 = s.h.Coefficients()[:s.domain0.Cardinality+2] + } else { + h1 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h1, s.h.Coefficients()[:s.domain0.Cardinality+2]) + h1[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[0]) + } return h1 } func (s *instance) h2() []fr.Element { - h2 := s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + var h2 []fr.Element + if !s.opt.StatisticalZK { + h2 = s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + } else { + h2 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h2, s.h.Coefficients()[s.domain0.Cardinality+2:2*(s.domain0.Cardinality+2)]) + h2[0].Sub(&h2[0], &s.quotientShardsRandomizers[0]) + h2[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[1]) + } return h2 } func (s *instance) h3() []fr.Element { - h3 := s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] - return h3 -} - -// fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) -func (s *instance) foldH() error { - // wait for H to be committed and zeta to be derived (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chH: - } - var n big.Int - n.SetUint64(s.domain0.Cardinality + 2) - - var zetaPowerNplusTwo fr.Element - zetaPowerNplusTwo.Exp(s.zeta, &n) - zetaPowerNplusTwo.BigInt(&n) - - s.foldedHDigest.ScalarMultiplication(&s.proof.H[2], &n) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[1]) // ζᵐ⁺²*Comm(h3) - s.foldedHDigest.ScalarMultiplication(&s.foldedHDigest, &n) // ζ²⁽ᵐ⁺²⁾*Comm(h3) + ζᵐ⁺²*Comm(h2) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[0]) - - // fold H (H₀ + ζᵐ⁺²*H₁ + ζ²⁽ᵐ⁺²⁾H₂)) - h1 := s.h1() - h2 := s.h2() - s.foldedH = s.h3() - - for i := 0; i < int(s.domain0.Cardinality)+2; i++ { - s.foldedH[i]. - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h2[i]). - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h1[i]) + var h3 []fr.Element + if !s.opt.StatisticalZK { + h3 = s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] + } else { + h3 = make([]fr.Element, s.domain0.Cardinality+2) + copy(h3, s.h.Coefficients()[2*(s.domain0.Cardinality+2):3*(s.domain0.Cardinality+2)]) + h3[0].Sub(&h3[0], &s.quotientShardsRandomizers[1]) } - - close(s.chFoldedH) - - return nil + return h3 } func (s *instance) computeLinearizedPolynomial() error { @@ -749,20 +725,6 @@ func (s *instance) computeLinearizedPolynomial() error { func (s *instance) batchOpening() error { - // wait for LRO to be committed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chLRO: - } - - // wait for foldedH to be computed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chFoldedH: - } - // wait for linearizedPolynomial to be computed (or ctx.Done()) select { case <-s.ctx.Done(): @@ -771,27 +733,25 @@ func (s *instance) batchOpening() error { } polysQcp := coefficients(s.trace.Qcp) - polysToOpen := make([][]fr.Element, 7+len(polysQcp)) - copy(polysToOpen[7:], polysQcp) - - polysToOpen[0] = s.foldedH - polysToOpen[1] = s.linearizedPolynomial - polysToOpen[2] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) - polysToOpen[3] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) - polysToOpen[4] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) - polysToOpen[5] = s.trace.S1.Coefficients() - polysToOpen[6] = s.trace.S2.Coefficients() - - digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+7) - copy(digestsToOpen[7:], s.pk.Vk.Qcp) - - digestsToOpen[0] = s.foldedHDigest - digestsToOpen[1] = s.linearizedPolynomialDigest - digestsToOpen[2] = s.proof.LRO[0] - digestsToOpen[3] = s.proof.LRO[1] - digestsToOpen[4] = s.proof.LRO[2] - digestsToOpen[5] = s.pk.Vk.S[0] - digestsToOpen[6] = s.pk.Vk.S[1] + polysToOpen := make([][]fr.Element, 6+len(polysQcp)) + copy(polysToOpen[6:], polysQcp) + + polysToOpen[0] = s.linearizedPolynomial + polysToOpen[1] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) + polysToOpen[2] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) + polysToOpen[3] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) + polysToOpen[4] = s.trace.S1.Coefficients() + polysToOpen[5] = s.trace.S2.Coefficients() + + digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+6) + copy(digestsToOpen[6:], s.pk.Vk.Qcp) + + digestsToOpen[0] = s.linearizedPolynomialDigest + digestsToOpen[1] = s.proof.LRO[0] + digestsToOpen[2] = s.proof.LRO[1] + digestsToOpen[3] = s.proof.LRO[2] + digestsToOpen[4] = s.pk.Vk.S[0] + digestsToOpen[5] = s.pk.Vk.S[1] var err error s.proof.BatchedProof, err = kzg.BatchOpenSinglePoint( @@ -834,7 +794,7 @@ func (s *instance) computeNumerator() (*iop.Polynomial, error) { case <-s.chQk: } - nbBsbGates := (len(s.x) - id_Qci + 1) >> 1 + nbBsbGates := len(s.proof.Bsb22Commitments) gateConstraint := func(u ...fr.Element) fr.Element { @@ -1139,7 +1099,7 @@ func evaluateBlinded(p, bp *iop.Polynomial, zeta fr.Element) fr.Element { return pEvaluatedAtZeta } -// /!\ modifies p's underlying array of coefficients, in particular the size changes +// /!\ modifies the size func getBlindedCoefficients(p, bp *iop.Polynomial) []fr.Element { cp := p.Coefficients() cbp := bp.Coefficients() @@ -1212,10 +1172,10 @@ func commitToQuotient(h1, h2, h3 []fr.Element, proof *Proof, kzgPk kzg.ProvingKe return g.Wait() } -// divideByXMinusOne +// divideByZH // The input must be in LagrangeCoset. // The result is in Canonical Regular. (in place using a) -func divideByXMinusOne(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { +func divideByZH(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { // check that the basis is LagrangeCoset if a.Basis != iop.LagrangeCoset || a.Layout != iop.BitReverse { @@ -1255,7 +1215,7 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { res[0].Exp(domains[1].FrMultiplicativeGen, expo) var t fr.Element - t.Exp(domains[1].Generator, big.NewInt(int64(domains[0].Cardinality))) + t.Exp(domains[1].Generator, expo) one := fr.One() @@ -1279,16 +1239,24 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { // The Linearized polynomial is: // // α²*L₁(ζ)*Z(X) -// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) -// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) +// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(β*s3(X))*Z(μζ) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) +// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) +// - Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) +// +// /!\ blindedZCanonical is modified func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, gamma, zeta, zu fr.Element, qcpZeta, blindedZCanonical []fr.Element, pi2Canonical [][]fr.Element, pk *ProvingKey) []fr.Element { - // TODO @gbotrel rename - // first part: individual constraints + + // l(ζ)r(ζ) var rl fr.Element rl.Mul(&rZeta, &lZeta) - // second part: - // Z(μζ)(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*s3(X)-Z(X)(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ) + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + // the linearised polynomial is + // α²*L₁(ζ)*Z(X) + + // s1*s3(X)+s2*Z(X) + l(ζ)*Ql(X) + + // l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) - + // Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) var s1, s2 fr.Element chS1 := make(chan struct{}, 1) go func() { @@ -1296,11 +1264,11 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s1.Mul(&s1, &beta).Add(&s1, &lZeta).Add(&s1, &gamma) // (l(ζ)+β*s1(ζ)+γ) close(chS1) }() - // ps2 := iop.NewPolynomial(&pk.S2Canonical, iop.Form{Basis: iop.Canonical, Layout: iop.Regular}) + tmp := s.trace.S2.Evaluate(zeta) // s2(ζ) tmp.Mul(&tmp, &beta).Add(&tmp, &rZeta).Add(&tmp, &gamma) // (r(ζ)+β*s2(ζ)+γ) <-chS1 - s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta) // (l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta).Mul(&s1, &alpha) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*Z(μζ)*α var uzeta, uuzeta fr.Element uzeta.Mul(&zeta, &pk.Vk.CosetShift) @@ -1311,27 +1279,36 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ) tmp.Mul(&beta, &uuzeta).Add(&tmp, &oZeta).Add(&tmp, &gamma) // (o(ζ)+β*u²*ζ+γ) s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - s2.Neg(&s2) // -(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + s2.Neg(&s2).Mul(&s2, &alpha) - // third part L₁(ζ)*α²*Z - var lagrangeZeta, one, den, frNbElmt fr.Element + // Z_h(ζ), ζⁿ⁺², L₁(ζ)*α²*Z + var zhZeta, zetaNPlusTwo, alphaSquareLagrangeZero, one, den, frNbElmt fr.Element one.SetOne() nbElmt := int64(s.domain0.Cardinality) - lagrangeZeta.Set(&zeta). - Exp(lagrangeZeta, big.NewInt(nbElmt)). - Sub(&lagrangeZeta, &one) + alphaSquareLagrangeZero.Set(&zeta).Exp(alphaSquareLagrangeZero, big.NewInt(nbElmt)) // ζⁿ + zetaNPlusTwo.Mul(&alphaSquareLagrangeZero, &zeta).Mul(&zetaNPlusTwo, &zeta) // ζⁿ⁺² + alphaSquareLagrangeZero.Sub(&alphaSquareLagrangeZero, &one) // ζⁿ - 1 + zhZeta.Set(&alphaSquareLagrangeZero) // Z_h(ζ) = ζⁿ - 1 frNbElmt.SetUint64(uint64(nbElmt)) - den.Sub(&zeta, &one). - Inverse(&den) - lagrangeZeta.Mul(&lagrangeZeta, &den). // L₁ = (ζⁿ⁻¹)/(ζ-1) - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &s.domain0.CardinalityInv) // (1/n)*α²*L₁(ζ) + den.Sub(&zeta, &one).Inverse(&den) // 1/(ζ-1) + alphaSquareLagrangeZero.Mul(&alphaSquareLagrangeZero, &den). // L₁ = (ζⁿ - 1)/(ζ-1) + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &s.domain0.CardinalityInv) // α²*L₁(ζ) s3canonical := s.trace.S3.Coefficients() s.trace.Qk.ToCanonical(s.domain0).ToRegular() + // len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 when Statistical ZK is activated + // len(h1)=len(h2)=len(h3)=len(blindedZCanonical)-1 when Statistical ZK is deactivated + h1 := s.h1() + h2 := s.h2() + h3 := s.h3() + + // at this stage we have + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) utils.Parallelize(len(blindedZCanonical), func(start, end int) { cql := s.trace.Ql.Coefficients() @@ -1343,45 +1320,50 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, var t, t0, t1 fr.Element for i := start; i < end; i++ { - - t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - + t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) if i < len(s3canonical) { - - t0.Mul(&s3canonical[i], &s1) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*β*s3(X) - + t0.Mul(&s3canonical[i], &s1) // α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ)*β*s3(X) t.Add(&t, &t0) } - - t.Mul(&t, &alpha) // α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ)) - if i < len(cqm) { - - t1.Mul(&cqm[i], &rl) // linPol = linPol + l(ζ)r(ζ)*Qm(X) - - t0.Mul(&cql[i], &lZeta) - t0.Add(&t0, &t1) - - t.Add(&t, &t0) // linPol = linPol + l(ζ)*Ql(X) - - t0.Mul(&cqr[i], &rZeta) - t.Add(&t, &t0) // linPol = linPol + r(ζ)*Qr(X) - - t0.Mul(&cqo[i], &oZeta) - t0.Add(&t0, &cqk[i]) - - t.Add(&t, &t0) // linPol = linPol + o(ζ)*Qo(X) + Qk(X) - - for j := range qcpZeta { + t1.Mul(&cqm[i], &rl) // l(ζ)r(ζ)*Qm(X) + t.Add(&t, &t1) // linPol += l(ζ)r(ζ)*Qm(X) + t0.Mul(&cql[i], &lZeta) // l(ζ)Q_l(X) + t.Add(&t, &t0) // linPol += l(ζ)*Ql(X) + t0.Mul(&cqr[i], &rZeta) //r(ζ)*Qr(X) + t.Add(&t, &t0) // linPol += r(ζ)*Qr(X) + t0.Mul(&cqo[i], &oZeta) // o(ζ)*Qo(X) + t.Add(&t, &t0) // linPol += o(ζ)*Qo(X) + t.Add(&t, &cqk[i]) // linPol += Qk(X) + for j := range qcpZeta { // linPol += ∑ᵢQcp_(ζ)Pi_(X) t0.Mul(&pi2Canonical[j][i], &qcpZeta[j]) t.Add(&t, &t0) } } - t0.Mul(&blindedZCanonical[i], &lagrangeZeta) - blindedZCanonical[i].Add(&t, &t0) // finish the computation + t0.Mul(&blindedZCanonical[i], &alphaSquareLagrangeZero) // α²L₁(ζ)Z(X) + blindedZCanonical[i].Add(&t, &t0) // linPol += α²L₁(ζ)Z(X) + + // if statistical zeroknowledge is deactivated, len(h1)=len(h2)=len(h3)=len(blindedZ)-1. + // Else len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 + if i < len(h3) { + t.Mul(&h3[i], &zetaNPlusTwo). + Add(&t, &h2[i]). + Mul(&t, &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } else { + if s.opt.StatisticalZK { + t.Mul(&h2[i], &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } + } } }) + return blindedZCanonical } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/setup.go index e0d7e50c06..16bc19bb53 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/setup.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/setup.go @@ -18,7 +18,6 @@ package plonk import ( "fmt" - "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/fft" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/iop" @@ -96,7 +95,7 @@ func Setup(spr *cs.SparseR1CS, srs, srsLagrange kzg.SRS) (*ProvingKey, *Verifyin // step 0: set the fft domains domain := initFFTDomain(spr) if domain.Cardinality < 2 { - return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", spr.GetNbConstraints()) + return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", len(spr.Public)+spr.GetNbConstraints()) } // check the size of the kzg srs. @@ -154,9 +153,7 @@ func (pk *ProvingKey) VerifyingKey() interface{} { func NewTrace(spr *cs.SparseR1CS, domain *fft.Domain) *Trace { var trace Trace - nbConstraints := spr.GetNbConstraints() - sizeSystem := uint64(nbConstraints + len(spr.Public)) - size := ecc.NextPowerOfTwo(sizeSystem) + size := int(domain.Cardinality) commitmentInfo := spr.CommitmentInfo.(constraint.PlonkCommitments) ql := make([]fr.Element, size) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/verify.go index ea78e72096..97006ffa6f 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls12-381/verify.go @@ -22,6 +22,7 @@ import ( "io" "math/big" + "github.com/consensys/gnark/backend/solidity" "time" "github.com/consensys/gnark-crypto/ecc" @@ -39,11 +40,13 @@ import ( ) var ( - errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") - errInvalidWitness = errors.New("witness length is invalid") + errAlgebraicRelation = errors.New("algebraic relation does not hold") + errInvalidWitness = errors.New("witness length is invalid") + errInvalidPoint = errors.New("point is not on the curve") ) func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { + log := logger.Logger().With().Str("curve", "bls12-381").Str("backend", "plonk").Logger() start := time.Now() cfg, err := backend.NewVerifierConfig(opts...) @@ -59,6 +62,32 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return errInvalidWitness } + // check that the points in the proof are on the curve + for i := 0; i < len(proof.LRO); i++ { + if !proof.LRO[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.Z.IsInSubGroup() { + return errInvalidPoint + } + for i := 0; i < len(proof.H); i++ { + if !proof.H[i].IsInSubGroup() { + return errInvalidPoint + } + } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + if !proof.Bsb22Commitments[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.BatchedProof.H.IsInSubGroup() { + return errInvalidPoint + } + if !proof.ZShiftedOpening.H.IsInSubGroup() { + return errInvalidPoint + } + // transcript to derive the challenge fs := fiatshamir.NewTranscript(cfg.ChallengeHash, "gamma", "beta", "alpha", "zeta") @@ -79,7 +108,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // derive alpha from Comm(l), Comm(r), Comm(o), Com(Z), Bsb22Commitments + // derive alpha from Com(Z), Bsb22Commitments alphaDeps := make([]*curve.G1Affine, len(proof.Bsb22Commitments)+1) for i := range proof.Bsb22Commitments { alphaDeps[i] = &proof.Bsb22Commitments[i] @@ -96,37 +125,42 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // evaluation of Z=Xⁿ⁻¹ at ζ - var zetaPowerM, zzeta fr.Element + // evaluation of zhZeta=ζⁿ-1 + var zetaPowerM, zhZeta, lagrangeZero fr.Element var bExpo big.Int one := fr.One() bExpo.SetUint64(vk.Size) zetaPowerM.Exp(zeta, &bExpo) - zzeta.Sub(&zetaPowerM, &one) + zhZeta.Sub(&zetaPowerM, &one) // ζⁿ-1 + lagrangeZero.Sub(&zeta, &one). // ζ-1 + Inverse(&lagrangeZero). // 1/(ζ-1) + Mul(&lagrangeZero, &zhZeta). // (ζ^n-1)/(ζ-1) + Mul(&lagrangeZero, &vk.SizeInv) // 1/n * (ζ^n-1)/(ζ-1) // compute PI = ∑_{i if the poly is shifted and in canonical form the index is computed differently - const ( id_L int = iota id_R @@ -101,12 +96,12 @@ type Proof struct { // Commitment to Z, the permutation polynomial Z kzg.Digest - // Commitments to h1, h2, h3 such that h = h1 + Xh2 + X**2h3 is the quotient polynomial + // Commitments to h1, h2, h3 such that h = h1 + Xⁿ⁺²*h2 + X²⁽ⁿ⁺²⁾*h3 is the quotient polynomial H [3]kzg.Digest Bsb22Commitments []kzg.Digest - // Batch opening proof of h1 + zeta*h2 + zeta**2h3, linearizedPolynomial, l, r, o, s1, s2, qCPrime + // Batch opening proof of linearizedPolynomial, l, r, o, s1, s2, qCPrime BatchedProof kzg.BatchOpeningProof // Opening proof of Z at zeta*mu @@ -151,14 +146,11 @@ func Prove(spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts g.Go(instance.buildRatioCopyConstraint) // compute h - g.Go(instance.evaluateConstraints) + g.Go(instance.computeQuotient) // open Z (blinded) at ωζ (proof.ZShiftedOpening) g.Go(instance.openZ) - // fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) - g.Go(instance.foldH) - // linearized polynomial g.Go(instance.computeLinearizedPolynomial) @@ -187,13 +179,11 @@ type instance struct { htfFunc hash.Hash // hash to field function // polynomials - x []*iop.Polynomial // x stores tracks the polynomial we need - bp []*iop.Polynomial // blinding polynomials - h *iop.Polynomial // h is the quotient polynomial - blindedZ []fr.Element // blindedZ is the blinded version of Z - - foldedH []fr.Element // foldedH is the folded version of H - foldedHDigest kzg.Digest // foldedHDigest is the kzg commitment of foldedH + x []*iop.Polynomial // x stores tracks the polynomial we need + bp []*iop.Polynomial // blinding polynomials + h *iop.Polynomial // h is the quotient polynomial + blindedZ []fr.Element // blindedZ is the blinded version of Z + quotientShardsRandomizers [2]fr.Element // random elements for blinding the shards of the quotient linearizedPolynomial []fr.Element linearizedPolynomialDigest kzg.Digest @@ -217,7 +207,6 @@ type instance struct { chRestoreLRO, chZOpening, chLinearizedPolynomial, - chFoldedH, chGammaBeta chan struct{} domain0, domain1 *fft.Domain @@ -248,7 +237,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi chH: make(chan struct{}, 1), chZOpening: make(chan struct{}, 1), chLinearizedPolynomial: make(chan struct{}, 1), - chFoldedH: make(chan struct{}, 1), chRestoreLRO: make(chan struct{}, 1), } s.initBSB22Commitments() @@ -259,6 +247,12 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi sizeSystem := uint64(nbConstraints + len(spr.Public)) // len(spr.Public) is for the placeholder constraints s.domain0 = fft.NewDomain(sizeSystem) + // sampling random numbers for blinding the quotient + if opts.StatisticalZK { + s.quotientShardsRandomizers[0].SetRandom() + s.quotientShardsRandomizers[1].SetRandom() + } + // h, the quotient polynomial is of degree 3(n+1)+2, so it's in a 3(n+2) dim vector space, // the domain is the next power of 2 superior to 3(n+2). 4*domainNum is enough in all cases // except when n<6. @@ -267,8 +261,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi } else { s.domain1 = fft.NewDomain(4*sizeSystem, fft.WithoutPrecompute()) } - // TODO @gbotrel domain1 is used for only 1 FFT --> precomputing the twiddles - // and storing them in memory is costly given its size. --> do a FFT on the fly // build trace s.trace = NewTrace(spr, s.domain0) @@ -335,7 +327,7 @@ func (s *instance) bsb22Hint(_ *big.Int, ins, outs []*big.Int) error { } // solveConstraints computes the evaluation of the polynomials L, R, O -// and sets x[id_L], x[id_R], x[id_O] in canonical form +// and sets x[id_L], x[id_R], x[id_O] in Lagrange form func (s *instance) solveConstraints() error { _solution, err := s.spr.Solve(s.fullWitness, s.opt.SolverOpts...) if err != nil { @@ -490,8 +482,8 @@ func (s *instance) deriveZeta() (err error) { return } -// evaluateConstraints computes H -func (s *instance) evaluateConstraints() (err error) { +// computeQuotient computes H +func (s *instance) computeQuotient() (err error) { s.x[id_Ql] = s.trace.Ql s.x[id_Qr] = s.trace.Qr s.x[id_Qm] = s.trace.Qm @@ -544,7 +536,7 @@ func (s *instance) evaluateConstraints() (err error) { return err } - s.h, err = divideByXMinusOne(numerator, [2]*fft.Domain{s.domain0, s.domain1}) + s.h, err = divideByZH(numerator, [2]*fft.Domain{s.domain0, s.domain1}) if err != nil { return err } @@ -625,56 +617,40 @@ func (s *instance) openZ() (err error) { } func (s *instance) h1() []fr.Element { - h1 := s.h.Coefficients()[:s.domain0.Cardinality+2] + var h1 []fr.Element + if !s.opt.StatisticalZK { + h1 = s.h.Coefficients()[:s.domain0.Cardinality+2] + } else { + h1 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h1, s.h.Coefficients()[:s.domain0.Cardinality+2]) + h1[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[0]) + } return h1 } func (s *instance) h2() []fr.Element { - h2 := s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + var h2 []fr.Element + if !s.opt.StatisticalZK { + h2 = s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + } else { + h2 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h2, s.h.Coefficients()[s.domain0.Cardinality+2:2*(s.domain0.Cardinality+2)]) + h2[0].Sub(&h2[0], &s.quotientShardsRandomizers[0]) + h2[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[1]) + } return h2 } func (s *instance) h3() []fr.Element { - h3 := s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] - return h3 -} - -// fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) -func (s *instance) foldH() error { - // wait for H to be committed and zeta to be derived (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chH: - } - var n big.Int - n.SetUint64(s.domain0.Cardinality + 2) - - var zetaPowerNplusTwo fr.Element - zetaPowerNplusTwo.Exp(s.zeta, &n) - zetaPowerNplusTwo.BigInt(&n) - - s.foldedHDigest.ScalarMultiplication(&s.proof.H[2], &n) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[1]) // ζᵐ⁺²*Comm(h3) - s.foldedHDigest.ScalarMultiplication(&s.foldedHDigest, &n) // ζ²⁽ᵐ⁺²⁾*Comm(h3) + ζᵐ⁺²*Comm(h2) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[0]) - - // fold H (H₀ + ζᵐ⁺²*H₁ + ζ²⁽ᵐ⁺²⁾H₂)) - h1 := s.h1() - h2 := s.h2() - s.foldedH = s.h3() - - for i := 0; i < int(s.domain0.Cardinality)+2; i++ { - s.foldedH[i]. - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h2[i]). - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h1[i]) + var h3 []fr.Element + if !s.opt.StatisticalZK { + h3 = s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] + } else { + h3 = make([]fr.Element, s.domain0.Cardinality+2) + copy(h3, s.h.Coefficients()[2*(s.domain0.Cardinality+2):3*(s.domain0.Cardinality+2)]) + h3[0].Sub(&h3[0], &s.quotientShardsRandomizers[1]) } - - close(s.chFoldedH) - - return nil + return h3 } func (s *instance) computeLinearizedPolynomial() error { @@ -749,20 +725,6 @@ func (s *instance) computeLinearizedPolynomial() error { func (s *instance) batchOpening() error { - // wait for LRO to be committed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chLRO: - } - - // wait for foldedH to be computed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chFoldedH: - } - // wait for linearizedPolynomial to be computed (or ctx.Done()) select { case <-s.ctx.Done(): @@ -771,27 +733,25 @@ func (s *instance) batchOpening() error { } polysQcp := coefficients(s.trace.Qcp) - polysToOpen := make([][]fr.Element, 7+len(polysQcp)) - copy(polysToOpen[7:], polysQcp) - - polysToOpen[0] = s.foldedH - polysToOpen[1] = s.linearizedPolynomial - polysToOpen[2] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) - polysToOpen[3] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) - polysToOpen[4] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) - polysToOpen[5] = s.trace.S1.Coefficients() - polysToOpen[6] = s.trace.S2.Coefficients() - - digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+7) - copy(digestsToOpen[7:], s.pk.Vk.Qcp) - - digestsToOpen[0] = s.foldedHDigest - digestsToOpen[1] = s.linearizedPolynomialDigest - digestsToOpen[2] = s.proof.LRO[0] - digestsToOpen[3] = s.proof.LRO[1] - digestsToOpen[4] = s.proof.LRO[2] - digestsToOpen[5] = s.pk.Vk.S[0] - digestsToOpen[6] = s.pk.Vk.S[1] + polysToOpen := make([][]fr.Element, 6+len(polysQcp)) + copy(polysToOpen[6:], polysQcp) + + polysToOpen[0] = s.linearizedPolynomial + polysToOpen[1] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) + polysToOpen[2] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) + polysToOpen[3] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) + polysToOpen[4] = s.trace.S1.Coefficients() + polysToOpen[5] = s.trace.S2.Coefficients() + + digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+6) + copy(digestsToOpen[6:], s.pk.Vk.Qcp) + + digestsToOpen[0] = s.linearizedPolynomialDigest + digestsToOpen[1] = s.proof.LRO[0] + digestsToOpen[2] = s.proof.LRO[1] + digestsToOpen[3] = s.proof.LRO[2] + digestsToOpen[4] = s.pk.Vk.S[0] + digestsToOpen[5] = s.pk.Vk.S[1] var err error s.proof.BatchedProof, err = kzg.BatchOpenSinglePoint( @@ -834,7 +794,7 @@ func (s *instance) computeNumerator() (*iop.Polynomial, error) { case <-s.chQk: } - nbBsbGates := (len(s.x) - id_Qci + 1) >> 1 + nbBsbGates := len(s.proof.Bsb22Commitments) gateConstraint := func(u ...fr.Element) fr.Element { @@ -1139,7 +1099,7 @@ func evaluateBlinded(p, bp *iop.Polynomial, zeta fr.Element) fr.Element { return pEvaluatedAtZeta } -// /!\ modifies p's underlying array of coefficients, in particular the size changes +// /!\ modifies the size func getBlindedCoefficients(p, bp *iop.Polynomial) []fr.Element { cp := p.Coefficients() cbp := bp.Coefficients() @@ -1212,10 +1172,10 @@ func commitToQuotient(h1, h2, h3 []fr.Element, proof *Proof, kzgPk kzg.ProvingKe return g.Wait() } -// divideByXMinusOne +// divideByZH // The input must be in LagrangeCoset. // The result is in Canonical Regular. (in place using a) -func divideByXMinusOne(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { +func divideByZH(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { // check that the basis is LagrangeCoset if a.Basis != iop.LagrangeCoset || a.Layout != iop.BitReverse { @@ -1255,7 +1215,7 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { res[0].Exp(domains[1].FrMultiplicativeGen, expo) var t fr.Element - t.Exp(domains[1].Generator, big.NewInt(int64(domains[0].Cardinality))) + t.Exp(domains[1].Generator, expo) one := fr.One() @@ -1279,16 +1239,24 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { // The Linearized polynomial is: // // α²*L₁(ζ)*Z(X) -// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) -// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) +// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(β*s3(X))*Z(μζ) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) +// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) +// - Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) +// +// /!\ blindedZCanonical is modified func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, gamma, zeta, zu fr.Element, qcpZeta, blindedZCanonical []fr.Element, pi2Canonical [][]fr.Element, pk *ProvingKey) []fr.Element { - // TODO @gbotrel rename - // first part: individual constraints + + // l(ζ)r(ζ) var rl fr.Element rl.Mul(&rZeta, &lZeta) - // second part: - // Z(μζ)(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*s3(X)-Z(X)(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ) + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + // the linearised polynomial is + // α²*L₁(ζ)*Z(X) + + // s1*s3(X)+s2*Z(X) + l(ζ)*Ql(X) + + // l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) - + // Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) var s1, s2 fr.Element chS1 := make(chan struct{}, 1) go func() { @@ -1296,11 +1264,11 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s1.Mul(&s1, &beta).Add(&s1, &lZeta).Add(&s1, &gamma) // (l(ζ)+β*s1(ζ)+γ) close(chS1) }() - // ps2 := iop.NewPolynomial(&pk.S2Canonical, iop.Form{Basis: iop.Canonical, Layout: iop.Regular}) + tmp := s.trace.S2.Evaluate(zeta) // s2(ζ) tmp.Mul(&tmp, &beta).Add(&tmp, &rZeta).Add(&tmp, &gamma) // (r(ζ)+β*s2(ζ)+γ) <-chS1 - s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta) // (l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta).Mul(&s1, &alpha) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*Z(μζ)*α var uzeta, uuzeta fr.Element uzeta.Mul(&zeta, &pk.Vk.CosetShift) @@ -1311,27 +1279,36 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ) tmp.Mul(&beta, &uuzeta).Add(&tmp, &oZeta).Add(&tmp, &gamma) // (o(ζ)+β*u²*ζ+γ) s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - s2.Neg(&s2) // -(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + s2.Neg(&s2).Mul(&s2, &alpha) - // third part L₁(ζ)*α²*Z - var lagrangeZeta, one, den, frNbElmt fr.Element + // Z_h(ζ), ζⁿ⁺², L₁(ζ)*α²*Z + var zhZeta, zetaNPlusTwo, alphaSquareLagrangeZero, one, den, frNbElmt fr.Element one.SetOne() nbElmt := int64(s.domain0.Cardinality) - lagrangeZeta.Set(&zeta). - Exp(lagrangeZeta, big.NewInt(nbElmt)). - Sub(&lagrangeZeta, &one) + alphaSquareLagrangeZero.Set(&zeta).Exp(alphaSquareLagrangeZero, big.NewInt(nbElmt)) // ζⁿ + zetaNPlusTwo.Mul(&alphaSquareLagrangeZero, &zeta).Mul(&zetaNPlusTwo, &zeta) // ζⁿ⁺² + alphaSquareLagrangeZero.Sub(&alphaSquareLagrangeZero, &one) // ζⁿ - 1 + zhZeta.Set(&alphaSquareLagrangeZero) // Z_h(ζ) = ζⁿ - 1 frNbElmt.SetUint64(uint64(nbElmt)) - den.Sub(&zeta, &one). - Inverse(&den) - lagrangeZeta.Mul(&lagrangeZeta, &den). // L₁ = (ζⁿ⁻¹)/(ζ-1) - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &s.domain0.CardinalityInv) // (1/n)*α²*L₁(ζ) + den.Sub(&zeta, &one).Inverse(&den) // 1/(ζ-1) + alphaSquareLagrangeZero.Mul(&alphaSquareLagrangeZero, &den). // L₁ = (ζⁿ - 1)/(ζ-1) + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &s.domain0.CardinalityInv) // α²*L₁(ζ) s3canonical := s.trace.S3.Coefficients() s.trace.Qk.ToCanonical(s.domain0).ToRegular() + // len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 when Statistical ZK is activated + // len(h1)=len(h2)=len(h3)=len(blindedZCanonical)-1 when Statistical ZK is deactivated + h1 := s.h1() + h2 := s.h2() + h3 := s.h3() + + // at this stage we have + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) utils.Parallelize(len(blindedZCanonical), func(start, end int) { cql := s.trace.Ql.Coefficients() @@ -1343,45 +1320,50 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, var t, t0, t1 fr.Element for i := start; i < end; i++ { - - t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - + t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) if i < len(s3canonical) { - - t0.Mul(&s3canonical[i], &s1) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*β*s3(X) - + t0.Mul(&s3canonical[i], &s1) // α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ)*β*s3(X) t.Add(&t, &t0) } - - t.Mul(&t, &alpha) // α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ)) - if i < len(cqm) { - - t1.Mul(&cqm[i], &rl) // linPol = linPol + l(ζ)r(ζ)*Qm(X) - - t0.Mul(&cql[i], &lZeta) - t0.Add(&t0, &t1) - - t.Add(&t, &t0) // linPol = linPol + l(ζ)*Ql(X) - - t0.Mul(&cqr[i], &rZeta) - t.Add(&t, &t0) // linPol = linPol + r(ζ)*Qr(X) - - t0.Mul(&cqo[i], &oZeta) - t0.Add(&t0, &cqk[i]) - - t.Add(&t, &t0) // linPol = linPol + o(ζ)*Qo(X) + Qk(X) - - for j := range qcpZeta { + t1.Mul(&cqm[i], &rl) // l(ζ)r(ζ)*Qm(X) + t.Add(&t, &t1) // linPol += l(ζ)r(ζ)*Qm(X) + t0.Mul(&cql[i], &lZeta) // l(ζ)Q_l(X) + t.Add(&t, &t0) // linPol += l(ζ)*Ql(X) + t0.Mul(&cqr[i], &rZeta) //r(ζ)*Qr(X) + t.Add(&t, &t0) // linPol += r(ζ)*Qr(X) + t0.Mul(&cqo[i], &oZeta) // o(ζ)*Qo(X) + t.Add(&t, &t0) // linPol += o(ζ)*Qo(X) + t.Add(&t, &cqk[i]) // linPol += Qk(X) + for j := range qcpZeta { // linPol += ∑ᵢQcp_(ζ)Pi_(X) t0.Mul(&pi2Canonical[j][i], &qcpZeta[j]) t.Add(&t, &t0) } } - t0.Mul(&blindedZCanonical[i], &lagrangeZeta) - blindedZCanonical[i].Add(&t, &t0) // finish the computation + t0.Mul(&blindedZCanonical[i], &alphaSquareLagrangeZero) // α²L₁(ζ)Z(X) + blindedZCanonical[i].Add(&t, &t0) // linPol += α²L₁(ζ)Z(X) + + // if statistical zeroknowledge is deactivated, len(h1)=len(h2)=len(h3)=len(blindedZ)-1. + // Else len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 + if i < len(h3) { + t.Mul(&h3[i], &zetaNPlusTwo). + Add(&t, &h2[i]). + Mul(&t, &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } else { + if s.opt.StatisticalZK { + t.Mul(&h2[i], &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } + } } }) + return blindedZCanonical } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/setup.go index 8035bbed8a..7a6a4b5ac9 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/setup.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/setup.go @@ -18,7 +18,6 @@ package plonk import ( "fmt" - "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bls24-315/fr" "github.com/consensys/gnark-crypto/ecc/bls24-315/fr/fft" "github.com/consensys/gnark-crypto/ecc/bls24-315/fr/iop" @@ -96,7 +95,7 @@ func Setup(spr *cs.SparseR1CS, srs, srsLagrange kzg.SRS) (*ProvingKey, *Verifyin // step 0: set the fft domains domain := initFFTDomain(spr) if domain.Cardinality < 2 { - return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", spr.GetNbConstraints()) + return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", len(spr.Public)+spr.GetNbConstraints()) } // check the size of the kzg srs. @@ -154,9 +153,7 @@ func (pk *ProvingKey) VerifyingKey() interface{} { func NewTrace(spr *cs.SparseR1CS, domain *fft.Domain) *Trace { var trace Trace - nbConstraints := spr.GetNbConstraints() - sizeSystem := uint64(nbConstraints + len(spr.Public)) - size := ecc.NextPowerOfTwo(sizeSystem) + size := int(domain.Cardinality) commitmentInfo := spr.CommitmentInfo.(constraint.PlonkCommitments) ql := make([]fr.Element, size) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/verify.go index 64076b69b5..2a646df122 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-315/verify.go @@ -22,6 +22,7 @@ import ( "io" "math/big" + "github.com/consensys/gnark/backend/solidity" "time" "github.com/consensys/gnark-crypto/ecc" @@ -39,11 +40,13 @@ import ( ) var ( - errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") - errInvalidWitness = errors.New("witness length is invalid") + errAlgebraicRelation = errors.New("algebraic relation does not hold") + errInvalidWitness = errors.New("witness length is invalid") + errInvalidPoint = errors.New("point is not on the curve") ) func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { + log := logger.Logger().With().Str("curve", "bls24-315").Str("backend", "plonk").Logger() start := time.Now() cfg, err := backend.NewVerifierConfig(opts...) @@ -59,6 +62,32 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return errInvalidWitness } + // check that the points in the proof are on the curve + for i := 0; i < len(proof.LRO); i++ { + if !proof.LRO[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.Z.IsInSubGroup() { + return errInvalidPoint + } + for i := 0; i < len(proof.H); i++ { + if !proof.H[i].IsInSubGroup() { + return errInvalidPoint + } + } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + if !proof.Bsb22Commitments[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.BatchedProof.H.IsInSubGroup() { + return errInvalidPoint + } + if !proof.ZShiftedOpening.H.IsInSubGroup() { + return errInvalidPoint + } + // transcript to derive the challenge fs := fiatshamir.NewTranscript(cfg.ChallengeHash, "gamma", "beta", "alpha", "zeta") @@ -79,7 +108,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // derive alpha from Comm(l), Comm(r), Comm(o), Com(Z), Bsb22Commitments + // derive alpha from Com(Z), Bsb22Commitments alphaDeps := make([]*curve.G1Affine, len(proof.Bsb22Commitments)+1) for i := range proof.Bsb22Commitments { alphaDeps[i] = &proof.Bsb22Commitments[i] @@ -96,37 +125,42 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // evaluation of Z=Xⁿ⁻¹ at ζ - var zetaPowerM, zzeta fr.Element + // evaluation of zhZeta=ζⁿ-1 + var zetaPowerM, zhZeta, lagrangeZero fr.Element var bExpo big.Int one := fr.One() bExpo.SetUint64(vk.Size) zetaPowerM.Exp(zeta, &bExpo) - zzeta.Sub(&zetaPowerM, &one) + zhZeta.Sub(&zetaPowerM, &one) // ζⁿ-1 + lagrangeZero.Sub(&zeta, &one). // ζ-1 + Inverse(&lagrangeZero). // 1/(ζ-1) + Mul(&lagrangeZero, &zhZeta). // (ζ^n-1)/(ζ-1) + Mul(&lagrangeZero, &vk.SizeInv) // 1/n * (ζ^n-1)/(ζ-1) // compute PI = ∑_{i if the poly is shifted and in canonical form the index is computed differently - const ( id_L int = iota id_R @@ -101,12 +96,12 @@ type Proof struct { // Commitment to Z, the permutation polynomial Z kzg.Digest - // Commitments to h1, h2, h3 such that h = h1 + Xh2 + X**2h3 is the quotient polynomial + // Commitments to h1, h2, h3 such that h = h1 + Xⁿ⁺²*h2 + X²⁽ⁿ⁺²⁾*h3 is the quotient polynomial H [3]kzg.Digest Bsb22Commitments []kzg.Digest - // Batch opening proof of h1 + zeta*h2 + zeta**2h3, linearizedPolynomial, l, r, o, s1, s2, qCPrime + // Batch opening proof of linearizedPolynomial, l, r, o, s1, s2, qCPrime BatchedProof kzg.BatchOpeningProof // Opening proof of Z at zeta*mu @@ -151,14 +146,11 @@ func Prove(spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts g.Go(instance.buildRatioCopyConstraint) // compute h - g.Go(instance.evaluateConstraints) + g.Go(instance.computeQuotient) // open Z (blinded) at ωζ (proof.ZShiftedOpening) g.Go(instance.openZ) - // fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) - g.Go(instance.foldH) - // linearized polynomial g.Go(instance.computeLinearizedPolynomial) @@ -187,13 +179,11 @@ type instance struct { htfFunc hash.Hash // hash to field function // polynomials - x []*iop.Polynomial // x stores tracks the polynomial we need - bp []*iop.Polynomial // blinding polynomials - h *iop.Polynomial // h is the quotient polynomial - blindedZ []fr.Element // blindedZ is the blinded version of Z - - foldedH []fr.Element // foldedH is the folded version of H - foldedHDigest kzg.Digest // foldedHDigest is the kzg commitment of foldedH + x []*iop.Polynomial // x stores tracks the polynomial we need + bp []*iop.Polynomial // blinding polynomials + h *iop.Polynomial // h is the quotient polynomial + blindedZ []fr.Element // blindedZ is the blinded version of Z + quotientShardsRandomizers [2]fr.Element // random elements for blinding the shards of the quotient linearizedPolynomial []fr.Element linearizedPolynomialDigest kzg.Digest @@ -217,7 +207,6 @@ type instance struct { chRestoreLRO, chZOpening, chLinearizedPolynomial, - chFoldedH, chGammaBeta chan struct{} domain0, domain1 *fft.Domain @@ -248,7 +237,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi chH: make(chan struct{}, 1), chZOpening: make(chan struct{}, 1), chLinearizedPolynomial: make(chan struct{}, 1), - chFoldedH: make(chan struct{}, 1), chRestoreLRO: make(chan struct{}, 1), } s.initBSB22Commitments() @@ -259,6 +247,12 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi sizeSystem := uint64(nbConstraints + len(spr.Public)) // len(spr.Public) is for the placeholder constraints s.domain0 = fft.NewDomain(sizeSystem) + // sampling random numbers for blinding the quotient + if opts.StatisticalZK { + s.quotientShardsRandomizers[0].SetRandom() + s.quotientShardsRandomizers[1].SetRandom() + } + // h, the quotient polynomial is of degree 3(n+1)+2, so it's in a 3(n+2) dim vector space, // the domain is the next power of 2 superior to 3(n+2). 4*domainNum is enough in all cases // except when n<6. @@ -267,8 +261,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi } else { s.domain1 = fft.NewDomain(4*sizeSystem, fft.WithoutPrecompute()) } - // TODO @gbotrel domain1 is used for only 1 FFT --> precomputing the twiddles - // and storing them in memory is costly given its size. --> do a FFT on the fly // build trace s.trace = NewTrace(spr, s.domain0) @@ -335,7 +327,7 @@ func (s *instance) bsb22Hint(_ *big.Int, ins, outs []*big.Int) error { } // solveConstraints computes the evaluation of the polynomials L, R, O -// and sets x[id_L], x[id_R], x[id_O] in canonical form +// and sets x[id_L], x[id_R], x[id_O] in Lagrange form func (s *instance) solveConstraints() error { _solution, err := s.spr.Solve(s.fullWitness, s.opt.SolverOpts...) if err != nil { @@ -490,8 +482,8 @@ func (s *instance) deriveZeta() (err error) { return } -// evaluateConstraints computes H -func (s *instance) evaluateConstraints() (err error) { +// computeQuotient computes H +func (s *instance) computeQuotient() (err error) { s.x[id_Ql] = s.trace.Ql s.x[id_Qr] = s.trace.Qr s.x[id_Qm] = s.trace.Qm @@ -544,7 +536,7 @@ func (s *instance) evaluateConstraints() (err error) { return err } - s.h, err = divideByXMinusOne(numerator, [2]*fft.Domain{s.domain0, s.domain1}) + s.h, err = divideByZH(numerator, [2]*fft.Domain{s.domain0, s.domain1}) if err != nil { return err } @@ -625,56 +617,40 @@ func (s *instance) openZ() (err error) { } func (s *instance) h1() []fr.Element { - h1 := s.h.Coefficients()[:s.domain0.Cardinality+2] + var h1 []fr.Element + if !s.opt.StatisticalZK { + h1 = s.h.Coefficients()[:s.domain0.Cardinality+2] + } else { + h1 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h1, s.h.Coefficients()[:s.domain0.Cardinality+2]) + h1[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[0]) + } return h1 } func (s *instance) h2() []fr.Element { - h2 := s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + var h2 []fr.Element + if !s.opt.StatisticalZK { + h2 = s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + } else { + h2 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h2, s.h.Coefficients()[s.domain0.Cardinality+2:2*(s.domain0.Cardinality+2)]) + h2[0].Sub(&h2[0], &s.quotientShardsRandomizers[0]) + h2[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[1]) + } return h2 } func (s *instance) h3() []fr.Element { - h3 := s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] - return h3 -} - -// fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) -func (s *instance) foldH() error { - // wait for H to be committed and zeta to be derived (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chH: - } - var n big.Int - n.SetUint64(s.domain0.Cardinality + 2) - - var zetaPowerNplusTwo fr.Element - zetaPowerNplusTwo.Exp(s.zeta, &n) - zetaPowerNplusTwo.BigInt(&n) - - s.foldedHDigest.ScalarMultiplication(&s.proof.H[2], &n) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[1]) // ζᵐ⁺²*Comm(h3) - s.foldedHDigest.ScalarMultiplication(&s.foldedHDigest, &n) // ζ²⁽ᵐ⁺²⁾*Comm(h3) + ζᵐ⁺²*Comm(h2) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[0]) - - // fold H (H₀ + ζᵐ⁺²*H₁ + ζ²⁽ᵐ⁺²⁾H₂)) - h1 := s.h1() - h2 := s.h2() - s.foldedH = s.h3() - - for i := 0; i < int(s.domain0.Cardinality)+2; i++ { - s.foldedH[i]. - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h2[i]). - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h1[i]) + var h3 []fr.Element + if !s.opt.StatisticalZK { + h3 = s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] + } else { + h3 = make([]fr.Element, s.domain0.Cardinality+2) + copy(h3, s.h.Coefficients()[2*(s.domain0.Cardinality+2):3*(s.domain0.Cardinality+2)]) + h3[0].Sub(&h3[0], &s.quotientShardsRandomizers[1]) } - - close(s.chFoldedH) - - return nil + return h3 } func (s *instance) computeLinearizedPolynomial() error { @@ -749,20 +725,6 @@ func (s *instance) computeLinearizedPolynomial() error { func (s *instance) batchOpening() error { - // wait for LRO to be committed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chLRO: - } - - // wait for foldedH to be computed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chFoldedH: - } - // wait for linearizedPolynomial to be computed (or ctx.Done()) select { case <-s.ctx.Done(): @@ -771,27 +733,25 @@ func (s *instance) batchOpening() error { } polysQcp := coefficients(s.trace.Qcp) - polysToOpen := make([][]fr.Element, 7+len(polysQcp)) - copy(polysToOpen[7:], polysQcp) - - polysToOpen[0] = s.foldedH - polysToOpen[1] = s.linearizedPolynomial - polysToOpen[2] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) - polysToOpen[3] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) - polysToOpen[4] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) - polysToOpen[5] = s.trace.S1.Coefficients() - polysToOpen[6] = s.trace.S2.Coefficients() - - digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+7) - copy(digestsToOpen[7:], s.pk.Vk.Qcp) - - digestsToOpen[0] = s.foldedHDigest - digestsToOpen[1] = s.linearizedPolynomialDigest - digestsToOpen[2] = s.proof.LRO[0] - digestsToOpen[3] = s.proof.LRO[1] - digestsToOpen[4] = s.proof.LRO[2] - digestsToOpen[5] = s.pk.Vk.S[0] - digestsToOpen[6] = s.pk.Vk.S[1] + polysToOpen := make([][]fr.Element, 6+len(polysQcp)) + copy(polysToOpen[6:], polysQcp) + + polysToOpen[0] = s.linearizedPolynomial + polysToOpen[1] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) + polysToOpen[2] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) + polysToOpen[3] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) + polysToOpen[4] = s.trace.S1.Coefficients() + polysToOpen[5] = s.trace.S2.Coefficients() + + digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+6) + copy(digestsToOpen[6:], s.pk.Vk.Qcp) + + digestsToOpen[0] = s.linearizedPolynomialDigest + digestsToOpen[1] = s.proof.LRO[0] + digestsToOpen[2] = s.proof.LRO[1] + digestsToOpen[3] = s.proof.LRO[2] + digestsToOpen[4] = s.pk.Vk.S[0] + digestsToOpen[5] = s.pk.Vk.S[1] var err error s.proof.BatchedProof, err = kzg.BatchOpenSinglePoint( @@ -834,7 +794,7 @@ func (s *instance) computeNumerator() (*iop.Polynomial, error) { case <-s.chQk: } - nbBsbGates := (len(s.x) - id_Qci + 1) >> 1 + nbBsbGates := len(s.proof.Bsb22Commitments) gateConstraint := func(u ...fr.Element) fr.Element { @@ -1139,7 +1099,7 @@ func evaluateBlinded(p, bp *iop.Polynomial, zeta fr.Element) fr.Element { return pEvaluatedAtZeta } -// /!\ modifies p's underlying array of coefficients, in particular the size changes +// /!\ modifies the size func getBlindedCoefficients(p, bp *iop.Polynomial) []fr.Element { cp := p.Coefficients() cbp := bp.Coefficients() @@ -1212,10 +1172,10 @@ func commitToQuotient(h1, h2, h3 []fr.Element, proof *Proof, kzgPk kzg.ProvingKe return g.Wait() } -// divideByXMinusOne +// divideByZH // The input must be in LagrangeCoset. // The result is in Canonical Regular. (in place using a) -func divideByXMinusOne(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { +func divideByZH(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { // check that the basis is LagrangeCoset if a.Basis != iop.LagrangeCoset || a.Layout != iop.BitReverse { @@ -1255,7 +1215,7 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { res[0].Exp(domains[1].FrMultiplicativeGen, expo) var t fr.Element - t.Exp(domains[1].Generator, big.NewInt(int64(domains[0].Cardinality))) + t.Exp(domains[1].Generator, expo) one := fr.One() @@ -1279,16 +1239,24 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { // The Linearized polynomial is: // // α²*L₁(ζ)*Z(X) -// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) -// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) +// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(β*s3(X))*Z(μζ) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) +// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) +// - Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) +// +// /!\ blindedZCanonical is modified func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, gamma, zeta, zu fr.Element, qcpZeta, blindedZCanonical []fr.Element, pi2Canonical [][]fr.Element, pk *ProvingKey) []fr.Element { - // TODO @gbotrel rename - // first part: individual constraints + + // l(ζ)r(ζ) var rl fr.Element rl.Mul(&rZeta, &lZeta) - // second part: - // Z(μζ)(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*s3(X)-Z(X)(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ) + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + // the linearised polynomial is + // α²*L₁(ζ)*Z(X) + + // s1*s3(X)+s2*Z(X) + l(ζ)*Ql(X) + + // l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) - + // Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) var s1, s2 fr.Element chS1 := make(chan struct{}, 1) go func() { @@ -1296,11 +1264,11 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s1.Mul(&s1, &beta).Add(&s1, &lZeta).Add(&s1, &gamma) // (l(ζ)+β*s1(ζ)+γ) close(chS1) }() - // ps2 := iop.NewPolynomial(&pk.S2Canonical, iop.Form{Basis: iop.Canonical, Layout: iop.Regular}) + tmp := s.trace.S2.Evaluate(zeta) // s2(ζ) tmp.Mul(&tmp, &beta).Add(&tmp, &rZeta).Add(&tmp, &gamma) // (r(ζ)+β*s2(ζ)+γ) <-chS1 - s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta) // (l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta).Mul(&s1, &alpha) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*Z(μζ)*α var uzeta, uuzeta fr.Element uzeta.Mul(&zeta, &pk.Vk.CosetShift) @@ -1311,27 +1279,36 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ) tmp.Mul(&beta, &uuzeta).Add(&tmp, &oZeta).Add(&tmp, &gamma) // (o(ζ)+β*u²*ζ+γ) s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - s2.Neg(&s2) // -(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + s2.Neg(&s2).Mul(&s2, &alpha) - // third part L₁(ζ)*α²*Z - var lagrangeZeta, one, den, frNbElmt fr.Element + // Z_h(ζ), ζⁿ⁺², L₁(ζ)*α²*Z + var zhZeta, zetaNPlusTwo, alphaSquareLagrangeZero, one, den, frNbElmt fr.Element one.SetOne() nbElmt := int64(s.domain0.Cardinality) - lagrangeZeta.Set(&zeta). - Exp(lagrangeZeta, big.NewInt(nbElmt)). - Sub(&lagrangeZeta, &one) + alphaSquareLagrangeZero.Set(&zeta).Exp(alphaSquareLagrangeZero, big.NewInt(nbElmt)) // ζⁿ + zetaNPlusTwo.Mul(&alphaSquareLagrangeZero, &zeta).Mul(&zetaNPlusTwo, &zeta) // ζⁿ⁺² + alphaSquareLagrangeZero.Sub(&alphaSquareLagrangeZero, &one) // ζⁿ - 1 + zhZeta.Set(&alphaSquareLagrangeZero) // Z_h(ζ) = ζⁿ - 1 frNbElmt.SetUint64(uint64(nbElmt)) - den.Sub(&zeta, &one). - Inverse(&den) - lagrangeZeta.Mul(&lagrangeZeta, &den). // L₁ = (ζⁿ⁻¹)/(ζ-1) - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &s.domain0.CardinalityInv) // (1/n)*α²*L₁(ζ) + den.Sub(&zeta, &one).Inverse(&den) // 1/(ζ-1) + alphaSquareLagrangeZero.Mul(&alphaSquareLagrangeZero, &den). // L₁ = (ζⁿ - 1)/(ζ-1) + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &s.domain0.CardinalityInv) // α²*L₁(ζ) s3canonical := s.trace.S3.Coefficients() s.trace.Qk.ToCanonical(s.domain0).ToRegular() + // len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 when Statistical ZK is activated + // len(h1)=len(h2)=len(h3)=len(blindedZCanonical)-1 when Statistical ZK is deactivated + h1 := s.h1() + h2 := s.h2() + h3 := s.h3() + + // at this stage we have + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) utils.Parallelize(len(blindedZCanonical), func(start, end int) { cql := s.trace.Ql.Coefficients() @@ -1343,45 +1320,50 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, var t, t0, t1 fr.Element for i := start; i < end; i++ { - - t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - + t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) if i < len(s3canonical) { - - t0.Mul(&s3canonical[i], &s1) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*β*s3(X) - + t0.Mul(&s3canonical[i], &s1) // α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ)*β*s3(X) t.Add(&t, &t0) } - - t.Mul(&t, &alpha) // α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ)) - if i < len(cqm) { - - t1.Mul(&cqm[i], &rl) // linPol = linPol + l(ζ)r(ζ)*Qm(X) - - t0.Mul(&cql[i], &lZeta) - t0.Add(&t0, &t1) - - t.Add(&t, &t0) // linPol = linPol + l(ζ)*Ql(X) - - t0.Mul(&cqr[i], &rZeta) - t.Add(&t, &t0) // linPol = linPol + r(ζ)*Qr(X) - - t0.Mul(&cqo[i], &oZeta) - t0.Add(&t0, &cqk[i]) - - t.Add(&t, &t0) // linPol = linPol + o(ζ)*Qo(X) + Qk(X) - - for j := range qcpZeta { + t1.Mul(&cqm[i], &rl) // l(ζ)r(ζ)*Qm(X) + t.Add(&t, &t1) // linPol += l(ζ)r(ζ)*Qm(X) + t0.Mul(&cql[i], &lZeta) // l(ζ)Q_l(X) + t.Add(&t, &t0) // linPol += l(ζ)*Ql(X) + t0.Mul(&cqr[i], &rZeta) //r(ζ)*Qr(X) + t.Add(&t, &t0) // linPol += r(ζ)*Qr(X) + t0.Mul(&cqo[i], &oZeta) // o(ζ)*Qo(X) + t.Add(&t, &t0) // linPol += o(ζ)*Qo(X) + t.Add(&t, &cqk[i]) // linPol += Qk(X) + for j := range qcpZeta { // linPol += ∑ᵢQcp_(ζ)Pi_(X) t0.Mul(&pi2Canonical[j][i], &qcpZeta[j]) t.Add(&t, &t0) } } - t0.Mul(&blindedZCanonical[i], &lagrangeZeta) - blindedZCanonical[i].Add(&t, &t0) // finish the computation + t0.Mul(&blindedZCanonical[i], &alphaSquareLagrangeZero) // α²L₁(ζ)Z(X) + blindedZCanonical[i].Add(&t, &t0) // linPol += α²L₁(ζ)Z(X) + + // if statistical zeroknowledge is deactivated, len(h1)=len(h2)=len(h3)=len(blindedZ)-1. + // Else len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 + if i < len(h3) { + t.Mul(&h3[i], &zetaNPlusTwo). + Add(&t, &h2[i]). + Mul(&t, &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } else { + if s.opt.StatisticalZK { + t.Mul(&h2[i], &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } + } } }) + return blindedZCanonical } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/setup.go index 1359bb5097..212657f6a0 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/setup.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/setup.go @@ -18,7 +18,6 @@ package plonk import ( "fmt" - "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bls24-317/fr" "github.com/consensys/gnark-crypto/ecc/bls24-317/fr/fft" "github.com/consensys/gnark-crypto/ecc/bls24-317/fr/iop" @@ -96,7 +95,7 @@ func Setup(spr *cs.SparseR1CS, srs, srsLagrange kzg.SRS) (*ProvingKey, *Verifyin // step 0: set the fft domains domain := initFFTDomain(spr) if domain.Cardinality < 2 { - return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", spr.GetNbConstraints()) + return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", len(spr.Public)+spr.GetNbConstraints()) } // check the size of the kzg srs. @@ -154,9 +153,7 @@ func (pk *ProvingKey) VerifyingKey() interface{} { func NewTrace(spr *cs.SparseR1CS, domain *fft.Domain) *Trace { var trace Trace - nbConstraints := spr.GetNbConstraints() - sizeSystem := uint64(nbConstraints + len(spr.Public)) - size := ecc.NextPowerOfTwo(sizeSystem) + size := int(domain.Cardinality) commitmentInfo := spr.CommitmentInfo.(constraint.PlonkCommitments) ql := make([]fr.Element, size) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/verify.go index ceda45d811..a5d7049753 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bls24-317/verify.go @@ -22,6 +22,7 @@ import ( "io" "math/big" + "github.com/consensys/gnark/backend/solidity" "time" "github.com/consensys/gnark-crypto/ecc" @@ -39,11 +40,13 @@ import ( ) var ( - errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") - errInvalidWitness = errors.New("witness length is invalid") + errAlgebraicRelation = errors.New("algebraic relation does not hold") + errInvalidWitness = errors.New("witness length is invalid") + errInvalidPoint = errors.New("point is not on the curve") ) func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { + log := logger.Logger().With().Str("curve", "bls24-317").Str("backend", "plonk").Logger() start := time.Now() cfg, err := backend.NewVerifierConfig(opts...) @@ -59,6 +62,32 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return errInvalidWitness } + // check that the points in the proof are on the curve + for i := 0; i < len(proof.LRO); i++ { + if !proof.LRO[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.Z.IsInSubGroup() { + return errInvalidPoint + } + for i := 0; i < len(proof.H); i++ { + if !proof.H[i].IsInSubGroup() { + return errInvalidPoint + } + } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + if !proof.Bsb22Commitments[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.BatchedProof.H.IsInSubGroup() { + return errInvalidPoint + } + if !proof.ZShiftedOpening.H.IsInSubGroup() { + return errInvalidPoint + } + // transcript to derive the challenge fs := fiatshamir.NewTranscript(cfg.ChallengeHash, "gamma", "beta", "alpha", "zeta") @@ -79,7 +108,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // derive alpha from Comm(l), Comm(r), Comm(o), Com(Z), Bsb22Commitments + // derive alpha from Com(Z), Bsb22Commitments alphaDeps := make([]*curve.G1Affine, len(proof.Bsb22Commitments)+1) for i := range proof.Bsb22Commitments { alphaDeps[i] = &proof.Bsb22Commitments[i] @@ -96,37 +125,42 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // evaluation of Z=Xⁿ⁻¹ at ζ - var zetaPowerM, zzeta fr.Element + // evaluation of zhZeta=ζⁿ-1 + var zetaPowerM, zhZeta, lagrangeZero fr.Element var bExpo big.Int one := fr.One() bExpo.SetUint64(vk.Size) zetaPowerM.Exp(zeta, &bExpo) - zzeta.Sub(&zetaPowerM, &one) + zhZeta.Sub(&zetaPowerM, &one) // ζⁿ-1 + lagrangeZero.Sub(&zeta, &one). // ζ-1 + Inverse(&lagrangeZero). // 1/(ζ-1) + Mul(&lagrangeZero, &zhZeta). // (ζ^n-1)/(ζ-1) + Mul(&lagrangeZero, &vk.SizeInv) // 1/n * (ζ^n-1)/(ζ-1) // compute PI = ∑_{i if the poly is shifted and in canonical form the index is computed differently - const ( id_L int = iota id_R @@ -101,12 +96,12 @@ type Proof struct { // Commitment to Z, the permutation polynomial Z kzg.Digest - // Commitments to h1, h2, h3 such that h = h1 + Xh2 + X**2h3 is the quotient polynomial + // Commitments to h1, h2, h3 such that h = h1 + Xⁿ⁺²*h2 + X²⁽ⁿ⁺²⁾*h3 is the quotient polynomial H [3]kzg.Digest Bsb22Commitments []kzg.Digest - // Batch opening proof of h1 + zeta*h2 + zeta**2h3, linearizedPolynomial, l, r, o, s1, s2, qCPrime + // Batch opening proof of linearizedPolynomial, l, r, o, s1, s2, qCPrime BatchedProof kzg.BatchOpeningProof // Opening proof of Z at zeta*mu @@ -151,14 +146,11 @@ func Prove(spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts g.Go(instance.buildRatioCopyConstraint) // compute h - g.Go(instance.evaluateConstraints) + g.Go(instance.computeQuotient) // open Z (blinded) at ωζ (proof.ZShiftedOpening) g.Go(instance.openZ) - // fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) - g.Go(instance.foldH) - // linearized polynomial g.Go(instance.computeLinearizedPolynomial) @@ -187,13 +179,11 @@ type instance struct { htfFunc hash.Hash // hash to field function // polynomials - x []*iop.Polynomial // x stores tracks the polynomial we need - bp []*iop.Polynomial // blinding polynomials - h *iop.Polynomial // h is the quotient polynomial - blindedZ []fr.Element // blindedZ is the blinded version of Z - - foldedH []fr.Element // foldedH is the folded version of H - foldedHDigest kzg.Digest // foldedHDigest is the kzg commitment of foldedH + x []*iop.Polynomial // x stores tracks the polynomial we need + bp []*iop.Polynomial // blinding polynomials + h *iop.Polynomial // h is the quotient polynomial + blindedZ []fr.Element // blindedZ is the blinded version of Z + quotientShardsRandomizers [2]fr.Element // random elements for blinding the shards of the quotient linearizedPolynomial []fr.Element linearizedPolynomialDigest kzg.Digest @@ -217,7 +207,6 @@ type instance struct { chRestoreLRO, chZOpening, chLinearizedPolynomial, - chFoldedH, chGammaBeta chan struct{} domain0, domain1 *fft.Domain @@ -248,7 +237,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi chH: make(chan struct{}, 1), chZOpening: make(chan struct{}, 1), chLinearizedPolynomial: make(chan struct{}, 1), - chFoldedH: make(chan struct{}, 1), chRestoreLRO: make(chan struct{}, 1), } s.initBSB22Commitments() @@ -259,6 +247,12 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi sizeSystem := uint64(nbConstraints + len(spr.Public)) // len(spr.Public) is for the placeholder constraints s.domain0 = fft.NewDomain(sizeSystem) + // sampling random numbers for blinding the quotient + if opts.StatisticalZK { + s.quotientShardsRandomizers[0].SetRandom() + s.quotientShardsRandomizers[1].SetRandom() + } + // h, the quotient polynomial is of degree 3(n+1)+2, so it's in a 3(n+2) dim vector space, // the domain is the next power of 2 superior to 3(n+2). 4*domainNum is enough in all cases // except when n<6. @@ -267,8 +261,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi } else { s.domain1 = fft.NewDomain(4*sizeSystem, fft.WithoutPrecompute()) } - // TODO @gbotrel domain1 is used for only 1 FFT --> precomputing the twiddles - // and storing them in memory is costly given its size. --> do a FFT on the fly // build trace s.trace = NewTrace(spr, s.domain0) @@ -335,7 +327,7 @@ func (s *instance) bsb22Hint(_ *big.Int, ins, outs []*big.Int) error { } // solveConstraints computes the evaluation of the polynomials L, R, O -// and sets x[id_L], x[id_R], x[id_O] in canonical form +// and sets x[id_L], x[id_R], x[id_O] in Lagrange form func (s *instance) solveConstraints() error { _solution, err := s.spr.Solve(s.fullWitness, s.opt.SolverOpts...) if err != nil { @@ -490,8 +482,8 @@ func (s *instance) deriveZeta() (err error) { return } -// evaluateConstraints computes H -func (s *instance) evaluateConstraints() (err error) { +// computeQuotient computes H +func (s *instance) computeQuotient() (err error) { s.x[id_Ql] = s.trace.Ql s.x[id_Qr] = s.trace.Qr s.x[id_Qm] = s.trace.Qm @@ -544,7 +536,7 @@ func (s *instance) evaluateConstraints() (err error) { return err } - s.h, err = divideByXMinusOne(numerator, [2]*fft.Domain{s.domain0, s.domain1}) + s.h, err = divideByZH(numerator, [2]*fft.Domain{s.domain0, s.domain1}) if err != nil { return err } @@ -625,56 +617,40 @@ func (s *instance) openZ() (err error) { } func (s *instance) h1() []fr.Element { - h1 := s.h.Coefficients()[:s.domain0.Cardinality+2] + var h1 []fr.Element + if !s.opt.StatisticalZK { + h1 = s.h.Coefficients()[:s.domain0.Cardinality+2] + } else { + h1 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h1, s.h.Coefficients()[:s.domain0.Cardinality+2]) + h1[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[0]) + } return h1 } func (s *instance) h2() []fr.Element { - h2 := s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + var h2 []fr.Element + if !s.opt.StatisticalZK { + h2 = s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + } else { + h2 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h2, s.h.Coefficients()[s.domain0.Cardinality+2:2*(s.domain0.Cardinality+2)]) + h2[0].Sub(&h2[0], &s.quotientShardsRandomizers[0]) + h2[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[1]) + } return h2 } func (s *instance) h3() []fr.Element { - h3 := s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] - return h3 -} - -// fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) -func (s *instance) foldH() error { - // wait for H to be committed and zeta to be derived (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chH: - } - var n big.Int - n.SetUint64(s.domain0.Cardinality + 2) - - var zetaPowerNplusTwo fr.Element - zetaPowerNplusTwo.Exp(s.zeta, &n) - zetaPowerNplusTwo.BigInt(&n) - - s.foldedHDigest.ScalarMultiplication(&s.proof.H[2], &n) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[1]) // ζᵐ⁺²*Comm(h3) - s.foldedHDigest.ScalarMultiplication(&s.foldedHDigest, &n) // ζ²⁽ᵐ⁺²⁾*Comm(h3) + ζᵐ⁺²*Comm(h2) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[0]) - - // fold H (H₀ + ζᵐ⁺²*H₁ + ζ²⁽ᵐ⁺²⁾H₂)) - h1 := s.h1() - h2 := s.h2() - s.foldedH = s.h3() - - for i := 0; i < int(s.domain0.Cardinality)+2; i++ { - s.foldedH[i]. - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h2[i]). - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h1[i]) + var h3 []fr.Element + if !s.opt.StatisticalZK { + h3 = s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] + } else { + h3 = make([]fr.Element, s.domain0.Cardinality+2) + copy(h3, s.h.Coefficients()[2*(s.domain0.Cardinality+2):3*(s.domain0.Cardinality+2)]) + h3[0].Sub(&h3[0], &s.quotientShardsRandomizers[1]) } - - close(s.chFoldedH) - - return nil + return h3 } func (s *instance) computeLinearizedPolynomial() error { @@ -749,20 +725,6 @@ func (s *instance) computeLinearizedPolynomial() error { func (s *instance) batchOpening() error { - // wait for LRO to be committed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chLRO: - } - - // wait for foldedH to be computed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chFoldedH: - } - // wait for linearizedPolynomial to be computed (or ctx.Done()) select { case <-s.ctx.Done(): @@ -771,27 +733,25 @@ func (s *instance) batchOpening() error { } polysQcp := coefficients(s.trace.Qcp) - polysToOpen := make([][]fr.Element, 7+len(polysQcp)) - copy(polysToOpen[7:], polysQcp) - - polysToOpen[0] = s.foldedH - polysToOpen[1] = s.linearizedPolynomial - polysToOpen[2] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) - polysToOpen[3] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) - polysToOpen[4] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) - polysToOpen[5] = s.trace.S1.Coefficients() - polysToOpen[6] = s.trace.S2.Coefficients() - - digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+7) - copy(digestsToOpen[7:], s.pk.Vk.Qcp) - - digestsToOpen[0] = s.foldedHDigest - digestsToOpen[1] = s.linearizedPolynomialDigest - digestsToOpen[2] = s.proof.LRO[0] - digestsToOpen[3] = s.proof.LRO[1] - digestsToOpen[4] = s.proof.LRO[2] - digestsToOpen[5] = s.pk.Vk.S[0] - digestsToOpen[6] = s.pk.Vk.S[1] + polysToOpen := make([][]fr.Element, 6+len(polysQcp)) + copy(polysToOpen[6:], polysQcp) + + polysToOpen[0] = s.linearizedPolynomial + polysToOpen[1] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) + polysToOpen[2] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) + polysToOpen[3] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) + polysToOpen[4] = s.trace.S1.Coefficients() + polysToOpen[5] = s.trace.S2.Coefficients() + + digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+6) + copy(digestsToOpen[6:], s.pk.Vk.Qcp) + + digestsToOpen[0] = s.linearizedPolynomialDigest + digestsToOpen[1] = s.proof.LRO[0] + digestsToOpen[2] = s.proof.LRO[1] + digestsToOpen[3] = s.proof.LRO[2] + digestsToOpen[4] = s.pk.Vk.S[0] + digestsToOpen[5] = s.pk.Vk.S[1] var err error s.proof.BatchedProof, err = kzg.BatchOpenSinglePoint( @@ -834,7 +794,7 @@ func (s *instance) computeNumerator() (*iop.Polynomial, error) { case <-s.chQk: } - nbBsbGates := (len(s.x) - id_Qci + 1) >> 1 + nbBsbGates := len(s.proof.Bsb22Commitments) gateConstraint := func(u ...fr.Element) fr.Element { @@ -1139,7 +1099,7 @@ func evaluateBlinded(p, bp *iop.Polynomial, zeta fr.Element) fr.Element { return pEvaluatedAtZeta } -// /!\ modifies p's underlying array of coefficients, in particular the size changes +// /!\ modifies the size func getBlindedCoefficients(p, bp *iop.Polynomial) []fr.Element { cp := p.Coefficients() cbp := bp.Coefficients() @@ -1212,10 +1172,10 @@ func commitToQuotient(h1, h2, h3 []fr.Element, proof *Proof, kzgPk kzg.ProvingKe return g.Wait() } -// divideByXMinusOne +// divideByZH // The input must be in LagrangeCoset. // The result is in Canonical Regular. (in place using a) -func divideByXMinusOne(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { +func divideByZH(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { // check that the basis is LagrangeCoset if a.Basis != iop.LagrangeCoset || a.Layout != iop.BitReverse { @@ -1255,7 +1215,7 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { res[0].Exp(domains[1].FrMultiplicativeGen, expo) var t fr.Element - t.Exp(domains[1].Generator, big.NewInt(int64(domains[0].Cardinality))) + t.Exp(domains[1].Generator, expo) one := fr.One() @@ -1279,16 +1239,24 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { // The Linearized polynomial is: // // α²*L₁(ζ)*Z(X) -// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) -// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) +// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(β*s3(X))*Z(μζ) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) +// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) +// - Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) +// +// /!\ blindedZCanonical is modified func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, gamma, zeta, zu fr.Element, qcpZeta, blindedZCanonical []fr.Element, pi2Canonical [][]fr.Element, pk *ProvingKey) []fr.Element { - // TODO @gbotrel rename - // first part: individual constraints + + // l(ζ)r(ζ) var rl fr.Element rl.Mul(&rZeta, &lZeta) - // second part: - // Z(μζ)(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*s3(X)-Z(X)(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ) + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + // the linearised polynomial is + // α²*L₁(ζ)*Z(X) + + // s1*s3(X)+s2*Z(X) + l(ζ)*Ql(X) + + // l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) - + // Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) var s1, s2 fr.Element chS1 := make(chan struct{}, 1) go func() { @@ -1296,11 +1264,11 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s1.Mul(&s1, &beta).Add(&s1, &lZeta).Add(&s1, &gamma) // (l(ζ)+β*s1(ζ)+γ) close(chS1) }() - // ps2 := iop.NewPolynomial(&pk.S2Canonical, iop.Form{Basis: iop.Canonical, Layout: iop.Regular}) + tmp := s.trace.S2.Evaluate(zeta) // s2(ζ) tmp.Mul(&tmp, &beta).Add(&tmp, &rZeta).Add(&tmp, &gamma) // (r(ζ)+β*s2(ζ)+γ) <-chS1 - s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta) // (l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta).Mul(&s1, &alpha) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*Z(μζ)*α var uzeta, uuzeta fr.Element uzeta.Mul(&zeta, &pk.Vk.CosetShift) @@ -1311,27 +1279,36 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ) tmp.Mul(&beta, &uuzeta).Add(&tmp, &oZeta).Add(&tmp, &gamma) // (o(ζ)+β*u²*ζ+γ) s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - s2.Neg(&s2) // -(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + s2.Neg(&s2).Mul(&s2, &alpha) - // third part L₁(ζ)*α²*Z - var lagrangeZeta, one, den, frNbElmt fr.Element + // Z_h(ζ), ζⁿ⁺², L₁(ζ)*α²*Z + var zhZeta, zetaNPlusTwo, alphaSquareLagrangeZero, one, den, frNbElmt fr.Element one.SetOne() nbElmt := int64(s.domain0.Cardinality) - lagrangeZeta.Set(&zeta). - Exp(lagrangeZeta, big.NewInt(nbElmt)). - Sub(&lagrangeZeta, &one) + alphaSquareLagrangeZero.Set(&zeta).Exp(alphaSquareLagrangeZero, big.NewInt(nbElmt)) // ζⁿ + zetaNPlusTwo.Mul(&alphaSquareLagrangeZero, &zeta).Mul(&zetaNPlusTwo, &zeta) // ζⁿ⁺² + alphaSquareLagrangeZero.Sub(&alphaSquareLagrangeZero, &one) // ζⁿ - 1 + zhZeta.Set(&alphaSquareLagrangeZero) // Z_h(ζ) = ζⁿ - 1 frNbElmt.SetUint64(uint64(nbElmt)) - den.Sub(&zeta, &one). - Inverse(&den) - lagrangeZeta.Mul(&lagrangeZeta, &den). // L₁ = (ζⁿ⁻¹)/(ζ-1) - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &s.domain0.CardinalityInv) // (1/n)*α²*L₁(ζ) + den.Sub(&zeta, &one).Inverse(&den) // 1/(ζ-1) + alphaSquareLagrangeZero.Mul(&alphaSquareLagrangeZero, &den). // L₁ = (ζⁿ - 1)/(ζ-1) + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &s.domain0.CardinalityInv) // α²*L₁(ζ) s3canonical := s.trace.S3.Coefficients() s.trace.Qk.ToCanonical(s.domain0).ToRegular() + // len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 when Statistical ZK is activated + // len(h1)=len(h2)=len(h3)=len(blindedZCanonical)-1 when Statistical ZK is deactivated + h1 := s.h1() + h2 := s.h2() + h3 := s.h3() + + // at this stage we have + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) utils.Parallelize(len(blindedZCanonical), func(start, end int) { cql := s.trace.Ql.Coefficients() @@ -1343,45 +1320,50 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, var t, t0, t1 fr.Element for i := start; i < end; i++ { - - t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - + t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) if i < len(s3canonical) { - - t0.Mul(&s3canonical[i], &s1) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*β*s3(X) - + t0.Mul(&s3canonical[i], &s1) // α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ)*β*s3(X) t.Add(&t, &t0) } - - t.Mul(&t, &alpha) // α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ)) - if i < len(cqm) { - - t1.Mul(&cqm[i], &rl) // linPol = linPol + l(ζ)r(ζ)*Qm(X) - - t0.Mul(&cql[i], &lZeta) - t0.Add(&t0, &t1) - - t.Add(&t, &t0) // linPol = linPol + l(ζ)*Ql(X) - - t0.Mul(&cqr[i], &rZeta) - t.Add(&t, &t0) // linPol = linPol + r(ζ)*Qr(X) - - t0.Mul(&cqo[i], &oZeta) - t0.Add(&t0, &cqk[i]) - - t.Add(&t, &t0) // linPol = linPol + o(ζ)*Qo(X) + Qk(X) - - for j := range qcpZeta { + t1.Mul(&cqm[i], &rl) // l(ζ)r(ζ)*Qm(X) + t.Add(&t, &t1) // linPol += l(ζ)r(ζ)*Qm(X) + t0.Mul(&cql[i], &lZeta) // l(ζ)Q_l(X) + t.Add(&t, &t0) // linPol += l(ζ)*Ql(X) + t0.Mul(&cqr[i], &rZeta) //r(ζ)*Qr(X) + t.Add(&t, &t0) // linPol += r(ζ)*Qr(X) + t0.Mul(&cqo[i], &oZeta) // o(ζ)*Qo(X) + t.Add(&t, &t0) // linPol += o(ζ)*Qo(X) + t.Add(&t, &cqk[i]) // linPol += Qk(X) + for j := range qcpZeta { // linPol += ∑ᵢQcp_(ζ)Pi_(X) t0.Mul(&pi2Canonical[j][i], &qcpZeta[j]) t.Add(&t, &t0) } } - t0.Mul(&blindedZCanonical[i], &lagrangeZeta) - blindedZCanonical[i].Add(&t, &t0) // finish the computation + t0.Mul(&blindedZCanonical[i], &alphaSquareLagrangeZero) // α²L₁(ζ)Z(X) + blindedZCanonical[i].Add(&t, &t0) // linPol += α²L₁(ζ)Z(X) + + // if statistical zeroknowledge is deactivated, len(h1)=len(h2)=len(h3)=len(blindedZ)-1. + // Else len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 + if i < len(h3) { + t.Mul(&h3[i], &zetaNPlusTwo). + Add(&t, &h2[i]). + Mul(&t, &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } else { + if s.opt.StatisticalZK { + t.Mul(&h2[i], &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } + } } }) + return blindedZCanonical } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/setup.go index 5d916034f6..0b01ec1cf0 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/setup.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/setup.go @@ -18,7 +18,6 @@ package plonk import ( "fmt" - "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/consensys/gnark-crypto/ecc/bn254/fr/fft" "github.com/consensys/gnark-crypto/ecc/bn254/fr/iop" @@ -96,7 +95,7 @@ func Setup(spr *cs.SparseR1CS, srs, srsLagrange kzg.SRS) (*ProvingKey, *Verifyin // step 0: set the fft domains domain := initFFTDomain(spr) if domain.Cardinality < 2 { - return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", spr.GetNbConstraints()) + return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", len(spr.Public)+spr.GetNbConstraints()) } // check the size of the kzg srs. @@ -154,9 +153,7 @@ func (pk *ProvingKey) VerifyingKey() interface{} { func NewTrace(spr *cs.SparseR1CS, domain *fft.Domain) *Trace { var trace Trace - nbConstraints := spr.GetNbConstraints() - sizeSystem := uint64(nbConstraints + len(spr.Public)) - size := ecc.NextPowerOfTwo(sizeSystem) + size := int(domain.Cardinality) commitmentInfo := spr.CommitmentInfo.(constraint.PlonkCommitments) ql := make([]fr.Element, size) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/solidity.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/solidity.go index 02bd82412e..29966d952d 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/solidity.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/solidity.go @@ -18,151 +18,150 @@ const tmplSolidityVerifier = `// SPDX-License-Identifier: Apache-2.0 // Code generated by gnark DO NOT EDIT -pragma solidity ^0.8.19; +pragma solidity {{ .Cfg.PragmaVersion }}; contract PlonkVerifier { uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617; uint256 private constant R_MOD_MINUS_ONE = 21888242871839275222246405745257275088548364400416034343698204186575808495616; uint256 private constant P_MOD = 21888242871839275222246405745257275088696311157297823662689037894645226208583; - {{ range $index, $element := .Kzg.G2 }} + {{ range $index, $element := .Vk.Kzg.G2 }} uint256 private constant G2_SRS_{{ $index }}_X_0 = {{ (fpstr $element.X.A1) }}; uint256 private constant G2_SRS_{{ $index }}_X_1 = {{ (fpstr $element.X.A0) }}; uint256 private constant G2_SRS_{{ $index }}_Y_0 = {{ (fpstr $element.Y.A1) }}; uint256 private constant G2_SRS_{{ $index }}_Y_1 = {{ (fpstr $element.Y.A0) }}; {{ end }} - uint256 private constant G1_SRS_X = {{ fpstr .Kzg.G1.X }}; - uint256 private constant G1_SRS_Y = {{ fpstr .Kzg.G1.Y }}; + uint256 private constant G1_SRS_X = {{ fpstr .Vk.Kzg.G1.X }}; + uint256 private constant G1_SRS_Y = {{ fpstr .Vk.Kzg.G1.Y }}; // ----------------------- vk --------------------- - uint256 private constant VK_NB_PUBLIC_INPUTS = {{ .NbPublicVariables }}; - uint256 private constant VK_DOMAIN_SIZE = {{ .Size }}; - uint256 private constant VK_INV_DOMAIN_SIZE = {{ (frstr .SizeInv) }}; - uint256 private constant VK_OMEGA = {{ (frstr .Generator) }}; - uint256 private constant VK_QL_COM_X = {{ (fpstr .Ql.X) }}; - uint256 private constant VK_QL_COM_Y = {{ (fpstr .Ql.Y) }}; - uint256 private constant VK_QR_COM_X = {{ (fpstr .Qr.X) }}; - uint256 private constant VK_QR_COM_Y = {{ (fpstr .Qr.Y) }}; - uint256 private constant VK_QM_COM_X = {{ (fpstr .Qm.X) }}; - uint256 private constant VK_QM_COM_Y = {{ (fpstr .Qm.Y) }}; - uint256 private constant VK_QO_COM_X = {{ (fpstr .Qo.X) }}; - uint256 private constant VK_QO_COM_Y = {{ (fpstr .Qo.Y) }}; - uint256 private constant VK_QK_COM_X = {{ (fpstr .Qk.X) }}; - uint256 private constant VK_QK_COM_Y = {{ (fpstr .Qk.Y) }}; - {{ range $index, $element := .S }} + uint256 private constant VK_NB_PUBLIC_INPUTS = {{ .Vk.NbPublicVariables }}; + uint256 private constant VK_DOMAIN_SIZE = {{ .Vk.Size }}; + uint256 private constant VK_INV_DOMAIN_SIZE = {{ (frstr .Vk.SizeInv) }}; + uint256 private constant VK_OMEGA = {{ (frstr .Vk.Generator) }}; + uint256 private constant VK_QL_COM_X = {{ (fpstr .Vk.Ql.X) }}; + uint256 private constant VK_QL_COM_Y = {{ (fpstr .Vk.Ql.Y) }}; + uint256 private constant VK_QR_COM_X = {{ (fpstr .Vk.Qr.X) }}; + uint256 private constant VK_QR_COM_Y = {{ (fpstr .Vk.Qr.Y) }}; + uint256 private constant VK_QM_COM_X = {{ (fpstr .Vk.Qm.X) }}; + uint256 private constant VK_QM_COM_Y = {{ (fpstr .Vk.Qm.Y) }}; + uint256 private constant VK_QO_COM_X = {{ (fpstr .Vk.Qo.X) }}; + uint256 private constant VK_QO_COM_Y = {{ (fpstr .Vk.Qo.Y) }}; + uint256 private constant VK_QK_COM_X = {{ (fpstr .Vk.Qk.X) }}; + uint256 private constant VK_QK_COM_Y = {{ (fpstr .Vk.Qk.Y) }}; + {{ range $index, $element := .Vk.S }} uint256 private constant VK_S{{ inc $index }}_COM_X = {{ (fpstr $element.X) }}; uint256 private constant VK_S{{ inc $index }}_COM_Y = {{ (fpstr $element.Y) }}; {{ end }} - uint256 private constant VK_COSET_SHIFT = 5; + uint256 private constant VK_COSET_SHIFT = {{ frstr .Vk.CosetShift }}; - {{ range $index, $element := .Qcp}} + {{ range $index, $element := .Vk.Qcp}} uint256 private constant VK_QCP_{{ $index }}_X = {{ (fpstr $element.X) }}; uint256 private constant VK_QCP_{{ $index }}_Y = {{ (fpstr $element.Y) }}; {{ end }} - {{ range $index, $element := .CommitmentConstraintIndexes -}} - uint256 private constant VK_INDEX_COMMIT_API{{ $index }} = {{ $element }}; + {{ range $index, $element := .Vk.CommitmentConstraintIndexes -}} + uint256 private constant VK_INDEX_COMMIT_API_{{ $index }} = {{ $element }}; {{ end -}} - uint256 private constant VK_NB_CUSTOM_GATES = {{ len .CommitmentConstraintIndexes }}; + uint256 private constant VK_NB_CUSTOM_GATES = {{ len .Vk.CommitmentConstraintIndexes }}; // ------------------------------------------------ + // size of the proof without call custom gate + uint256 private constant FIXED_PROOF_SIZE = 0x300; + // offset proof - uint256 private constant PROOF_L_COM_X = 0x00; - uint256 private constant PROOF_L_COM_Y = 0x20; - uint256 private constant PROOF_R_COM_X = 0x40; - uint256 private constant PROOF_R_COM_Y = 0x60; - uint256 private constant PROOF_O_COM_X = 0x80; - uint256 private constant PROOF_O_COM_Y = 0xa0; + {{ $offset := 0 }} + uint256 private constant PROOF_L_COM_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_L_COM_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_R_COM_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_R_COM_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_O_COM_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_O_COM_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} // h = h_0 + x^{n+2}h_1 + x^{2(n+2)}h_2 - uint256 private constant PROOF_H_0_X = 0xc0; - uint256 private constant PROOF_H_0_Y = 0xe0; - uint256 private constant PROOF_H_1_X = 0x100; - uint256 private constant PROOF_H_1_Y = 0x120; - uint256 private constant PROOF_H_2_X = 0x140; - uint256 private constant PROOF_H_2_Y = 0x160; - - // wire values at zeta - uint256 private constant PROOF_L_AT_ZETA = 0x180; - uint256 private constant PROOF_R_AT_ZETA = 0x1a0; - uint256 private constant PROOF_O_AT_ZETA = 0x1c0; + uint256 private constant PROOF_H_0_COM_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_H_0_COM_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_H_1_COM_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_H_1_COM_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_H_2_COM_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_H_2_COM_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} - //uint256[STATE_WIDTH-1] permutation_polynomials_at_zeta; // Sσ1(zeta),Sσ2(zeta) - uint256 private constant PROOF_S1_AT_ZETA = 0x1e0; // Sσ1(zeta) - uint256 private constant PROOF_S2_AT_ZETA = 0x200; // Sσ2(zeta) + // "evaluations of wire polynomials at zeta + uint256 private constant PROOF_L_AT_ZETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_R_AT_ZETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_O_AT_ZETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} - //Bn254.G1Point grand_product_commitment; // [z(x)] - uint256 private constant PROOF_GRAND_PRODUCT_COMMITMENT_X = 0x220; - uint256 private constant PROOF_GRAND_PRODUCT_COMMITMENT_Y = 0x240; + // S1(zeta),S2(zeta) + uint256 private constant PROOF_S1_AT_ZETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} // Sσ1(zeta) + uint256 private constant PROOF_S2_AT_ZETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} // Sσ2(zeta) - uint256 private constant PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA = 0x260; // z(w*zeta) - uint256 private constant PROOF_QUOTIENT_POLYNOMIAL_AT_ZETA = 0x280; // t(zeta) - uint256 private constant PROOF_LINEARISED_POLYNOMIAL_AT_ZETA = 0x2a0; // r(zeta) + // [Z] + uint256 private constant PROOF_GRAND_PRODUCT_COMMITMENT_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_GRAND_PRODUCT_COMMITMENT_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} - // Folded proof for the opening of H, linearised poly, l, r, o, s_1, s_2, qcp - uint256 private constant PROOF_BATCH_OPENING_AT_ZETA_X = 0x2c0; // [Wzeta] - uint256 private constant PROOF_BATCH_OPENING_AT_ZETA_Y = 0x2e0; + uint256 private constant PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA = {{ hex $offset }};{{ $offset = add $offset 0x20}} // z(w*zeta) - uint256 private constant PROOF_OPENING_AT_ZETA_OMEGA_X = 0x300; - uint256 private constant PROOF_OPENING_AT_ZETA_OMEGA_Y = 0x320; + // Folded proof for the opening of linearised poly, l, r, o, s_1, s_2, qcp + uint256 private constant PROOF_BATCH_OPENING_AT_ZETA_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_BATCH_OPENING_AT_ZETA_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} - uint256 private constant PROOF_OPENING_QCP_AT_ZETA = 0x340; - uint256 private constant PROOF_COMMITMENTS_WIRES_CUSTOM_GATES = {{ hex (add 832 (mul (len .CommitmentConstraintIndexes) 32 ) )}}; + uint256 private constant PROOF_OPENING_AT_ZETA_OMEGA_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant PROOF_OPENING_AT_ZETA_OMEGA_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} - // -> next part of proof is - // [ openings_selector_commits || commitments_wires_commit_api] + uint256 private constant PROOF_OPENING_QCP_AT_ZETA = {{ hex $offset }}; + uint256 private constant PROOF_BSB_COMMITMENTS = {{ hex (add $offset (mul (len .Vk.CommitmentConstraintIndexes) 32 ) )}}; // -------- offset state // challenges to check the claimed quotient - uint256 private constant STATE_ALPHA = 0x00; - uint256 private constant STATE_BETA = 0x20; - uint256 private constant STATE_GAMMA = 0x40; - uint256 private constant STATE_ZETA = 0x60; - - // reusable value - uint256 private constant STATE_ALPHA_SQUARE_LAGRANGE_0 = 0x80; - - // commitment to H - uint256 private constant STATE_FOLDED_H_X = 0xa0; - uint256 private constant STATE_FOLDED_H_Y = 0xc0; - - // commitment to the linearised polynomial - uint256 private constant STATE_LINEARISED_POLYNOMIAL_X = 0xe0; - uint256 private constant STATE_LINEARISED_POLYNOMIAL_Y = 0x100; - - // Folded proof for the opening of H, linearised poly, l, r, o, s_1, s_2, qcp - uint256 private constant STATE_FOLDED_CLAIMED_VALUES = 0x120; - - // folded digests of H, linearised poly, l, r, o, s_1, s_2, qcp - uint256 private constant STATE_FOLDED_DIGESTS_X = 0x140; - uint256 private constant STATE_FOLDED_DIGESTS_Y = 0x160; - - uint256 private constant STATE_PI = 0x180; - - uint256 private constant STATE_ZETA_POWER_N_MINUS_ONE = 0x1a0; - - uint256 private constant STATE_GAMMA_KZG = 0x1c0; - - uint256 private constant STATE_SUCCESS = 0x1e0; - uint256 private constant STATE_CHECK_VAR = 0x200; // /!\ this slot is used for debugging only - - uint256 private constant STATE_LAST_MEM = 0x220; + {{ $offset = 0 }} + uint256 private constant STATE_ALPHA = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_BETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_GAMMA = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_ZETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_ALPHA_SQUARE_LAGRANGE_0 = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_FOLDED_H_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_FOLDED_H_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_LINEARISED_POLYNOMIAL_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_LINEARISED_POLYNOMIAL_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_FOLDED_CLAIMED_VALUES = {{ hex $offset }};{{ $offset = add $offset 0x20}} // Folded proof for the opening of H, linearised poly, l, r, o, s_1, s_2, qcp + uint256 private constant STATE_FOLDED_DIGESTS_X = {{ hex $offset }};{{ $offset = add $offset 0x20}} // linearised poly, l, r, o, s_1, s_2, qcp + uint256 private constant STATE_FOLDED_DIGESTS_Y = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_PI = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_ZETA_POWER_N_MINUS_ONE = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_GAMMA_KZG = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_SUCCESS = {{ hex $offset }};{{ $offset = add $offset 0x20}} + uint256 private constant STATE_CHECK_VAR = {{ hex $offset }};{{ $offset = add $offset 0x20}} // /!\ this slot is used for debugging only + uint256 private constant STATE_LAST_MEM = {{ hex $offset }};{{ $offset = add $offset 0x20}} + + // -------- utils (for Fiat Shamir) + uint256 private constant FS_ALPHA = 0x616C706861; // "alpha" + uint256 private constant FS_BETA = 0x62657461; // "beta" + uint256 private constant FS_GAMMA = 0x67616d6d61; // "gamma" + uint256 private constant FS_ZETA = 0x7a657461; // "zeta" + uint256 private constant FS_GAMMA_KZG = 0x67616d6d61; // "gamma" // -------- errors uint256 private constant ERROR_STRING_ID = 0x08c379a000000000000000000000000000000000000000000000000000000000; // selector for function Error(string) - {{ if (gt (len .CommitmentConstraintIndexes) 0 )}} + {{ if (gt (len .Vk.CommitmentConstraintIndexes) 0 )}} // -------- utils (for hash_fr) uint256 private constant HASH_FR_BB = 340282366920938463463374607431768211456; // 2**128 uint256 private constant HASH_FR_ZERO_UINT256 = 0; - uint8 private constant HASH_FR_LEN_IN_BYTES = 48; uint8 private constant HASH_FR_SIZE_DOMAIN = 11; uint8 private constant HASH_FR_ONE = 1; uint8 private constant HASH_FR_TWO = 2; {{ end }} + + // -------- precompiles + uint8 private constant SHA2 = 0x2; + uint8 private constant MOD_EXP = 0x5; + uint8 private constant EC_ADD = 0x6; + uint8 private constant EC_MUL = 0x7; + uint8 private constant EC_PAIR = 0x8; /// Verify a Plonk proof. /// Reverts if the proof or the public inputs are malformed. @@ -197,14 +196,14 @@ contract PlonkVerifier { // public inputs contribution let l_pi := sum_pi_wo_api_commit(public_inputs.offset, public_inputs.length, freeMem) - {{ if (gt (len .CommitmentConstraintIndexes) 0 ) -}} - let l_wocommit := sum_pi_commit(proof.offset, public_inputs.length, freeMem) - l_pi := addmod(l_wocommit, l_pi, R_MOD) + {{ if (gt (len .Vk.CommitmentConstraintIndexes) 0 ) -}} + let l_pi_commit := sum_pi_commit(proof.offset, public_inputs.length, freeMem) + l_pi := addmod(l_pi_commit, l_pi, R_MOD) {{ end -}} mstore(add(mem, STATE_PI), l_pi) compute_alpha_square_lagrange_0() - verify_quotient_poly_eval_at_zeta(proof.offset) + compute_opening_linearised_polynomial(proof.offset) fold_h(proof.offset) compute_commitment_linearised_polynomial(proof.offset) compute_gamma_kzg(proof.offset) @@ -224,6 +223,16 @@ contract PlonkVerifier { revert(ptError, 0x64) } + /// Called when an exponentiation mod r fails + function error_mod_exp() { + let ptError := mload(0x40) + mstore(ptError, ERROR_STRING_ID) // selector for function Error(string) + mstore(add(ptError, 0x4), 0x20) + mstore(add(ptError, 0x24), 0xc) + mstore(add(ptError, 0x44), "error mod exp") + revert(ptError, 0x64) + } + /// Called when an operation on Bn254 fails /// @dev for instance when calling EcMul on a point not on Bn254. function error_ec_op() { @@ -268,6 +277,15 @@ contract PlonkVerifier { revert(ptError, 0x64) } + function error_pairing() { + let ptError := mload(0x40) + mstore(ptError, ERROR_STRING_ID) // selector for function Error(string) + mstore(add(ptError, 0x4), 0x20) + mstore(add(ptError, 0x24), 0xd) + mstore(add(ptError, 0x44), "error pairing") + revert(ptError, 0x64) + } + function error_verify() { let ptError := mload(0x40) mstore(ptError, ERROR_STRING_ID) // selector for function Error(string) @@ -312,7 +330,7 @@ contract PlonkVerifier { /// Checks if the proof is of the correct size /// @param actual_proof_size size of the proof (not the expected size) function check_proof_size(actual_proof_size) { - let expected_proof_size := add(0x340, mul(VK_NB_CUSTOM_GATES,0x60)) + let expected_proof_size := add(FIXED_PROOF_SIZE, mul(VK_NB_CUSTOM_GATES,0x60)) if iszero(eq(actual_proof_size, expected_proof_size)) { error_proof_size() } @@ -322,22 +340,9 @@ contract PlonkVerifier { /// @param aproof pointer to the beginning of the proof /// @dev the 'a' prepending proof is to have a local name function check_proof_openings_size(aproof) { - - - // linearised polynomial at zeta - let p := add(aproof, PROOF_LINEARISED_POLYNOMIAL_AT_ZETA) - if gt(calldataload(p), R_MOD_MINUS_ONE) { - error_proof_openings_size() - } - - // quotient polynomial at zeta - p := add(aproof, PROOF_QUOTIENT_POLYNOMIAL_AT_ZETA) - if gt(calldataload(p), R_MOD_MINUS_ONE) { - error_proof_openings_size() - } // PROOF_L_AT_ZETA - p := add(aproof, PROOF_L_AT_ZETA) + let p := add(aproof, PROOF_L_AT_ZETA) if gt(calldataload(p), R_MOD_MINUS_ONE) { error_proof_openings_size() } @@ -409,33 +414,31 @@ contract PlonkVerifier { let state := mload(0x40) let mPtr := add(state, STATE_LAST_MEM) - // gamma - // gamma in ascii is [0x67,0x61,0x6d, 0x6d, 0x61] - // (same for alpha, beta, zeta) - mstore(mPtr, 0x67616d6d61) // "gamma" - - mstore(add(mPtr, 0x20), VK_S1_COM_X) - mstore(add(mPtr, 0x40), VK_S1_COM_Y) - mstore(add(mPtr, 0x60), VK_S2_COM_X) - mstore(add(mPtr, 0x80), VK_S2_COM_Y) - mstore(add(mPtr, 0xa0), VK_S3_COM_X) - mstore(add(mPtr, 0xc0), VK_S3_COM_Y) - mstore(add(mPtr, 0xe0), VK_QL_COM_X) - mstore(add(mPtr, 0x100), VK_QL_COM_Y) - mstore(add(mPtr, 0x120), VK_QR_COM_X) - mstore(add(mPtr, 0x140), VK_QR_COM_Y) - mstore(add(mPtr, 0x160), VK_QM_COM_X) - mstore(add(mPtr, 0x180), VK_QM_COM_Y) - mstore(add(mPtr, 0x1a0), VK_QO_COM_X) - mstore(add(mPtr, 0x1c0), VK_QO_COM_Y) - mstore(add(mPtr, 0x1e0), VK_QK_COM_X) - mstore(add(mPtr, 0x200), VK_QK_COM_Y) - {{ range $index, $element := .CommitmentConstraintIndexes}} - mstore(add(mPtr, {{ hex (add 544 (mul $index 64)) }}), VK_QCP_{{ $index }}_X) - mstore(add(mPtr, {{ hex (add 576 (mul $index 64)) }}), VK_QCP_{{ $index }}_Y) + mstore(mPtr, FS_GAMMA) // "gamma" + + {{ $offset = 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), VK_S1_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_S1_COM_Y) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_S2_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_S2_COM_Y) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_S3_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_S3_COM_Y) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QL_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QL_COM_Y) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QR_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QR_COM_Y) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QM_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QM_COM_Y) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QO_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QO_COM_Y) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QK_COM_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QK_COM_Y) {{ $offset = add $offset 0x20}} + {{ range $index, $element := .Vk.CommitmentConstraintIndexes}} + mstore(add(mPtr, {{ hex $offset }}), VK_QCP_{{ $index }}_X) {{ $offset = add $offset 0x20}} + mstore(add(mPtr, {{ hex $offset }}), VK_QCP_{{ $index }}_Y) {{ $offset = add $offset 0x20}} {{ end }} // public inputs - let _mPtr := add(mPtr, {{ hex (add (mul (len .CommitmentConstraintIndexes) 64) 544) }}) + let _mPtr := add(mPtr, {{ hex (add (mul (len .Vk.CommitmentConstraintIndexes) 64) 544) }}) let size_pi_in_bytes := mul(nb_pi, 0x20) calldatacopy(_mPtr, pi, size_pi_in_bytes) _mPtr := add(_mPtr, size_pi_in_bytes) @@ -450,10 +453,10 @@ contract PlonkVerifier { // + nb_public_inputs*0x20 // + nb_custom gates*0x40 let size := add(0x2c5, size_pi_in_bytes) - {{ if (gt (len .CommitmentConstraintIndexes) 0 )}} + {{ if (gt (len .Vk.CommitmentConstraintIndexes) 0 )}} size := add(size, mul(VK_NB_CUSTOM_GATES, 0x40)) {{ end -}} - let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma" + let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma" if iszero(l_success) { error_verify() } @@ -472,9 +475,9 @@ contract PlonkVerifier { let mPtr := add(mload(0x40), STATE_LAST_MEM) // beta - mstore(mPtr, 0x62657461) // "beta" + mstore(mPtr, FS_BETA) // "beta" mstore(add(mPtr, 0x20), gamma_not_reduced) - let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1c), 0x24, mPtr, 0x20) //0x1b -> 000.."gamma" + let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1c), 0x24, mPtr, 0x20) //0x1b -> 000.."gamma" if iszero(l_success) { error_verify() } @@ -496,13 +499,13 @@ contract PlonkVerifier { let full_size := 0x65 // size("alpha") + 0x20 (previous challenge) // alpha - mstore(mPtr, 0x616C706861) // "alpha" + mstore(mPtr, FS_ALPHA) // "alpha" let _mPtr := add(mPtr, 0x20) mstore(_mPtr, beta_not_reduced) _mPtr := add(_mPtr, 0x20) - {{ if (gt (len .CommitmentConstraintIndexes) 0 )}} + {{ if (gt (len .Vk.CommitmentConstraintIndexes) 0 )}} // Bsb22Commitments - let proof_bsb_commitments := add(aproof, PROOF_COMMITMENTS_WIRES_CUSTOM_GATES) + let proof_bsb_commitments := add(aproof, PROOF_BSB_COMMITMENTS) let size_bsb_commitments := mul(0x40, VK_NB_CUSTOM_GATES) calldatacopy(_mPtr, proof_bsb_commitments, size_bsb_commitments) _mPtr := add(_mPtr, size_bsb_commitments) @@ -510,7 +513,7 @@ contract PlonkVerifier { {{ end }} // [Z], the commitment to the grand product polynomial calldatacopy(_mPtr, add(aproof, PROOF_GRAND_PRODUCT_COMMITMENT_X), 0x40) - let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1b), full_size, mPtr, 0x20) + let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), full_size, mPtr, 0x20) if iszero(l_success) { error_verify() } @@ -530,10 +533,10 @@ contract PlonkVerifier { let mPtr := add(mload(0x40), STATE_LAST_MEM) // zeta - mstore(mPtr, 0x7a657461) // "zeta" + mstore(mPtr, FS_ZETA) // "zeta" mstore(add(mPtr, 0x20), alpha_not_reduced) - calldatacopy(add(mPtr, 0x40), add(aproof, PROOF_H_0_X), 0xc0) - let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1c), 0xe4, mPtr, 0x20) + calldatacopy(add(mPtr, 0x40), add(aproof, PROOF_H_0_COM_X), 0xc0) + let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1c), 0xe4, mPtr, 0x20) if iszero(l_success) { error_verify() } @@ -573,24 +576,24 @@ contract PlonkVerifier { /// batch_compute_lagranges_at_z computes [L_0(z), .., L_{n-1}(z)] /// @param z point at which the Lagranges are evaluated /// @param zpnmo ζⁿ-1 - /// @param n number of public inputs (number of Lagranges to compute) + /// @param n_pub number of public inputs (number of Lagranges to compute) /// @param mPtr pointer to which the results are stored - function batch_compute_lagranges_at_z(z, zpnmo, n, mPtr) { + function batch_compute_lagranges_at_z(z, zpnmo, n_pub, mPtr) { let zn := mulmod(zpnmo, VK_INV_DOMAIN_SIZE, R_MOD) // 1/n * (ζⁿ - 1) let _w := 1 let _mPtr := mPtr - for {let i:=0} lt(i,n) {i:=add(i,1)} + for {let i:=0} lt(i,n_pub) {i:=add(i,1)} { mstore(_mPtr, addmod(z,sub(R_MOD, _w), R_MOD)) _w := mulmod(_w, VK_OMEGA, R_MOD) _mPtr := add(_mPtr, 0x20) } - batch_invert(mPtr, n, _mPtr) + batch_invert(mPtr, n_pub, _mPtr) _mPtr := mPtr _w := 1 - for {let i:=0} lt(i,n) {i:=add(i,1)} + for {let i:=0} lt(i,n_pub) {i:=add(i,1)} { mstore(_mPtr, mulmod(mulmod(mload(_mPtr), zn , R_MOD), _w, R_MOD)) _mPtr := add(_mPtr, 0x20) @@ -627,7 +630,7 @@ contract PlonkVerifier { } } - {{ if (gt (len .CommitmentConstraintIndexes) 0 )}} + {{ if (gt (len .Vk.CommitmentConstraintIndexes) 0 )}} /// Public inputs (the ones coming from the custom gate) contribution /// @param aproof pointer to the proof /// @param nb_public_inputs number of public inputs @@ -639,16 +642,18 @@ contract PlonkVerifier { let z := mload(add(state, STATE_ZETA)) let zpnmo := mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)) - let p := add(aproof, PROOF_COMMITMENTS_WIRES_CUSTOM_GATES) + let p := add(aproof, PROOF_BSB_COMMITMENTS) let h_fr, ith_lagrange - {{ range $index, $element := .CommitmentConstraintIndexes}} + {{ range $index, $element := .Vk.CommitmentConstraintIndexes}} h_fr := hash_fr(calldataload(p), calldataload(add(p, 0x20)), mPtr) - ith_lagrange := compute_ith_lagrange_at_z(z, zpnmo, add(nb_public_inputs, VK_INDEX_COMMIT_API{{ $index }}), mPtr) + ith_lagrange := compute_ith_lagrange_at_z(z, zpnmo, add(nb_public_inputs, VK_INDEX_COMMIT_API_{{ $index }}), mPtr) pi_commit := addmod(pi_commit, mulmod(h_fr, ith_lagrange, R_MOD), R_MOD) + {{ if (lt (inc $index) (len $.Vk.CommitmentConstraintIndexes) )}} p := add(p, 0x40) {{ end }} + {{ end }} } @@ -708,7 +713,7 @@ contract PlonkVerifier { // size domain mstore8(add(mPtr, 0x8e), HASH_FR_SIZE_DOMAIN) - let l_success := staticcall(gas(), 0x2, mPtr, 0x8f, mPtr, 0x20) + let l_success := staticcall(gas(), SHA2, mPtr, 0x8f, mPtr, 0x20) if iszero(l_success) { error_verify() } @@ -732,7 +737,7 @@ contract PlonkVerifier { mstore8(add(mPtr, 0x2b), 0x6b) mstore8(add(mPtr, 0x2c), HASH_FR_SIZE_DOMAIN) // size domain - l_success := staticcall(gas(), 0x2, mPtr, 0x2d, mPtr, 0x20) + l_success := staticcall(gas(), SHA2, mPtr, 0x2d, mPtr, 0x20) if iszero(l_success) { error_verify() } @@ -759,14 +764,14 @@ contract PlonkVerifier { mstore8(add(mPtr, 0x4c), HASH_FR_SIZE_DOMAIN) // size domain let offset := add(mPtr, 0x20) - l_success := staticcall(gas(), 0x2, offset, 0x2d, offset, 0x20) + l_success := staticcall(gas(), SHA2, offset, 0x2d, offset, 0x20) if iszero(l_success) { error_verify() } // at this point we have mPtr = [ b1 || b2] where b1 is on 32byes and b2 in 16bytes. // we interpret it as a big integer mod r in big endian (similar to regular decimal notation) - // the result is then 2**(8*16)*mPtr[32:] + mPtr[32:48] + // the result is then 2**(8*16)*mPtr[:32] + mPtr[32:48] res := mulmod(mload(mPtr), HASH_FR_BB, R_MOD) // <- res = 2**128 * mPtr[:32] let b1 := shr(128, mload(add(mPtr, 0x20))) // b1 <- [0, 0, .., 0 || b2[:16] ] res := addmod(res, b1, R_MOD) @@ -807,7 +812,7 @@ contract PlonkVerifier { // derive a random number. As there is no random generator, we // do an FS like challenge derivation, depending on both digests and - // ζ to ensure that the prover cannot control the random numger. + // ζ to ensure that the prover cannot control the random number. // Note: adding the other point ζω is not needed, as ω is known beforehand. mstore(mPtr, mload(add(state, STATE_FOLDED_DIGESTS_X))) mstore(add(mPtr, 0x20), mload(add(state, STATE_FOLDED_DIGESTS_Y))) @@ -819,7 +824,7 @@ contract PlonkVerifier { mstore(add(mPtr, 0xe0), calldataload(add(aproof, PROOF_OPENING_AT_ZETA_OMEGA_Y))) mstore(add(mPtr, 0x100), mload(add(state, STATE_ZETA))) mstore(add(mPtr, 0x120), mload(add(state, STATE_GAMMA_KZG))) - let random := staticcall(gas(), 0x2, mPtr, 0x140, mPtr, 0x20) + let random := staticcall(gas(), SHA2, mPtr, 0x140, mPtr, 0x20) if iszero(random){ error_random_generation() } @@ -869,17 +874,18 @@ contract PlonkVerifier { mstore(folded_quotients_y, sub(P_MOD, mload(folded_quotients_y))) mstore(mPtr, mload(folded_digests)) - mstore(add(mPtr, 0x20), mload(add(folded_digests, 0x20))) - mstore(add(mPtr, 0x40), G2_SRS_0_X_0) // the 4 lines are the canonical G2 point on BN254 - mstore(add(mPtr, 0x60), G2_SRS_0_X_1) - mstore(add(mPtr, 0x80), G2_SRS_0_Y_0) - mstore(add(mPtr, 0xa0), G2_SRS_0_Y_1) - mstore(add(mPtr, 0xc0), mload(folded_quotients)) - mstore(add(mPtr, 0xe0), mload(add(folded_quotients, 0x20))) - mstore(add(mPtr, 0x100), G2_SRS_1_X_0) - mstore(add(mPtr, 0x120), G2_SRS_1_X_1) - mstore(add(mPtr, 0x140), G2_SRS_1_Y_0) - mstore(add(mPtr, 0x160), G2_SRS_1_Y_1) + {{ $offset = 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), mload(add(folded_digests, 0x20))) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_0_X_0) {{ $offset = add $offset 0x20 }} // the 4 lines are the canonical G2 point on BN254 + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_0_X_1) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_0_Y_0) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_0_Y_1) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), mload(folded_quotients)) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), mload(add(folded_quotients, 0x20))) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_1_X_0) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_1_X_1) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_1_Y_0) {{ $offset = add $offset 0x20 }} + mstore(add(mPtr, {{ hex $offset }}), G2_SRS_1_Y_1) {{ $offset = add $offset 0x20 }} check_pairing_kzg(mPtr) } @@ -890,17 +896,17 @@ contract PlonkVerifier { function check_pairing_kzg(mPtr) { let state := mload(0x40) - // TODO test the staticcall using the method from audit_4-5 let l_success := staticcall(gas(), 8, mPtr, 0x180, 0x00, 0x20) + if iszero(l_success) { + error_pairing() + } let res_pairing := mload(0x00) - let s_success := mload(add(state, STATE_SUCCESS)) - res_pairing := and(and(res_pairing, l_success), s_success) mstore(add(state, STATE_SUCCESS), res_pairing) } /// @notice Fold the opening proofs at ζ: - /// * at state+state_folded_digest we store: [H] + γ[Linearised_polynomial]+γ²[L] + γ³[R] + γ⁴[O] + γ⁵[S₁] +γ⁶[S₂] + ∑ᵢγ⁶⁺ⁱ[Pi_{i}] - /// * at state+state_folded_claimed_values we store: H(ζ) + γLinearised_polynomial(ζ)+γ²L(ζ) + γ³R(ζ)+ γ⁴O(ζ) + γ⁵S₁(ζ) +γ⁶S₂(ζ) + ∑ᵢγ⁶⁺ⁱPi_{i}(ζ) + /// * at state+state_folded_digest we store: [Linearised_polynomial]+γ[L] + γ²[R] + γ³[O] + γ⁴[S₁] +γ⁵[S₂] + ∑ᵢγ⁵⁺ⁱ[Pi_{i}] + /// * at state+state_folded_claimed_values we store: Linearised_polynomial(ζ)+γL(ζ) + γ²R(ζ)+ γ³O(ζ) + γ⁴S₁(ζ) +γ⁵S₂(ζ) + ∑ᵢγ⁵⁺ⁱPi_{i}(ζ) /// @param aproof pointer to the proof /// acc_gamma stores the γⁱ function fold_state(aproof) { @@ -914,15 +920,11 @@ contract PlonkVerifier { let acc_gamma := l_gamma_kzg let state_folded_digests := add(state, STATE_FOLDED_DIGESTS_X) - mstore(add(state, STATE_FOLDED_DIGESTS_X), mload(add(state, STATE_FOLDED_H_X))) - mstore(add(state, STATE_FOLDED_DIGESTS_Y), mload(add(state, STATE_FOLDED_H_Y))) - mstore(add(state, STATE_FOLDED_CLAIMED_VALUES), calldataload(add(aproof, PROOF_QUOTIENT_POLYNOMIAL_AT_ZETA))) - - point_acc_mul(state_folded_digests, add(state, STATE_LINEARISED_POLYNOMIAL_X), acc_gamma, mPtr) - fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), add(aproof, PROOF_LINEARISED_POLYNOMIAL_AT_ZETA), acc_gamma) + mstore(state_folded_digests, mload(add(state, STATE_LINEARISED_POLYNOMIAL_X))) + mstore(add(state, STATE_FOLDED_DIGESTS_Y), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y))) + mstore(add(state, STATE_FOLDED_CLAIMED_VALUES), mload(add(state, STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA))) - acc_gamma := mulmod(acc_gamma, l_gamma_kzg, R_MOD) - point_acc_mul_calldata(add(state, STATE_FOLDED_DIGESTS_X), add(aproof, PROOF_L_COM_X), acc_gamma, mPtr) + point_acc_mul_calldata(state_folded_digests, add(aproof, PROOF_L_COM_X), acc_gamma, mPtr) fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), add(aproof, PROOF_L_AT_ZETA), acc_gamma) acc_gamma := mulmod(acc_gamma, l_gamma_kzg, R_MOD) @@ -945,19 +947,17 @@ contract PlonkVerifier { point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40) fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), add(aproof, PROOF_S2_AT_ZETA), acc_gamma) - {{- if (gt (len .CommitmentConstraintIndexes) 0 ) }} - let poscaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) - {{ end -}} - - {{ range $index, $element := .CommitmentConstraintIndexes }} + {{- if (gt (len .Vk.CommitmentConstraintIndexes) 0 ) }} + let poqaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) + {{ range $index, $element := .Vk.CommitmentConstraintIndexes }} acc_gamma := mulmod(acc_gamma, l_gamma_kzg, R_MOD) mstore(mPtr, VK_QCP_{{ $index }}_X) mstore(mPtr20, VK_QCP_{{ $index }}_Y) point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40) - fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), poscaz, acc_gamma) - poscaz := add(poscaz, 0x20) + fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), poqaz, acc_gamma) + poqaz := add(poqaz, 0x20) {{ end }} - + {{ end -}} } /// @notice generate the challenge (using Fiat Shamir) to fold the opening proofs @@ -965,13 +965,11 @@ contract PlonkVerifier { /// The process for deriving γ is the same as in derive_gamma but this time the inputs are /// in this order (the [] means it's a commitment): /// * ζ - /// * [H] ( = H₁ + ζᵐ⁺²*H₂ + ζ²⁽ᵐ⁺²⁾*H₃ ) /// * [Linearised polynomial] /// * [L], [R], [O] /// * [S₁] [S₂] /// * [Pi_{i}] (wires associated to custom gates) /// Then there are the purported evaluations of the previous committed polynomials: - /// * H(ζ) /// * Linearised_polynomial(ζ) /// * L(ζ), R(ζ), O(ζ), S₁(ζ), S₂(ζ) /// * Pi_{i}(ζ) @@ -981,50 +979,45 @@ contract PlonkVerifier { let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) - mstore(mPtr, 0x67616d6d61) // "gamma" + mstore(mPtr, FS_GAMMA_KZG) // "gamma" mstore(add(mPtr, 0x20), mload(add(state, STATE_ZETA))) - mstore(add(mPtr,0x40), mload(add(state, STATE_FOLDED_H_X))) - mstore(add(mPtr,0x60), mload(add(state, STATE_FOLDED_H_Y))) - mstore(add(mPtr,0x80), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X))) - mstore(add(mPtr,0xa0), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y))) - calldatacopy(add(mPtr, 0xc0), add(aproof, PROOF_L_COM_X), 0xc0) - mstore(add(mPtr,0x180), VK_S1_COM_X) - mstore(add(mPtr,0x1a0), VK_S1_COM_Y) - mstore(add(mPtr,0x1c0), VK_S2_COM_X) - mstore(add(mPtr,0x1e0), VK_S2_COM_Y) + mstore(add(mPtr,0x40), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X))) + mstore(add(mPtr,0x60), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y))) + calldatacopy(add(mPtr, 0x80), add(aproof, PROOF_L_COM_X), 0xc0) + mstore(add(mPtr,0x140), VK_S1_COM_X) + mstore(add(mPtr,0x160), VK_S1_COM_Y) + mstore(add(mPtr,0x180), VK_S2_COM_X) + mstore(add(mPtr,0x1a0), VK_S2_COM_Y) - let offset := 0x200 - {{ range $index, $element := .CommitmentConstraintIndexes }} + let offset := 0x1c0 + + {{ range $index, $element := .Vk.CommitmentConstraintIndexes -}} mstore(add(mPtr,offset), VK_QCP_{{ $index }}_X) mstore(add(mPtr,add(offset, 0x20)), VK_QCP_{{ $index }}_Y) offset := add(offset, 0x40) - {{ end }} - - mstore(add(mPtr, offset), calldataload(add(aproof, PROOF_QUOTIENT_POLYNOMIAL_AT_ZETA))) - mstore(add(mPtr, add(offset, 0x20)), calldataload(add(aproof, PROOF_LINEARISED_POLYNOMIAL_AT_ZETA))) - mstore(add(mPtr, add(offset, 0x40)), calldataload(add(aproof, PROOF_L_AT_ZETA))) - mstore(add(mPtr, add(offset, 0x60)), calldataload(add(aproof, PROOF_R_AT_ZETA))) - mstore(add(mPtr, add(offset, 0x80)), calldataload(add(aproof, PROOF_O_AT_ZETA))) - mstore(add(mPtr, add(offset, 0xa0)), calldataload(add(aproof, PROOF_S1_AT_ZETA))) - mstore(add(mPtr, add(offset, 0xc0)), calldataload(add(aproof, PROOF_S2_AT_ZETA))) - - let _mPtr := add(mPtr, add(offset, 0xe0)) - {{ if (gt (len .CommitmentConstraintIndexes) 0 )}} - let _poscaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) - for {let i:=0} lt(i, VK_NB_CUSTOM_GATES) {i:=add(i,1)} - { - mstore(_mPtr, calldataload(_poscaz)) - _poscaz := add(_poscaz, 0x20) - _mPtr := add(_mPtr, 0x20) - } + {{ end -}} + + mstore(add(mPtr, offset), mload(add(state, STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA))) + mstore(add(mPtr, add(offset, 0x20)), calldataload(add(aproof, PROOF_L_AT_ZETA))) + mstore(add(mPtr, add(offset, 0x40)), calldataload(add(aproof, PROOF_R_AT_ZETA))) + mstore(add(mPtr, add(offset, 0x60)), calldataload(add(aproof, PROOF_O_AT_ZETA))) + mstore(add(mPtr, add(offset, 0x80)), calldataload(add(aproof, PROOF_S1_AT_ZETA))) + mstore(add(mPtr, add(offset, 0xa0)), calldataload(add(aproof, PROOF_S2_AT_ZETA))) + + let _mPtr := add(mPtr, add(offset, 0xc0)) + + {{ if (gt (len .Vk.CommitmentConstraintIndexes) 0 )}} + let _poqaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) + calldatacopy(_mPtr, _poqaz, mul(VK_NB_CUSTOM_GATES, 0x20)) + _mPtr := add(_mPtr, mul(VK_NB_CUSTOM_GATES, 0x20)) {{ end }} mstore(_mPtr, calldataload(add(aproof, PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA))) let start_input := 0x1b // 00.."gamma" - let size_input := add(0x17, mul(VK_NB_CUSTOM_GATES,3)) // number of 32bytes elmts = 0x17 (zeta+2*7+7 for the digests+openings) + 2*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + VK_NB_CUSTOM_GATES (for the openings of the selectors) + let size_input := add(0x14, mul(VK_NB_CUSTOM_GATES,3)) // number of 32bytes elmts = 0x14 (zeta+3*6 for the digests+openings) + 3*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + 1 (opening of Z at ζω) size_input := add(0x5, mul(size_input, 0x20)) // size in bytes: 15*32 bytes + 5 bytes for gamma - let check_staticcall := staticcall(gas(), 0x2, add(mPtr,start_input), size_input, add(state, STATE_GAMMA_KZG), 0x20) + let check_staticcall := staticcall(gas(), SHA2, add(mPtr,start_input), size_input, add(state, STATE_GAMMA_KZG), 0x20) if iszero(check_staticcall) { error_verify() } @@ -1032,6 +1025,7 @@ contract PlonkVerifier { } function compute_commitment_linearised_polynomial_ec(aproof, s1, s2) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -1076,24 +1070,26 @@ contract PlonkVerifier { add(mPtr, 0x40) ) - let commits_api_at_zeta := add(aproof, PROOF_OPENING_QCP_AT_ZETA) - let commits_api := add(aproof, PROOF_COMMITMENTS_WIRES_CUSTOM_GATES) + {{ if (gt (len .Vk.CommitmentConstraintIndexes) 0 )}} + let qcp_opening_at_zeta := add(aproof, PROOF_OPENING_QCP_AT_ZETA) + let bsb_commitments := add(aproof, PROOF_BSB_COMMITMENTS) for { let i := 0 } lt(i, VK_NB_CUSTOM_GATES) { i := add(i, 1) } { - mstore(mPtr, calldataload(commits_api)) - mstore(add(mPtr, 0x20), calldataload(add(commits_api, 0x20))) + mstore(mPtr, calldataload(bsb_commitments)) + mstore(add(mPtr, 0x20), calldataload(add(bsb_commitments, 0x20))) point_acc_mul( add(state, STATE_LINEARISED_POLYNOMIAL_X), mPtr, - calldataload(commits_api_at_zeta), + calldataload(qcp_opening_at_zeta), add(mPtr, 0x40) ) - commits_api_at_zeta := add(commits_api_at_zeta, 0x20) - commits_api := add(commits_api, 0x40) + qcp_opening_at_zeta := add(qcp_opening_at_zeta, 0x20) + bsb_commitments := add(bsb_commitments, 0x40) } + {{ end }} mstore(mPtr, VK_S3_COM_X) mstore(add(mPtr, 0x20), VK_S3_COM_Y) @@ -1102,15 +1098,22 @@ contract PlonkVerifier { mstore(mPtr, calldataload(add(aproof, PROOF_GRAND_PRODUCT_COMMITMENT_X))) mstore(add(mPtr, 0x20), calldataload(add(aproof, PROOF_GRAND_PRODUCT_COMMITMENT_Y))) point_acc_mul(add(state, STATE_LINEARISED_POLYNOMIAL_X), mPtr, s2, add(mPtr, 0x40)) + + point_add( + add(state, STATE_LINEARISED_POLYNOMIAL_X), + add(state, STATE_LINEARISED_POLYNOMIAL_X), + add(state, STATE_FOLDED_H_X), + mPtr) } /// @notice Compute the commitment to the linearized polynomial equal to /// L(ζ)[Qₗ]+r(ζ)[Qᵣ]+R(ζ)L(ζ)[Qₘ]+O(ζ)[Qₒ]+[Qₖ]+Σᵢqc'ᵢ(ζ)[BsbCommitmentᵢ] + - /// α*( Z(μζ)(L(ζ)+β*S₁(ζ)+γ)*(R(ζ)+β*S₂(ζ)+γ)[S₃]-[Z](L(ζ)+β*id_{1}(ζ)+γ)*(R(ζ)+β*id_{2(ζ)+γ)*(O(ζ)+β*id_{3}(ζ)+γ) ) + - /// α²*L₁(ζ)[Z] + /// α*( Z(μζ)(L(ζ)+β*S₁(ζ)+γ)*(R(ζ)+β*S₂(ζ)+γ)[S₃]-[Z](L(ζ)+β*id_{1}(ζ)+γ)*(R(ζ)+β*id_{2}(ζ)+γ)*(O(ζ)+β*id_{3}(ζ)+γ) ) + + /// α²*L₁(ζ)[Z] - Z_{H}(ζ)*(([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾*[H₂]) /// where /// * id_1 = id, id_2 = vk_coset_shift*id, id_3 = vk_coset_shift^{2}*id /// * the [] means that it's a commitment (i.e. a point on Bn254(F_p)) + /// * Z_{H}(ζ) = ζ^n-1 /// @param aproof pointer to the proof function compute_commitment_linearised_polynomial(aproof) { let state := mload(0x40) @@ -1158,7 +1161,7 @@ contract PlonkVerifier { compute_commitment_linearised_polynomial_ec(aproof, s1, s2) } - /// @notice compute H₁ + ζᵐ⁺²*H₂ + ζ²⁽ᵐ⁺²⁾*H₃ and store the result at + /// @notice compute -z_h(ζ)*([H₁] + ζⁿ⁺²[H₂] + ζ²⁽ⁿ⁺²⁾[H₃]) and store the result at /// state + state_folded_h /// @param aproof pointer to the proof function fold_h(aproof) { @@ -1166,53 +1169,53 @@ contract PlonkVerifier { let n_plus_two := add(VK_DOMAIN_SIZE, 2) let mPtr := add(mload(0x40), STATE_LAST_MEM) let zeta_power_n_plus_two := pow(mload(add(state, STATE_ZETA)), n_plus_two, mPtr) - point_mul_calldata(add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_2_X), zeta_power_n_plus_two, mPtr) - point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_1_X), mPtr) + point_mul_calldata(add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_2_COM_X), zeta_power_n_plus_two, mPtr) + point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_1_COM_X), mPtr) point_mul(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), zeta_power_n_plus_two, mPtr) - point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_0_X), mPtr) + point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_0_COM_X), mPtr) + point_mul(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)), mPtr) + let folded_h_y := mload(add(state, STATE_FOLDED_H_Y)) + folded_h_y := sub(P_MOD, folded_h_y) + mstore(add(state, STATE_FOLDED_H_Y), folded_h_y) } - /// @notice check that - /// L(ζ)Qₗ(ζ)+r(ζ)Qᵣ(ζ)+R(ζ)L(ζ)Qₘ(ζ)+O(ζ)Qₒ(ζ)+Qₖ(ζ)+Σᵢqc'ᵢ(ζ)BsbCommitmentᵢ(ζ) + - /// α*( Z(μζ)(l(ζ)+β*s₁(ζ)+γ)*(r(ζ)+β*s₂(ζ)+γ)*β*s₃(X)-Z(X)(l(ζ)+β*id_1(ζ)+γ)*(r(ζ)+β*id_2(ζ)+γ)*(o(ζ)+β*id_3(ζ)+γ) ) ) - /// + α²*L₁(ζ) = - /// (ζⁿ-1)H(ζ) + /// @notice check that the opening of the linearised polynomial at zeta is equal to + /// - [ PI(ζ) - α²*L₁(ζ) + α(l(ζ)+β*s1(ζ)+γ)(r(ζ)+β*s2(ζ)+γ)(o(ζ)+γ)*z(ωζ) ] /// @param aproof pointer to the proof - function verify_quotient_poly_eval_at_zeta(aproof) { + function compute_opening_linearised_polynomial(aproof) { + let state := mload(0x40) // (l(ζ)+β*s1(ζ)+γ) - let s1 := add(mload(0x40), STATE_LAST_MEM) - mstore(s1, mulmod(calldataload(add(aproof, PROOF_S1_AT_ZETA)), mload(add(state, STATE_BETA)), R_MOD)) - mstore(s1, addmod(mload(s1), mload(add(state, STATE_GAMMA)), R_MOD)) - mstore(s1, addmod(mload(s1), calldataload(add(aproof, PROOF_L_AT_ZETA)), R_MOD)) + let s1 + s1 := mulmod(calldataload(add(aproof, PROOF_S1_AT_ZETA)), mload(add(state, STATE_BETA)), R_MOD) + s1 := addmod(s1, mload(add(state, STATE_GAMMA)), R_MOD) + s1 := addmod(s1, calldataload(add(aproof, PROOF_L_AT_ZETA)), R_MOD) // (r(ζ)+β*s2(ζ)+γ) - let s2 := add(s1, 0x20) - mstore(s2, mulmod(calldataload(add(aproof, PROOF_S2_AT_ZETA)), mload(add(state, STATE_BETA)), R_MOD)) - mstore(s2, addmod(mload(s2), mload(add(state, STATE_GAMMA)), R_MOD)) - mstore(s2, addmod(mload(s2), calldataload(add(aproof, PROOF_R_AT_ZETA)), R_MOD)) - // _s2 := mload(s2) + let s2 + s2 := mulmod(calldataload(add(aproof, PROOF_S2_AT_ZETA)), mload(add(state, STATE_BETA)), R_MOD) + s2 := addmod(s2, mload(add(state, STATE_GAMMA)), R_MOD) + s2 := addmod(s2, calldataload(add(aproof, PROOF_R_AT_ZETA)), R_MOD) // (o(ζ)+γ) - let o := add(s1, 0x40) - mstore(o, addmod(calldataload(add(aproof, PROOF_O_AT_ZETA)), mload(add(state, STATE_GAMMA)), R_MOD)) - - // α*(Z(μζ))*(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(o(ζ)+γ) - mstore(s1, mulmod(mload(s1), mload(s2), R_MOD)) - mstore(s1, mulmod(mload(s1), mload(o), R_MOD)) - mstore(s1, mulmod(mload(s1), mload(add(state, STATE_ALPHA)), R_MOD)) - mstore(s1, mulmod(mload(s1), calldataload(add(aproof, PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA)), R_MOD)) - - let computed_quotient := add(s1, 0x60) - - // linearizedpolynomial + pi(zeta) - mstore(computed_quotient,addmod(calldataload(add(aproof, PROOF_LINEARISED_POLYNOMIAL_AT_ZETA)), mload(add(state, STATE_PI)), R_MOD)) - mstore(computed_quotient, addmod(mload(computed_quotient), mload(s1), R_MOD)) - mstore(computed_quotient,addmod(mload(computed_quotient), sub(R_MOD, mload(add(state, STATE_ALPHA_SQUARE_LAGRANGE_0))), R_MOD)) - mstore(s2,mulmod(calldataload(add(aproof, PROOF_QUOTIENT_POLYNOMIAL_AT_ZETA)),mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)),R_MOD)) + let o + o := addmod(calldataload(add(aproof, PROOF_O_AT_ZETA)), mload(add(state, STATE_GAMMA)), R_MOD) + + // α*Z(μζ)*(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(o(ζ)+γ) + s1 := mulmod(s1, s2, R_MOD) + s1 := mulmod(s1, o, R_MOD) + s1 := mulmod(s1, mload(add(state, STATE_ALPHA)), R_MOD) + s1 := mulmod(s1, calldataload(add(aproof, PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA)), R_MOD) + + // PI(ζ) - α²*L₁(ζ) + α(l(ζ)+β*s1(ζ)+γ)(r(ζ)+β*s2(ζ)+γ)(o(ζ)+γ)*z(ωζ) + s1 := addmod(s1, mload(add(state, STATE_PI)), R_MOD) + s2 := mload(add(state, STATE_ALPHA_SQUARE_LAGRANGE_0)) + s2 := sub(R_MOD, s2) + s1 := addmod(s1, s2, R_MOD) + s1 := sub(R_MOD, s1) - mstore(add(state, STATE_SUCCESS), eq(mload(computed_quotient), mload(s2))) + mstore(add(state, STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA), s1) } // BEGINNING utils math functions ------------------------------------------------- @@ -1222,12 +1225,11 @@ contract PlonkVerifier { /// @param q pointer to the second point /// @param mPtr pointer to free memory function point_add(dst, p, q, mPtr) { - let state := mload(0x40) mstore(mPtr, mload(p)) mstore(add(mPtr, 0x20), mload(add(p, 0x20))) mstore(add(mPtr, 0x40), mload(q)) mstore(add(mPtr, 0x60), mload(add(q, 0x20))) - let l_success := staticcall(gas(),6,mPtr,0x80,dst,0x40) + let l_success := staticcall(gas(),EC_ADD,mPtr,0x80,dst,0x40) if iszero(l_success) { error_ec_op() } @@ -1238,12 +1240,11 @@ contract PlonkVerifier { /// @param q pointer to the second point (calladata) /// @param mPtr pointer to free memory function point_add_calldata(dst, p, q, mPtr) { - let state := mload(0x40) mstore(mPtr, mload(p)) mstore(add(mPtr, 0x20), mload(add(p, 0x20))) mstore(add(mPtr, 0x40), calldataload(q)) mstore(add(mPtr, 0x60), calldataload(add(q, 0x20))) - let l_success := staticcall(gas(), 6, mPtr, 0x80, dst, 0x40) + let l_success := staticcall(gas(), EC_ADD, mPtr, 0x80, dst, 0x40) if iszero(l_success) { error_ec_op() } @@ -1254,11 +1255,10 @@ contract PlonkVerifier { /// @param s scalar /// @param mPtr free memory function point_mul(dst,src,s, mPtr) { - let state := mload(0x40) mstore(mPtr,mload(src)) mstore(add(mPtr,0x20),mload(add(src,0x20))) mstore(add(mPtr,0x40),s) - let l_success := staticcall(gas(),7,mPtr,0x60,dst,0x40) + let l_success := staticcall(gas(),EC_MUL,mPtr,0x60,dst,0x40) if iszero(l_success) { error_ec_op() } @@ -1269,11 +1269,10 @@ contract PlonkVerifier { /// @param s scalar /// @param mPtr free memory function point_mul_calldata(dst, src, s, mPtr) { - let state := mload(0x40) mstore(mPtr, calldataload(src)) mstore(add(mPtr, 0x20), calldataload(add(src, 0x20))) mstore(add(mPtr, 0x40), s) - let l_success := staticcall(gas(), 7, mPtr, 0x60, dst, 0x40) + let l_success := staticcall(gas(), EC_MUL, mPtr, 0x60, dst, 0x40) if iszero(l_success) { error_ec_op() } @@ -1285,14 +1284,13 @@ contract PlonkVerifier { /// @param s scalar /// @param mPtr free memory function point_acc_mul(dst,src,s, mPtr) { - let state := mload(0x40) mstore(mPtr,mload(src)) mstore(add(mPtr,0x20),mload(add(src,0x20))) mstore(add(mPtr,0x40),s) let l_success := staticcall(gas(),7,mPtr,0x60,mPtr,0x40) mstore(add(mPtr,0x40),mload(dst)) mstore(add(mPtr,0x60),mload(add(dst,0x20))) - l_success := and(l_success, staticcall(gas(),6,mPtr,0x80,dst, 0x40)) + l_success := and(l_success, staticcall(gas(),EC_ADD,mPtr,0x80,dst, 0x40)) if iszero(l_success) { error_ec_op() } @@ -1304,14 +1302,13 @@ contract PlonkVerifier { /// @param s scalar /// @mPtr free memory function point_acc_mul_calldata(dst, src, s, mPtr) { - let state := mload(0x40) mstore(mPtr, calldataload(src)) mstore(add(mPtr, 0x20), calldataload(add(src, 0x20))) mstore(add(mPtr, 0x40), s) let l_success := staticcall(gas(), 7, mPtr, 0x60, mPtr, 0x40) mstore(add(mPtr, 0x40), mload(dst)) mstore(add(mPtr, 0x60), mload(add(dst, 0x20))) - l_success := and(l_success, staticcall(gas(), 6, mPtr, 0x80, dst, 0x40)) + l_success := and(l_success, staticcall(gas(), EC_ADD, mPtr, 0x80, dst, 0x40)) if iszero(l_success) { error_ec_op() } @@ -1337,9 +1334,9 @@ contract PlonkVerifier { mstore(add(mPtr, 0x60), x) mstore(add(mPtr, 0x80), e) mstore(add(mPtr, 0xa0), R_MOD) - let check_staticcall := staticcall(gas(),0x05,mPtr,0xc0,mPtr,0x20) + let check_staticcall := staticcall(gas(),MOD_EXP,mPtr,0xc0,mPtr,0x20) if eq(check_staticcall, 0) { - error_verify() + error_mod_exp() } res := mload(mPtr) } @@ -1383,7 +1380,7 @@ func (proof *Proof) MarshalSolidity() []byte { // uint256 o_at_zeta; // uint256 s1_at_zeta; // uint256 s2_at_zeta; - for i := 2; i < 7; i++ { + for i := 1; i < 6; i++ { tmp32 = proof.BatchedProof.ClaimedValues[i].Bytes() res = append(res, tmp32[:]...) } @@ -1397,12 +1394,8 @@ func (proof *Proof) MarshalSolidity() []byte { tmp32 = proof.ZShiftedOpening.ClaimedValue.Bytes() res = append(res, tmp32[:]...) - // uint256 quotient_polynomial_at_zeta; - // uint256 linearization_polynomial_at_zeta; - tmp32 = proof.BatchedProof.ClaimedValues[0].Bytes() - res = append(res, tmp32[:]...) - tmp32 = proof.BatchedProof.ClaimedValues[1].Bytes() - res = append(res, tmp32[:]...) + // we skip the claimed value of the linearised polynomial at zeta because it + // is recomputed by the verifier and plugged in the batch opening proof directly // uint256 opening_at_zeta_proof_x; // uint256 opening_at_zeta_proof_y; @@ -1416,16 +1409,14 @@ func (proof *Proof) MarshalSolidity() []byte { // uint256[] selector_commit_api_at_zeta; // uint256[] wire_committed_commitments; - if len(proof.Bsb22Commitments) > 0 { - for i := 0; i < len(proof.Bsb22Commitments); i++ { - tmp32 = proof.BatchedProof.ClaimedValues[7+i].Bytes() - res = append(res, tmp32[:]...) - } - - for _, bc := range proof.Bsb22Commitments { - tmp64 = bc.RawBytes() - res = append(res, tmp64[:]...) - } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + tmp32 = proof.BatchedProof.ClaimedValues[6+i].Bytes() + res = append(res, tmp32[:]...) + } + + for _, bc := range proof.Bsb22Commitments { + tmp64 = bc.RawBytes() + res = append(res, tmp64[:]...) } return res diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/unmarshal.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/unmarshal.go index bdc578cac2..9554884105 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/unmarshal.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/unmarshal.go @@ -41,7 +41,7 @@ func UnmarshalSolidity(s []byte, nbCommits int) Proof { // uint256 o_at_zeta; // uint256 s1_at_zeta; // uint256 s2_at_zeta; - for i := 2; i < 7; i++ { + for i := 1; i < 6; i++ { proof.BatchedProof.ClaimedValues[i].SetBytes(s[offset : offset+fr_size]) offset += fr_size } @@ -55,12 +55,8 @@ func UnmarshalSolidity(s []byte, nbCommits int) Proof { proof.ZShiftedOpening.ClaimedValue.SetBytes(s[offset : offset+fr_size]) offset += fr_size - // uint256 quotient_polynomial_at_zeta; - // uint256 linearization_polynomial_at_zeta; - proof.BatchedProof.ClaimedValues[0].SetBytes(s[offset : offset+fr_size]) - offset += fr_size - proof.BatchedProof.ClaimedValues[1].SetBytes(s[offset : offset+fr_size]) - offset += fr_size + // we skip the claimed value of the linearised polynomial at zeta as + // it is not in the marshal solidity proof // uint256 opening_at_zeta_proof_x; // uint256 opening_at_zeta_proof_y; @@ -75,7 +71,7 @@ func UnmarshalSolidity(s []byte, nbCommits int) Proof { // uint256[] selector_commit_api_at_zeta; // uint256[] wire_committed_commitments; for i := 0; i < nbCommits; i++ { - proof.BatchedProof.ClaimedValues[7+i].SetBytes(s[offset : offset+fr_size]) + proof.BatchedProof.ClaimedValues[6+i].SetBytes(s[offset : offset+fr_size]) offset += fr_size } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/verify.go index b119a71c9b..2197228b3f 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bn254/verify.go @@ -19,6 +19,7 @@ package plonk import ( "errors" "fmt" + "github.com/consensys/gnark/backend/solidity" "io" "math/big" "text/template" @@ -39,11 +40,13 @@ import ( ) var ( - errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") - errInvalidWitness = errors.New("witness length is invalid") + errAlgebraicRelation = errors.New("algebraic relation does not hold") + errInvalidWitness = errors.New("witness length is invalid") + errInvalidPoint = errors.New("point is not on the curve") ) func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { + log := logger.Logger().With().Str("curve", "bn254").Str("backend", "plonk").Logger() start := time.Now() cfg, err := backend.NewVerifierConfig(opts...) @@ -59,6 +62,32 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return errInvalidWitness } + // check that the points in the proof are on the curve + for i := 0; i < len(proof.LRO); i++ { + if !proof.LRO[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.Z.IsInSubGroup() { + return errInvalidPoint + } + for i := 0; i < len(proof.H); i++ { + if !proof.H[i].IsInSubGroup() { + return errInvalidPoint + } + } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + if !proof.Bsb22Commitments[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.BatchedProof.H.IsInSubGroup() { + return errInvalidPoint + } + if !proof.ZShiftedOpening.H.IsInSubGroup() { + return errInvalidPoint + } + // transcript to derive the challenge fs := fiatshamir.NewTranscript(cfg.ChallengeHash, "gamma", "beta", "alpha", "zeta") @@ -79,7 +108,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // derive alpha from Comm(l), Comm(r), Comm(o), Com(Z), Bsb22Commitments + // derive alpha from Com(Z), Bsb22Commitments alphaDeps := make([]*curve.G1Affine, len(proof.Bsb22Commitments)+1) for i := range proof.Bsb22Commitments { alphaDeps[i] = &proof.Bsb22Commitments[i] @@ -96,37 +125,42 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // evaluation of Z=Xⁿ⁻¹ at ζ - var zetaPowerM, zzeta fr.Element + // evaluation of zhZeta=ζⁿ-1 + var zetaPowerM, zhZeta, lagrangeZero fr.Element var bExpo big.Int one := fr.One() bExpo.SetUint64(vk.Size) zetaPowerM.Exp(zeta, &bExpo) - zzeta.Sub(&zetaPowerM, &one) + zhZeta.Sub(&zetaPowerM, &one) // ζⁿ-1 + lagrangeZero.Sub(&zeta, &one). // ζ-1 + Inverse(&lagrangeZero). // 1/(ζ-1) + Mul(&lagrangeZero, &zhZeta). // (ζ^n-1)/(ζ-1) + Mul(&lagrangeZero, &vk.SizeInv) // 1/n * (ζ^n-1)/(ζ-1) // compute PI = ∑_{i if the poly is shifted and in canonical form the index is computed differently - const ( id_L int = iota id_R @@ -101,12 +96,12 @@ type Proof struct { // Commitment to Z, the permutation polynomial Z kzg.Digest - // Commitments to h1, h2, h3 such that h = h1 + Xh2 + X**2h3 is the quotient polynomial + // Commitments to h1, h2, h3 such that h = h1 + Xⁿ⁺²*h2 + X²⁽ⁿ⁺²⁾*h3 is the quotient polynomial H [3]kzg.Digest Bsb22Commitments []kzg.Digest - // Batch opening proof of h1 + zeta*h2 + zeta**2h3, linearizedPolynomial, l, r, o, s1, s2, qCPrime + // Batch opening proof of linearizedPolynomial, l, r, o, s1, s2, qCPrime BatchedProof kzg.BatchOpeningProof // Opening proof of Z at zeta*mu @@ -151,14 +146,11 @@ func Prove(spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts g.Go(instance.buildRatioCopyConstraint) // compute h - g.Go(instance.evaluateConstraints) + g.Go(instance.computeQuotient) // open Z (blinded) at ωζ (proof.ZShiftedOpening) g.Go(instance.openZ) - // fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) - g.Go(instance.foldH) - // linearized polynomial g.Go(instance.computeLinearizedPolynomial) @@ -187,13 +179,11 @@ type instance struct { htfFunc hash.Hash // hash to field function // polynomials - x []*iop.Polynomial // x stores tracks the polynomial we need - bp []*iop.Polynomial // blinding polynomials - h *iop.Polynomial // h is the quotient polynomial - blindedZ []fr.Element // blindedZ is the blinded version of Z - - foldedH []fr.Element // foldedH is the folded version of H - foldedHDigest kzg.Digest // foldedHDigest is the kzg commitment of foldedH + x []*iop.Polynomial // x stores tracks the polynomial we need + bp []*iop.Polynomial // blinding polynomials + h *iop.Polynomial // h is the quotient polynomial + blindedZ []fr.Element // blindedZ is the blinded version of Z + quotientShardsRandomizers [2]fr.Element // random elements for blinding the shards of the quotient linearizedPolynomial []fr.Element linearizedPolynomialDigest kzg.Digest @@ -217,7 +207,6 @@ type instance struct { chRestoreLRO, chZOpening, chLinearizedPolynomial, - chFoldedH, chGammaBeta chan struct{} domain0, domain1 *fft.Domain @@ -248,7 +237,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi chH: make(chan struct{}, 1), chZOpening: make(chan struct{}, 1), chLinearizedPolynomial: make(chan struct{}, 1), - chFoldedH: make(chan struct{}, 1), chRestoreLRO: make(chan struct{}, 1), } s.initBSB22Commitments() @@ -259,6 +247,12 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi sizeSystem := uint64(nbConstraints + len(spr.Public)) // len(spr.Public) is for the placeholder constraints s.domain0 = fft.NewDomain(sizeSystem) + // sampling random numbers for blinding the quotient + if opts.StatisticalZK { + s.quotientShardsRandomizers[0].SetRandom() + s.quotientShardsRandomizers[1].SetRandom() + } + // h, the quotient polynomial is of degree 3(n+1)+2, so it's in a 3(n+2) dim vector space, // the domain is the next power of 2 superior to 3(n+2). 4*domainNum is enough in all cases // except when n<6. @@ -267,8 +261,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi } else { s.domain1 = fft.NewDomain(4*sizeSystem, fft.WithoutPrecompute()) } - // TODO @gbotrel domain1 is used for only 1 FFT --> precomputing the twiddles - // and storing them in memory is costly given its size. --> do a FFT on the fly // build trace s.trace = NewTrace(spr, s.domain0) @@ -335,7 +327,7 @@ func (s *instance) bsb22Hint(_ *big.Int, ins, outs []*big.Int) error { } // solveConstraints computes the evaluation of the polynomials L, R, O -// and sets x[id_L], x[id_R], x[id_O] in canonical form +// and sets x[id_L], x[id_R], x[id_O] in Lagrange form func (s *instance) solveConstraints() error { _solution, err := s.spr.Solve(s.fullWitness, s.opt.SolverOpts...) if err != nil { @@ -490,8 +482,8 @@ func (s *instance) deriveZeta() (err error) { return } -// evaluateConstraints computes H -func (s *instance) evaluateConstraints() (err error) { +// computeQuotient computes H +func (s *instance) computeQuotient() (err error) { s.x[id_Ql] = s.trace.Ql s.x[id_Qr] = s.trace.Qr s.x[id_Qm] = s.trace.Qm @@ -544,7 +536,7 @@ func (s *instance) evaluateConstraints() (err error) { return err } - s.h, err = divideByXMinusOne(numerator, [2]*fft.Domain{s.domain0, s.domain1}) + s.h, err = divideByZH(numerator, [2]*fft.Domain{s.domain0, s.domain1}) if err != nil { return err } @@ -625,56 +617,40 @@ func (s *instance) openZ() (err error) { } func (s *instance) h1() []fr.Element { - h1 := s.h.Coefficients()[:s.domain0.Cardinality+2] + var h1 []fr.Element + if !s.opt.StatisticalZK { + h1 = s.h.Coefficients()[:s.domain0.Cardinality+2] + } else { + h1 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h1, s.h.Coefficients()[:s.domain0.Cardinality+2]) + h1[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[0]) + } return h1 } func (s *instance) h2() []fr.Element { - h2 := s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + var h2 []fr.Element + if !s.opt.StatisticalZK { + h2 = s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + } else { + h2 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h2, s.h.Coefficients()[s.domain0.Cardinality+2:2*(s.domain0.Cardinality+2)]) + h2[0].Sub(&h2[0], &s.quotientShardsRandomizers[0]) + h2[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[1]) + } return h2 } func (s *instance) h3() []fr.Element { - h3 := s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] - return h3 -} - -// fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) -func (s *instance) foldH() error { - // wait for H to be committed and zeta to be derived (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chH: - } - var n big.Int - n.SetUint64(s.domain0.Cardinality + 2) - - var zetaPowerNplusTwo fr.Element - zetaPowerNplusTwo.Exp(s.zeta, &n) - zetaPowerNplusTwo.BigInt(&n) - - s.foldedHDigest.ScalarMultiplication(&s.proof.H[2], &n) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[1]) // ζᵐ⁺²*Comm(h3) - s.foldedHDigest.ScalarMultiplication(&s.foldedHDigest, &n) // ζ²⁽ᵐ⁺²⁾*Comm(h3) + ζᵐ⁺²*Comm(h2) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[0]) - - // fold H (H₀ + ζᵐ⁺²*H₁ + ζ²⁽ᵐ⁺²⁾H₂)) - h1 := s.h1() - h2 := s.h2() - s.foldedH = s.h3() - - for i := 0; i < int(s.domain0.Cardinality)+2; i++ { - s.foldedH[i]. - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h2[i]). - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h1[i]) + var h3 []fr.Element + if !s.opt.StatisticalZK { + h3 = s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] + } else { + h3 = make([]fr.Element, s.domain0.Cardinality+2) + copy(h3, s.h.Coefficients()[2*(s.domain0.Cardinality+2):3*(s.domain0.Cardinality+2)]) + h3[0].Sub(&h3[0], &s.quotientShardsRandomizers[1]) } - - close(s.chFoldedH) - - return nil + return h3 } func (s *instance) computeLinearizedPolynomial() error { @@ -749,20 +725,6 @@ func (s *instance) computeLinearizedPolynomial() error { func (s *instance) batchOpening() error { - // wait for LRO to be committed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chLRO: - } - - // wait for foldedH to be computed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chFoldedH: - } - // wait for linearizedPolynomial to be computed (or ctx.Done()) select { case <-s.ctx.Done(): @@ -771,27 +733,25 @@ func (s *instance) batchOpening() error { } polysQcp := coefficients(s.trace.Qcp) - polysToOpen := make([][]fr.Element, 7+len(polysQcp)) - copy(polysToOpen[7:], polysQcp) - - polysToOpen[0] = s.foldedH - polysToOpen[1] = s.linearizedPolynomial - polysToOpen[2] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) - polysToOpen[3] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) - polysToOpen[4] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) - polysToOpen[5] = s.trace.S1.Coefficients() - polysToOpen[6] = s.trace.S2.Coefficients() - - digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+7) - copy(digestsToOpen[7:], s.pk.Vk.Qcp) - - digestsToOpen[0] = s.foldedHDigest - digestsToOpen[1] = s.linearizedPolynomialDigest - digestsToOpen[2] = s.proof.LRO[0] - digestsToOpen[3] = s.proof.LRO[1] - digestsToOpen[4] = s.proof.LRO[2] - digestsToOpen[5] = s.pk.Vk.S[0] - digestsToOpen[6] = s.pk.Vk.S[1] + polysToOpen := make([][]fr.Element, 6+len(polysQcp)) + copy(polysToOpen[6:], polysQcp) + + polysToOpen[0] = s.linearizedPolynomial + polysToOpen[1] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) + polysToOpen[2] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) + polysToOpen[3] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) + polysToOpen[4] = s.trace.S1.Coefficients() + polysToOpen[5] = s.trace.S2.Coefficients() + + digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+6) + copy(digestsToOpen[6:], s.pk.Vk.Qcp) + + digestsToOpen[0] = s.linearizedPolynomialDigest + digestsToOpen[1] = s.proof.LRO[0] + digestsToOpen[2] = s.proof.LRO[1] + digestsToOpen[3] = s.proof.LRO[2] + digestsToOpen[4] = s.pk.Vk.S[0] + digestsToOpen[5] = s.pk.Vk.S[1] var err error s.proof.BatchedProof, err = kzg.BatchOpenSinglePoint( @@ -834,7 +794,7 @@ func (s *instance) computeNumerator() (*iop.Polynomial, error) { case <-s.chQk: } - nbBsbGates := (len(s.x) - id_Qci + 1) >> 1 + nbBsbGates := len(s.proof.Bsb22Commitments) gateConstraint := func(u ...fr.Element) fr.Element { @@ -1139,7 +1099,7 @@ func evaluateBlinded(p, bp *iop.Polynomial, zeta fr.Element) fr.Element { return pEvaluatedAtZeta } -// /!\ modifies p's underlying array of coefficients, in particular the size changes +// /!\ modifies the size func getBlindedCoefficients(p, bp *iop.Polynomial) []fr.Element { cp := p.Coefficients() cbp := bp.Coefficients() @@ -1212,10 +1172,10 @@ func commitToQuotient(h1, h2, h3 []fr.Element, proof *Proof, kzgPk kzg.ProvingKe return g.Wait() } -// divideByXMinusOne +// divideByZH // The input must be in LagrangeCoset. // The result is in Canonical Regular. (in place using a) -func divideByXMinusOne(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { +func divideByZH(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { // check that the basis is LagrangeCoset if a.Basis != iop.LagrangeCoset || a.Layout != iop.BitReverse { @@ -1255,7 +1215,7 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { res[0].Exp(domains[1].FrMultiplicativeGen, expo) var t fr.Element - t.Exp(domains[1].Generator, big.NewInt(int64(domains[0].Cardinality))) + t.Exp(domains[1].Generator, expo) one := fr.One() @@ -1279,16 +1239,24 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { // The Linearized polynomial is: // // α²*L₁(ζ)*Z(X) -// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) -// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) +// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(β*s3(X))*Z(μζ) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) +// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) +// - Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) +// +// /!\ blindedZCanonical is modified func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, gamma, zeta, zu fr.Element, qcpZeta, blindedZCanonical []fr.Element, pi2Canonical [][]fr.Element, pk *ProvingKey) []fr.Element { - // TODO @gbotrel rename - // first part: individual constraints + + // l(ζ)r(ζ) var rl fr.Element rl.Mul(&rZeta, &lZeta) - // second part: - // Z(μζ)(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*s3(X)-Z(X)(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ) + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + // the linearised polynomial is + // α²*L₁(ζ)*Z(X) + + // s1*s3(X)+s2*Z(X) + l(ζ)*Ql(X) + + // l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) - + // Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) var s1, s2 fr.Element chS1 := make(chan struct{}, 1) go func() { @@ -1296,11 +1264,11 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s1.Mul(&s1, &beta).Add(&s1, &lZeta).Add(&s1, &gamma) // (l(ζ)+β*s1(ζ)+γ) close(chS1) }() - // ps2 := iop.NewPolynomial(&pk.S2Canonical, iop.Form{Basis: iop.Canonical, Layout: iop.Regular}) + tmp := s.trace.S2.Evaluate(zeta) // s2(ζ) tmp.Mul(&tmp, &beta).Add(&tmp, &rZeta).Add(&tmp, &gamma) // (r(ζ)+β*s2(ζ)+γ) <-chS1 - s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta) // (l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta).Mul(&s1, &alpha) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*Z(μζ)*α var uzeta, uuzeta fr.Element uzeta.Mul(&zeta, &pk.Vk.CosetShift) @@ -1311,27 +1279,36 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ) tmp.Mul(&beta, &uuzeta).Add(&tmp, &oZeta).Add(&tmp, &gamma) // (o(ζ)+β*u²*ζ+γ) s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - s2.Neg(&s2) // -(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + s2.Neg(&s2).Mul(&s2, &alpha) - // third part L₁(ζ)*α²*Z - var lagrangeZeta, one, den, frNbElmt fr.Element + // Z_h(ζ), ζⁿ⁺², L₁(ζ)*α²*Z + var zhZeta, zetaNPlusTwo, alphaSquareLagrangeZero, one, den, frNbElmt fr.Element one.SetOne() nbElmt := int64(s.domain0.Cardinality) - lagrangeZeta.Set(&zeta). - Exp(lagrangeZeta, big.NewInt(nbElmt)). - Sub(&lagrangeZeta, &one) + alphaSquareLagrangeZero.Set(&zeta).Exp(alphaSquareLagrangeZero, big.NewInt(nbElmt)) // ζⁿ + zetaNPlusTwo.Mul(&alphaSquareLagrangeZero, &zeta).Mul(&zetaNPlusTwo, &zeta) // ζⁿ⁺² + alphaSquareLagrangeZero.Sub(&alphaSquareLagrangeZero, &one) // ζⁿ - 1 + zhZeta.Set(&alphaSquareLagrangeZero) // Z_h(ζ) = ζⁿ - 1 frNbElmt.SetUint64(uint64(nbElmt)) - den.Sub(&zeta, &one). - Inverse(&den) - lagrangeZeta.Mul(&lagrangeZeta, &den). // L₁ = (ζⁿ⁻¹)/(ζ-1) - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &s.domain0.CardinalityInv) // (1/n)*α²*L₁(ζ) + den.Sub(&zeta, &one).Inverse(&den) // 1/(ζ-1) + alphaSquareLagrangeZero.Mul(&alphaSquareLagrangeZero, &den). // L₁ = (ζⁿ - 1)/(ζ-1) + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &s.domain0.CardinalityInv) // α²*L₁(ζ) s3canonical := s.trace.S3.Coefficients() s.trace.Qk.ToCanonical(s.domain0).ToRegular() + // len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 when Statistical ZK is activated + // len(h1)=len(h2)=len(h3)=len(blindedZCanonical)-1 when Statistical ZK is deactivated + h1 := s.h1() + h2 := s.h2() + h3 := s.h3() + + // at this stage we have + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) utils.Parallelize(len(blindedZCanonical), func(start, end int) { cql := s.trace.Ql.Coefficients() @@ -1343,45 +1320,50 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, var t, t0, t1 fr.Element for i := start; i < end; i++ { - - t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - + t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) if i < len(s3canonical) { - - t0.Mul(&s3canonical[i], &s1) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*β*s3(X) - + t0.Mul(&s3canonical[i], &s1) // α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ)*β*s3(X) t.Add(&t, &t0) } - - t.Mul(&t, &alpha) // α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ)) - if i < len(cqm) { - - t1.Mul(&cqm[i], &rl) // linPol = linPol + l(ζ)r(ζ)*Qm(X) - - t0.Mul(&cql[i], &lZeta) - t0.Add(&t0, &t1) - - t.Add(&t, &t0) // linPol = linPol + l(ζ)*Ql(X) - - t0.Mul(&cqr[i], &rZeta) - t.Add(&t, &t0) // linPol = linPol + r(ζ)*Qr(X) - - t0.Mul(&cqo[i], &oZeta) - t0.Add(&t0, &cqk[i]) - - t.Add(&t, &t0) // linPol = linPol + o(ζ)*Qo(X) + Qk(X) - - for j := range qcpZeta { + t1.Mul(&cqm[i], &rl) // l(ζ)r(ζ)*Qm(X) + t.Add(&t, &t1) // linPol += l(ζ)r(ζ)*Qm(X) + t0.Mul(&cql[i], &lZeta) // l(ζ)Q_l(X) + t.Add(&t, &t0) // linPol += l(ζ)*Ql(X) + t0.Mul(&cqr[i], &rZeta) //r(ζ)*Qr(X) + t.Add(&t, &t0) // linPol += r(ζ)*Qr(X) + t0.Mul(&cqo[i], &oZeta) // o(ζ)*Qo(X) + t.Add(&t, &t0) // linPol += o(ζ)*Qo(X) + t.Add(&t, &cqk[i]) // linPol += Qk(X) + for j := range qcpZeta { // linPol += ∑ᵢQcp_(ζ)Pi_(X) t0.Mul(&pi2Canonical[j][i], &qcpZeta[j]) t.Add(&t, &t0) } } - t0.Mul(&blindedZCanonical[i], &lagrangeZeta) - blindedZCanonical[i].Add(&t, &t0) // finish the computation + t0.Mul(&blindedZCanonical[i], &alphaSquareLagrangeZero) // α²L₁(ζ)Z(X) + blindedZCanonical[i].Add(&t, &t0) // linPol += α²L₁(ζ)Z(X) + + // if statistical zeroknowledge is deactivated, len(h1)=len(h2)=len(h3)=len(blindedZ)-1. + // Else len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 + if i < len(h3) { + t.Mul(&h3[i], &zetaNPlusTwo). + Add(&t, &h2[i]). + Mul(&t, &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } else { + if s.opt.StatisticalZK { + t.Mul(&h2[i], &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } + } } }) + return blindedZCanonical } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/setup.go index 8aa342a41a..03622060e3 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/setup.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/setup.go @@ -18,7 +18,6 @@ package plonk import ( "fmt" - "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bw6-633/fr" "github.com/consensys/gnark-crypto/ecc/bw6-633/fr/fft" "github.com/consensys/gnark-crypto/ecc/bw6-633/fr/iop" @@ -96,7 +95,7 @@ func Setup(spr *cs.SparseR1CS, srs, srsLagrange kzg.SRS) (*ProvingKey, *Verifyin // step 0: set the fft domains domain := initFFTDomain(spr) if domain.Cardinality < 2 { - return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", spr.GetNbConstraints()) + return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", len(spr.Public)+spr.GetNbConstraints()) } // check the size of the kzg srs. @@ -154,9 +153,7 @@ func (pk *ProvingKey) VerifyingKey() interface{} { func NewTrace(spr *cs.SparseR1CS, domain *fft.Domain) *Trace { var trace Trace - nbConstraints := spr.GetNbConstraints() - sizeSystem := uint64(nbConstraints + len(spr.Public)) - size := ecc.NextPowerOfTwo(sizeSystem) + size := int(domain.Cardinality) commitmentInfo := spr.CommitmentInfo.(constraint.PlonkCommitments) ql := make([]fr.Element, size) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/verify.go index 5004b6955e..c9e1f1928e 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-633/verify.go @@ -22,6 +22,7 @@ import ( "io" "math/big" + "github.com/consensys/gnark/backend/solidity" "time" "github.com/consensys/gnark-crypto/ecc" @@ -39,11 +40,13 @@ import ( ) var ( - errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") - errInvalidWitness = errors.New("witness length is invalid") + errAlgebraicRelation = errors.New("algebraic relation does not hold") + errInvalidWitness = errors.New("witness length is invalid") + errInvalidPoint = errors.New("point is not on the curve") ) func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { + log := logger.Logger().With().Str("curve", "bw6-633").Str("backend", "plonk").Logger() start := time.Now() cfg, err := backend.NewVerifierConfig(opts...) @@ -59,6 +62,32 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return errInvalidWitness } + // check that the points in the proof are on the curve + for i := 0; i < len(proof.LRO); i++ { + if !proof.LRO[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.Z.IsInSubGroup() { + return errInvalidPoint + } + for i := 0; i < len(proof.H); i++ { + if !proof.H[i].IsInSubGroup() { + return errInvalidPoint + } + } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + if !proof.Bsb22Commitments[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.BatchedProof.H.IsInSubGroup() { + return errInvalidPoint + } + if !proof.ZShiftedOpening.H.IsInSubGroup() { + return errInvalidPoint + } + // transcript to derive the challenge fs := fiatshamir.NewTranscript(cfg.ChallengeHash, "gamma", "beta", "alpha", "zeta") @@ -79,7 +108,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // derive alpha from Comm(l), Comm(r), Comm(o), Com(Z), Bsb22Commitments + // derive alpha from Com(Z), Bsb22Commitments alphaDeps := make([]*curve.G1Affine, len(proof.Bsb22Commitments)+1) for i := range proof.Bsb22Commitments { alphaDeps[i] = &proof.Bsb22Commitments[i] @@ -96,37 +125,42 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // evaluation of Z=Xⁿ⁻¹ at ζ - var zetaPowerM, zzeta fr.Element + // evaluation of zhZeta=ζⁿ-1 + var zetaPowerM, zhZeta, lagrangeZero fr.Element var bExpo big.Int one := fr.One() bExpo.SetUint64(vk.Size) zetaPowerM.Exp(zeta, &bExpo) - zzeta.Sub(&zetaPowerM, &one) + zhZeta.Sub(&zetaPowerM, &one) // ζⁿ-1 + lagrangeZero.Sub(&zeta, &one). // ζ-1 + Inverse(&lagrangeZero). // 1/(ζ-1) + Mul(&lagrangeZero, &zhZeta). // (ζ^n-1)/(ζ-1) + Mul(&lagrangeZero, &vk.SizeInv) // 1/n * (ζ^n-1)/(ζ-1) // compute PI = ∑_{i if the poly is shifted and in canonical form the index is computed differently - const ( id_L int = iota id_R @@ -101,12 +96,12 @@ type Proof struct { // Commitment to Z, the permutation polynomial Z kzg.Digest - // Commitments to h1, h2, h3 such that h = h1 + Xh2 + X**2h3 is the quotient polynomial + // Commitments to h1, h2, h3 such that h = h1 + Xⁿ⁺²*h2 + X²⁽ⁿ⁺²⁾*h3 is the quotient polynomial H [3]kzg.Digest Bsb22Commitments []kzg.Digest - // Batch opening proof of h1 + zeta*h2 + zeta**2h3, linearizedPolynomial, l, r, o, s1, s2, qCPrime + // Batch opening proof of linearizedPolynomial, l, r, o, s1, s2, qCPrime BatchedProof kzg.BatchOpeningProof // Opening proof of Z at zeta*mu @@ -151,14 +146,11 @@ func Prove(spr *cs.SparseR1CS, pk *ProvingKey, fullWitness witness.Witness, opts g.Go(instance.buildRatioCopyConstraint) // compute h - g.Go(instance.evaluateConstraints) + g.Go(instance.computeQuotient) // open Z (blinded) at ωζ (proof.ZShiftedOpening) g.Go(instance.openZ) - // fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) - g.Go(instance.foldH) - // linearized polynomial g.Go(instance.computeLinearizedPolynomial) @@ -187,13 +179,11 @@ type instance struct { htfFunc hash.Hash // hash to field function // polynomials - x []*iop.Polynomial // x stores tracks the polynomial we need - bp []*iop.Polynomial // blinding polynomials - h *iop.Polynomial // h is the quotient polynomial - blindedZ []fr.Element // blindedZ is the blinded version of Z - - foldedH []fr.Element // foldedH is the folded version of H - foldedHDigest kzg.Digest // foldedHDigest is the kzg commitment of foldedH + x []*iop.Polynomial // x stores tracks the polynomial we need + bp []*iop.Polynomial // blinding polynomials + h *iop.Polynomial // h is the quotient polynomial + blindedZ []fr.Element // blindedZ is the blinded version of Z + quotientShardsRandomizers [2]fr.Element // random elements for blinding the shards of the quotient linearizedPolynomial []fr.Element linearizedPolynomialDigest kzg.Digest @@ -217,7 +207,6 @@ type instance struct { chRestoreLRO, chZOpening, chLinearizedPolynomial, - chFoldedH, chGammaBeta chan struct{} domain0, domain1 *fft.Domain @@ -248,7 +237,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi chH: make(chan struct{}, 1), chZOpening: make(chan struct{}, 1), chLinearizedPolynomial: make(chan struct{}, 1), - chFoldedH: make(chan struct{}, 1), chRestoreLRO: make(chan struct{}, 1), } s.initBSB22Commitments() @@ -259,6 +247,12 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi sizeSystem := uint64(nbConstraints + len(spr.Public)) // len(spr.Public) is for the placeholder constraints s.domain0 = fft.NewDomain(sizeSystem) + // sampling random numbers for blinding the quotient + if opts.StatisticalZK { + s.quotientShardsRandomizers[0].SetRandom() + s.quotientShardsRandomizers[1].SetRandom() + } + // h, the quotient polynomial is of degree 3(n+1)+2, so it's in a 3(n+2) dim vector space, // the domain is the next power of 2 superior to 3(n+2). 4*domainNum is enough in all cases // except when n<6. @@ -267,8 +261,6 @@ func newInstance(ctx context.Context, spr *cs.SparseR1CS, pk *ProvingKey, fullWi } else { s.domain1 = fft.NewDomain(4*sizeSystem, fft.WithoutPrecompute()) } - // TODO @gbotrel domain1 is used for only 1 FFT --> precomputing the twiddles - // and storing them in memory is costly given its size. --> do a FFT on the fly // build trace s.trace = NewTrace(spr, s.domain0) @@ -335,7 +327,7 @@ func (s *instance) bsb22Hint(_ *big.Int, ins, outs []*big.Int) error { } // solveConstraints computes the evaluation of the polynomials L, R, O -// and sets x[id_L], x[id_R], x[id_O] in canonical form +// and sets x[id_L], x[id_R], x[id_O] in Lagrange form func (s *instance) solveConstraints() error { _solution, err := s.spr.Solve(s.fullWitness, s.opt.SolverOpts...) if err != nil { @@ -490,8 +482,8 @@ func (s *instance) deriveZeta() (err error) { return } -// evaluateConstraints computes H -func (s *instance) evaluateConstraints() (err error) { +// computeQuotient computes H +func (s *instance) computeQuotient() (err error) { s.x[id_Ql] = s.trace.Ql s.x[id_Qr] = s.trace.Qr s.x[id_Qm] = s.trace.Qm @@ -544,7 +536,7 @@ func (s *instance) evaluateConstraints() (err error) { return err } - s.h, err = divideByXMinusOne(numerator, [2]*fft.Domain{s.domain0, s.domain1}) + s.h, err = divideByZH(numerator, [2]*fft.Domain{s.domain0, s.domain1}) if err != nil { return err } @@ -625,56 +617,40 @@ func (s *instance) openZ() (err error) { } func (s *instance) h1() []fr.Element { - h1 := s.h.Coefficients()[:s.domain0.Cardinality+2] + var h1 []fr.Element + if !s.opt.StatisticalZK { + h1 = s.h.Coefficients()[:s.domain0.Cardinality+2] + } else { + h1 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h1, s.h.Coefficients()[:s.domain0.Cardinality+2]) + h1[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[0]) + } return h1 } func (s *instance) h2() []fr.Element { - h2 := s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + var h2 []fr.Element + if !s.opt.StatisticalZK { + h2 = s.h.Coefficients()[s.domain0.Cardinality+2 : 2*(s.domain0.Cardinality+2)] + } else { + h2 = make([]fr.Element, s.domain0.Cardinality+3) + copy(h2, s.h.Coefficients()[s.domain0.Cardinality+2:2*(s.domain0.Cardinality+2)]) + h2[0].Sub(&h2[0], &s.quotientShardsRandomizers[0]) + h2[s.domain0.Cardinality+2].Set(&s.quotientShardsRandomizers[1]) + } return h2 } func (s *instance) h3() []fr.Element { - h3 := s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] - return h3 -} - -// fold the commitment to H ([H₀] + ζᵐ⁺²*[H₁] + ζ²⁽ᵐ⁺²⁾[H₂]) -func (s *instance) foldH() error { - // wait for H to be committed and zeta to be derived (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chH: - } - var n big.Int - n.SetUint64(s.domain0.Cardinality + 2) - - var zetaPowerNplusTwo fr.Element - zetaPowerNplusTwo.Exp(s.zeta, &n) - zetaPowerNplusTwo.BigInt(&n) - - s.foldedHDigest.ScalarMultiplication(&s.proof.H[2], &n) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[1]) // ζᵐ⁺²*Comm(h3) - s.foldedHDigest.ScalarMultiplication(&s.foldedHDigest, &n) // ζ²⁽ᵐ⁺²⁾*Comm(h3) + ζᵐ⁺²*Comm(h2) - s.foldedHDigest.Add(&s.foldedHDigest, &s.proof.H[0]) - - // fold H (H₀ + ζᵐ⁺²*H₁ + ζ²⁽ᵐ⁺²⁾H₂)) - h1 := s.h1() - h2 := s.h2() - s.foldedH = s.h3() - - for i := 0; i < int(s.domain0.Cardinality)+2; i++ { - s.foldedH[i]. - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h2[i]). - Mul(&s.foldedH[i], &zetaPowerNplusTwo). - Add(&s.foldedH[i], &h1[i]) + var h3 []fr.Element + if !s.opt.StatisticalZK { + h3 = s.h.Coefficients()[2*(s.domain0.Cardinality+2) : 3*(s.domain0.Cardinality+2)] + } else { + h3 = make([]fr.Element, s.domain0.Cardinality+2) + copy(h3, s.h.Coefficients()[2*(s.domain0.Cardinality+2):3*(s.domain0.Cardinality+2)]) + h3[0].Sub(&h3[0], &s.quotientShardsRandomizers[1]) } - - close(s.chFoldedH) - - return nil + return h3 } func (s *instance) computeLinearizedPolynomial() error { @@ -749,20 +725,6 @@ func (s *instance) computeLinearizedPolynomial() error { func (s *instance) batchOpening() error { - // wait for LRO to be committed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chLRO: - } - - // wait for foldedH to be computed (or ctx.Done()) - select { - case <-s.ctx.Done(): - return errContextDone - case <-s.chFoldedH: - } - // wait for linearizedPolynomial to be computed (or ctx.Done()) select { case <-s.ctx.Done(): @@ -771,27 +733,25 @@ func (s *instance) batchOpening() error { } polysQcp := coefficients(s.trace.Qcp) - polysToOpen := make([][]fr.Element, 7+len(polysQcp)) - copy(polysToOpen[7:], polysQcp) - - polysToOpen[0] = s.foldedH - polysToOpen[1] = s.linearizedPolynomial - polysToOpen[2] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) - polysToOpen[3] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) - polysToOpen[4] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) - polysToOpen[5] = s.trace.S1.Coefficients() - polysToOpen[6] = s.trace.S2.Coefficients() - - digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+7) - copy(digestsToOpen[7:], s.pk.Vk.Qcp) - - digestsToOpen[0] = s.foldedHDigest - digestsToOpen[1] = s.linearizedPolynomialDigest - digestsToOpen[2] = s.proof.LRO[0] - digestsToOpen[3] = s.proof.LRO[1] - digestsToOpen[4] = s.proof.LRO[2] - digestsToOpen[5] = s.pk.Vk.S[0] - digestsToOpen[6] = s.pk.Vk.S[1] + polysToOpen := make([][]fr.Element, 6+len(polysQcp)) + copy(polysToOpen[6:], polysQcp) + + polysToOpen[0] = s.linearizedPolynomial + polysToOpen[1] = getBlindedCoefficients(s.x[id_L], s.bp[id_Bl]) + polysToOpen[2] = getBlindedCoefficients(s.x[id_R], s.bp[id_Br]) + polysToOpen[3] = getBlindedCoefficients(s.x[id_O], s.bp[id_Bo]) + polysToOpen[4] = s.trace.S1.Coefficients() + polysToOpen[5] = s.trace.S2.Coefficients() + + digestsToOpen := make([]curve.G1Affine, len(s.pk.Vk.Qcp)+6) + copy(digestsToOpen[6:], s.pk.Vk.Qcp) + + digestsToOpen[0] = s.linearizedPolynomialDigest + digestsToOpen[1] = s.proof.LRO[0] + digestsToOpen[2] = s.proof.LRO[1] + digestsToOpen[3] = s.proof.LRO[2] + digestsToOpen[4] = s.pk.Vk.S[0] + digestsToOpen[5] = s.pk.Vk.S[1] var err error s.proof.BatchedProof, err = kzg.BatchOpenSinglePoint( @@ -834,7 +794,7 @@ func (s *instance) computeNumerator() (*iop.Polynomial, error) { case <-s.chQk: } - nbBsbGates := (len(s.x) - id_Qci + 1) >> 1 + nbBsbGates := len(s.proof.Bsb22Commitments) gateConstraint := func(u ...fr.Element) fr.Element { @@ -1139,7 +1099,7 @@ func evaluateBlinded(p, bp *iop.Polynomial, zeta fr.Element) fr.Element { return pEvaluatedAtZeta } -// /!\ modifies p's underlying array of coefficients, in particular the size changes +// /!\ modifies the size func getBlindedCoefficients(p, bp *iop.Polynomial) []fr.Element { cp := p.Coefficients() cbp := bp.Coefficients() @@ -1212,10 +1172,10 @@ func commitToQuotient(h1, h2, h3 []fr.Element, proof *Proof, kzgPk kzg.ProvingKe return g.Wait() } -// divideByXMinusOne +// divideByZH // The input must be in LagrangeCoset. // The result is in Canonical Regular. (in place using a) -func divideByXMinusOne(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { +func divideByZH(a *iop.Polynomial, domains [2]*fft.Domain) (*iop.Polynomial, error) { // check that the basis is LagrangeCoset if a.Basis != iop.LagrangeCoset || a.Layout != iop.BitReverse { @@ -1255,7 +1215,7 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { res[0].Exp(domains[1].FrMultiplicativeGen, expo) var t fr.Element - t.Exp(domains[1].Generator, big.NewInt(int64(domains[0].Cardinality))) + t.Exp(domains[1].Generator, expo) one := fr.One() @@ -1279,16 +1239,24 @@ func evaluateXnMinusOneDomainBigCoset(domains [2]*fft.Domain) []fr.Element { // The Linearized polynomial is: // // α²*L₁(ζ)*Z(X) -// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) -// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) +// + α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*(β*s3(X))*Z(μζ) - Z(X)*(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ)) +// + l(ζ)*Ql(X) + l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) +// - Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) +// +// /!\ blindedZCanonical is modified func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, gamma, zeta, zu fr.Element, qcpZeta, blindedZCanonical []fr.Element, pi2Canonical [][]fr.Element, pk *ProvingKey) []fr.Element { - // TODO @gbotrel rename - // first part: individual constraints + + // l(ζ)r(ζ) var rl fr.Element rl.Mul(&rZeta, &lZeta) - // second part: - // Z(μζ)(l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*s3(X)-Z(X)(l(ζ)+β*id1(ζ)+γ)*(r(ζ)+β*id2(ζ)+γ)*(o(ζ)+β*id3(ζ)+γ) + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + // the linearised polynomial is + // α²*L₁(ζ)*Z(X) + + // s1*s3(X)+s2*Z(X) + l(ζ)*Ql(X) + + // l(ζ)r(ζ)*Qm(X) + r(ζ)*Qr(X) + o(ζ)*Qo(X) + Qk(X) + ∑ᵢQcp_(ζ)Pi_(X) - + // Z_{H}(ζ)*((H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) var s1, s2 fr.Element chS1 := make(chan struct{}, 1) go func() { @@ -1296,11 +1264,11 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s1.Mul(&s1, &beta).Add(&s1, &lZeta).Add(&s1, &gamma) // (l(ζ)+β*s1(ζ)+γ) close(chS1) }() - // ps2 := iop.NewPolynomial(&pk.S2Canonical, iop.Form{Basis: iop.Canonical, Layout: iop.Regular}) + tmp := s.trace.S2.Evaluate(zeta) // s2(ζ) tmp.Mul(&tmp, &beta).Add(&tmp, &rZeta).Add(&tmp, &gamma) // (r(ζ)+β*s2(ζ)+γ) <-chS1 - s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta) // (l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + s1.Mul(&s1, &tmp).Mul(&s1, &zu).Mul(&s1, &beta).Mul(&s1, &alpha) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*β*Z(μζ)*α var uzeta, uuzeta fr.Element uzeta.Mul(&zeta, &pk.Vk.CosetShift) @@ -1311,27 +1279,36 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ) tmp.Mul(&beta, &uuzeta).Add(&tmp, &oZeta).Add(&tmp, &gamma) // (o(ζ)+β*u²*ζ+γ) s2.Mul(&s2, &tmp) // (l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - s2.Neg(&s2) // -(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) + s2.Neg(&s2).Mul(&s2, &alpha) - // third part L₁(ζ)*α²*Z - var lagrangeZeta, one, den, frNbElmt fr.Element + // Z_h(ζ), ζⁿ⁺², L₁(ζ)*α²*Z + var zhZeta, zetaNPlusTwo, alphaSquareLagrangeZero, one, den, frNbElmt fr.Element one.SetOne() nbElmt := int64(s.domain0.Cardinality) - lagrangeZeta.Set(&zeta). - Exp(lagrangeZeta, big.NewInt(nbElmt)). - Sub(&lagrangeZeta, &one) + alphaSquareLagrangeZero.Set(&zeta).Exp(alphaSquareLagrangeZero, big.NewInt(nbElmt)) // ζⁿ + zetaNPlusTwo.Mul(&alphaSquareLagrangeZero, &zeta).Mul(&zetaNPlusTwo, &zeta) // ζⁿ⁺² + alphaSquareLagrangeZero.Sub(&alphaSquareLagrangeZero, &one) // ζⁿ - 1 + zhZeta.Set(&alphaSquareLagrangeZero) // Z_h(ζ) = ζⁿ - 1 frNbElmt.SetUint64(uint64(nbElmt)) - den.Sub(&zeta, &one). - Inverse(&den) - lagrangeZeta.Mul(&lagrangeZeta, &den). // L₁ = (ζⁿ⁻¹)/(ζ-1) - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &alpha). - Mul(&lagrangeZeta, &s.domain0.CardinalityInv) // (1/n)*α²*L₁(ζ) + den.Sub(&zeta, &one).Inverse(&den) // 1/(ζ-1) + alphaSquareLagrangeZero.Mul(&alphaSquareLagrangeZero, &den). // L₁ = (ζⁿ - 1)/(ζ-1) + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &alpha). + Mul(&alphaSquareLagrangeZero, &s.domain0.CardinalityInv) // α²*L₁(ζ) s3canonical := s.trace.S3.Coefficients() s.trace.Qk.ToCanonical(s.domain0).ToRegular() + // len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 when Statistical ZK is activated + // len(h1)=len(h2)=len(h3)=len(blindedZCanonical)-1 when Statistical ZK is deactivated + h1 := s.h1() + h2 := s.h2() + h3 := s.h3() + + // at this stage we have + // s1 = α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ) + // s2 = -α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) utils.Parallelize(len(blindedZCanonical), func(start, end int) { cql := s.trace.Ql.Coefficients() @@ -1343,45 +1320,50 @@ func (s *instance) innerComputeLinearizedPoly(lZeta, rZeta, oZeta, alpha, beta, var t, t0, t1 fr.Element for i := start; i < end; i++ { - - t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) - + t.Mul(&blindedZCanonical[i], &s2) // -Z(X)*α*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ) if i < len(s3canonical) { - - t0.Mul(&s3canonical[i], &s1) // (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*β*s3(X) - + t0.Mul(&s3canonical[i], &s1) // α*(l(ζ)+β*s1(β)+γ)*(r(ζ)+β*s2(β)+γ)*β*Z(μζ)*β*s3(X) t.Add(&t, &t0) } - - t.Mul(&t, &alpha) // α*( (l(ζ)+β*s1(ζ)+γ)*(r(ζ)+β*s2(ζ)+γ)*Z(μζ)*s3(X) - Z(X)*(l(ζ)+β*ζ+γ)*(r(ζ)+β*u*ζ+γ)*(o(ζ)+β*u²*ζ+γ)) - if i < len(cqm) { - - t1.Mul(&cqm[i], &rl) // linPol = linPol + l(ζ)r(ζ)*Qm(X) - - t0.Mul(&cql[i], &lZeta) - t0.Add(&t0, &t1) - - t.Add(&t, &t0) // linPol = linPol + l(ζ)*Ql(X) - - t0.Mul(&cqr[i], &rZeta) - t.Add(&t, &t0) // linPol = linPol + r(ζ)*Qr(X) - - t0.Mul(&cqo[i], &oZeta) - t0.Add(&t0, &cqk[i]) - - t.Add(&t, &t0) // linPol = linPol + o(ζ)*Qo(X) + Qk(X) - - for j := range qcpZeta { + t1.Mul(&cqm[i], &rl) // l(ζ)r(ζ)*Qm(X) + t.Add(&t, &t1) // linPol += l(ζ)r(ζ)*Qm(X) + t0.Mul(&cql[i], &lZeta) // l(ζ)Q_l(X) + t.Add(&t, &t0) // linPol += l(ζ)*Ql(X) + t0.Mul(&cqr[i], &rZeta) //r(ζ)*Qr(X) + t.Add(&t, &t0) // linPol += r(ζ)*Qr(X) + t0.Mul(&cqo[i], &oZeta) // o(ζ)*Qo(X) + t.Add(&t, &t0) // linPol += o(ζ)*Qo(X) + t.Add(&t, &cqk[i]) // linPol += Qk(X) + for j := range qcpZeta { // linPol += ∑ᵢQcp_(ζ)Pi_(X) t0.Mul(&pi2Canonical[j][i], &qcpZeta[j]) t.Add(&t, &t0) } } - t0.Mul(&blindedZCanonical[i], &lagrangeZeta) - blindedZCanonical[i].Add(&t, &t0) // finish the computation + t0.Mul(&blindedZCanonical[i], &alphaSquareLagrangeZero) // α²L₁(ζ)Z(X) + blindedZCanonical[i].Add(&t, &t0) // linPol += α²L₁(ζ)Z(X) + + // if statistical zeroknowledge is deactivated, len(h1)=len(h2)=len(h3)=len(blindedZ)-1. + // Else len(h1)=len(h2)=len(blindedZCanonical)=len(h3)+1 + if i < len(h3) { + t.Mul(&h3[i], &zetaNPlusTwo). + Add(&t, &h2[i]). + Mul(&t, &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } else { + if s.opt.StatisticalZK { + t.Mul(&h2[i], &zetaNPlusTwo). + Add(&t, &h1[i]). + Mul(&t, &zhZeta) + blindedZCanonical[i].Sub(&blindedZCanonical[i], &t) // linPol -= Z_h(ζ)*(H₀(X) + ζᵐ⁺²*H₁(X) + ζ²⁽ᵐ⁺²⁾*H₂(X)) + } + } } }) + return blindedZCanonical } diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/setup.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/setup.go index 9764e5a796..b9cd13daed 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/setup.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/setup.go @@ -18,7 +18,6 @@ package plonk import ( "fmt" - "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark-crypto/ecc/bw6-761/fr" "github.com/consensys/gnark-crypto/ecc/bw6-761/fr/fft" "github.com/consensys/gnark-crypto/ecc/bw6-761/fr/iop" @@ -96,7 +95,7 @@ func Setup(spr *cs.SparseR1CS, srs, srsLagrange kzg.SRS) (*ProvingKey, *Verifyin // step 0: set the fft domains domain := initFFTDomain(spr) if domain.Cardinality < 2 { - return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", spr.GetNbConstraints()) + return nil, nil, fmt.Errorf("circuit has only %d constraints; unsupported by the current implementation", len(spr.Public)+spr.GetNbConstraints()) } // check the size of the kzg srs. @@ -154,9 +153,7 @@ func (pk *ProvingKey) VerifyingKey() interface{} { func NewTrace(spr *cs.SparseR1CS, domain *fft.Domain) *Trace { var trace Trace - nbConstraints := spr.GetNbConstraints() - sizeSystem := uint64(nbConstraints + len(spr.Public)) - size := ecc.NextPowerOfTwo(sizeSystem) + size := int(domain.Cardinality) commitmentInfo := spr.CommitmentInfo.(constraint.PlonkCommitments) ql := make([]fr.Element, size) diff --git a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/verify.go b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/verify.go index 17edc2fdef..23522a2dca 100644 --- a/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/verify.go +++ b/galoisd/vendor/github.com/consensys/gnark/backend/plonk/bw6-761/verify.go @@ -22,6 +22,7 @@ import ( "io" "math/big" + "github.com/consensys/gnark/backend/solidity" "time" "github.com/consensys/gnark-crypto/ecc" @@ -39,11 +40,13 @@ import ( ) var ( - errWrongClaimedQuotient = errors.New("claimed quotient is not as expected") - errInvalidWitness = errors.New("witness length is invalid") + errAlgebraicRelation = errors.New("algebraic relation does not hold") + errInvalidWitness = errors.New("witness length is invalid") + errInvalidPoint = errors.New("point is not on the curve") ) func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...backend.VerifierOption) error { + log := logger.Logger().With().Str("curve", "bw6-761").Str("backend", "plonk").Logger() start := time.Now() cfg, err := backend.NewVerifierConfig(opts...) @@ -59,6 +62,32 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return errInvalidWitness } + // check that the points in the proof are on the curve + for i := 0; i < len(proof.LRO); i++ { + if !proof.LRO[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.Z.IsInSubGroup() { + return errInvalidPoint + } + for i := 0; i < len(proof.H); i++ { + if !proof.H[i].IsInSubGroup() { + return errInvalidPoint + } + } + for i := 0; i < len(proof.Bsb22Commitments); i++ { + if !proof.Bsb22Commitments[i].IsInSubGroup() { + return errInvalidPoint + } + } + if !proof.BatchedProof.H.IsInSubGroup() { + return errInvalidPoint + } + if !proof.ZShiftedOpening.H.IsInSubGroup() { + return errInvalidPoint + } + // transcript to derive the challenge fs := fiatshamir.NewTranscript(cfg.ChallengeHash, "gamma", "beta", "alpha", "zeta") @@ -79,7 +108,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // derive alpha from Comm(l), Comm(r), Comm(o), Com(Z), Bsb22Commitments + // derive alpha from Com(Z), Bsb22Commitments alphaDeps := make([]*curve.G1Affine, len(proof.Bsb22Commitments)+1) for i := range proof.Bsb22Commitments { alphaDeps[i] = &proof.Bsb22Commitments[i] @@ -96,37 +125,42 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac return err } - // evaluation of Z=Xⁿ⁻¹ at ζ - var zetaPowerM, zzeta fr.Element + // evaluation of zhZeta=ζⁿ-1 + var zetaPowerM, zhZeta, lagrangeZero fr.Element var bExpo big.Int one := fr.One() bExpo.SetUint64(vk.Size) zetaPowerM.Exp(zeta, &bExpo) - zzeta.Sub(&zetaPowerM, &one) + zhZeta.Sub(&zetaPowerM, &one) // ζⁿ-1 + lagrangeZero.Sub(&zeta, &one). // ζ-1 + Inverse(&lagrangeZero). // 1/(ζ-1) + Mul(&lagrangeZero, &zhZeta). // (ζ^n-1)/(ζ-1) + Mul(&lagrangeZero, &vk.SizeInv) // 1/n * (ζ^n-1)/(ζ-1) // compute PI = ∑_{i= len(cs.Levels) { - cs.Levels = append(cs.Levels, []int{iID}) + cs.Levels = append(cs.Levels, []uint32{iID}) } else { cs.Levels[level] = append(cs.Levels[level], iID) } diff --git a/galoisd/vendor/github.com/consensys/gnark/constraint/marshal.go b/galoisd/vendor/github.com/consensys/gnark/constraint/marshal.go new file mode 100644 index 0000000000..06a0d2d6b7 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/constraint/marshal.go @@ -0,0 +1,363 @@ +package constraint + +import ( + "bytes" + "encoding/binary" + "errors" + "reflect" + + "github.com/consensys/gnark/internal/backend/ioutils" + "github.com/fxamacker/cbor/v2" + "golang.org/x/sync/errgroup" +) + +// ToBytes serializes the constraint system to a byte slice +// This is not meant to be called directly since the constraint.System is embedded in +// a "curve-typed" system (e.g. bls12-381.system) +func (cs *System) ToBytes() ([]byte, error) { + // we prepare and write 4 distinct blocks of data; + // that allow for a more efficient serialization/deserialization (+ parallelism) + var calldata, instructions, levels []byte + var g errgroup.Group + g.Go(func() error { + var err error + calldata, err = cs.calldataToBytes() + return err + }) + g.Go(func() error { + var err error + instructions, err = cs.instructionsToBytes() + return err + }) + g.Go(func() error { + var err error + levels, err = cs.levelsToBytes() + return err + }) + body, err := cs.toBytes() + if err != nil { + return nil, err + } + + if err := g.Wait(); err != nil { + return nil, err + } + + // header + h := header{ + levelsLen: uint64(len(levels)), + instructionsLen: uint64(len(instructions)), + calldataLen: uint64(len(calldata)), + bodyLen: uint64(len(body)), + } + + // write header + buf := h.toBytes() + buf = append(buf, levels...) + buf = append(buf, instructions...) + buf = append(buf, calldata...) + buf = append(buf, body...) + + return buf, nil +} + +// FromBytes deserializes the constraint system from a byte slice +// This is not meant to be called directly since the constraint.System is embedded in +// a "curve-typed" system (e.g. bls12-381.system) +func (cs *System) FromBytes(data []byte) (int, error) { + if len(data) < headerLen { + return 0, errors.New("invalid data length") + } + + // read the header which contains the length of each section + h := new(header) + h.fromBytes(data) + + if len(data) < headerLen+int(h.levelsLen)+int(h.instructionsLen)+int(h.calldataLen)+int(h.bodyLen) { + return 0, errors.New("invalid data length") + } + + // read the sections in parallel + var g errgroup.Group + g.Go(func() error { + return cs.levelsFromBytes(data[headerLen : headerLen+h.levelsLen]) + }) + + g.Go(func() error { + return cs.instructionsFromBytes(data[headerLen+h.levelsLen : headerLen+h.levelsLen+h.instructionsLen]) + }) + + g.Go(func() error { + return cs.calldataFromBytes(data[headerLen+h.levelsLen+h.instructionsLen : headerLen+h.levelsLen+h.instructionsLen+h.calldataLen]) + }) + + // CBOR decoding of the constraint system (except what we do directly in binary) + ts := getTagSet() + dm, err := cbor.DecOptions{ + MaxArrayElements: 2147483647, + MaxMapPairs: 2147483647, + }.DecModeWithTags(ts) + + if err != nil { + return 0, err + } + decoder := dm.NewDecoder(bytes.NewReader(data[headerLen+h.levelsLen+h.instructionsLen+h.calldataLen : headerLen+h.levelsLen+h.instructionsLen+h.calldataLen+h.bodyLen])) + + if err := decoder.Decode(&cs); err != nil { + return 0, err + } + + if err := cs.CheckSerializationHeader(); err != nil { + return 0, err + } + + switch v := cs.CommitmentInfo.(type) { + case *Groth16Commitments: + cs.CommitmentInfo = *v + case *PlonkCommitments: + cs.CommitmentInfo = *v + } + + if err := g.Wait(); err != nil { + return 0, err + } + + return headerLen + int(h.levelsLen) + int(h.instructionsLen) + int(h.calldataLen) + int(h.bodyLen), nil +} + +func (cs *System) toBytes() ([]byte, error) { + // CBOR encoding of the constraint system (except what we do directly in binary) + ts := getTagSet() + enc, err := cbor.CoreDetEncOptions().EncModeWithTags(ts) + if err != nil { + return nil, err + } + buf := new(bytes.Buffer) + encoder := enc.NewEncoder(buf) + + // encode our object + err = encoder.Encode(cs) + if err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +const headerLen = 4 * 8 + +type header struct { + // length in bytes of each sections + levelsLen uint64 + instructionsLen uint64 + calldataLen uint64 + bodyLen uint64 +} + +func (h *header) toBytes() []byte { + buf := make([]byte, 0, 8*4+h.levelsLen+h.instructionsLen+h.calldataLen+h.bodyLen) + + buf = binary.LittleEndian.AppendUint64(buf, h.levelsLen) + buf = binary.LittleEndian.AppendUint64(buf, h.instructionsLen) + buf = binary.LittleEndian.AppendUint64(buf, h.calldataLen) + buf = binary.LittleEndian.AppendUint64(buf, h.bodyLen) + + return buf +} + +func (h *header) fromBytes(buf []byte) { + h.levelsLen = binary.LittleEndian.Uint64(buf[:8]) + h.instructionsLen = binary.LittleEndian.Uint64(buf[8:16]) + h.calldataLen = binary.LittleEndian.Uint64(buf[16:24]) + h.bodyLen = binary.LittleEndian.Uint64(buf[24:32]) +} + +func (cs *System) calldataToBytes() ([]byte, error) { + // calldata doesn't compress as well as the other sections; + // it still give a better size to use intcomp.CompressUint32 here, + // and an even better one to use binary.UVarint + // but, we keep it simple as it makes deserialization much faster + // user is still free to compress the final []byte slice if needed. + buf := make([]byte, 0, 8+len(cs.CallData)*binary.MaxVarintLen32) + buf = binary.LittleEndian.AppendUint64(buf, uint64(len(cs.CallData))) + // binary.LittleEndian.PutUint64(buf, uint64(len(cs.CallData))) + // buf = buf[:8+len(cs.CallData)*4] + for _, v := range cs.CallData { + buf = binary.AppendUvarint(buf, uint64(v)) + // binary.LittleEndian.PutUint32(buf[8+i*4:8+i*4+4], v) + } + return buf, nil +} + +func (cs *System) instructionsToBytes() ([]byte, error) { + // prepare the []uint32 separated slices for the packed instructions + sBlueprintID := make([]uint32, len(cs.Instructions)) + sConstraintOffset := make([]uint32, len(cs.Instructions)) + sWireOffset := make([]uint32, len(cs.Instructions)) + sStartCallData := make([]uint64, len(cs.Instructions)) + + // collect them + for i, inst := range cs.Instructions { + sBlueprintID[i] = uint32(inst.BlueprintID) + sConstraintOffset[i] = inst.ConstraintOffset + sWireOffset[i] = inst.WireOffset + sStartCallData[i] = inst.StartCallData + } + + // they compress very well due to their nature (sequential integers) + var buf32 []uint32 + var err error + var buf bytes.Buffer + buf.Grow(4 * len(cs.Instructions) * 3) + + buf32, err = ioutils.CompressAndWriteUints32(&buf, sBlueprintID, buf32) + if err != nil { + return nil, err + } + buf32, err = ioutils.CompressAndWriteUints32(&buf, sConstraintOffset, buf32) + if err != nil { + return nil, err + } + _, err = ioutils.CompressAndWriteUints32(&buf, sWireOffset, buf32) + if err != nil { + return nil, err + } + + err = ioutils.CompressAndWriteUints64(&buf, sStartCallData) + if err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func (cs *System) levelsToBytes() ([]byte, error) { + // they compress very well due to their nature (sequential integers) + var buf32 []uint32 + var buf bytes.Buffer + var err error + buf.Grow(4 * len(cs.Instructions)) + + binary.Write(&buf, binary.LittleEndian, uint64(len(cs.Levels))) + for _, l := range cs.Levels { + buf32, err = ioutils.CompressAndWriteUints32(&buf, l, buf32) + if err != nil { + return nil, err + } + } + + return buf.Bytes(), nil +} + +func (cs *System) levelsFromBytes(in []byte) error { + + levelsLen := binary.LittleEndian.Uint64(in[:8]) + + in = in[8:] + + var ( + buf32 []uint32 + err error + n int + ) + + cs.Levels = make([][]uint32, levelsLen) + for i := range cs.Levels { + buf32, n, cs.Levels[i], err = ioutils.ReadAndDecompressUints32(in, buf32) + if err != nil { + return err + } + in = in[n:] + } + + return nil +} + +func (cs *System) instructionsFromBytes(in []byte) error { + + // read the packed instructions + var ( + sBlueprintID, sConstraintOffset, sWireOffset []uint32 + sStartCallData []uint64 + err error + n int + buf32 []uint32 + ) + buf32, n, sBlueprintID, err = ioutils.ReadAndDecompressUints32(in, buf32) + if err != nil { + return err + } + in = in[n:] + buf32, n, sConstraintOffset, err = ioutils.ReadAndDecompressUints32(in, buf32) + if err != nil { + return err + } + in = in[n:] + _, n, sWireOffset, err = ioutils.ReadAndDecompressUints32(in, buf32) + if err != nil { + return err + } + in = in[n:] + _, sStartCallData, err = ioutils.ReadAndDecompressUints64(in) + if err != nil { + return err + } + + // rebuild the instructions + cs.Instructions = make([]PackedInstruction, len(sBlueprintID)) + for i := range cs.Instructions { + cs.Instructions[i] = PackedInstruction{ + BlueprintID: BlueprintID(sBlueprintID[i]), + ConstraintOffset: sConstraintOffset[i], + WireOffset: sWireOffset[i], + StartCallData: sStartCallData[i], + } + } + + return nil +} + +func (cs *System) calldataFromBytes(buf []byte) error { + calldataLen := binary.LittleEndian.Uint64(buf[:8]) + cs.CallData = make([]uint32, calldataLen) + buf = buf[8:] + for i := uint64(0); i < calldataLen; i++ { + v, n := binary.Uvarint(buf[:min(len(buf), binary.MaxVarintLen64)]) + if n <= 0 { + return errors.New("invalid calldata") + } + cs.CallData[i] = uint32(v) + buf = buf[n:] + } + return nil +} + +func getTagSet() cbor.TagSet { + // temporary for refactor + ts := cbor.NewTagSet() + // https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml + // 65536-15309735 Unassigned + tagNum := uint64(5309735) + addType := func(t reflect.Type) { + if err := ts.Add( + cbor.TagOptions{EncTag: cbor.EncTagRequired, DecTag: cbor.DecTagRequired}, + t, + tagNum, + ); err != nil { + panic(err) + } + tagNum++ + } + + addType(reflect.TypeOf(BlueprintGenericHint{})) + addType(reflect.TypeOf(BlueprintGenericR1C{})) + addType(reflect.TypeOf(BlueprintGenericSparseR1C{})) + addType(reflect.TypeOf(BlueprintSparseR1CAdd{})) + addType(reflect.TypeOf(BlueprintSparseR1CMul{})) + addType(reflect.TypeOf(BlueprintSparseR1CBool{})) + addType(reflect.TypeOf(BlueprintLookupHint{})) + addType(reflect.TypeOf(Groth16Commitments{})) + addType(reflect.TypeOf(PlonkCommitments{})) + + return ts +} diff --git a/galoisd/vendor/github.com/consensys/gnark/constraint/string_utils.go b/galoisd/vendor/github.com/consensys/gnark/constraint/string_utils.go index 427d5ed4e7..35740f417a 100644 --- a/galoisd/vendor/github.com/consensys/gnark/constraint/string_utils.go +++ b/galoisd/vendor/github.com/consensys/gnark/constraint/string_utils.go @@ -32,7 +32,7 @@ func (sbb *StringBuilder) WriteLinearExpression(l LinearExpression) { } } -// WriteLinearExpression appends the term to the current buffer +// WriteTerm appends the term to the current buffer func (sbb *StringBuilder) WriteTerm(t Term) { if t.CoeffID() == CoeffIdZero { sbb.WriteByte('0') diff --git a/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/coeff.go b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/coeff.go index 3aec8da553..73f8c0c5b0 100644 --- a/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/coeff.go +++ b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/coeff.go @@ -17,6 +17,8 @@ package cs import ( + "encoding/binary" + "errors" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/internal/utils" "math/big" @@ -46,6 +48,42 @@ func newCoeffTable(capacity int) CoeffTable { } +func (ct *CoeffTable) toBytes() []byte { + buf := make([]byte, 0, 8+len(ct.Coefficients)*fr.Bytes) + ctLen := uint64(len(ct.Coefficients)) + + buf = binary.LittleEndian.AppendUint64(buf, ctLen) + for _, c := range ct.Coefficients { + for _, w := range c { + buf = binary.LittleEndian.AppendUint64(buf, w) + } + } + + return buf +} + +func (ct *CoeffTable) fromBytes(buf []byte) error { + if len(buf) < 8 { + return errors.New("invalid buffer size") + } + ctLen := binary.LittleEndian.Uint64(buf[:8]) + buf = buf[8:] + + if uint64(len(buf)) < ctLen*fr.Bytes { + return errors.New("invalid buffer size") + } + ct.Coefficients = make([]fr.Element, ctLen) + for i := uint64(0); i < ctLen; i++ { + var c fr.Element + k := int(i) * fr.Bytes + for j := 0; j < fr.Limbs; j++ { + c[j] = binary.LittleEndian.Uint64(buf[k+j*8 : k+(j+1)*8]) + } + ct.Coefficients[i] = c + } + return nil +} + func (ct *CoeffTable) AddCoeff(coeff constraint.Element) uint32 { c := (*fr.Element)(coeff[:]) var cID uint32 diff --git a/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/marshal.go b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/marshal.go new file mode 100644 index 0000000000..ea13e57dad --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/marshal.go @@ -0,0 +1,101 @@ +// Copyright 2020 ConsenSys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by gnark DO NOT EDIT + +package cs + +import ( + "encoding/binary" + "fmt" + "io" + + "github.com/blang/semver/v4" +) + +// WriteTo encodes R1CS into provided io.Writer using cbor +func (cs *system) WriteTo(w io.Writer) (int64, error) { + b, err := cs.System.ToBytes() + if err != nil { + return 0, err + } + + c := cs.CoeffTable.toBytes() + + totalLen := uint64(len(b) + len(c)) + gnarkVersion := semver.MustParse(cs.GnarkVersion) + // write totalLen, gnarkVersion.Major, gnarkVersion.Minor, gnarkVersion.Patch using + // binary.LittleEndian + if err := binary.Write(w, binary.LittleEndian, totalLen); err != nil { + return 0, err + } + if err := binary.Write(w, binary.LittleEndian, gnarkVersion.Major); err != nil { + return 0, err + } + if err := binary.Write(w, binary.LittleEndian, gnarkVersion.Minor); err != nil { + return 0, err + } + if err := binary.Write(w, binary.LittleEndian, gnarkVersion.Patch); err != nil { + return 0, err + } + + // write the system + n, err := w.Write(b) + if err != nil { + return int64(n), err + } + + // write the coeff table + m, err := w.Write(c) + return int64(n+m) + 4*8, err +} + +// ReadFrom attempts to decode R1CS from io.Reader using cbor +func (cs *system) ReadFrom(r io.Reader) (int64, error) { + var totalLen uint64 + if err := binary.Read(r, binary.LittleEndian, &totalLen); err != nil { + return 0, err + } + + var major, minor, patch uint64 + if err := binary.Read(r, binary.LittleEndian, &major); err != nil { + return 0, err + } + if err := binary.Read(r, binary.LittleEndian, &minor); err != nil { + return 0, err + } + if err := binary.Read(r, binary.LittleEndian, &patch); err != nil { + return 0, err + } + // TODO @gbotrel validate version, duplicate logic with core.go CheckSerializationHeader + if major != 0 || minor < 10 { + return 0, fmt.Errorf("unsupported gnark version %d.%d.%d", major, minor, patch) + } + + data := make([]byte, totalLen) + if _, err := io.ReadFull(r, data); err != nil { + return 0, err + } + n, err := cs.System.FromBytes(data) + if err != nil { + return 0, err + } + data = data[n:] + + if err := cs.CoeffTable.fromBytes(data); err != nil { + return 0, err + } + + return int64(totalLen) + 4*8, nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/solver.go b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/solver.go index 11fe6a7ba7..84e920572d 100644 --- a/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/solver.go +++ b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/solver.go @@ -430,7 +430,7 @@ func (solver *solver) run() error { // then we check that the constraint is valid // if a[i] * b[i] != c[i]; it means the constraint is not satisfied var wg sync.WaitGroup - chTasks := make(chan []int, solver.nbTasks) + chTasks := make(chan []uint32, solver.nbTasks) chError := make(chan error, solver.nbTasks) // start a worker pool diff --git a/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/system.go b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/system.go index dceacfe31d..e8671cea2e 100644 --- a/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/system.go +++ b/galoisd/vendor/github.com/consensys/gnark/constraint/tinyfield/system.go @@ -17,16 +17,13 @@ package cs import ( - "github.com/fxamacker/cbor/v2" "io" "time" "github.com/consensys/gnark/backend/witness" "github.com/consensys/gnark/constraint" csolver "github.com/consensys/gnark/constraint/solver" - "github.com/consensys/gnark/internal/backend/ioutils" "github.com/consensys/gnark/logger" - "reflect" "github.com/consensys/gnark-crypto/ecc" @@ -149,55 +146,6 @@ func (cs *system) CurveID() ecc.ID { return ecc.UNKNOWN } -// WriteTo encodes R1CS into provided io.Writer using cbor -func (cs *system) WriteTo(w io.Writer) (int64, error) { - _w := ioutils.WriterCounter{W: w} // wraps writer to count the bytes written - ts := getTagSet() - enc, err := cbor.CoreDetEncOptions().EncModeWithTags(ts) - if err != nil { - return 0, err - } - encoder := enc.NewEncoder(&_w) - - // encode our object - err = encoder.Encode(cs) - return _w.N, err -} - -// ReadFrom attempts to decode R1CS from io.Reader using cbor -func (cs *system) ReadFrom(r io.Reader) (int64, error) { - ts := getTagSet() - dm, err := cbor.DecOptions{ - MaxArrayElements: 2147483647, - MaxMapPairs: 2147483647, - }.DecModeWithTags(ts) - - if err != nil { - return 0, err - } - decoder := dm.NewDecoder(r) - - // initialize coeff table - cs.CoeffTable = newCoeffTable(0) - - if err := decoder.Decode(&cs); err != nil { - return int64(decoder.NumBytesRead()), err - } - - if err := cs.CheckSerializationHeader(); err != nil { - return int64(decoder.NumBytesRead()), err - } - - switch v := cs.CommitmentInfo.(type) { - case *constraint.Groth16Commitments: - cs.CommitmentInfo = *v - case *constraint.PlonkCommitments: - cs.CommitmentInfo = *v - } - - return int64(decoder.NumBytesRead()), nil -} - func (cs *system) GetCoefficient(i int) (r constraint.Element) { copy(r[:], cs.Coefficients[i][:]) return @@ -351,36 +299,6 @@ func (t *SparseR1CSSolution) ReadFrom(r io.Reader) (int64, error) { return n, err } -func getTagSet() cbor.TagSet { - // temporary for refactor - ts := cbor.NewTagSet() - // https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml - // 65536-15309735 Unassigned - tagNum := uint64(5309735) - addType := func(t reflect.Type) { - if err := ts.Add( - cbor.TagOptions{EncTag: cbor.EncTagRequired, DecTag: cbor.DecTagRequired}, - t, - tagNum, - ); err != nil { - panic(err) - } - tagNum++ - } - - addType(reflect.TypeOf(constraint.BlueprintGenericHint{})) - addType(reflect.TypeOf(constraint.BlueprintGenericR1C{})) - addType(reflect.TypeOf(constraint.BlueprintGenericSparseR1C{})) - addType(reflect.TypeOf(constraint.BlueprintSparseR1CAdd{})) - addType(reflect.TypeOf(constraint.BlueprintSparseR1CMul{})) - addType(reflect.TypeOf(constraint.BlueprintSparseR1CBool{})) - addType(reflect.TypeOf(constraint.BlueprintLookupHint{})) - addType(reflect.TypeOf(constraint.Groth16Commitments{})) - addType(reflect.TypeOf(constraint.PlonkCommitments{})) - - return ts -} - func (s *system) AddGkr(gkr constraint.GkrInfo) error { return s.System.AddGkr(gkr) } diff --git a/galoisd/vendor/github.com/consensys/gnark/doc.go b/galoisd/vendor/github.com/consensys/gnark/doc.go index 233687841c..73f850a3df 100644 --- a/galoisd/vendor/github.com/consensys/gnark/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark/doc.go @@ -22,7 +22,7 @@ import ( "github.com/consensys/gnark-crypto/ecc" ) -var Version = semver.MustParse("0.10.0-alpha") +var Version = semver.MustParse("0.10.0") // Curves return the curves supported by gnark func Curves() []ecc.ID { diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api.go b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api.go index 958741632d..a23665fbb8 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api.go @@ -294,12 +294,14 @@ func (builder *builder) Div(i1, i2 frontend.Variable) frontend.Variable { if !v2Constant { res := builder.newInternalVariable() - debug := builder.newDebugInfo("div", v1, "/", v2, " == ", res) v2Inv := builder.newInternalVariable() // note that here we ensure that v2 can't be 0, but it costs us one extra constraint c1 := builder.cs.AddR1C(builder.newR1C(v2, v2Inv, builder.cstOne()), builder.genericGate) c2 := builder.cs.AddR1C(builder.newR1C(v1, v2Inv, res), builder.genericGate) - builder.cs.AttachDebugInfo(debug, []int{c1, c2}) + if debug.Debug { + debug := builder.newDebugInfo("div", v1, "/", v2, " == ", res) + builder.cs.AttachDebugInfo(debug, []int{c1, c2}) + } return res } @@ -542,8 +544,6 @@ func (builder *builder) IsZero(i1 frontend.Variable) frontend.Variable { return builder.cstZero() } - debug := builder.newDebugInfo("isZero", a) - // x = 1/a // in a hint (x == 0 if a == 0) // m = -a*x + 1 // constrain m to be 1 if a == 0 // a * m = 0 // constrain m to be 0 if a != 0 @@ -563,7 +563,10 @@ func (builder *builder) IsZero(i1 frontend.Variable) frontend.Variable { // a * m = 0 // constrain m to be 0 if a != 0 c2 := builder.cs.AddR1C(builder.newR1C(a, m, builder.cstZero()), builder.genericGate) - builder.cs.AttachDebugInfo(debug, []int{c1, c2}) + if debug.Debug { + debug := builder.newDebugInfo("isZero", a) + builder.cs.AttachDebugInfo(debug, []int{c1, c2}) + } builder.MarkBoolean(m) diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api_assertions.go b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api_assertions.go index b75f200f7a..328194685c 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api_assertions.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/api_assertions.go @@ -28,6 +28,15 @@ import ( // AssertIsEqual adds an assertion in the constraint builder (i1 == i2) func (builder *builder) AssertIsEqual(i1, i2 frontend.Variable) { + c1, i1Constant := builder.constantValue(i1) + c2, i2Constant := builder.constantValue(i2) + + if i1Constant && i2Constant { + if c1 != c2 { + panic("non-equal constant values") + } + return + } // encoded 1 * i1 == i2 r := builder.getLinearExpression(builder.toVariable(i1)) o := builder.getLinearExpression(builder.toVariable(i2)) @@ -105,11 +114,10 @@ func (builder *builder) AssertIsLessOrEqual(v frontend.Variable, bound frontend. } } - nbBits := builder.cs.FieldBitLen() - vBits := bits.ToBinary(builder, v, bits.WithNbDigits(nbBits), bits.WithUnconstrainedOutputs()) - // bound is constant if bConst { + nbBits := builder.cs.FieldBitLen() + vBits := bits.ToBinary(builder, v, bits.WithNbDigits(nbBits), bits.WithUnconstrainedOutputs()) builder.MustBeLessOrEqCst(vBits, builder.cs.ToBigInt(cb), v) return } @@ -123,8 +131,6 @@ func (builder *builder) mustBeLessOrEqVar(a, bound frontend.Variable) { _, aConst := builder.constantValue(a) - debug := builder.newDebugInfo("mustBeLessOrEq", a, " <= ", bound) - nbBits := builder.cs.FieldBitLen() aBits := bits.ToBinary(builder, a, bits.WithNbDigits(nbBits), bits.WithUnconstrainedOutputs(), bits.OmitModulusCheck()) @@ -170,7 +176,10 @@ func (builder *builder) mustBeLessOrEqVar(a, bound frontend.Variable) { } } - builder.cs.AttachDebugInfo(debug, added) + if debug.Debug { + debug := builder.newDebugInfo("mustBeLessOrEq", a, " <= ", bound) + builder.cs.AttachDebugInfo(debug, added) + } } @@ -195,9 +204,6 @@ func (builder *builder) MustBeLessOrEqCst(aBits []frontend.Variable, bound *big. panic("AssertIsLessOrEqual: bound is too large, constraint will never be satisfied") } - // debug info - debug := builder.newDebugInfo("mustBeLessOrEq", aForDebug, " <= ", builder.toVariable(bound)) - // t trailing bits in the bound t := 0 for i := 0; i < nbBits; i++ { @@ -234,7 +240,8 @@ func (builder *builder) MustBeLessOrEqCst(aBits []frontend.Variable, bound *big. } } - if len(added) != 0 { + if debug.Debug && len(added) != 0 { + debug := builder.newDebugInfo("mustBeLessOrEq", aForDebug, " <= ", builder.toVariable(bound)) builder.cs.AttachDebugInfo(debug, added) } } diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/builder.go b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/builder.go index df1306b4c4..3102addbb5 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/builder.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/r1cs/builder.go @@ -58,7 +58,7 @@ type builder struct { kvstore.Store // map for recording boolean constrained variables (to not constrain them twice) - mtBooleans map[uint64][]expr.LinearExpression + mtBooleans map[[16]byte][]expr.LinearExpression tOne constraint.Element eZero, eOne expr.LinearExpression @@ -82,7 +82,7 @@ func newBuilder(field *big.Int, config frontend.CompileConfig) *builder { macCapacity = config.CompressThreshold } builder := builder{ - mtBooleans: make(map[uint64][]expr.LinearExpression, config.Capacity/10), + mtBooleans: make(map[[16]byte][]expr.LinearExpression, config.Capacity/10), config: config, heap: make(minHeap, 0, 100), mbuf1: make(expr.LinearExpression, 0, macCapacity), @@ -308,6 +308,9 @@ func (builder *builder) constantValue(v frontend.Variable) (constraint.Element, // and are always reduced to one element. may not always be true? return constraint.Element{}, false } + if _v[0].Coeff.IsZero() { + return constraint.Element{}, true + } if !(_v[0].WireID() == 0) { // public ONE WIRE return constraint.Element{}, false } diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api.go b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api.go index eacb0df6b2..21b6276672 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api.go @@ -351,9 +351,6 @@ func (builder *builder) Or(a, b frontend.Variable) frontend.Variable { return 0 } - res := builder.newInternalVariable() - builder.MarkBoolean(res) - // if one input is constant, ensure we put it in b if aConstant { a, b = b, a @@ -362,20 +359,14 @@ func (builder *builder) Or(a, b frontend.Variable) frontend.Variable { } if bConstant { - xa := a.(expr.Term) - // b = b - 1 - qL := _b - qL = builder.cs.Sub(qL, builder.tOne) - qL = builder.cs.Mul(qL, xa.Coeff) - // a * (b-1) + res == 0 - builder.addPlonkConstraint(sparseR1C{ - xa: xa.VID, - xc: res.VID, - qL: qL, - qO: builder.tOne, - }) - return res + if builder.cs.IsOne(_b) { + return 1 + } else { + return a + } } + res := builder.newInternalVariable() + builder.MarkBoolean(res) xa := a.(expr.Term) xb := b.(expr.Term) // -a - b + ab + res == 0 diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api_assertions.go b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api_assertions.go index 3fe9ef1d9a..bce25ec16b 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api_assertions.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/api_assertions.go @@ -20,6 +20,7 @@ import ( "fmt" "math/big" + "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/debug" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/frontend/internal/expr" @@ -165,11 +166,10 @@ func (builder *builder) AssertIsLessOrEqual(v frontend.Variable, bound frontend. } } - nbBits := builder.cs.FieldBitLen() - vBits := bits.ToBinary(builder, v, bits.WithNbDigits(nbBits), bits.WithUnconstrainedOutputs()) - // bound is constant if bConst { + nbBits := builder.cs.FieldBitLen() + vBits := bits.ToBinary(builder, v, bits.WithNbDigits(nbBits), bits.WithUnconstrainedOutputs()) builder.MustBeLessOrEqCst(vBits, builder.cs.ToBigInt(cb), v) return } @@ -182,8 +182,10 @@ func (builder *builder) AssertIsLessOrEqual(v frontend.Variable, bound frontend. } func (builder *builder) mustBeLessOrEqVar(a frontend.Variable, bound expr.Term) { - - debug := builder.newDebugInfo("mustBeLessOrEq", a, " <= ", bound) + var debugInfo []constraint.DebugInfo + if debug.Debug { + debugInfo = []constraint.DebugInfo{builder.newDebugInfo("mustBeLessOrEq", a, " <= ", bound)} + } nbBits := builder.cs.FieldBitLen() @@ -219,14 +221,14 @@ func (builder *builder) mustBeLessOrEqVar(a frontend.Variable, bound expr.Term) builder.addPlonkConstraint(sparseR1C{ xa: l.VID, qL: l.Coeff, - }, debug) + }, debugInfo...) } else { // l * a[i] == 0 builder.addPlonkConstraint(sparseR1C{ xa: l.VID, xb: aBits[i].(expr.Term).VID, qM: l.Coeff, - }, debug) + }, debugInfo...) } } @@ -254,8 +256,11 @@ func (builder *builder) MustBeLessOrEqCst(aBits []frontend.Variable, bound *big. panic("AssertIsLessOrEqual: bound is too large, constraint will never be satisfied") } - // debug info - debug := builder.newDebugInfo("mustBeLessOrEq", aForDebug, " <= ", bound) + // debugInfo info + var debugInfo []constraint.DebugInfo + if debug.Debug { + debugInfo = []constraint.DebugInfo{builder.newDebugInfo("mustBeLessOrEq", aForDebug, " <= ", bound)} + } // t trailing bits in the bound t := 0 @@ -289,7 +294,7 @@ func (builder *builder) MustBeLessOrEqCst(aBits []frontend.Variable, bound *big. xa: l.VID, xb: aBits[i].(expr.Term).VID, qM: builder.tOne, - }, debug) + }, debugInfo...) } else { builder.AssertIsBoolean(aBits[i]) } diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/builder.go b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/builder.go index 16a9ddd289..49e0289e15 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/builder.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/cs/scs/builder.go @@ -17,6 +17,7 @@ limitations under the License. package scs import ( + "fmt" "math/big" "reflect" "sort" @@ -191,6 +192,13 @@ func (builder *builder) addPlonkConstraint(c sparseR1C, debugInfo ...constraint. if !c.qM.IsZero() && (c.xa == 0 || c.xb == 0) { // TODO this is internal but not easy to detect; if qM is set, but one or both of xa / xb is not, // since wireID == 0 is a valid wire, it may trigger unexpected behavior. + // + // ivokub: This essentially means we add a constraint which is always + // satisfied for any input. It only increases the number of constraints + // without adding any real constraints on the inputs. But this is good + // to catch unoptimal code on the caller side -- we have found a few + // multiplications by zero in field emulation and emulated group + // arithmetic. And this has allowed to optimize the implementation. log := logger.Logger() log.Warn().Msg("adding a plonk constraint with qM set but xa or xb == 0 (wire 0)") } @@ -312,7 +320,10 @@ func (builder *builder) ConstantValue(v frontend.Variable) (*big.Int, bool) { } func (builder *builder) constantValue(v frontend.Variable) (constraint.Element, bool) { - if _, ok := v.(expr.Term); ok { + if vv, ok := v.(expr.Term); ok { + if vv.Coeff.IsZero() { + return constraint.Element{}, true + } return constraint.Element{}, false } return builder.cs.FromInterface(v), true @@ -686,3 +697,70 @@ func (builder *builder) ToCanonicalVariable(v frontend.Variable) frontend.Canoni return term } } + +// GetWireConstraints returns the pairs (constraintID, wireLocation) for the +// given wires in the compiled constraint system: +// - constraintID is the index of the constraint in the constraint system. +// - wireLocation is the location of the wire in the constraint (0=xA or 1=xB). +// +// If the argument addMissing is true, then the function will add a new +// constraint for each wire that is not found in the constraint system. This may +// happen when getting the constraint for a witness which is not used in +// constraints. Otherwise, when addMissing is false, the function returns an +// error if a wire is not found in the constraint system. +// +// The method only returns a single pair (constraintID, wireLocation) for every +// unique wire (removing duplicates). The order of the returned pairs is not the +// same as for the given arguments. +func (builder *builder) GetWireConstraints(wires []frontend.Variable, addMissing bool) ([][2]int, error) { + // construct a lookup table table for later quick access when iterating over instructions + lookup := make(map[int]struct{}) + for _, w := range wires { + ww, ok := w.(expr.Term) + if !ok { + panic("input wire is not a Term") + } + lookup[ww.WireID()] = struct{}{} + } + nbPub := builder.cs.GetNbPublicVariables() + res := make([][2]int, 0, len(wires)) + iterator := builder.cs.GetSparseR1CIterator() + for c, constraintIdx := iterator.Next(), 0; c != nil; c, constraintIdx = iterator.Next(), constraintIdx+1 { + if _, ok := lookup[int(c.XA)]; ok { + res = append(res, [2]int{nbPub + constraintIdx, 0}) + delete(lookup, int(c.XA)) + } + if _, ok := lookup[int(c.XB)]; ok { + res = append(res, [2]int{nbPub + constraintIdx, 1}) + delete(lookup, int(c.XB)) + } + if _, ok := lookup[int(c.XC)]; ok { + res = append(res, [2]int{nbPub + constraintIdx, 2}) + delete(lookup, int(c.XC)) + } + if len(lookup) == 0 { + // we can break early if we found constraints for all the wires + break + } + } + if addMissing { + nbWitnessWires := builder.cs.GetNbPublicVariables() + builder.cs.GetNbSecretVariables() + for k := range lookup { + if k >= nbWitnessWires { + return nil, fmt.Errorf("addMissing is true, but wire %d is not a witness", k) + } + constraintIdx := builder.cs.AddSparseR1C(constraint.SparseR1C{ + XA: uint32(k), + XC: uint32(k), + QL: constraint.CoeffIdOne, + QO: constraint.CoeffIdMinusOne, + }, builder.genericGate) + res = append(res, [2]int{nbPub + constraintIdx, 0}) + delete(lookup, k) + } + } + if len(lookup) > 0 { + return nil, fmt.Errorf("constraint with wire not found in circuit") + } + return res, nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/linear_expression.go b/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/linear_expression.go index 682bf0985d..8aabe7ed95 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/linear_expression.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/linear_expression.go @@ -2,6 +2,7 @@ package expr import ( "github.com/consensys/gnark/constraint" + "golang.org/x/crypto/blake2b" ) type LinearExpression []Term @@ -52,12 +53,16 @@ func (l LinearExpression) Less(i, j int) bool { return iID < jID } -// HashCode returns a fast-to-compute but NOT collision resistant hash code identifier for the linear -// expression -func (l LinearExpression) HashCode() uint64 { - h := uint64(17) - for _, val := range l { - h = h*23 + val.HashCode() // TODO @gbotrel revisit +// HashCode returns a collision-resistant identifier of the linear expression. It is constructed from the hash codes of the terms. +func (l LinearExpression) HashCode() [16]byte { + h, err := blake2b.New256(nil) + if err != nil { + panic(err) } - return h + for i := range l { + termHash := l[i].HashCode() + h.Write(termHash[:]) + } + crc := h.Sum(nil) + return [16]byte(crc[:16]) } diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/term.go b/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/term.go index 5c9ba5877c..ff803dd57f 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/term.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/internal/expr/term.go @@ -1,6 +1,11 @@ package expr -import "github.com/consensys/gnark/constraint" +import ( + "encoding/binary" + + "github.com/consensys/gnark/constraint" + "golang.org/x/crypto/blake2b" +) type Term struct { VID int @@ -20,6 +25,16 @@ func (t Term) WireID() int { return t.VID } -func (t Term) HashCode() uint64 { - return t.Coeff[0]*29 + uint64(t.VID<<12) +// HashCode returns a collision resistant hash code identifier for the term. +func (t Term) HashCode() [16]byte { + h, err := blake2b.New256(nil) + if err != nil { + panic(err) + } + h.Write(binary.BigEndian.AppendUint64(nil, uint64(t.VID))) + for i := range t.Coeff { + h.Write(binary.BigEndian.AppendUint64(nil, uint64(t.Coeff[i]))) + } + crc := h.Sum(nil) + return [16]byte(crc[:16]) } diff --git a/galoisd/vendor/github.com/consensys/gnark/frontend/schema/walk.go b/galoisd/vendor/github.com/consensys/gnark/frontend/schema/walk.go index e62a18db0e..f3a8fb9cab 100644 --- a/galoisd/vendor/github.com/consensys/gnark/frontend/schema/walk.go +++ b/galoisd/vendor/github.com/consensys/gnark/frontend/schema/walk.go @@ -96,6 +96,10 @@ func (w *walker) arraySliceElem(index int, v reflect.Value) error { if v.CanAddr() && v.Addr().CanInterface() { // TODO @gbotrel don't like that hook, undesirable side effects // will be hard to detect; (for example calling Parse multiple times will init multiple times!) + // + // ivokub: completely agree, I have had to work around quite a lot in + // field emulation to "deinitialize" the elements. Maybe we can have a + // destructor/deinit hook also? value := v.Addr().Interface() if ih, hasInitHook := value.(InitHook); hasInitHook { ih.GnarkInitHook() @@ -164,6 +168,10 @@ func (w *walker) StructField(sf reflect.StructField, v reflect.Value) error { if v.CanAddr() && v.Addr().CanInterface() { // TODO @gbotrel don't like that hook, undesirable side effects // will be hard to detect; (for example calling Parse multiple times will init multiple times!) + // + // ivokub: completely agree, I have had to work around quite a lot in + // field emulation to "deinitialize" the elements. Maybe we can have a + // destructor/deinit hook also? value := v.Addr().Interface() if ih, hasInitHook := value.(InitHook); hasInitHook { ih.GnarkInitHook() diff --git a/galoisd/vendor/github.com/consensys/gnark/internal/backend/ioutils/intcomp.go b/galoisd/vendor/github.com/consensys/gnark/internal/backend/ioutils/intcomp.go new file mode 100644 index 0000000000..def78616b1 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/internal/backend/ioutils/intcomp.go @@ -0,0 +1,74 @@ +package ioutils + +import ( + "encoding/binary" + "io" + + "github.com/ronanh/intcomp" +) + +// CompressAndWriteUints32 compresses a slice of uint32 and writes it to w. +// It returns the input buffer (possibly extended) for future use. +func CompressAndWriteUints32(w io.Writer, input []uint32, buffer []uint32) ([]uint32, error) { + buffer = buffer[:0] + buffer = intcomp.CompressUint32(input, buffer) + if err := binary.Write(w, binary.LittleEndian, uint64(len(buffer))); err != nil { + return nil, err + } + if err := binary.Write(w, binary.LittleEndian, buffer); err != nil { + return nil, err + } + return buffer, nil +} + +// CompressAndWriteUints64 compresses a slice of uint64 and writes it to w. +// It returns the input buffer (possibly extended) for future use. +func CompressAndWriteUints64(w io.Writer, input []uint64) error { + buffer := intcomp.CompressUint64(input, nil) + if err := binary.Write(w, binary.LittleEndian, uint64(len(buffer))); err != nil { + return err + } + return binary.Write(w, binary.LittleEndian, buffer) +} + +// ReadAndDecompressUints32 reads a compressed slice of uint32 from r and decompresses it. +// It returns the number of bytes read, the decompressed slice and an error. +func ReadAndDecompressUints32(in []byte, buf32 []uint32) (outbuf32 []uint32, read int, out []uint32, err error) { + if len(in) < 8 { + return buf32, 0, nil, io.ErrUnexpectedEOF + } + length := binary.LittleEndian.Uint64(in[:8]) + if uint64(len(in)) < 8+4*length { + return buf32, 0, nil, io.ErrUnexpectedEOF + } + in = in[8 : 8+4*length] + if cap(buf32) < int(length) { + buf32 = make([]uint32, length) + } else { + buf32 = buf32[:length] + } + + for i := 0; i < int(length); i++ { + buf32[i] = binary.LittleEndian.Uint32(in[4*i : 4*(i+1)]) + } + + return buf32, 8 + 4*int(length), intcomp.UncompressUint32(buf32, nil), nil +} + +// ReadAndDecompressUints64 reads a compressed slice of uint64 from r and decompresses it. +// It returns the number of bytes read, the decompressed slice and an error. +func ReadAndDecompressUints64(in []byte) (int, []uint64, error) { + if len(in) < 8 { + return 0, nil, io.ErrUnexpectedEOF + } + length := binary.LittleEndian.Uint64(in[:8]) + if uint64(len(in)) < 8+8*length { + return 0, nil, io.ErrUnexpectedEOF + } + in = in[8 : 8+8*length] + buffer := make([]uint64, length) + for i := 0; i < int(length); i++ { + buffer[i] = binary.LittleEndian.Uint64(in[8*i : 8*(i+1)]) + } + return 8 + 8*int(length), intcomp.UncompressUint64(buffer, nil), nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark/io/io.go b/galoisd/vendor/github.com/consensys/gnark/io/io.go index 268e0f84ba..3d6847f35e 100644 --- a/galoisd/vendor/github.com/consensys/gnark/io/io.go +++ b/galoisd/vendor/github.com/consensys/gnark/io/io.go @@ -39,3 +39,11 @@ type WriterRawTo interface { type UnsafeReaderFrom interface { UnsafeReadFrom(r io.Reader) (int64, error) } + +// BinaryDumper is the interface that wraps the WriteDump and ReadDump methods. +// WriteDump writes the object to w, ReadDump reads the object from r. +// The object is serialized in binary format, in a very fast, very unsafe way. +type BinaryDumper interface { + WriteDump(w io.Writer) error + ReadDump(r io.Reader) error +} diff --git a/galoisd/vendor/github.com/consensys/gnark/io/roundtrip.go b/galoisd/vendor/github.com/consensys/gnark/io/roundtrip.go index 92bb038cfc..ecac78afaf 100644 --- a/galoisd/vendor/github.com/consensys/gnark/io/roundtrip.go +++ b/galoisd/vendor/github.com/consensys/gnark/io/roundtrip.go @@ -73,3 +73,20 @@ func RoundTripCheck(from any, to func() any) error { return nil } + +func DumpRoundTripCheck(from any, to func() any) error { + var buf bytes.Buffer + + if err := from.(BinaryDumper).WriteDump(&buf); err != nil { + return err + } + + r := to().(BinaryDumper) + if err := r.ReadDump(bytes.NewReader(buf.Bytes())); err != nil { + return err + } + if !reflect.DeepEqual(from, r) { + return errors.New("reconstructed object don't match original (ReadDump)") + } + return nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark/profile/profile_worker.go b/galoisd/vendor/github.com/consensys/gnark/profile/profile_worker.go index 97817fe898..62b4a453fb 100644 --- a/galoisd/vendor/github.com/consensys/gnark/profile/profile_worker.go +++ b/galoisd/vendor/github.com/consensys/gnark/profile/profile_worker.go @@ -71,6 +71,8 @@ func collectSample(pc []uintptr) { if strings.HasSuffix(frame.Function, ".func1") { // TODO @gbotrel filter anonymous func better + // + // ivokub: relevant comment - if we have many anonymous functions in package, then the name of the anonymous function has different suffices. continue } diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12.go index abe8bd9a9e..22218351f7 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12.go @@ -49,8 +49,8 @@ func (e Ext12) Mul(x, y *E12) *E12 { a = e.Ext6.Mul(a, b) b = e.Ext6.Mul(&x.C0, &y.C0) c := e.Ext6.Mul(&x.C1, &y.C1) - z1 := e.Ext6.Sub(a, b) - z1 = e.Ext6.Sub(z1, c) + d := e.Ext6.Add(c, b) + z1 := e.Ext6.Sub(a, d) z0 := e.Ext6.MulByNonResidue(c) z0 = e.Ext6.Add(z0, b) return &E12{ @@ -101,8 +101,7 @@ func (e Ext12) IsZero(z *E12) frontend.Variable { func (e Ext12) Square(x *E12) *E12 { c0 := e.Ext6.Sub(&x.C0, &x.C1) c3 := e.Ext6.MulByNonResidue(&x.C1) - c3 = e.Ext6.Neg(c3) - c3 = e.Ext6.Add(&x.C0, c3) + c3 = e.Ext6.Sub(&x.C0, c3) c2 := e.Ext6.Mul(&x.C0, &x.C1) c0 = e.Ext6.Mul(c0, c3) c0 = e.Ext6.Add(c0, c2) @@ -115,6 +114,65 @@ func (e Ext12) Square(x *E12) *E12 { } } +// Granger--Scott cyclotomic square +func (e Ext12) CyclotomicSquare(x *E12) *E12 { + t0 := e.Ext2.Square(&x.C1.B1) + t1 := e.Ext2.Square(&x.C0.B0) + t6 := e.Ext2.Add(&x.C1.B1, &x.C0.B0) + t6 = e.Ext2.Square(t6) + t6 = e.Ext2.Sub(t6, t0) + t6 = e.Ext2.Sub(t6, t1) + t2 := e.Ext2.Square(&x.C0.B2) + t3 := e.Ext2.Square(&x.C1.B0) + t7 := e.Ext2.Add(&x.C0.B2, &x.C1.B0) + t7 = e.Ext2.Square(t7) + t7 = e.Ext2.Sub(t7, t2) + t7 = e.Ext2.Sub(t7, t3) + t4 := e.Ext2.Square(&x.C1.B2) + t5 := e.Ext2.Square(&x.C0.B1) + t8 := e.Ext2.Add(&x.C1.B2, &x.C0.B1) + t8 = e.Ext2.Square(t8) + t8 = e.Ext2.Sub(t8, t4) + t8 = e.Ext2.Sub(t8, t5) + t8 = e.Ext2.MulByNonResidue(t8) + t0 = e.Ext2.MulByNonResidue(t0) + t0 = e.Ext2.Add(t0, t1) + t2 = e.Ext2.MulByNonResidue(t2) + t2 = e.Ext2.Add(t2, t3) + t4 = e.Ext2.MulByNonResidue(t4) + t4 = e.Ext2.Add(t4, t5) + z00 := e.Ext2.Sub(t0, &x.C0.B0) + z00 = e.Ext2.Double(z00) + z00 = e.Ext2.Add(z00, t0) + z01 := e.Ext2.Sub(t2, &x.C0.B1) + z01 = e.Ext2.Double(z01) + z01 = e.Ext2.Add(z01, t2) + z02 := e.Ext2.Sub(t4, &x.C0.B2) + z02 = e.Ext2.Double(z02) + z02 = e.Ext2.Add(z02, t4) + z10 := e.Ext2.Add(t8, &x.C1.B0) + z10 = e.Ext2.Double(z10) + z10 = e.Ext2.Add(z10, t8) + z11 := e.Ext2.Add(t6, &x.C1.B1) + z11 = e.Ext2.Double(z11) + z11 = e.Ext2.Add(z11, t6) + z12 := e.Ext2.Add(t7, &x.C1.B2) + z12 = e.Ext2.Double(z12) + z12 = e.Ext2.Add(z12, t7) + return &E12{ + C0: E6{ + B0: *z00, + B1: *z01, + B2: *z02, + }, + C1: E6{ + B0: *z10, + B1: *z11, + B2: *z12, + }, + } +} + func (e Ext12) AssertIsEqual(x, y *E12) { e.Ext6.AssertIsEqual(&x.C0, &y.C0) e.Ext6.AssertIsEqual(&x.C1, &y.C1) diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12_pairing.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12_pairing.go index 257f7d640f..64d0d11fb8 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12_pairing.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e12_pairing.go @@ -4,6 +4,76 @@ import ( "github.com/consensys/gnark/std/math/emulated" ) +func (e Ext12) nSquareGS(z *E12, n int) *E12 { + for i := 0; i < n; i++ { + z = e.CyclotomicSquare(z) + } + return z +} + +// Exponentiation by U=6u+2 where t is the seed u=4965661367192848881 +func (e Ext12) ExpByU(x *E12) *E12 { + // ExpByU computation is derived from the addition chain: + // _10 = 2*1 + // _11 = 1 + _10 + // _110 = 2*_11 + // _111 = 1 + _110 + // _1100 = 2*_110 + // _1111 = _11 + _1100 + // _1100000 = _1100 << 3 + // _1100111 = _111 + _1100000 + // i22 = ((_1100111 << 2 + 1) << 5 + _1111) << 3 + // i38 = ((1 + i22) << 4 + _111) << 9 + _111 + // i50 = 2*((i38 << 4 + _11) << 5 + _1111) + // i61 = ((1 + i50) << 5 + _111) << 3 + _11 + // i75 = ((i61 << 6 + _111) << 4 + _111) << 2 + // return ((1 + i75) << 2 + 1) << 3 + // + // Operations: 64 squares 18 multiplies + // + // Generated by github.com/mmcloughlin/addchain v0.4.0. + + z := e.Square(x) + t0 := e.Mul(x, z) + t1 := e.Square(t0) + z = e.Mul(x, t1) + t2 := e.Square(t1) + t1 = e.Mul(t0, t2) + t2 = e.nSquareGS(t2, 3) + t2 = e.Mul(z, t2) + t2 = e.nSquareGS(t2, 2) + t2 = e.Mul(x, t2) + t2 = e.nSquareGS(t2, 5) + t2 = e.Mul(t1, t2) + t2 = e.nSquareGS(t2, 3) + t2 = e.Mul(x, t2) + t2 = e.nSquareGS(t2, 4) + t2 = e.Mul(z, t2) + t2 = e.nSquareGS(t2, 9) + t2 = e.Mul(z, t2) + t2 = e.nSquareGS(t2, 4) + t2 = e.Mul(t0, t2) + t2 = e.nSquareGS(t2, 5) + t1 = e.Mul(t1, t2) + t1 = e.Square(t1) + t1 = e.Mul(x, t1) + t1 = e.nSquareGS(t1, 5) + t1 = e.Mul(z, t1) + t1 = e.nSquareGS(t1, 3) + t0 = e.Mul(t0, t1) + t0 = e.nSquareGS(t0, 6) + t0 = e.Mul(z, t0) + t0 = e.nSquareGS(t0, 4) + z = e.Mul(z, t0) + z = e.nSquareGS(z, 2) + z = e.Mul(x, z) + z = e.nSquareGS(z, 2) + z = e.Mul(x, z) + z = e.nSquareGS(z, 3) + + return z +} + func (e Ext12) nSquareTorus(z *E6, n int) *E6 { for i := 0; i < n; i++ { z = e.SquareTorus(z) @@ -14,7 +84,7 @@ func (e Ext12) nSquareTorus(z *E6, n int) *E6 { // Exponentiation by the seed t=4965661367192848881 // The computations are performed on E6 compressed form using Torus-based arithmetic. func (e Ext12) ExptTorus(x *E6) *E6 { - // Expt computation is derived from the addition chain: + // ExptTorus computation is derived from the addition chain: // // _10 = 2*1 // _100 = 2*_10 @@ -154,8 +224,8 @@ func (e *Ext12) Mul034By034(d3, d4, c3, c4 *E2) [5]*E2 { tmp := e.Ext2.Add(c3, c4) x34 := e.Ext2.Add(d3, d4) x34 = e.Ext2.Mul(x34, tmp) - x34 = e.Ext2.Sub(x34, x3) - x34 = e.Ext2.Sub(x34, x4) + tmp = e.Ext2.Add(x4, x3) + x34 = e.Ext2.Sub(x34, tmp) zC0B0 := e.Ext2.MulByNonResidue(x4) zC0B0 = e.Ext2.Add(zC0B0, e.Ext2.One()) @@ -181,8 +251,8 @@ func (e *Ext12) MulBy01234(z *E12, x [5]*E2) *E12 { a = e.Ext6.Mul(a, b) b = e.Ext6.Mul(&z.C0, c0) c := e.Ext6.MulBy01(&z.C1, x[3], x[4]) - z1 := e.Ext6.Sub(a, b) - z1 = e.Ext6.Sub(z1, c) + d := e.Ext6.Add(c, b) + z1 := e.Ext6.Sub(a, d) z0 := e.Ext6.MulByNonResidue(c) z0 = e.Ext6.Add(z0, b) return &E12{ @@ -211,8 +281,8 @@ func (e *Ext12) Mul01234By034(x [5]*E2, z3, z4 *E2) *E12 { b := e.Ext6.Add(c0, c1) a = e.Ext6.Mul(a, b) c := e.Ext6.Mul01By01(z3, z4, x[3], x[4]) - z1 := e.Ext6.Sub(a, c0) - z1 = e.Ext6.Sub(z1, c) + b = e.Ext6.Add(c0, c) + z1 := e.Ext6.Sub(a, b) z0 := e.Ext6.MulByNonResidue(c) z0 = e.Ext6.Add(z0, c0) return &E12{ @@ -351,3 +421,124 @@ func (e Ext12) FrobeniusCubeTorus(y *E6) *E6 { return res } + +// FinalExponentiationCheck checks that a Miller function output x lies in the +// same equivalence class as the reduced pairing. This replaces the final +// exponentiation step in-circuit. +// The method follows Section 4 of [On Proving Pairings] paper by A. Novakovic and L. Eagen. +// +// [On Proving Pairings]: https://eprint.iacr.org/2024/640.pdf +func (e Ext12) FinalExponentiationCheck(x *E12) *E12 { + res, err := e.fp.NewHint(finalExpHint, 24, &x.C0.B0.A0, &x.C0.B0.A1, &x.C0.B1.A0, &x.C0.B1.A1, &x.C0.B2.A0, &x.C0.B2.A1, &x.C1.B0.A0, &x.C1.B0.A1, &x.C1.B1.A0, &x.C1.B1.A1, &x.C1.B2.A0, &x.C1.B2.A1) + if err != nil { + // err is non-nil only for invalid number of inputs + panic(err) + } + + residueWitness := E12{ + C0: E6{ + B0: E2{A0: *res[0], A1: *res[1]}, + B1: E2{A0: *res[2], A1: *res[3]}, + B2: E2{A0: *res[4], A1: *res[5]}, + }, + C1: E6{ + B0: E2{A0: *res[6], A1: *res[7]}, + B1: E2{A0: *res[8], A1: *res[9]}, + B2: E2{A0: *res[10], A1: *res[11]}, + }, + } + // constrain cubicNonResiduePower to be in Fp6 + cubicNonResiduePower := E12{ + C0: E6{ + B0: E2{A0: *res[12], A1: *res[13]}, + B1: E2{A0: *res[14], A1: *res[15]}, + B2: E2{A0: *res[16], A1: *res[17]}, + }, + C1: (*e.Ext6.Zero()), + } + + // Check that x * cubicNonResiduePower == residueWitness^λ + // where λ = 6u + 2 + q^3 - q^2 + q, with u the BN254 seed + // and residueWitness, cubicNonResiduePower from the hint. + t2 := e.Mul(&cubicNonResiduePower, x) + + t1 := e.FrobeniusCube(&residueWitness) + t0 := e.FrobeniusSquare(&residueWitness) + t1 = e.DivUnchecked(t1, t0) + t0 = e.Frobenius(&residueWitness) + t1 = e.Mul(t1, t0) + + // exponentiation by U=6u+2 + t0 = e.ExpByU(&residueWitness) + + t0 = e.Mul(t0, t1) + + e.AssertIsEqual(t0, t2) + + return nil +} + +func (e Ext12) Frobenius(x *E12) *E12 { + t0 := e.Ext2.Conjugate(&x.C0.B0) + t1 := e.Ext2.Conjugate(&x.C0.B1) + t2 := e.Ext2.Conjugate(&x.C0.B2) + t3 := e.Ext2.Conjugate(&x.C1.B0) + t4 := e.Ext2.Conjugate(&x.C1.B1) + t5 := e.Ext2.Conjugate(&x.C1.B2) + t1 = e.Ext2.MulByNonResidue1Power2(t1) + t2 = e.Ext2.MulByNonResidue1Power4(t2) + t3 = e.Ext2.MulByNonResidue1Power1(t3) + t4 = e.Ext2.MulByNonResidue1Power3(t4) + t5 = e.Ext2.MulByNonResidue1Power5(t5) + return &E12{ + C0: E6{ + B0: *t0, + B1: *t1, + B2: *t2, + }, + C1: E6{ + B0: *t3, + B1: *t4, + B2: *t5, + }, + } +} + +func (e Ext12) FrobeniusSquare(x *E12) *E12 { + z00 := &x.C0.B0 + z01 := e.Ext2.MulByNonResidue2Power2(&x.C0.B1) + z02 := e.Ext2.MulByNonResidue2Power4(&x.C0.B2) + z10 := e.Ext2.MulByNonResidue2Power1(&x.C1.B0) + z11 := e.Ext2.MulByNonResidue2Power3(&x.C1.B1) + z12 := e.Ext2.MulByNonResidue2Power5(&x.C1.B2) + return &E12{ + C0: E6{B0: *z00, B1: *z01, B2: *z02}, + C1: E6{B0: *z10, B1: *z11, B2: *z12}, + } +} + +func (e Ext12) FrobeniusCube(x *E12) *E12 { + t0 := e.Ext2.Conjugate(&x.C0.B0) + t1 := e.Ext2.Conjugate(&x.C0.B1) + t2 := e.Ext2.Conjugate(&x.C0.B2) + t3 := e.Ext2.Conjugate(&x.C1.B0) + t4 := e.Ext2.Conjugate(&x.C1.B1) + t5 := e.Ext2.Conjugate(&x.C1.B2) + t1 = e.Ext2.MulByNonResidue3Power2(t1) + t2 = e.Ext2.MulByNonResidue3Power4(t2) + t3 = e.Ext2.MulByNonResidue3Power1(t3) + t4 = e.Ext2.MulByNonResidue3Power3(t4) + t5 = e.Ext2.MulByNonResidue3Power5(t5) + return &E12{ + C0: E6{ + B0: *t0, + B1: *t1, + B2: *t2, + }, + C1: E6{ + B0: *t3, + B1: *t4, + B2: *t5, + }, + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e2.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e2.go index 161712f197..5d38c50eaf 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e2.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e2.go @@ -60,8 +60,8 @@ func NewExt2(api frontend.API) *Ext2 { } func (e Ext2) MulByElement(x *E2, y *baseEl) *E2 { - z0 := e.fp.MulMod(&x.A0, y) - z1 := e.fp.MulMod(&x.A1, y) + z0 := e.fp.Mul(&x.A0, y) + z1 := e.fp.Mul(&x.A1, y) return &E2{ A0: *z0, A1: *z1, @@ -134,8 +134,8 @@ func (e Ext2) MulByNonResidue1Power5(x *E2) *E2 { func (e Ext2) MulByNonResidue2Power1(x *E2) *E2 { element := emulated.ValueOf[emulated.BN254Fp]("21888242871839275220042445260109153167277707414472061641714758635765020556617") return &E2{ - A0: *e.fp.MulMod(&x.A0, &element), - A1: *e.fp.MulMod(&x.A1, &element), + A0: *e.fp.Mul(&x.A0, &element), + A1: *e.fp.Mul(&x.A1, &element), } } @@ -143,8 +143,8 @@ func (e Ext2) MulByNonResidue2Power1(x *E2) *E2 { func (e Ext2) MulByNonResidue2Power2(x *E2) *E2 { element := emulated.ValueOf[emulated.BN254Fp]("21888242871839275220042445260109153167277707414472061641714758635765020556616") return &E2{ - A0: *e.fp.MulMod(&x.A0, &element), - A1: *e.fp.MulMod(&x.A1, &element), + A0: *e.fp.Mul(&x.A0, &element), + A1: *e.fp.Mul(&x.A1, &element), } } @@ -152,8 +152,8 @@ func (e Ext2) MulByNonResidue2Power2(x *E2) *E2 { func (e Ext2) MulByNonResidue2Power3(x *E2) *E2 { element := emulated.ValueOf[emulated.BN254Fp]("21888242871839275222246405745257275088696311157297823662689037894645226208582") return &E2{ - A0: *e.fp.MulMod(&x.A0, &element), - A1: *e.fp.MulMod(&x.A1, &element), + A0: *e.fp.Mul(&x.A0, &element), + A1: *e.fp.Mul(&x.A1, &element), } } @@ -161,8 +161,8 @@ func (e Ext2) MulByNonResidue2Power3(x *E2) *E2 { func (e Ext2) MulByNonResidue2Power4(x *E2) *E2 { element := emulated.ValueOf[emulated.BN254Fp]("2203960485148121921418603742825762020974279258880205651966") return &E2{ - A0: *e.fp.MulMod(&x.A0, &element), - A1: *e.fp.MulMod(&x.A1, &element), + A0: *e.fp.Mul(&x.A0, &element), + A1: *e.fp.Mul(&x.A1, &element), } } @@ -170,8 +170,8 @@ func (e Ext2) MulByNonResidue2Power4(x *E2) *E2 { func (e Ext2) MulByNonResidue2Power5(x *E2) *E2 { element := emulated.ValueOf[emulated.BN254Fp]("2203960485148121921418603742825762020974279258880205651967") return &E2{ - A0: *e.fp.MulMod(&x.A0, &element), - A1: *e.fp.MulMod(&x.A1, &element), + A0: *e.fp.Mul(&x.A0, &element), + A1: *e.fp.Mul(&x.A1, &element), } } @@ -201,17 +201,20 @@ func (e Ext2) MulByNonResidue3Power5(x *E2) *E2 { } func (e Ext2) Mul(x, y *E2) *E2 { - a := e.fp.Add(&x.A0, &x.A1) - b := e.fp.Add(&y.A0, &y.A1) - a = e.fp.MulMod(a, b) - b = e.fp.MulMod(&x.A0, &y.A0) - c := e.fp.MulMod(&x.A1, &y.A1) - z1 := e.fp.Sub(a, b) - z1 = e.fp.Sub(z1, c) - z0 := e.fp.Sub(b, c) + + v0 := e.fp.Mul(&x.A0, &y.A0) + v1 := e.fp.Mul(&x.A1, &y.A1) + + b0 := e.fp.Sub(v0, v1) + b1 := e.fp.Add(&x.A0, &x.A1) + tmp := e.fp.Add(&y.A0, &y.A1) + b1 = e.fp.Mul(b1, tmp) + tmp = e.fp.Add(v0, v1) + b1 = e.fp.Sub(b1, tmp) + return &E2{ - A0: *z0, - A1: *z1, + A0: *b0, + A1: *b1, } } @@ -269,8 +272,8 @@ func (e Ext2) IsZero(z *E2) frontend.Variable { func (e Ext2) Square(x *E2) *E2 { a := e.fp.Add(&x.A0, &x.A1) b := e.fp.Sub(&x.A0, &x.A1) - a = e.fp.MulMod(a, b) - b = e.fp.MulMod(&x.A0, &x.A1) + a = e.fp.Mul(a, b) + b = e.fp.Mul(&x.A0, &x.A1) b = e.fp.MulConst(b, big.NewInt(2)) return &E2{ A0: *a, @@ -293,6 +296,14 @@ func (e Ext2) AssertIsEqual(x, y *E2) { e.fp.AssertIsEqual(&x.A1, &y.A1) } +func (e Ext2) IsEqual(x, y *E2) frontend.Variable { + xDiff := e.fp.Sub(&x.A0, &y.A0) + yDiff := e.fp.Sub(&x.A1, &y.A1) + xIsZero := e.fp.IsZero(xDiff) + yIsZero := e.fp.IsZero(yDiff) + return e.api.And(xIsZero, yIsZero) +} + func FromE2(y *bn254.E2) E2 { return E2{ A0: emulated.ValueOf[emulated.BN254Fp](y.A0), diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e6.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e6.go index 31ba7e0515..584043114c 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e6.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/e6.go @@ -1,8 +1,11 @@ package fields_bn254 import ( + "math/big" + "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/internal/frontendtype" ) type E6 struct { @@ -79,29 +82,138 @@ func (e Ext6) Sub(x, y *E6) *E6 { } } +// Mul multiplies two E6 elmts func (e Ext6) Mul(x, y *E6) *E6 { + if ft, ok := e.api.(frontendtype.FrontendTyper); ok { + switch ft.FrontendType() { + case frontendtype.R1CS: + return e.mulToom3OverKaratsuba(x, y) + case frontendtype.SCS: + return e.mulKaratsubaOverKaratsuba(x, y) + } + } + return e.mulKaratsubaOverKaratsuba(x, y) +} + +func (e Ext6) mulToom3OverKaratsuba(x, y *E6) *E6 { + // Toom-Cook-3x over Karatsuba: + // We start by computing five interpolation points – these are evaluations of + // the product x(u)y(u) with u ∈ {0, ±1, 2, ∞}: + // + // v0 = x(0)y(0) = x.A0 * y.A0 + // v1 = x(1)y(1) = (x.A0 + x.A1 + x.A2)(y.A0 + y.A1 + y.A2) + // v2 = x(−1)y(−1) = (x.A0 − x.A1 + x.A2)(y.A0 − y.A1 + y.A2) + // v3 = x(2)y(2) = (x.A0 + 2x.A1 + 4x.A2)(y.A0 + 2y.A1 + 4y.A2) + // v4 = x(∞)y(∞) = x.A2 * y.A2 + + v0 := e.Ext2.Mul(&x.B0, &y.B0) + + t1 := e.Ext2.Add(&x.B0, &x.B2) + t2 := e.Ext2.Add(&y.B0, &y.B2) + t3 := e.Ext2.Add(t2, &y.B1) + v1 := e.Ext2.Add(t1, &x.B1) + v1 = e.Ext2.Mul(v1, t3) + + t3 = e.Ext2.Sub(t2, &y.B1) + v2 := e.Ext2.Sub(t1, &x.B1) + v2 = e.Ext2.Mul(v2, t3) + + t1 = e.Ext2.MulByConstElement(&x.B1, big.NewInt(2)) + t2 = e.Ext2.MulByConstElement(&x.B2, big.NewInt(4)) + v3 := e.Ext2.Add(t1, t2) + v3 = e.Ext2.Add(v3, &x.B0) + t1 = e.Ext2.MulByConstElement(&y.B1, big.NewInt(2)) + t2 = e.Ext2.MulByConstElement(&y.B2, big.NewInt(4)) + t3 = e.Ext2.Add(t1, t2) + t3 = e.Ext2.Add(t3, &y.B0) + v3 = e.Ext2.Mul(v3, t3) + + v4 := e.Ext2.Mul(&x.B2, &y.B2) + + // Then the interpolation is performed as: + // + // a0 = v0 + β((1/2)v0 − (1/2)v1 − (1/6)v2 + (1/6)v3 − 2v4) + // a1 = −(1/2)v0 + v1 − (1/3)v2 − (1/6)v3 + 2v4 + βv4 + // a2 = −v0 + (1/2)v1 + (1/2)v2 − v4 + // + // where β is the cubic non-residue. + // + // In-circuit, we compute 6*x*y as + // c0 = 6v0 + β(3v0 − 3v1 − v2 + v3 − 12v4) + // a1 = -(3v0 + 2v2 + v3) + 6(v1 + 2v4 + βv4) + // a2 = 3(v1 + v2 - 2(v0 + v4)) + // + // and then divide a0, a1 and a2 by 6 using a hint. + + a0 := e.Ext2.MulByConstElement(v0, big.NewInt(6)) + t1 = e.Ext2.Sub(v0, v1) + t1 = e.Ext2.MulByConstElement(t1, big.NewInt(3)) + t1 = e.Ext2.Sub(t1, v2) + t1 = e.Ext2.Add(t1, v3) + t2 = e.Ext2.MulByConstElement(v4, big.NewInt(12)) + t1 = e.Ext2.Sub(t1, t2) + t1 = e.Ext2.MulByNonResidue(t1) + a0 = e.Ext2.Add(a0, t1) + + a1 := e.Ext2.MulByConstElement(v0, big.NewInt(3)) + t1 = e.Ext2.MulByConstElement(v2, big.NewInt(2)) + a1 = e.Ext2.Add(a1, t1) + a1 = e.Ext2.Add(a1, v3) + t1 = e.Ext2.MulByConstElement(v4, big.NewInt(2)) + t1 = e.Ext2.Add(t1, v1) + t2 = e.Ext2.MulByNonResidue(v4) + t1 = e.Ext2.Add(t1, t2) + t1 = e.Ext2.MulByConstElement(t1, big.NewInt(6)) + a1 = e.Ext2.Sub(t1, a1) + + a2 := e.Ext2.Add(v1, v2) + a2 = e.Ext2.MulByConstElement(a2, big.NewInt(3)) + t1 = e.Ext2.Add(v0, v4) + t1 = e.Ext2.MulByConstElement(t1, big.NewInt(6)) + a2 = e.Ext2.Sub(a2, t1) + + res := e.divE6By6([6]*baseEl{&a0.A0, &a0.A1, &a1.A0, &a1.A1, &a2.A0, &a2.A1}) + return &E6{ + B0: E2{ + A0: *res[0], + A1: *res[1], + }, + B1: E2{ + A0: *res[2], + A1: *res[3], + }, + B2: E2{ + A0: *res[4], + A1: *res[5], + }, + } +} + +func (e Ext6) mulKaratsubaOverKaratsuba(x, y *E6) *E6 { + // Karatsuba over Karatsuba: + // Algorithm 13 from https://eprint.iacr.org/2010/354.pdf t0 := e.Ext2.Mul(&x.B0, &y.B0) t1 := e.Ext2.Mul(&x.B1, &y.B1) t2 := e.Ext2.Mul(&x.B2, &y.B2) c0 := e.Ext2.Add(&x.B1, &x.B2) tmp := e.Ext2.Add(&y.B1, &y.B2) c0 = e.Ext2.Mul(c0, tmp) - c0 = e.Ext2.Sub(c0, t1) - c0 = e.Ext2.Sub(c0, t2) + tmp = e.Ext2.Add(t2, t1) + c0 = e.Ext2.Sub(c0, tmp) c0 = e.Ext2.MulByNonResidue(c0) c0 = e.Ext2.Add(c0, t0) c1 := e.Ext2.Add(&x.B0, &x.B1) tmp = e.Ext2.Add(&y.B0, &y.B1) c1 = e.Ext2.Mul(c1, tmp) - c1 = e.Ext2.Sub(c1, t0) - c1 = e.Ext2.Sub(c1, t1) + tmp = e.Ext2.Add(t0, t1) + c1 = e.Ext2.Sub(c1, tmp) tmp = e.Ext2.MulByNonResidue(t2) c1 = e.Ext2.Add(c1, tmp) tmp = e.Ext2.Add(&x.B0, &x.B2) c2 := e.Ext2.Add(&y.B0, &y.B2) c2 = e.Ext2.Mul(c2, tmp) - c2 = e.Ext2.Sub(c2, t0) - c2 = e.Ext2.Sub(c2, t2) + tmp = e.Ext2.Add(t0, t2) + c2 = e.Ext2.Sub(c2, tmp) c2 = e.Ext2.Add(c2, t1) return &E6{ B0: *c0, @@ -148,6 +260,17 @@ func (e Ext6) Square(x *E6) *E6 { } } +func (e Ext6) MulByConstE2(x *E6, y *E2) *E6 { + z0 := e.Ext2.Mul(&x.B0, y) + z1 := e.Ext2.Mul(&x.B1, y) + z2 := e.Ext2.Mul(&x.B2, y) + return &E6{ + B0: *z0, + B1: *z1, + B2: *z2, + } +} + func (e Ext6) MulByE2(x *E6, y *E2) *E6 { z0 := e.Ext2.Mul(&x.B0, y) z1 := e.Ext2.Mul(&x.B1, y) @@ -204,8 +327,8 @@ func (e Ext6) MulBy01(z *E6, c0, c1 *E2) *E6 { t1 := e.Ext2.Add(c0, c1) tmp = e.Ext2.Add(&z.B0, &z.B1) t1 = e.Ext2.Mul(t1, tmp) - t1 = e.Ext2.Sub(t1, a) - t1 = e.Ext2.Sub(t1, b) + tmp = e.Ext2.Add(a, b) + t1 = e.Ext2.Sub(t1, tmp) return &E6{ B0: *t0, B1: *t1, @@ -234,8 +357,8 @@ func (e Ext6) Mul01By01(c0, c1, d0, d1 *E2) *E6 { t1 := e.Ext2.Add(c0, c1) tmp := e.Ext2.Add(d0, d1) t1 = e.Ext2.Mul(t1, tmp) - t1 = e.Ext2.Sub(t1, a) - t1 = e.Ext2.Sub(t1, b) + tmp = e.Ext2.Add(a, b) + t1 = e.Ext2.Sub(t1, tmp) return &E6{ B0: *a, B1: *t1, @@ -317,6 +440,37 @@ func (e Ext6) DivUnchecked(x, y *E6) *E6 { return &div } +func (e Ext6) divE6By6(x [6]*baseEl) [6]*baseEl { + res, err := e.fp.NewHint(divE6By6Hint, 6, x[0], x[1], x[2], x[3], x[4], x[5]) + if err != nil { + // err is non-nil only for invalid number of inputs + panic(err) + } + + y0 := *res[0] + y1 := *res[1] + y2 := *res[2] + y3 := *res[3] + y4 := *res[4] + y5 := *res[5] + + // xi == 6 * yi + x0 := e.fp.MulConst(&y0, big.NewInt(6)) + x1 := e.fp.MulConst(&y1, big.NewInt(6)) + x2 := e.fp.MulConst(&y2, big.NewInt(6)) + x3 := e.fp.MulConst(&y3, big.NewInt(6)) + x4 := e.fp.MulConst(&y4, big.NewInt(6)) + x5 := e.fp.MulConst(&y5, big.NewInt(6)) + e.fp.AssertIsEqual(x[0], x0) + e.fp.AssertIsEqual(x[1], x1) + e.fp.AssertIsEqual(x[2], x2) + e.fp.AssertIsEqual(x[3], x3) + e.fp.AssertIsEqual(x[4], x4) + e.fp.AssertIsEqual(x[5], x5) + + return [6]*baseEl{&y0, &y1, &y2, &y3, &y4, &y5} +} + func (e Ext6) Select(selector frontend.Variable, z1, z0 *E6) *E6 { b0 := e.Ext2.Select(selector, &z1.B0, &z0.B0) b1 := e.Ext2.Select(selector, &z1.B1, &z0.B1) diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/hints.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/hints.go index b08d6ed977..c5d68ed67d 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/hints.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/fields_bn254/hints.go @@ -4,6 +4,7 @@ import ( "math/big" "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/consensys/gnark/constraint/solver" "github.com/consensys/gnark/std/math/emulated" ) @@ -22,9 +23,11 @@ func GetHints() []solver.Hint { divE6Hint, inverseE6Hint, squareTorusHint, + divE6By6Hint, // E12 divE12Hint, inverseE12Hint, + finalExpHint, } } @@ -149,6 +152,36 @@ func squareTorusHint(nativeMod *big.Int, nativeInputs, nativeOutputs []*big.Int) }) } +func divE6By6Hint(nativeMod *big.Int, nativeInputs, nativeOutputs []*big.Int) error { + return emulated.UnwrapHint(nativeInputs, nativeOutputs, + func(mod *big.Int, inputs, outputs []*big.Int) error { + var a, c bn254.E6 + + a.B0.A0.SetBigInt(inputs[0]) + a.B0.A1.SetBigInt(inputs[1]) + a.B1.A0.SetBigInt(inputs[2]) + a.B1.A1.SetBigInt(inputs[3]) + a.B2.A0.SetBigInt(inputs[4]) + a.B2.A1.SetBigInt(inputs[5]) + + var sixInv fp.Element + sixInv.SetString("6") + sixInv.Inverse(&sixInv) + c.B0.MulByElement(&a.B0, &sixInv) + c.B1.MulByElement(&a.B1, &sixInv) + c.B2.MulByElement(&a.B2, &sixInv) + + c.B0.A0.BigInt(outputs[0]) + c.B0.A1.BigInt(outputs[1]) + c.B1.A0.BigInt(outputs[2]) + c.B1.A1.BigInt(outputs[3]) + c.B2.A0.BigInt(outputs[4]) + c.B2.A1.BigInt(outputs[5]) + + return nil + }) +} + // E12 hints func inverseE12Hint(nativeMod *big.Int, nativeInputs, nativeOutputs []*big.Int) error { return emulated.UnwrapHint(nativeInputs, nativeOutputs, @@ -236,3 +269,126 @@ func divE12Hint(nativeMod *big.Int, nativeInputs, nativeOutputs []*big.Int) erro return nil }) } + +func finalExpHint(nativeMod *big.Int, nativeInputs, nativeOutputs []*big.Int) error { + // This follows section 4.3.2 of https://eprint.iacr.org/2024/640.pdf + return emulated.UnwrapHint(nativeInputs, nativeOutputs, + func(mod *big.Int, inputs, outputs []*big.Int) error { + var tmp, x3, cubicNonResiduePower, x, millerLoop, residueWitness, residueWitnessInv, one, root27thOf1 bn254.E12 + var exp1, exp2, rInv, mInv big.Int + + millerLoop.C0.B0.A0.SetBigInt(inputs[0]) + millerLoop.C0.B0.A1.SetBigInt(inputs[1]) + millerLoop.C0.B1.A0.SetBigInt(inputs[2]) + millerLoop.C0.B1.A1.SetBigInt(inputs[3]) + millerLoop.C0.B2.A0.SetBigInt(inputs[4]) + millerLoop.C0.B2.A1.SetBigInt(inputs[5]) + millerLoop.C1.B0.A0.SetBigInt(inputs[6]) + millerLoop.C1.B0.A1.SetBigInt(inputs[7]) + millerLoop.C1.B1.A0.SetBigInt(inputs[8]) + millerLoop.C1.B1.A1.SetBigInt(inputs[9]) + millerLoop.C1.B2.A0.SetBigInt(inputs[10]) + millerLoop.C1.B2.A1.SetBigInt(inputs[11]) + + // exp1 = (p^12-1)/3 + exp1.SetString("4030969696062745741797811005853058291874379204406359442560681893891674450106959530046539719647151210908190211459382793062006703141168852426020468083171325367934590379984666859998399967609544754664110191464072930598755441160008826659219834762354786403012110463250131961575955268597858015384895449311534622125256548620283853223733396368939858981844663598065852816056384933498610930035891058807598891752166582271931875150099691598048016175399382213304673796601585080509443902692818733420199004555566113537482054218823936116647313678747500267068559627206777530424029211671772692598157901876223857571299238046741502089890557442500582300718504160740314926185458079985126192563953772118929726791041828902047546977272656240744693339962973939047279285351052107950250121751682659529260304162131862468322644288196213423232132152125277136333208005221619443705106431645884840489295409272576227859206166894626854018093044908314720", 10) + // root27thOf1 = (0, c010, c011, 0, 0, 0, 0, 0, 0, 0, 0, 0) + // is a 27-th root of unity which is necessarily a cubic non-residue + // since h/r = (p^12-1)/r = 27·l and 3 does not divide l. + // it was computed as w^((p^12-1)/27) = c2 * w^2 + c8 * w^8 where + // Fp12 = Fp[w]/w^12-18w^6+82 which is isomorphic to our Fp12 tower + // then c010 = (c2 + 9 * c8) % p and c011 = c8 + root27thOf1.C0.B1.A0.SetString("9483667112135124394372960210728142145589475128897916459350428495526310884707") + root27thOf1.C0.B1.A1.SetString("4534159768373982659291990808346042891252278737770656686799127720849666919525") + + if one.Exp(millerLoop, &exp1).IsOne() { + // residueWitness = millerLoop is a cubic residue + cubicNonResiduePower.SetOne() + residueWitness.Set(&millerLoop) + } else if one.Exp(*millerLoop.Mul(&millerLoop, &root27thOf1), &exp1).IsOne() { + // residueWitness = millerLoop * root27thOf1 is a cubic residue + cubicNonResiduePower.Set(&root27thOf1) + residueWitness.Set(&millerLoop) + } else { + // residueWitness = millerLoop * root27thOf1^2 is a cubic residue + cubicNonResiduePower.Square(&root27thOf1) + residueWitness.Mul(&millerLoop, &root27thOf1) + } + + // 1. compute r-th root: + // Exponentiate to rInv where + // rInv = 1/r mod (p^12-1)/r + rInv.SetString("495819184011867778744231927046742333492451180917315223017345540833046880485481720031136878341141903241966521818658471092566752321606779256340158678675679238405722886654128392203338228575623261160538734808887996935946888297414610216445334190959815200956855428635568184508263913274453942864817234480763055154719338281461936129150171789463489422401982681230261920147923652438266934726901346095892093443898852488218812468761027620988447655860644584419583586883569984588067403598284748297179498734419889699245081714359110559679136004228878808158639412436468707589339209058958785568729925402190575720856279605832146553573981587948304340677613460685405477047119496887534881410757668344088436651291444274840864486870663164657544390995506448087189408281061890434467956047582679858345583941396130713046072603335601764495918026585155498301896749919393", 10) + residueWitness.Exp(residueWitness, &rInv) + + // 2. compute m-th root: + // where m = (6x + 2 + q^3 - q^2 + q)/(3r) + // Exponentiate to mInv where + // mInv = 1/m mod p^12-1 + mInv.SetString("17840267520054779749190587238017784600702972825655245554504342129614427201836516118803396948809179149954197175783449826546445899524065131269177708416982407215963288737761615699967145070776364294542559324079147363363059480104341231360692143673915822421222230661528586799190306058519400019024762424366780736540525310403098758015600523609594113357130678138304964034267260758692953579514899054295817541844330584721967571697039986079722203518034173581264955381924826388858518077894154909963532054519350571947910625755075099598588672669612434444513251495355121627496067454526862754597351094345783576387352673894873931328099247263766690688395096280633426669535619271711975898132416216382905928886703963310231865346128293216316379527200971959980873989485521004596686352787540034457467115536116148612884807380187255514888720048664139404687086409399", 10) + residueWitness.Exp(residueWitness, &mInv) + + // 3. compute cube root: + // since gcd(3, (p^12-1)/r) ≠ 1 we use a modified Toneelli-Shanks algorithm + // see Alg.4 of https://eprint.iacr.org/2024/640.pdf + // Typo in the paper: p^k-1 = 3^n * s instead of p-1 = 3^r * s + // where k=12 and n=3 here and exp2 = (s+1)/3 + residueWitnessInv.Inverse(&residueWitness) + exp2.SetString("149295173928249842288807815031594751550902933496531831205951181255247201855813315927649619246190785589192230054051214557852100116339587126889646966043382421034614458517950624444385183985538694617189266350521219651805757080000326913304438324531658755667115202342597480058368713651772519088329461085612393412046538837788290860138273939590365147475728281409846400594680923462911515927255224400281440435265428973034513894448136725853630228718495637529802733207466114092942366766400693830377740909465411612499335341437923559875826432546203713595131838044695464089778859691547136762894737106526809539677749557286722299625576201574095640767352005953344997266128077036486155280146436004404804695964512181557316554713802082990544197776406442186936269827816744738898152657469728130713344598597476387715653492155415311971560450078713968012341037230430349766855793764662401499603533676762082513303932107208402000670112774382027", 10) + x.Exp(residueWitness, &exp2) + + // 3^t is ord(x^3 / residueWitness) + x3.Square(&x).Mul(&x3, &x).Mul(&x3, &residueWitnessInv) + t := 0 + for !x3.IsOne() { + t++ + tmp.Square(&x3) + x3.Mul(&tmp, &x3) + } + + for t != 0 { + x.Mul(&x, tmp.Exp(root27thOf1, &exp2)) + + // 3^t is ord(x^3 / residueWitness) + x3.Square(&x).Mul(&x3, &x).Mul(&x3, &residueWitnessInv) + t = 0 + for !x3.IsOne() { + t++ + tmp.Square(&x3) + x3.Mul(&tmp, &x3) + } + } + + // x is now the cube root of residueWitness + residueWitness.Set(&x) + + residueWitness.C0.B0.A0.BigInt(outputs[0]) + residueWitness.C0.B0.A1.BigInt(outputs[1]) + residueWitness.C0.B1.A0.BigInt(outputs[2]) + residueWitness.C0.B1.A1.BigInt(outputs[3]) + residueWitness.C0.B2.A0.BigInt(outputs[4]) + residueWitness.C0.B2.A1.BigInt(outputs[5]) + residueWitness.C1.B0.A0.BigInt(outputs[6]) + residueWitness.C1.B0.A1.BigInt(outputs[7]) + residueWitness.C1.B1.A0.BigInt(outputs[8]) + residueWitness.C1.B1.A1.BigInt(outputs[9]) + residueWitness.C1.B2.A0.BigInt(outputs[10]) + residueWitness.C1.B2.A1.BigInt(outputs[11]) + + // we also need to return the cubic non-residue power + cubicNonResiduePower.C0.B0.A0.BigInt(outputs[12]) + cubicNonResiduePower.C0.B0.A1.BigInt(outputs[13]) + cubicNonResiduePower.C0.B1.A0.BigInt(outputs[14]) + cubicNonResiduePower.C0.B1.A1.BigInt(outputs[15]) + cubicNonResiduePower.C0.B2.A0.BigInt(outputs[16]) + cubicNonResiduePower.C0.B2.A1.BigInt(outputs[17]) + cubicNonResiduePower.C1.B0.A0.BigInt(outputs[18]) + cubicNonResiduePower.C1.B0.A1.BigInt(outputs[19]) + cubicNonResiduePower.C1.B1.A0.BigInt(outputs[20]) + cubicNonResiduePower.C1.B1.A1.BigInt(outputs[21]) + cubicNonResiduePower.C1.B2.A0.BigInt(outputs[22]) + cubicNonResiduePower.C1.B2.A1.BigInt(outputs[23]) + + return nil + }) +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/g2.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/g2.go index 1bd521c7ce..66493302bf 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/g2.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/g2.go @@ -10,6 +10,7 @@ import ( ) type G2 struct { + api frontend.API *fields_bn254.Ext2 w *emulated.Element[BaseField] u, v *fields_bn254.E2 @@ -49,6 +50,7 @@ func NewG2(api frontend.API) *G2 { A1: emulated.ValueOf[BaseField]("3505843767911556378687030309984248845540243509899259641013678093033130930403"), } return &G2{ + api: api, Ext2: fields_bn254.NewExt2(api), w: &w, u: &u, @@ -262,3 +264,9 @@ func (g2 *G2) AssertIsEqual(p, q *G2Affine) { g2.Ext2.AssertIsEqual(&p.P.X, &q.P.X) g2.Ext2.AssertIsEqual(&p.P.Y, &q.P.Y) } + +func (g2 *G2) IsEqual(p, q *G2Affine) frontend.Variable { + xEqual := g2.Ext2.IsEqual(&p.P.X, &q.P.X) + yEqual := g2.Ext2.IsEqual(&p.P.Y, &q.P.Y) + return g2.api.And(xEqual, yEqual) +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/hints.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/hints.go new file mode 100644 index 0000000000..d7700dd24a --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/hints.go @@ -0,0 +1,169 @@ +package sw_bn254 + +import ( + "errors" + "math/big" + + "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark/constraint/solver" + "github.com/consensys/gnark/std/math/emulated" +) + +func init() { + solver.RegisterHint(GetHints()...) +} + +// GetHints returns all hint functions used in the package. +func GetHints() []solver.Hint { + return []solver.Hint{ + millerLoopAndCheckFinalExpHint, + } +} + +func millerLoopAndCheckFinalExpHint(nativeMod *big.Int, nativeInputs, nativeOutputs []*big.Int) error { + // This follows section 4.3.2 of https://eprint.iacr.org/2024/640.pdf + return emulated.UnwrapHint(nativeInputs, nativeOutputs, + func(mod *big.Int, inputs, outputs []*big.Int) error { + var previous, tmp, x3, cubicNonResiduePower, x, millerLoop, residueWitness, residueWitnessInv, one, root27thOf1 bn254.E12 + var exp1, exp2, rInv, mInv big.Int + var P bn254.G1Affine + var Q bn254.G2Affine + + P.X.SetBigInt(inputs[0]) + P.Y.SetBigInt(inputs[1]) + Q.X.A0.SetBigInt(inputs[2]) + Q.X.A1.SetBigInt(inputs[3]) + Q.Y.A0.SetBigInt(inputs[4]) + Q.Y.A1.SetBigInt(inputs[5]) + + previous.C0.B0.A0.SetBigInt(inputs[6]) + previous.C0.B0.A1.SetBigInt(inputs[7]) + previous.C0.B1.A0.SetBigInt(inputs[8]) + previous.C0.B1.A1.SetBigInt(inputs[9]) + previous.C0.B2.A0.SetBigInt(inputs[10]) + previous.C0.B2.A1.SetBigInt(inputs[11]) + previous.C1.B0.A0.SetBigInt(inputs[12]) + previous.C1.B0.A1.SetBigInt(inputs[13]) + previous.C1.B1.A0.SetBigInt(inputs[14]) + previous.C1.B1.A1.SetBigInt(inputs[15]) + previous.C1.B2.A0.SetBigInt(inputs[16]) + previous.C1.B2.A1.SetBigInt(inputs[17]) + + if previous.IsZero() { + return errors.New("previous Miller loop result is zero") + } + + lines := bn254.PrecomputeLines(Q) + millerLoop, err := bn254.MillerLoopFixedQ( + []bn254.G1Affine{P}, + [][2][len(bn254.LoopCounter)]bn254.LineEvaluationAff{lines}, + ) + if err != nil { + return err + } + + millerLoop.Mul(&millerLoop, &previous) + + // exp1 = (p^12-1)/3 + exp1.SetString("4030969696062745741797811005853058291874379204406359442560681893891674450106959530046539719647151210908190211459382793062006703141168852426020468083171325367934590379984666859998399967609544754664110191464072930598755441160008826659219834762354786403012110463250131961575955268597858015384895449311534622125256548620283853223733396368939858981844663598065852816056384933498610930035891058807598891752166582271931875150099691598048016175399382213304673796601585080509443902692818733420199004555566113537482054218823936116647313678747500267068559627206777530424029211671772692598157901876223857571299238046741502089890557442500582300718504160740314926185458079985126192563953772118929726791041828902047546977272656240744693339962973939047279285351052107950250121751682659529260304162131862468322644288196213423232132152125277136333208005221619443705106431645884840489295409272576227859206166894626854018093044908314720", 10) + // root27thOf1 = (0, c010, c011, 0, 0, 0, 0, 0, 0, 0, 0, 0) + // is a 27-th root of unity which is necessarily a cubic non-residue + // since h/r = (p^12-1)/r = 27·l and 3 does not divide l. + // it was computed as w^((p^12-1)/27) = c2 * w^2 + c8 * w^8 where + // Fp12 = Fp[w]/w^12-18w^6+82 which is isomorphic to our Fp12 tower + // then c010 = (c2 + 9 * c8) % p and c011 = c8 + root27thOf1.C0.B1.A0.SetString("9483667112135124394372960210728142145589475128897916459350428495526310884707") + root27thOf1.C0.B1.A1.SetString("4534159768373982659291990808346042891252278737770656686799127720849666919525") + + if one.Exp(millerLoop, &exp1).IsOne() { + // residueWitness = millerLoop is a cubic residue + cubicNonResiduePower.SetOne() + residueWitness.Set(&millerLoop) + } else if one.Exp(*millerLoop.Mul(&millerLoop, &root27thOf1), &exp1).IsOne() { + // residueWitness = millerLoop * root27thOf1 is a cubic residue + cubicNonResiduePower.Set(&root27thOf1) + residueWitness.Set(&millerLoop) + } else { + // residueWitness = millerLoop * root27thOf1^2 is a cubic residue + cubicNonResiduePower.Square(&root27thOf1) + residueWitness.Mul(&millerLoop, &root27thOf1) + } + + // 1. compute r-th root: + // Exponentiate to rInv where + // rInv = 1/r mod (p^12-1)/r + rInv.SetString("495819184011867778744231927046742333492451180917315223017345540833046880485481720031136878341141903241966521818658471092566752321606779256340158678675679238405722886654128392203338228575623261160538734808887996935946888297414610216445334190959815200956855428635568184508263913274453942864817234480763055154719338281461936129150171789463489422401982681230261920147923652438266934726901346095892093443898852488218812468761027620988447655860644584419583586883569984588067403598284748297179498734419889699245081714359110559679136004228878808158639412436468707589339209058958785568729925402190575720856279605832146553573981587948304340677613460685405477047119496887534881410757668344088436651291444274840864486870663164657544390995506448087189408281061890434467956047582679858345583941396130713046072603335601764495918026585155498301896749919393", 10) + residueWitness.Exp(residueWitness, &rInv) + + // 2. compute m-th root: + // where m = (6x + 2 + q^3 - q^2 + q)/(3r) + // Exponentiate to mInv where + // mInv = 1/m mod p^12-1 + mInv.SetString("17840267520054779749190587238017784600702972825655245554504342129614427201836516118803396948809179149954197175783449826546445899524065131269177708416982407215963288737761615699967145070776364294542559324079147363363059480104341231360692143673915822421222230661528586799190306058519400019024762424366780736540525310403098758015600523609594113357130678138304964034267260758692953579514899054295817541844330584721967571697039986079722203518034173581264955381924826388858518077894154909963532054519350571947910625755075099598588672669612434444513251495355121627496067454526862754597351094345783576387352673894873931328099247263766690688395096280633426669535619271711975898132416216382905928886703963310231865346128293216316379527200971959980873989485521004596686352787540034457467115536116148612884807380187255514888720048664139404687086409399", 10) + residueWitness.Exp(residueWitness, &mInv) + + // 3. compute cube root: + // since gcd(3, (p^12-1)/r) ≠ 1 we use a modified Toneelli-Shanks algorithm + // see Alg.4 of https://eprint.iacr.org/2024/640.pdf + // Typo in the paper: p^k-1 = 3^n * s instead of p-1 = 3^r * s + // where k=12 and n=3 here and exp2 = (s+1)/3 + residueWitnessInv.Inverse(&residueWitness) + exp2.SetString("149295173928249842288807815031594751550902933496531831205951181255247201855813315927649619246190785589192230054051214557852100116339587126889646966043382421034614458517950624444385183985538694617189266350521219651805757080000326913304438324531658755667115202342597480058368713651772519088329461085612393412046538837788290860138273939590365147475728281409846400594680923462911515927255224400281440435265428973034513894448136725853630228718495637529802733207466114092942366766400693830377740909465411612499335341437923559875826432546203713595131838044695464089778859691547136762894737106526809539677749557286722299625576201574095640767352005953344997266128077036486155280146436004404804695964512181557316554713802082990544197776406442186936269827816744738898152657469728130713344598597476387715653492155415311971560450078713968012341037230430349766855793764662401499603533676762082513303932107208402000670112774382027", 10) + x.Exp(residueWitness, &exp2) + + // 3^t is ord(x^3 / residueWitness) + x3.Square(&x).Mul(&x3, &x).Mul(&x3, &residueWitnessInv) + t := 0 + for !x3.IsOne() { + t++ + tmp.Square(&x3) + x3.Mul(&tmp, &x3) + } + + for t != 0 { + x.Mul(&x, tmp.Exp(root27thOf1, &exp2)) + + // 3^t is ord(x^3 / residueWitness) + x3.Square(&x).Mul(&x3, &x).Mul(&x3, &residueWitnessInv) + t = 0 + for !x3.IsOne() { + t++ + tmp.Square(&x3) + x3.Mul(&tmp, &x3) + } + } + + // x is now the cube root of residueWitness + residueWitness.Set(&x) + residueWitnessInv.Inverse(&residueWitness) + + residueWitness.C0.B0.A0.BigInt(outputs[0]) + residueWitness.C0.B0.A1.BigInt(outputs[1]) + residueWitness.C0.B1.A0.BigInt(outputs[2]) + residueWitness.C0.B1.A1.BigInt(outputs[3]) + residueWitness.C0.B2.A0.BigInt(outputs[4]) + residueWitness.C0.B2.A1.BigInt(outputs[5]) + residueWitness.C1.B0.A0.BigInt(outputs[6]) + residueWitness.C1.B0.A1.BigInt(outputs[7]) + residueWitness.C1.B1.A0.BigInt(outputs[8]) + residueWitness.C1.B1.A1.BigInt(outputs[9]) + residueWitness.C1.B2.A0.BigInt(outputs[10]) + residueWitness.C1.B2.A1.BigInt(outputs[11]) + + // we also need to return the cubic non-residue power + cubicNonResiduePower.C0.B0.A0.BigInt(outputs[12]) + cubicNonResiduePower.C0.B0.A1.BigInt(outputs[13]) + cubicNonResiduePower.C0.B1.A0.BigInt(outputs[14]) + cubicNonResiduePower.C0.B1.A1.BigInt(outputs[15]) + cubicNonResiduePower.C0.B2.A0.BigInt(outputs[16]) + cubicNonResiduePower.C0.B2.A1.BigInt(outputs[17]) + cubicNonResiduePower.C1.B0.A0.BigInt(outputs[18]) + cubicNonResiduePower.C1.B0.A1.BigInt(outputs[19]) + cubicNonResiduePower.C1.B1.A0.BigInt(outputs[20]) + cubicNonResiduePower.C1.B1.A1.BigInt(outputs[21]) + cubicNonResiduePower.C1.B2.A0.BigInt(outputs[22]) + cubicNonResiduePower.C1.B2.A1.BigInt(outputs[23]) + + return nil + }) +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/pairing.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/pairing.go index ddcecfef05..3cc9ca67e8 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/pairing.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_bn254/pairing.go @@ -245,13 +245,22 @@ func (pr Pairing) Pair(P []*G1Affine, Q []*G2Affine) (*GTEl, error) { // // This function doesn't check that the inputs are in the correct subgroups. See AssertIsOnG1 and AssertIsOnG2. func (pr Pairing) PairingCheck(P []*G1Affine, Q []*G2Affine) error { - f, err := pr.Pair(P, Q) + f, err := pr.MillerLoop(P, Q) if err != nil { return err } - one := pr.One() - pr.AssertIsEqual(f, one) + // We perform the easy part of the final exp to push f to the cyclotomic + // subgroup so that FinalExponentiationCheck is carried with optimized + // cyclotomic squaring (e.g. Karabina12345). + // + // f = f^(p⁶-1)(p²+1) + buf := pr.Conjugate(f) + buf = pr.DivUnchecked(buf, f) + f = pr.FrobeniusSquare(buf) + f = pr.Mul(f, buf) + + pr.FinalExponentiationCheck(f) return nil } @@ -264,7 +273,7 @@ func (pr Pairing) AssertIsOnCurve(P *G1Affine) { pr.curve.AssertIsOnCurve(P) } -func (pr Pairing) AssertIsOnTwist(Q *G2Affine) { +func (pr Pairing) computeTwistEquation(Q *G2Affine) (left, right *fields_bn254.E2) { // Twist: Y² == X³ + aX + b, where a=0 and b=3/(9+u) // (X,Y) ∈ {Y² == X³ + aX + b} U (0,0) @@ -272,25 +281,32 @@ func (pr Pairing) AssertIsOnTwist(Q *G2Affine) { selector := pr.api.And(pr.Ext2.IsZero(&Q.P.X), pr.Ext2.IsZero(&Q.P.Y)) b := pr.Ext2.Select(selector, pr.Ext2.Zero(), pr.bTwist) - left := pr.Ext2.Square(&Q.P.Y) - right := pr.Ext2.Square(&Q.P.X) + left = pr.Ext2.Square(&Q.P.Y) + right = pr.Ext2.Square(&Q.P.X) right = pr.Ext2.Mul(right, &Q.P.X) right = pr.Ext2.Add(right, b) + return left, right +} + +func (pr Pairing) AssertIsOnTwist(Q *G2Affine) { + left, right := pr.computeTwistEquation(Q) pr.Ext2.AssertIsEqual(left, right) } +// IsOnTwist returns a boolean indicating if the G2 point is in the twist. +func (pr Pairing) IsOnTwist(Q *G2Affine) frontend.Variable { + left, right := pr.computeTwistEquation(Q) + diff := pr.Ext2.Sub(left, right) + return pr.Ext2.IsZero(diff) +} + func (pr Pairing) AssertIsOnG1(P *G1Affine) { // BN254 has a prime order, so we only // 1- Check P is on the curve pr.AssertIsOnCurve(P) } -func (pr Pairing) AssertIsOnG2(Q *G2Affine) { - // 1- Check Q is on the curve - pr.AssertIsOnTwist(Q) - - // 2- Check Q has the right subgroup order - +func (pr Pairing) computeG2ShortVector(Q *G2Affine) (_Q *G2Affine) { // [x₀]Q xQ := pr.g2.scalarMulBySeed(Q) // ψ([x₀]Q) @@ -302,14 +318,34 @@ func (pr Pairing) AssertIsOnG2(Q *G2Affine) { psi3xxQ = pr.g2.psi(psi3xxQ) // _Q = ψ³([2x₀]Q) - ψ²([x₀]Q) - ψ([x₀]Q) - [x₀]Q - _Q := pr.g2.sub(psi2xQ, psi3xxQ) + _Q = pr.g2.sub(psi2xQ, psi3xxQ) _Q = pr.g2.sub(_Q, psixQ) _Q = pr.g2.sub(_Q, xQ) + return _Q +} +func (pr Pairing) AssertIsOnG2(Q *G2Affine) { + // 1- Check Q is on the curve + pr.AssertIsOnTwist(Q) + + // 2- Check Q has the right subgroup order + _Q := pr.computeG2ShortVector(Q) // [r]Q == 0 <==> _Q == Q pr.g2.AssertIsEqual(Q, _Q) } +// IsOnG2 returns a boolean indicating if the G2 point is in the subgroup. The +// method assumes that the point is already on the curve. Call +// [Pairing.AssertIsOnTwist] before to ensure point is on the curve. +func (pr Pairing) IsOnG2(Q *G2Affine) frontend.Variable { + // 1 - is Q on curve + isOnCurve := pr.IsOnTwist(Q) + // 2 - is Q in the subgroup + _Q := pr.computeG2ShortVector(Q) + isInSubgroup := pr.g2.IsEqual(Q, _Q) + return pr.api.And(isOnCurve, isInSubgroup) +} + // loopCounter = 6x₀+2 = 29793968203157093288 // // in 2-NAF @@ -365,7 +401,6 @@ func (pr Pairing) millerLoopLines(P []*G1Affine, lines []lineEvaluations) (*GTEl xNegOverY[k] = pr.curveF.Neg(xNegOverY[k]) } - // f_{x₀+1+λ(x₀³-x₀²-x₀),Q}(P), Q is known in advance var prodLines [5]*fields_bn254.E2 res := pr.Ext12.One() @@ -644,12 +679,138 @@ func (pr Pairing) MillerLoopAndMul(P *G1Affine, Q *G2Affine, previous *GTEl) (*G return res, err } -// FinalExponentiationIsOne performs the final exponentiation on e -// and checks that the result in 1 in GT. +// MillerLoopAndFinalExpCheck computes the Miller loop between P and Q, +// multiplies it in 𝔽p¹² by previous and checks that the result lies in the +// same equivalence class as the reduced pairing purported to be 1. This check +// replaces the final exponentiation step in-circuit and follows Section 4 of +// [On Proving Pairings] paper by A. Novakovic and L. Eagen. // // This method is needed for evmprecompiles/ecpair. -func (pr Pairing) FinalExponentiationIsOne(e *GTEl) { - res := pr.finalExponentiation(e, false) - one := pr.One() - pr.AssertIsEqual(res, one) +// +// [On Proving Pairings]: https://eprint.iacr.org/2024/640.pdf +func (pr Pairing) MillerLoopAndFinalExpCheck(P *G1Affine, Q *G2Affine, previous *GTEl) error { + + // hint the non-residue witness + hint, err := pr.curveF.NewHint(millerLoopAndCheckFinalExpHint, 24, &P.X, &P.Y, &Q.P.X.A0, &Q.P.X.A1, &Q.P.Y.A0, &Q.P.Y.A1, &previous.C0.B0.A0, &previous.C0.B0.A1, &previous.C0.B1.A0, &previous.C0.B1.A1, &previous.C0.B2.A0, &previous.C0.B2.A1, &previous.C1.B0.A0, &previous.C1.B0.A1, &previous.C1.B1.A0, &previous.C1.B1.A1, &previous.C1.B2.A0, &previous.C1.B2.A1) + if err != nil { + // err is non-nil only for invalid number of inputs + panic(err) + } + + residueWitness := fields_bn254.E12{ + C0: fields_bn254.E6{ + B0: fields_bn254.E2{A0: *hint[0], A1: *hint[1]}, + B1: fields_bn254.E2{A0: *hint[2], A1: *hint[3]}, + B2: fields_bn254.E2{A0: *hint[4], A1: *hint[5]}, + }, + C1: fields_bn254.E6{ + B0: fields_bn254.E2{A0: *hint[6], A1: *hint[7]}, + B1: fields_bn254.E2{A0: *hint[8], A1: *hint[9]}, + B2: fields_bn254.E2{A0: *hint[10], A1: *hint[11]}, + }, + } + // constrain cubicNonResiduePower to be in Fp6 + cubicNonResiduePower := fields_bn254.E12{ + C0: fields_bn254.E6{ + B0: fields_bn254.E2{A0: *hint[12], A1: *hint[13]}, + B1: fields_bn254.E2{A0: *hint[14], A1: *hint[15]}, + B2: fields_bn254.E2{A0: *hint[16], A1: *hint[17]}, + }, + C1: (*pr.Ext6.Zero()), + } + + // residueWitnessInv = 1 / residueWitness + residueWitnessInv := pr.Inverse(&residueWitness) + + if Q.Lines == nil { + Qlines := pr.computeLines(&Q.P) + Q.Lines = &Qlines + } + lines := *Q.Lines + + // precomputations + yInv := pr.curveF.Inverse(&P.Y) + xNegOverY := pr.curveF.MulMod(&P.X, yInv) + xNegOverY = pr.curveF.Neg(xNegOverY) + + // init Miller loop accumulator to residueWitnessInv to share the squarings + // of residueWitnessInv^{6x₀+2} + res := residueWitnessInv + + // Compute f_{6x₀+2,Q}(P) + for i := 64; i >= 0; i-- { + res = pr.Square(res) + + switch loopCounter[i] { + case 0: + // ℓ × res + res = pr.MulBy034( + res, + pr.MulByElement(&lines[0][i].R0, xNegOverY), + pr.MulByElement(&lines[0][i].R1, yInv), + ) + case 1: + // multiply by residueWitnessInv when bit=1 + res = pr.Mul(res, residueWitnessInv) + // lines evaluations at P + // and ℓ × ℓ + prodLines := pr.Mul034By034( + pr.MulByElement(&lines[0][i].R0, xNegOverY), + pr.MulByElement(&lines[0][i].R1, yInv), + pr.MulByElement(&lines[1][i].R0, xNegOverY), + pr.MulByElement(&lines[1][i].R1, yInv), + ) + // (ℓ × ℓ) × res + res = pr.MulBy01234(res, prodLines) + case -1: + // multiply by residueWitness when bit=-1 + res = pr.Mul(res, &residueWitness) + // lines evaluations at P + // and ℓ × ℓ + prodLines := pr.Mul034By034( + pr.MulByElement(&lines[0][i].R0, xNegOverY), + pr.MulByElement(&lines[0][i].R1, yInv), + pr.MulByElement(&lines[1][i].R0, xNegOverY), + pr.MulByElement(&lines[1][i].R1, yInv), + ) + // (ℓ × ℓ) × res + res = pr.MulBy01234(res, prodLines) + default: + return nil + } + } + + // Compute ℓ_{[6x₀+2]Q,π(Q)}(P) · ℓ_{[6x₀+2]Q+π(Q),-π²(Q)}(P) + // lines evaluations at P + // and ℓ × ℓ + prodLines := pr.Mul034By034( + pr.MulByElement(&lines[0][65].R0, xNegOverY), + pr.MulByElement(&lines[0][65].R1, yInv), + pr.MulByElement(&lines[1][65].R0, xNegOverY), + pr.MulByElement(&lines[1][65].R1, yInv), + ) + // (ℓ × ℓ) × res + res = pr.MulBy01234(res, prodLines) + + // multiply by previous multi-Miller function + res = pr.Mul(res, previous) + + // Check that res * cubicNonResiduePower * residueWitnessInv^λ' == 1 + // where λ' = q^3 - q^2 + q, with u the BN254 seed + // and residueWitnessInv, cubicNonResiduePower from the hint. + // Note that res is already MillerLoop(P,Q) * residueWitnessInv^{6x₀+2} since + // we initialized the Miller loop accumulator with residueWitnessInv. + t2 := pr.Mul(&cubicNonResiduePower, res) + + t1 := pr.FrobeniusCube(residueWitnessInv) + t0 := pr.FrobeniusSquare(residueWitnessInv) + t1 = pr.DivUnchecked(t1, t0) + t0 = pr.Frobenius(residueWitnessInv) + t1 = pr.Mul(t1, t0) + + t2 = pr.Mul(t2, t1) + + pr.AssertIsEqual(t2, pr.One()) + + return nil } diff --git a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_emulated/point.go b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_emulated/point.go index 0ed2f78307..7e308f649d 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_emulated/point.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/algebra/emulated/sw_emulated/point.go @@ -7,6 +7,7 @@ import ( "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/std/algebra/algopts" "github.com/consensys/gnark/std/math/emulated" + "github.com/consensys/gnark/std/math/emulated/emparams" "golang.org/x/exp/slices" ) @@ -127,6 +128,11 @@ func (c *Curve[B, S]) MarshalG1(p AffinePoint[B]) []frontend.Variable { res := make([]frontend.Variable, 2*nbBits) copy(res, bx) copy(res[len(bx):], by) + switch any(fp).(type) { + case emparams.Secp256k1Fp: + // in gnark-crypto we do not store the infinity bit for secp256k1 points + return res + } xZ := c.baseApi.IsZero(x) yZ := c.baseApi.IsZero(y) isZero := c.api.Mul(xZ, yZ) @@ -582,7 +588,7 @@ func (c *Curve[B, S]) scalarMulGLV(Q *AffinePoint[B], s *emulated.Element[S], op // B1 = Q+Φ(Q) // B2 = -Q-Φ(Q) // B3 = Q-Φ(Q) - // B4 = -QΦ(Q) + // B4 = -Q+Φ(Q) // // If we extend this by merging two iterations, we need to look up P and P' // both from {B1, B2, B3, B4} and compute: @@ -798,7 +804,6 @@ func (c *Curve[B, S]) jointScalarMulGeneric(p1, p2 *AffinePoint[B], s1, s2 *emul panic(fmt.Sprintf("parse opts: %v", err)) } if cfg.CompleteArithmetic { - // TODO @yelhousni: optimize res1 := c.scalarMulGeneric(p1, s1, opts...) res2 := c.scalarMulGeneric(p2, s2, opts...) return c.AddUnified(res1, res2) @@ -855,7 +860,6 @@ func (c *Curve[B, S]) jointScalarMulGLV(p1, p2 *AffinePoint[B], s1, s2 *emulated panic(fmt.Sprintf("parse opts: %v", err)) } if cfg.CompleteArithmetic { - // TODO @yelhousni: optimize res1 := c.scalarMulGLV(p1, s1, opts...) res2 := c.scalarMulGLV(p2, s2, opts...) return c.AddUnified(res1, res2) diff --git a/galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/doc.go b/galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/doc.go new file mode 100644 index 0000000000..915b2ad3b1 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/doc.go @@ -0,0 +1,41 @@ +// Package mimc provides a ZKP-circuit function to compute a MiMC hash. +// +// For the reference implementation of the MiMC hash function, see the +// corresponding package in [gnark-crypto]. +// +// # Length extension attack +// +// The MiMC hash function is vulnerable to a length extension attack. For +// example when we have a hash +// +// h = MiMC(k || m) +// +// and we want to hash a new message +// +// m' = m || m2, +// +// we can compute +// +// h' = MiMC(k || m || m2) +// +// without knowing k by computing +// +// h' = MiMC(h || m2). +// +// This is because the MiMC hash function is a simple iterated cipher, and the +// hash value is the state of the cipher after encrypting the message. +// +// There are several ways to mitigate this attack: +// - use a random key for each hash +// - use a domain separation tag for different use cases: +// h = MiMC(k || tag || m) +// - use the secret input as last input: +// h = MiMC(m || k) +// +// In general, inside a circuit the length-extension attack is not a concern as +// due to the circuit definition the attacker can not append messages to +// existing hash. But the user has to consider the cases when using a secret key +// and MiMC in different contexts. +// +// [gnark-crypto]: https://pkg.go.dev/github.com/consensys/gnark-crypto/hash +package mimc diff --git a/galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/mimc.go b/galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/mimc.go index 210ecdf652..1d6fa4d35c 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/mimc.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/hash/mimc/mimc.go @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package mimc provides a ZKP-circuit function to compute a MiMC hash. package mimc import ( @@ -26,7 +25,9 @@ import ( "github.com/consensys/gnark/internal/utils" ) -// MiMC contains the params of the Mimc hash func and the curves on which it is implemented +// MiMC contains the params of the MiMC hash func and the curves on which it is implemented. +// +// NB! See the package documentation for length extension attack consideration. type MiMC struct { params []big.Int // slice containing constants for the encryption rounds id ecc.ID // id needed to know which encryption function to use @@ -35,7 +36,12 @@ type MiMC struct { api frontend.API // underlying constraint system } -// NewMiMC returns a MiMC instance, that can be used in a gnark circuit +// NewMiMC returns a MiMC instance that can be used in a gnark circuit. The +// out-circuit counterpart of this function is provided in [gnark-crypto]. +// +// NB! See the package documentation for length extension attack consideration. +// +// [gnark-crypto]: https://pkg.go.dev/github.com/consensys/gnark-crypto/hash func NewMiMC(api frontend.API) (MiMC, error) { // TODO @gbotrel use field if constructor, ok := newMimc[utils.FieldToCurve(api.Compiler().Field())]; ok { @@ -55,10 +61,10 @@ func (h *MiMC) Reset() { h.h = 0 } -// Sum hash (in r1cs form) using Miyaguchi–Preneel: -// https://en.wikipedia.org/wiki/One-way_compression_function -// The XOR operation is replaced by field addition. -// See github.com/consensys/gnark-crypto for reference implementation. +// Sum hash using [Miyaguchi–Preneel] where the XOR operation is replaced by +// field addition. +// +// [Miyaguchi–Preneel]: https://en.wikipedia.org/wiki/One-way_compression_function func (h *MiMC) Sum() frontend.Variable { //h.Write(data...)s diff --git a/galoisd/vendor/github.com/consensys/gnark/std/hash/sha2/sha2.go b/galoisd/vendor/github.com/consensys/gnark/std/hash/sha2/sha2.go index edb261e621..ea36f7f70d 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/hash/sha2/sha2.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/hash/sha2/sha2.go @@ -6,9 +6,13 @@ package sha2 import ( "encoding/binary" + "math/big" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/std/hash" + "github.com/consensys/gnark/std/math/bits" + "github.com/consensys/gnark/std/math/bitslice" + "github.com/consensys/gnark/std/math/cmp" "github.com/consensys/gnark/std/math/uints" "github.com/consensys/gnark/std/permutation/sha2" ) @@ -18,16 +22,17 @@ var _seed = uints.NewU32Array([]uint32{ }) type digest struct { + api frontend.API uapi *uints.BinaryField[uints.U32] in []uints.U8 } -func New(api frontend.API) (hash.BinaryHasher, error) { +func New(api frontend.API) (hash.BinaryFixedLengthHasher, error) { uapi, err := uints.New[uints.U32](api) if err != nil { return nil, err } - return &digest{uapi: uapi}, nil + return &digest{api: api, uapi: uapi}, nil } func (d *digest) Write(data []uints.U8) { @@ -71,7 +76,6 @@ func (d *digest) Sum() []uints.U8 { } func (d *digest) FixedLengthSum(length frontend.Variable) []uints.U8 { - panic("TODO") // we need to do two things here -- first the padding has to be put to the // right place. For that we need to know how many blocks we have used. We // need to fit at least 9 more bytes (padding byte and 8 bytes for input @@ -80,6 +84,69 @@ func (d *digest) FixedLengthSum(length frontend.Variable) []uints.U8 { // // idea - have a mask for blocks where 1 is only for the block we want to // use. + + data := make([]uints.U8, len(d.in)) + copy(data, d.in) + + comparator := cmp.NewBoundedComparator(d.api, big.NewInt(int64(len(data)+64+8)), false) + + for i := 0; i < 64+8; i++ { + data = append(data, uints.NewU8(0)) + } + + lenMod64 := d.mod64(length) + lenMod64Less56 := comparator.IsLess(lenMod64, 56) + + paddingCount := d.api.Sub(64, lenMod64) + paddingCount = d.api.Select(lenMod64Less56, paddingCount, d.api.Add(paddingCount, 64)) + + totalLen := d.api.Add(length, paddingCount) + last8BytesPos := d.api.Sub(totalLen, 8) + + var dataLenBtyes [8]frontend.Variable + d.bigEndianPutUint64(dataLenBtyes[:], d.api.Mul(length, 8)) + + for i := range data { + isPaddingStartPos := d.api.IsZero(d.api.Sub(i, length)) + data[i].Val = d.api.Select(isPaddingStartPos, 0x80, data[i].Val) + + isPaddingPos := comparator.IsLess(length, i) + data[i].Val = d.api.Select(isPaddingPos, 0, data[i].Val) + } + + for i := range data { + isLast8BytesPos := d.api.IsZero(d.api.Sub(i, last8BytesPos)) + for j := 0; j < 8; j++ { + if i+j < len(data) { + data[i+j].Val = d.api.Select(isLast8BytesPos, dataLenBtyes[j], data[i+j].Val) + } + } + } + + var runningDigest [8]uints.U32 + var resultDigest [8]uints.U32 + var buf [64]uints.U8 + copy(runningDigest[:], _seed) + copy(resultDigest[:], _seed) + + for i := 0; i < len(data)/64; i++ { + copy(buf[:], data[i*64:(i+1)*64]) + runningDigest = sha2.Permute(d.uapi, runningDigest, buf) + + isInRange := comparator.IsLess(i*64, totalLen) + + for j := 0; j < 8; j++ { + for k := 0; k < 4; k++ { + resultDigest[j][k].Val = d.api.Select(isInRange, runningDigest[j][k].Val, resultDigest[j][k].Val) + } + } + } + + var ret []uints.U8 + for i := range resultDigest { + ret = append(ret, d.uapi.UnpackMSB(resultDigest[i])...) + } + return ret } func (d *digest) Reset() { @@ -87,3 +154,15 @@ func (d *digest) Reset() { } func (d *digest) Size() int { return 32 } + +func (d *digest) mod64(v frontend.Variable) frontend.Variable { + lower, _ := bitslice.Partition(d.api, v, 6, bitslice.WithNbDigits(64)) + return lower +} + +func (d *digest) bigEndianPutUint64(b []frontend.Variable, x frontend.Variable) { + bts := bits.ToBinary(d.api, x, bits.WithNbDigits(64)) + for i := 0; i < 8; i++ { + b[i] = bits.FromBinary(d.api, bts[(8-i-1)*8:(8-i)*8]) + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/bits/hints.go b/galoisd/vendor/github.com/consensys/gnark/std/math/bits/hints.go index bb3da6d13c..2266b4bb3a 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/bits/hints.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/bits/hints.go @@ -1,7 +1,6 @@ package bits import ( - "errors" "math/big" "github.com/consensys/gnark/constraint/solver" @@ -12,7 +11,6 @@ func GetHints() []solver.Hint { ithBit, nBits, nTrits, - nNaf, } } @@ -61,54 +59,3 @@ func nTrits(_ *big.Int, inputs []*big.Int, results []*big.Int) error { return nil } - -// NNAF returns the NAF decomposition of the input. The number of digits is -// defined by the number of elements in the results slice. -func nNaf(_ *big.Int, inputs []*big.Int, results []*big.Int) error { - n := inputs[0] - return nafDecomposition(n, results) -} - -// nafDecomposition gets the naf decomposition of a big number -func nafDecomposition(a *big.Int, results []*big.Int) error { - if a == nil || a.Sign() == -1 { - return errors.New("invalid input to naf decomposition; negative (or nil) big.Int not supported") - } - - var zero, one, three big.Int - - one.SetUint64(1) - three.SetUint64(3) - - n := 0 - - // some buffers - var buf, aCopy big.Int - aCopy.Set(a) - - for aCopy.Cmp(&zero) != 0 && n < len(results) { - - // if aCopy % 2 == 0 - buf.And(&aCopy, &one) - - // aCopy even - if buf.Cmp(&zero) == 0 { - results[n].SetUint64(0) - } else { // aCopy odd - buf.And(&aCopy, &three) - if buf.IsUint64() && buf.Uint64() == 3 { - results[n].SetInt64(-1) - aCopy.Add(&aCopy, &one) - } else { - results[n].SetUint64(1) - } - } - aCopy.Rsh(&aCopy, 1) - n++ - } - for ; n < len(results); n++ { - results[n].SetUint64(0) - } - - return nil -} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/bits/naf.go b/galoisd/vendor/github.com/consensys/gnark/std/math/bits/naf.go deleted file mode 100644 index 56b4b9e468..0000000000 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/bits/naf.go +++ /dev/null @@ -1,50 +0,0 @@ -package bits - -import ( - "math/big" - - "github.com/consensys/gnark/frontend" -) - -// ToNAF returns the NAF decomposition of given input. -// The non-adjacent form (NAF) of a number is a unique signed-digit representation, -// in which non-zero values cannot be adjacent. For example, NAF(13) = [1, 0, -1, 0, 1]. -func ToNAF(api frontend.API, v frontend.Variable, opts ...BaseConversionOption) []frontend.Variable { - // parse options - cfg := baseConversionConfig{ - NbDigits: api.Compiler().FieldBitLen(), - UnconstrainedOutputs: false, - } - - for _, o := range opts { - if err := o(&cfg); err != nil { - panic(err) - } - } - - c := big.NewInt(1) - - bits, err := api.Compiler().NewHint(nNaf, cfg.NbDigits, v) - if err != nil { - panic(err) - } - - var Σbi frontend.Variable - Σbi = 0 - for i := 0; i < cfg.NbDigits; i++ { - Σbi = api.Add(Σbi, api.Mul(bits[i], c)) - c.Lsh(c, 1) - if !cfg.UnconstrainedOutputs { - // b * (1 - b) * (1 + b) == 0 - // TODO this adds 3 constraint, not 2. Need api.Compiler().AddConstraint(...) - b := bits[i] - y := api.Mul(api.Sub(1, b), api.Add(1, b)) - api.AssertIsEqual(api.Mul(b, y), 0) - } - } - - // record the constraint Σ (2**i * b[i]) == v - api.AssertIsEqual(Σbi, v) - - return bits -} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/opts.go b/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/opts.go index fa333efb1a..fa55cfae79 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/opts.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/opts.go @@ -17,8 +17,14 @@ func parseOpts(opts ...Option) (*opt, error) { return o, nil } +// Option allows to customize the behavior of functions in this package. See +// [WithNbDigits] and [WithUnconstrainedOutputs] for examples. type Option func(*opt) error +// WithNbDigits sets the bound on the number of digits the input can have. If +// this is not set, then we use standard binary decomposition of the input. If +// it is set and it is less than the width of the native field, then we use +// lookup table based method for bounding the inputs which is more efficient. func WithNbDigits(nbDigits int) Option { return func(o *opt) error { if nbDigits < 1 { @@ -29,6 +35,8 @@ func WithNbDigits(nbDigits int) Option { } } +// WithUnconstrainedOutputs allows to skip the output decomposition and outputs +// width checks. Can be used when these are performed by the caller. func WithUnconstrainedOutputs() Option { return func(o *opt) error { o.nocheck = true diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/partition.go b/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/partition.go index f20c6d3513..7b07c3f983 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/partition.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/bitslice/partition.go @@ -1,9 +1,11 @@ +// Package bitslice allows partitioning variables. package bitslice import ( "math/big" "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/std/math/bits" "github.com/consensys/gnark/std/rangecheck" ) @@ -40,6 +42,19 @@ func Partition(api frontend.API, v frontend.Variable, split uint, opts ...Option } return 0, v } + // when nbDigits is not set, then we assume the bound is the field size. + // However, in that case the decomposition check is more involved as we need + // to avoid the recomposed value to overflow the field. We do not have good + // methods for avoiding it when using range checker gadget, so we defer it + // to `bits.ToBinary`. + if opt.digits == 0 || opt.digits >= api.Compiler().FieldBitLen() { + bts := bits.ToBinary(api, v) + lowerBts := bts[:split] + upperBts := bts[split:] + lower = bits.FromBinary(api, lowerBts) + upper = bits.FromBinary(api, upperBts) + return lower, upper + } ret, err := api.Compiler().NewHint(partitionHint, 2, split, v) if err != nil { panic(err) @@ -58,7 +73,7 @@ func Partition(api frontend.API, v frontend.Variable, split uint, opts ...Option if opt.digits > 0 { upperBound = opt.digits } - rh.Check(upper, upperBound) + rh.Check(upper, upperBound-int(split)) rh.Check(lower, int(split)) m := big.NewInt(1) diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/cmp/bounded.go b/galoisd/vendor/github.com/consensys/gnark/std/math/cmp/bounded.go new file mode 100644 index 0000000000..0c527ffcf3 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/cmp/bounded.go @@ -0,0 +1,229 @@ +package cmp + +import ( + "fmt" + "github.com/consensys/gnark/constraint/solver" + "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/std/math/bits" + "math/big" +) + +func init() { + // register hints + solver.RegisterHint(GetHints()...) +} + +// GetHints returns all hint functions used in this package. This method is +// useful for registering all hints in the solver. +func GetHints() []solver.Hint { + return []solver.Hint{isLessOutputHint, minOutputHint} +} + +// BoundedComparator provides comparison methods, with relatively low circuit +// complexity, for signed comparison of two integers a and b, when an upper +// bound for their absolute difference (|a - b|) is known. These methods perform +// only one binary conversion of length: absDiffUppBitLen. +// +// a and b can be any signed integers, as long as their absolute difference +// respects the specified bound: |a - b| <= absDiffUpp. See +// NewBoundedComparator, for more information. +type BoundedComparator struct { + // absDiffUppBitLen is the assumed maximum length for the binary representation + // of |a - b|. Every method preforms exactly one binary decomposition of this + // length. + absDiffUppBitLen int + api frontend.API + + // we will use value receiver for methods of this struct, + // since: 1) the struct is small. 2) methods should not modify any fields. +} + +// NewBoundedComparator creates a new BoundedComparator, which provides methods +// for comparing two numbers a and b. +// +// absDiffUpp is the upper bound of the absolute difference of a and b, such +// that |a - b| <= absDiffUpp. Notice that |a - b| can be equal to absDiffUpp. +// absDiffUpp must be a positive number, and P - absDiffUpp - 1 must have a +// longer binary representation than absDiffUpp, where P is the order of the +// underlying field. Lower values of absDiffUpp will reduce the number of +// generated constraints. +// +// This function can detect invalid values of absDiffUpp and panics when the +// provided value is not positive or is too big. +// +// As long as |a - b| <= absDiffUpp, all the methods of BoundedComparator work +// correctly. +// +// If |a - b| > absDiffUpp, as long as |a - b| < P - 2^absDiffUpp.BitLen(), +// either a proof can not be generated or the comparison methods work correctly. +// +// When |a - b| >= P - 2^absDiffUpp.BitLen(), if allowNonDeterministicBehaviour +// is not set, either a proof can not be generated or the methods wrongly +// produce reversed results. The exact behaviour depends on the specific method +// and the value of |a - b|, but it will be always well-defined and +// deterministic. +// +// If allowNonDeterministicBehaviour is set, when +// |a - b| >= P - 2^absDiffUpp.BitLen(), the generated constraint system +// sometimes may have multiple solutions and hence the behaviour of the exported +// methods of BoundedComparator will be undefined. +func NewBoundedComparator(api frontend.API, absDiffUpp *big.Int, allowNonDeterministicBehaviour bool) *BoundedComparator { + // Our comparison methods work by using the fact that when a != b, + // between certain two numbers at the same time only one can be + // non-negative (i.e. positive or zero): + // + // AssertIsLessEq -> (a - b, b - a) + // AssertIsLess -> (a - b - 1, b - a - 1) + // IsLess -> (a - b, b - a - 1) + // IsLessEq -> (a - b - 1, b - a) + // Min -> (a - b, b - a) + // + // We assume that the underlying field is of prime order P, so the negative + // of x is P - x. We need to be able to determine the non-negative number in + // each case, and we are doing that by relying on the fact that the negative + // number has a longer binary decomposition than a certain threshold: + // absDiffUppBitLen. So, we'll need to find a suitable absDiffUppBitLen, and + // make sure that any possible negative number has a longer binary + // representation than absDiffUppBitLen. + // + // We see that, between different methods, the biggest possible positive number + // is |a - b| and the smallest possible negative number is -(|a - b| + 1). + // + // On the other hand, we have |a - b| <= absDiffUpp which means: + // -(|a - b| + 1) >= -(absDiffUpp + 1). Therefore, if we let + // absDiffUppBitLen = absDiffUpp.BitLen(), + // that would be the minimum possible value for absDiffUppBitLen. + // Then, we will need to make sure that P - absDiffUpp - 1 has a binary + // representation longer than absDiffUppBitLen. + // + // If we increase |a - b|, as soon as P - |a - b| - 1 becomes smaller than + // 2^absDiffUpp.BitLen(), the negative number will have a binary representation + // that is shorter than the threshold and proofs for wrong results can be + // generated. In this case, if the positive number has a longer than threshold + // binary representation the behaviour of the comparison methods will stay + // well-defined, and the constraint system will have a wrong but unique + // solution. The positive number is always bigger than |a - b| - 1. So, we need + // to make sure that if + // P - |a - b| <= 2^absDiffUpp.BitLen(), then |a - b| - 1 >= 2^absDiffUpp.BitLen(). + // Obviously this condition holds when P - 1 >= 2^(absDiffUpp.BitLen()+1) or + // P > 2^(absDiffUpp.BitLen()+1). + P := api.Compiler().Field() + if absDiffUpp.Cmp(big.NewInt(0)) != 1 || absDiffUpp.Cmp(P) != -1 { + panic("absDiffUpp must be a positive number smaller than the field order") + } + // we checked absDiffUpp < P, so we'll not have an overflow here. + smallestNeg := new(big.Int).Sub(P, absDiffUpp) + smallestNeg.Sub(smallestNeg, big.NewInt(1)) + if smallestNeg.BitLen() <= absDiffUpp.BitLen() { + panic("cannot construct the comparator, the specified absDiffUpp is too high") + } + + if !allowNonDeterministicBehaviour { + // if not P > 2^(absDiffUpp.BitLen()+1) + if P.Cmp(new(big.Int).Lsh(big.NewInt(1), uint(absDiffUpp.BitLen()+1))) != 1 { + panic("absDiffUpp has to be smaller for ensuring deterministic behaviour") + } + } + + return &BoundedComparator{ + absDiffUppBitLen: absDiffUpp.BitLen(), + api: api, + } +} + +// assertIsNonNegative defines constraints that ensure x >= 0. +func (bc BoundedComparator) assertIsNonNegative(x frontend.Variable) { + bits.ToBinary(bc.api, x, bits.WithNbDigits(bc.absDiffUppBitLen)) +} + +// AssertIsLessEq defines a set of constraints that can be satisfied only +// if a <= b. +func (bc BoundedComparator) AssertIsLessEq(a, b frontend.Variable) { + // a <= b <==> b - a >= 0 + bc.assertIsNonNegative(bc.api.Sub(b, a)) +} + +// AssertIsLess defines a set of constraints that can be satisfied only +// if a < b. +func (bc BoundedComparator) AssertIsLess(a, b frontend.Variable) { + // a < b <==> a <= b - 1 + bc.AssertIsLessEq(a, bc.api.Sub(b, 1)) +} + +// IsLess returns 1 if a < b, and returns 0 if a >= b. +func (bc BoundedComparator) IsLess(a, b frontend.Variable) frontend.Variable { + res, err := bc.api.Compiler().NewHint(isLessOutputHint, 1, a, b) + if err != nil { + panic(fmt.Sprintf("error in calling isLessOutputHint: %v", err)) + } + indicator := res[0] + // a < b <==> b - a - 1 >= 0 + // a >= b <==> a - b >= 0 + bc.assertIsNonNegative(bc.api.Select(indicator, bc.api.Sub(b, a, 1), bc.api.Sub(a, b))) + return indicator +} + +// IsLessEq returns 1 if a <= b, and returns 0 if a > b. +func (bc BoundedComparator) IsLessEq(a, b frontend.Variable) frontend.Variable { + // a <= b <==> a < b + 1 + return bc.IsLess(a, bc.api.Add(b, 1)) +} + +// Min returns the minimum of a and b. +func (bc BoundedComparator) Min(a, b frontend.Variable) frontend.Variable { + res, err := bc.api.Compiler().NewHint(minOutputHint, 1, a, b) + if err != nil { + panic(fmt.Sprintf("error in calling minOutputHint: %v", err)) + } + min := res[0] + + aDiff := bc.api.Sub(a, min) + bDiff := bc.api.Sub(b, min) + + // (a - min) * (b - min) == 0 + bc.api.AssertIsEqual(0, bc.api.Mul(aDiff, bDiff)) + + // (a - min) + (b - min) >= 0 + bc.assertIsNonNegative(bc.api.Add(aDiff, bDiff)) + + return min +} + +// cmpInField compares a and b in a finite field of the specified order. +func cmpInField(a, b, order *big.Int) int { + biggestPositiveNum := new(big.Int).Rsh(order, 1) + if a.Cmp(biggestPositiveNum)*b.Cmp(biggestPositiveNum) == -1 { + return -a.Cmp(b) + } + return a.Cmp(b) +} + +// minOutputHint produces the output of [BoundedComparator.Min] as a hint. +func minOutputHint(fieldOrder *big.Int, inputs, results []*big.Int) error { + a := inputs[0] + b := inputs[1] + + if cmpInField(a, b, fieldOrder) == -1 { + // a < b + results[0].Set(a) + } else { + // a >= b + results[0].Set(b) + } + return nil +} + +// isLessOutputHint produces the output of [BoundedComparator.IsLess] as a hint. +func isLessOutputHint(fieldOrder *big.Int, inputs, results []*big.Int) error { + a := inputs[0] + b := inputs[1] + + if cmpInField(a, b, fieldOrder) == -1 { + // a < b + results[0].SetUint64(1) + } else { + // a >= b + results[0].SetUint64(0) + } + return nil +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/cmp/generic.go b/galoisd/vendor/github.com/consensys/gnark/std/math/cmp/generic.go new file mode 100644 index 0000000000..97bac20567 --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/cmp/generic.go @@ -0,0 +1,105 @@ +// Package cmp provides methods and functions for comparing two numbers. +package cmp + +import ( + "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/std/math/bits" + "math/big" +) + +// IsLess returns 1 if a < b, and returns 0 if a >= b. a and b should be +// integers in range [0, P-1], where P is the order of the underlying field used +// by the proof system. +// +// When inputs are not in range [0, P-1], the remainder of their division by P +// will be considered for comparison. +func IsLess(api frontend.API, a, b frontend.Variable) frontend.Variable { + return isLessRecursive(api, bits.ToBinary(api, a), bits.ToBinary(api, b), false, true) +} + +// IsLessOrEqual returns 1 if a <= b, and returns 0 if a > b. a and b should be +// integers in range [0, P-1], where P is the order of the underlying field used +// by the proof system. +// +// When inputs are not in range [0, P-1], the remainder of their division by P +// will be considered for comparison. +func IsLessOrEqual(api frontend.API, a, b frontend.Variable) frontend.Variable { + return isLessRecursive(api, bits.ToBinary(api, a), bits.ToBinary(api, b), true, true) +} + +// IsLessBinary compares two non-negative binary numbers represented by aBits +// and bBits. It returns 1 if the integer represented by aBits is less than the +// integer represented by bBits, and returns 0 otherwise. +func IsLessBinary(api frontend.API, aBits, bBits []frontend.Variable) frontend.Variable { + if len(aBits) != len(bBits) { + panic("a and b must have the same length") + } + assertBits(api, aBits) + assertBits(api, bBits) + return isLessRecursive(api, aBits, bBits, false, true) +} + +// IsLessOrEqualBinary compares two non-negative binary numbers represented by +// aBits and bBits. It returns 1 if the integer represented by aBits is less +// than or equal to the integer represented by bBits, and returns 0 otherwise. +func IsLessOrEqualBinary(api frontend.API, aBits, bBits []frontend.Variable) frontend.Variable { + if len(aBits) != len(bBits) { + panic("a and b must have the same length") + } + assertBits(api, aBits) + assertBits(api, bBits) + return isLessRecursive(api, aBits, bBits, true, true) +} + +// isLessRecursive compares binary numbers a and b. When useBoundedCmp is false +// it performs normal bit by bit comparison which defines 2*n multiplication +// constraints. When useBoundedCmp is true, bit by bit comparison will be used +// for a few high order bits and the rest of bits will be compared by +// BoundedComparator. If addition is free, this will define n + 5 constraints +// when n == api.Compiler().FieldBitLen(). +// +// acceptEquality determines the return value of the function when a == b. +func isLessRecursive(api frontend.API, + a, b []frontend.Variable, + acceptEquality bool, useBoundedCmp bool) frontend.Variable { + n := len(a) + if n == 0 { + if acceptEquality { + return 1 + } else { + return 0 + } + } + // Interestingly when one of the two numbers is a constant, using bit by bit + // comparison will produce 3 fewer constraints than using the BoundedComparator. + if useBoundedCmp && n <= api.Compiler().FieldBitLen()-2 && + isNotConstant(api, a[n-1]) && isNotConstant(api, b[n-1]) { + diffBound := new(big.Int).Lsh(big.NewInt(1), uint(n)) + diffBound.Sub(diffBound, big.NewInt(1)) + comparator := NewBoundedComparator(api, diffBound, false) + a := bits.FromBinary(api, a, bits.WithUnconstrainedInputs()) + b := bits.FromBinary(api, b, bits.WithUnconstrainedInputs()) + if acceptEquality { + return comparator.IsLessEq(a, b) + } else { + return comparator.IsLess(a, b) + } + } + + // out = (a[n-1] + b[n-1] - 2*a[n-1]*b[n-1])*(b[n-1] - cmp) + cmp + eq := api.Add(a[n-1], b[n-1], api.Mul(-2, a[n-1], b[n-1])) + cmp := isLessRecursive(api, a[:n-1], b[:n-1], acceptEquality, useBoundedCmp) + return api.Add(cmp, api.Mul(eq, api.Sub(b[n-1], cmp))) +} + +func isNotConstant(api frontend.API, x frontend.Variable) bool { + _, isConstant := api.Compiler().ConstantValue(x) + return !isConstant +} + +// assertBits defines boolean constraints for every element of bits. +func assertBits(api frontend.API, bits []frontend.Variable) { + for _, b := range bits { + api.AssertIsBoolean(b) + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/composition.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/composition.go index 79b0216a80..d94d4f5cca 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/composition.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/composition.go @@ -23,7 +23,8 @@ func recompose(inputs []*big.Int, nbBits uint, res *big.Int) error { res.Lsh(res, nbBits) res.Add(res, inputs[len(inputs)-i-1]) } - // TODO @gbotrel mod reduce ? + // we do not mod-reduce here as the result is mod-reduced by the caller if + // needed. In some places we need non-reduced results. return nil } @@ -66,11 +67,10 @@ func decompose(input *big.Int, nbBits uint, res []*big.Int) error { // // then no such underflow happens and s = a-b (mod p) as the padding is multiple // of p. -func subPadding[T FieldParams](overflow uint, nbLimbs uint) []*big.Int { - var fp T - p := fp.Modulus() - bitsPerLimbs := fp.BitsPerLimb() - +func subPadding(modulus *big.Int, bitsPerLimbs uint, overflow uint, nbLimbs uint) []*big.Int { + if modulus.Cmp(big.NewInt(0)) == 0 { + panic("modulus is zero") + } // first, we build a number nLimbs, such that nLimbs > b; // here b is defined by its bounds, that is b is an element with nbLimbs of (bitsPerLimbs+overflow) // so a number nLimbs > b, is simply taking the next power of 2 over this bound . @@ -86,8 +86,8 @@ func subPadding[T FieldParams](overflow uint, nbLimbs uint) []*big.Int { panic(fmt.Sprintf("recompose: %v", err)) } // mod reduce n, and negate it - n.Mod(n, p) - n.Sub(p, n) + n.Mod(n, modulus) + n.Sub(modulus, n) // construct pad such that: // pad := n - neg(n mod p) == kp diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/custommod.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/custommod.go new file mode 100644 index 0000000000..2f5cbaca1b --- /dev/null +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/custommod.go @@ -0,0 +1,99 @@ +package emulated + +import ( + "errors" + + "github.com/consensys/gnark/frontend" +) + +// ModMul computes a*b mod modulus. Instead of taking modulus as a constant +// parametrized by T, it is passed as an argument. This allows to use a variable +// modulus in the circuit. Type parameter T should be sufficiently big to fit a, +// b and modulus. Recommended to use [emparams.Mod1e512] or +// [emparams.Mod1e4096]. +// +// NB! circuit complexity depends on T rather on the actual length of the modulus. +func (f *Field[T]) ModMul(a, b *Element[T], modulus *Element[T]) *Element[T] { + res := f.mulMod(a, b, 0, modulus) + return res +} + +// ModAdd computes a+b mod modulus. Instead of taking modulus as a constant +// parametrized by T, it is passed as an argument. This allows to use a variable +// modulus in the circuit. Type parameter T should be sufficiently big to fit a, +// b and modulus. Recommended to use [emparams.Mod1e512] or +// [emparams.Mod1e4096]. +// +// NB! circuit complexity depends on T rather on the actual length of the modulus. +func (f *Field[T]) ModAdd(a, b *Element[T], modulus *Element[T]) *Element[T] { + // inlined version of [Field.reduceAndOp] which uses variable-modulus reduction + var nextOverflow uint + var err error + var target overflowError + for nextOverflow, err = f.addPreCond(a, b); errors.As(err, &target); nextOverflow, err = f.addPreCond(a, b) { + if errors.As(err, &target) { + if !target.reduceRight { + a = f.mulMod(a, f.shortOne(), 0, modulus) + } else { + b = f.mulMod(b, f.shortOne(), 0, modulus) + } + } + } + res := f.add(a, b, nextOverflow) + return res +} + +func (f *Field[T]) modSub(a, b *Element[T], modulus *Element[T]) *Element[T] { + // like fixed modulus subtraction, but for sub padding need to use hint + // instead of assuming T as a constant. And when doing as a hint, then need + // to assert that the padding is a multiple of the modulus (done inside callSubPaddingHint) + nextOverflow := max(b.overflow+1, a.overflow) + 1 + nbLimbs := max(len(a.Limbs), len(b.Limbs)) + limbs := make([]frontend.Variable, nbLimbs) + padding := f.computeSubPaddingHint(b.overflow, uint(nbLimbs), modulus) + for i := range limbs { + limbs[i] = padding.Limbs[i] + if i < len(a.Limbs) { + limbs[i] = f.api.Add(limbs[i], a.Limbs[i]) + } + if i < len(b.Limbs) { + limbs[i] = f.api.Sub(limbs[i], b.Limbs[i]) + } + } + res := f.newInternalElement(limbs, nextOverflow) + return res +} + +// ModAssertIsEqual asserts equality of a and b mod modulus. Instead of taking +// modulus as a constant parametrized by T, it is passed as an argument. This +// allows to use a variable modulus in the circuit. Type parameter T should be +// sufficiently big to fit a, b and modulus. Recommended to use +// [emparams.Mod1e512] or [emparams.Mod1e4096]. +// +// NB! circuit complexity depends on T rather on the actual length of the modulus. +func (f *Field[T]) ModAssertIsEqual(a, b *Element[T], modulus *Element[T]) { + // like fixed modulus AssertIsEqual, but uses current Sub implementation for + // computing the diff + diff := f.modSub(b, a, modulus) + f.checkZero(diff, modulus) +} + +// ModExp computes base^exp mod modulus. Instead of taking modulus as a constant +// parametrized by T, it is passed as an argument. This allows to use a variable +// modulus in the circuit. Type parameter T should be sufficiently big to fit +// base, exp and modulus. Recommended to use [emparams.Mod1e512] or +// [emparams.Mod1e4096]. +// +// NB! circuit complexity depends on T rather on the actual length of the modulus. +func (f *Field[T]) ModExp(base, exp, modulus *Element[T]) *Element[T] { + expBts := f.ToBits(exp) + n := len(expBts) + res := f.Select(expBts[0], base, f.One()) + base = f.ModMul(base, base, modulus) + for i := 1; i < n-1; i++ { + res = f.Select(expBts[i], f.ModMul(base, res, modulus), res) + base = f.ModMul(base, base, modulus) + } + res = f.Select(expBts[n-1], f.ModMul(base, res, modulus), res) + return res +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/doc.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/doc.go index 61a6e54288..6f4685f253 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/doc.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/doc.go @@ -184,5 +184,17 @@ The package currently does not explicitly differentiate between constant and variable elements. The builder may track some elements as being constants. Some operations have a fast track path for cases when all inputs are constants. There is [Field.MulConst], which provides variable by constant multiplication. + +# Variable-modulus operations + +The package also exposes methods for performing operations with variable +modulus. The modulus is represented as an element and is not required to be +prime. The methods for variable-modulus operations are [Field.ModMul], +[Field.ModAdd], [Field.ModExp] and [Field.ModAssertIsEqual]. The modulus is +passed as an argument to the operation. + +The type parameter for the [Field] should be sufficiently big to allow to fit +the inputs and the modulus. Recommended to use predefined [emparams.Mod1e512] or +[emparams.Mod1e4096]. */ package emulated diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/emparams/emparams.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/emparams/emparams.go index ebbf7d5d8c..22e7872203 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/emparams/emparams.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/emparams/emparams.go @@ -254,7 +254,7 @@ type BW6761Fr struct{ sixLimbPrimeField } func (fp BW6761Fr) Modulus() *big.Int { return ecc.BW6_761.ScalarField() } -// BLS12315Fp provides type parametrization for field emulation: +// BLS24315Fp provides type parametrization for field emulation: // - limbs: 5 // - limb width: 64 bits // @@ -264,11 +264,11 @@ func (fp BW6761Fr) Modulus() *big.Int { return ecc.BW6_761.ScalarField() } // 39705142709513438335025689890408969744933502416914749335064285505637884093126342347073617133569 (base 10) // // This is the base field of the BLS24-315 curve. -type BLS12315Fp struct{ fiveLimbPrimeField } +type BLS24315Fp struct{ fiveLimbPrimeField } -func (fp BLS12315Fp) Modulus() *big.Int { return ecc.BLS24_315.BaseField() } +func (fp BLS24315Fp) Modulus() *big.Int { return ecc.BLS24_315.BaseField() } -// BLS12315Fr provides type parametrization for field emulation: +// BLS24315Fr provides type parametrization for field emulation: // - limbs: 4 // - limb width: 64 bits // @@ -278,6 +278,63 @@ func (fp BLS12315Fp) Modulus() *big.Int { return ecc.BLS24_315.BaseField() } // 0x196deac24a9da12b25fc7ec9cf927a98c8c480ece644e36419d0c5fd00c00001 (base 10) // // This is the scalar field of the BLS24-315 curve. -type BLS12315Fr struct{ fourLimbPrimeField } +type BLS24315Fr struct{ fourLimbPrimeField } -func (fr BLS12315Fr) Modulus() *big.Int { return ecc.BLS24_315.ScalarField() } +func (fr BLS24315Fr) Modulus() *big.Int { return ecc.BLS24_315.ScalarField() } + +// Mod1e4096 provides type parametrization for emulated aritmetic: +// - limbs: 64 +// - limb width: 64 bits +// +// The modulus for type parametrisation is 2^4096-1. +// +// This is non-prime modulus. It is mainly targeted for using variable-modulus +// operations (ModAdd, ModMul, ModExp, ModAssertIsEqual) for variable modulus +// arithmetic. +type Mod1e4096 struct{} + +func (Mod1e4096) NbLimbs() uint { return 64 } +func (Mod1e4096) BitsPerLimb() uint { return 64 } +func (Mod1e4096) IsPrime() bool { return false } +func (Mod1e4096) Modulus() *big.Int { + val, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) + return val +} + +// Mod1e512 provides type parametrization for emulated aritmetic: +// - limbs: 8 +// - limb width: 64 bits +// +// The modulus for type parametrisation is 2^512-1. +// +// This is non-prime modulus. It is mainly targeted for using variable-modulus +// operations (ModAdd, ModMul, ModExp, ModAssertIsEqual) for variable modulus +// arithmetic. +type Mod1e512 struct{} + +func (Mod1e512) NbLimbs() uint { return 8 } +func (Mod1e512) BitsPerLimb() uint { return 64 } +func (Mod1e512) IsPrime() bool { return false } +func (Mod1e512) Modulus() *big.Int { + val, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) + return val +} + +// Mod1e256 provides type parametrization for emulated aritmetic: +// - limbs: 4 +// - limb width: 64 bits +// +// The modulus for type parametrisation is 2^256-1. +// +// This is non-prime modulus. It is mainly targeted for using variable-modulus +// operations (ModAdd, ModMul, ModExp, ModAssertIsEqual) for variable modulus +// arithmetic. +type Mod1e256 struct{} + +func (Mod1e256) NbLimbs() uint { return 4 } +func (Mod1e256) BitsPerLimb() uint { return 64 } +func (Mod1e256) IsPrime() bool { return false } +func (Mod1e256) Modulus() *big.Int { + val, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16) + return val +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field.go index 6c1f19b04d..96bca2fd79 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field.go @@ -43,7 +43,7 @@ type Field[T FieldParams] struct { log zerolog.Logger - constrainedLimbs map[uint64]struct{} + constrainedLimbs map[[16]byte]struct{} checker frontend.Rangechecker mulChecks []mulCheck[T] @@ -69,7 +69,7 @@ func NewField[T FieldParams](native frontend.API) (*Field[T], error) { f := &Field[T]{ api: native, log: logger.Logger(), - constrainedLimbs: make(map[uint64]struct{}), + constrainedLimbs: make(map[[16]byte]struct{}), checker: rangecheck.New(native), } @@ -216,7 +216,7 @@ func (f *Field[T]) enforceWidthConditional(a *Element[T]) (didConstrain bool) { } continue } - if vv, ok := a.Limbs[i].(interface{ HashCode() uint64 }); ok { + if vv, ok := a.Limbs[i].(interface{ HashCode() [16]byte }); ok { // okay, this is a canonical variable and it has a hashcode. We use // it to see if the limb is already constrained. h := vv.HashCode() diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_assert.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_assert.go index a2809e4eb9..86ff353424 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_assert.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_assert.go @@ -46,7 +46,7 @@ func (f *Field[T]) AssertIsEqual(a, b *Element[T]) { } diff := f.Sub(b, a) - f.checkZero(diff) + f.checkZero(diff, nil) } // AssertIsLessOrEqual ensures that e is less or equal than a. For proper @@ -111,7 +111,7 @@ func (f *Field[T]) IsZero(a *Element[T]) frontend.Variable { // as ca is already reduced, then every limb overflow is already 0. Only // every addition adds a bit to the overflow totalOverflow := len(ca.Limbs) - 1 - if totalOverflow < int(f.maxOverflow()) { + if totalOverflow > int(f.maxOverflow()) { // the sums of limbs would overflow the native field. Use the first // approach instead. res := f.api.IsZero(ca.Limbs[0]) diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_mul.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_mul.go index 9a2671d08a..278b9a5024 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_mul.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_mul.go @@ -58,21 +58,25 @@ type mulCheck[T FieldParams] struct { r *Element[T] // reduced value k *Element[T] // coefficient c *Element[T] // carry + p *Element[T] // modulus if non-nil } // evalRound1 evaluates first c(X), r(X) and k(X) at a given random point at[0]. // In the first round we do not assume that any of them is already evaluated as // they come directly from hint. -func (mc *mulCheck[T]) evalRound1(api frontend.API, at []frontend.Variable) { +func (mc *mulCheck[T]) evalRound1(at []frontend.Variable) { mc.c = mc.f.evalWithChallenge(mc.c, at) mc.r = mc.f.evalWithChallenge(mc.r, at) mc.k = mc.f.evalWithChallenge(mc.k, at) + if mc.p != nil { + mc.p = mc.f.evalWithChallenge(mc.p, at) + } } // evalRound2 now evaluates a and b at a given random point at[0]. However, it // may happen that a or b is equal to r from a previous mulcheck. In that case // we can reuse the evaluation to save constraints. -func (mc *mulCheck[T]) evalRound2(api frontend.API, at []frontend.Variable) { +func (mc *mulCheck[T]) evalRound2(at []frontend.Variable) { mc.a = mc.f.evalWithChallenge(mc.a, at) mc.b = mc.f.evalWithChallenge(mc.b, at) } @@ -81,6 +85,9 @@ func (mc *mulCheck[T]) evalRound2(api frontend.API, at []frontend.Variable) { // computation of p(ch) and (2^t-ch) can be shared over all mulCheck instances, // then we get them already evaluated as peval and coef. func (mc *mulCheck[T]) check(api frontend.API, peval, coef frontend.Variable) { + if mc.p != nil { + peval = mc.p.evaluation + } ls := api.Mul(mc.a.evaluation, mc.b.evaluation) rs := api.Add(mc.r.evaluation, api.Mul(peval, mc.k.evaluation), api.Mul(mc.c.evaluation, coef)) api.AssertIsEqual(ls, rs) @@ -99,14 +106,19 @@ func (mc *mulCheck[T]) cleanEvaluations() { mc.k.isEvaluated = false mc.c.evaluation = 0 mc.c.isEvaluated = false + if mc.p != nil { + mc.p.evaluation = 0 + mc.p.isEvaluated = false + } } // mulMod returns a*b mod r. In practice it computes the result using a hint and // defers the actual multiplication check. -func (f *Field[T]) mulMod(a, b *Element[T], _ uint) *Element[T] { +func (f *Field[T]) mulMod(a, b *Element[T], _ uint, p *Element[T]) *Element[T] { f.enforceWidthConditional(a) f.enforceWidthConditional(b) - k, r, c, err := f.callMulHint(a, b, true) + f.enforceWidthConditional(p) + k, r, c, err := f.callMulHint(a, b, true, p) if err != nil { panic(err) } @@ -117,18 +129,20 @@ func (f *Field[T]) mulMod(a, b *Element[T], _ uint) *Element[T] { c: c, k: k, r: r, + p: p, } f.mulChecks = append(f.mulChecks, mc) return r } // checkZero creates multiplication check a * 1 = 0 + k*p. -func (f *Field[T]) checkZero(a *Element[T]) { +func (f *Field[T]) checkZero(a *Element[T], p *Element[T]) { // the method works similarly to mulMod, but we know that we are multiplying // by one and expected result should be zero. f.enforceWidthConditional(a) + f.enforceWidthConditional(p) b := f.shortOne() - k, r, c, err := f.callMulHint(a, b, false) + k, r, c, err := f.callMulHint(a, b, false, p) if err != nil { panic(err) } @@ -139,6 +153,7 @@ func (f *Field[T]) checkZero(a *Element[T]) { c: c, k: k, r: r, // expected to be zero on zero limbs. + p: p, } f.mulChecks = append(f.mulChecks, mc) } @@ -191,6 +206,9 @@ func (f *Field[T]) performMulChecks(api frontend.API) error { toCommit = append(toCommit, f.mulChecks[i].r.Limbs...) toCommit = append(toCommit, f.mulChecks[i].k.Limbs...) toCommit = append(toCommit, f.mulChecks[i].c.Limbs...) + if f.mulChecks[i].p != nil { + toCommit = append(toCommit, f.mulChecks[i].p.Limbs...) + } } // we give all the inputs as inputs to obtain random verifier challenge. multicommit.WithCommitment(api, func(api frontend.API, commitment frontend.Variable) error { @@ -207,11 +225,11 @@ func (f *Field[T]) performMulChecks(api frontend.API) error { } // evaluate all r, k, c for i := range f.mulChecks { - f.mulChecks[i].evalRound1(api, at) + f.mulChecks[i].evalRound1(at) } // assuming r is input to some other multiplication, then is already evaluated for i := range f.mulChecks { - f.mulChecks[i].evalRound2(api, at) + f.mulChecks[i].evalRound2(at) } // evaluate p(X) at challenge pval := f.evalWithChallenge(f.Modulus(), at) @@ -234,7 +252,7 @@ func (f *Field[T]) performMulChecks(api frontend.API) error { } // callMulHint uses hint to compute r, k and c. -func (f *Field[T]) callMulHint(a, b *Element[T], isMulMod bool) (quo, rem, carries *Element[T], err error) { +func (f *Field[T]) callMulHint(a, b *Element[T], isMulMod bool, customMod *Element[T]) (quo, rem, carries *Element[T], err error) { // compute the expected overflow after the multiplication of a*b to be able // to estimate the number of bits required to represent the result. nextOverflow, _ := f.mulPreCond(a, b) @@ -249,8 +267,15 @@ func (f *Field[T]) callMulHint(a, b *Element[T], isMulMod bool) (quo, rem, carri // we compute the width of the product of a*b, then we divide it by the // width of the modulus. We add 1 to the result to ensure that we have // enough space for the quotient. + modbits := uint(f.fParams.Modulus().BitLen()) + if customMod != nil { + // when we're using custom modulus, then we do not really know its + // length ahead of time. We assume worst case scenario and assume that + // the quotient can be the total length of the multiplication result. + modbits = 0 + } nbQuoLimbs := (uint(nbMultiplicationResLimbs(len(a.Limbs), len(b.Limbs)))*nbBits + nextOverflow + 1 - // - uint(f.fParams.Modulus().BitLen()) + // + modbits + // nbBits - 1) / nbBits // the remainder is always less than modulus so can represent on the same @@ -267,7 +292,11 @@ func (f *Field[T]) callMulHint(a, b *Element[T], isMulMod bool) (quo, rem, carri len(a.Limbs), nbQuoLimbs, } - hintInputs = append(hintInputs, f.Modulus().Limbs...) + modulusLimbs := f.Modulus().Limbs + if customMod != nil { + modulusLimbs = customMod.Limbs + } + hintInputs = append(hintInputs, modulusLimbs...) hintInputs = append(hintInputs, a.Limbs...) hintInputs = append(hintInputs, b.Limbs...) ret, err := f.api.NewHint(mulHint, int(nbQuoLimbs)+int(nbRemLimbs)+int(nbCarryLimbs), hintInputs...) @@ -328,7 +357,9 @@ func mulHint(field *big.Int, inputs, outputs []*big.Int) error { quo := new(big.Int) rem := new(big.Int) ab := new(big.Int).Mul(a, b) - quo.QuoRem(ab, p, rem) + if p.Cmp(new(big.Int)) != 0 { + quo.QuoRem(ab, p, rem) + } if err := decompose(quo, uint(nbBits), quoLimbs); err != nil { return fmt.Errorf("decompose quo: %w", err) } @@ -380,7 +411,7 @@ func mulHint(field *big.Int, inputs, outputs []*big.Int) error { // For multiplying by a constant, use [Field[T].MulConst] method which is more // efficient. func (f *Field[T]) Mul(a, b *Element[T]) *Element[T] { - return f.reduceAndOp(f.mulMod, f.mulPreCond, a, b) + return f.reduceAndOp(func(a, b *Element[T], u uint) *Element[T] { return f.mulMod(a, b, u, nil) }, f.mulPreCond, a, b) } // MulMod computes a*b and reduces it modulo the field order. The returned Element @@ -388,7 +419,7 @@ func (f *Field[T]) Mul(a, b *Element[T]) *Element[T] { // // Equivalent to [Field[T].Mul], kept for backwards compatibility. func (f *Field[T]) MulMod(a, b *Element[T]) *Element[T] { - return f.reduceAndOp(f.mulMod, f.mulPreCond, a, b) + return f.reduceAndOp(func(a, b *Element[T], u uint) *Element[T] { return f.mulMod(a, b, u, nil) }, f.mulPreCond, a, b) } // MulConst multiplies a by a constant c and returns it. We assume that the @@ -463,3 +494,18 @@ func (f *Field[T]) mulNoReduce(a, b *Element[T], nextoverflow uint) *Element[T] } return f.newInternalElement(resLimbs, nextoverflow) } + +// Exp computes base^exp modulo the field order. The returned Element has default +// number of limbs and zero overflow. +func (f *Field[T]) Exp(base, exp *Element[T]) *Element[T] { + expBts := f.ToBits(exp) + n := len(expBts) + res := f.Select(expBts[0], base, f.One()) + base = f.Mul(base, base) + for i := 1; i < n-1; i++ { + res = f.Select(expBts[i], f.Mul(base, res), res) + base = f.Mul(base, base) + } + res = f.Select(expBts[n-1], f.Mul(base, res), res) + return res +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_ops.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_ops.go index aeaf2c3059..a9f0d9cda3 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_ops.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/field_ops.go @@ -176,7 +176,7 @@ func (f *Field[T]) Reduce(a *Element[T]) *Element[T] { panic("trying to reduce a constant, which happen to have an overflow flag set") } // slow path - use hint to reduce value - return f.mulMod(a, f.One(), 0) + return f.mulMod(a, f.One(), 0, nil) } // Sub subtracts b from a and returns it. Reduces locally if wouldn't fit into @@ -204,9 +204,10 @@ func (f *Field[T]) sub(a, b *Element[T], nextOverflow uint) *Element[T] { // first we have to compute padding to ensure that the subtraction does not // underflow. + var fp T nbLimbs := max(len(a.Limbs), len(b.Limbs)) limbs := make([]frontend.Variable, nbLimbs) - padLimbs := subPadding[T](b.overflow, uint(nbLimbs)) + padLimbs := subPadding(fp.Modulus(), fp.BitsPerLimb(), b.overflow, uint(nbLimbs)) for i := range limbs { limbs[i] = padLimbs[i] if i < len(a.Limbs) { diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/hints.go b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/hints.go index 6c1644c407..eab14b47e9 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/hints.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/emulated/hints.go @@ -22,6 +22,7 @@ func GetHints() []solver.Hint { InverseHint, SqrtHint, mulHint, + subPaddingHint, } } @@ -153,3 +154,51 @@ func SqrtHint(mod *big.Int, inputs []*big.Int, outputs []*big.Int) error { return nil }) } + +// subPaddingHint computes the padding for the subtraction of two numbers. It +// ensures that the padding is a multiple of the modulus. Can be used to avoid +// underflow. +// +// In case of fixed modulus use subPadding instead. +func subPaddingHint(mod *big.Int, inputs, outputs []*big.Int) error { + if len(inputs) < 4 { + return fmt.Errorf("input must be at least four elements") + } + nbLimbs := int(inputs[0].Int64()) + bitsPerLimbs := uint(inputs[1].Uint64()) + overflow := uint(inputs[2].Uint64()) + retLimbs := int(inputs[3].Int64()) + if len(inputs[4:]) != nbLimbs { + return fmt.Errorf("input length mismatch") + } + if len(outputs) != retLimbs { + return fmt.Errorf("result does not fit into output") + } + pLimbs := inputs[4 : 4+nbLimbs] + p := new(big.Int) + if err := recompose(pLimbs, bitsPerLimbs, p); err != nil { + return fmt.Errorf("recompose modulus: %w", err) + } + padLimbs := subPadding(p, bitsPerLimbs, overflow, uint(nbLimbs)) + for i := range padLimbs { + outputs[i].Set(padLimbs[i]) + } + + return nil +} + +func (f *Field[T]) computeSubPaddingHint(overflow uint, nbLimbs uint, modulus *Element[T]) *Element[T] { + var fp T + inputs := []frontend.Variable{fp.NbLimbs(), fp.BitsPerLimb(), overflow, nbLimbs} + inputs = append(inputs, modulus.Limbs...) + res, err := f.api.NewHint(subPaddingHint, int(nbLimbs), inputs...) + if err != nil { + panic(fmt.Sprintf("sub padding hint: %v", err)) + } + for i := range res { + f.checker.Check(res[i], int(fp.BitsPerLimb()+overflow+1)) + } + padding := f.newInternalElement(res, fp.BitsPerLimb()+overflow+1) + f.checkZero(padding, modulus) + return padding +} diff --git a/galoisd/vendor/github.com/consensys/gnark/std/math/uints/uint8.go b/galoisd/vendor/github.com/consensys/gnark/std/math/uints/uint8.go index cec591d10c..adabe49483 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/math/uints/uint8.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/math/uints/uint8.go @@ -24,6 +24,7 @@ package uints import ( "fmt" + "math/bits" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/std/internal/logderivprecomp" @@ -173,15 +174,18 @@ func (bf *BinaryField[T]) ValueOf(a frontend.Variable) T { if err != nil { panic(err) } - // TODO: add constraint which ensures that map back to + for i := range bts { r[i] = bf.ByteValueOf(bts[i]) } + expectedValue := bf.ToValue(r) + bf.api.AssertIsEqual(a, expectedValue) + return r } func (bf *BinaryField[T]) ToValue(a T) frontend.Variable { - v := make([]frontend.Variable, len(a)) + v := make([]frontend.Variable, bf.lenBts()) for i := range v { v[i] = bf.api.Mul(a[i].Val, 1<<(i*8)) } @@ -206,8 +210,8 @@ func (bf *BinaryField[T]) PackLSB(a ...U8) T { } func (bf *BinaryField[T]) UnpackMSB(a T) []U8 { - ret := make([]U8, len(a)) - for i := 0; i < len(a); i++ { + ret := make([]U8, bf.lenBts()) + for i := 0; i < len(ret); i++ { ret[len(a)-i-1] = a[i] } return ret @@ -215,8 +219,8 @@ func (bf *BinaryField[T]) UnpackMSB(a T) []U8 { func (bf *BinaryField[T]) UnpackLSB(a T) []U8 { // cannot deduce that a can be cast to []U8 - ret := make([]U8, len(a)) - for i := 0; i < len(a); i++ { + ret := make([]U8, bf.lenBts()) + for i := 0; i < len(ret); i++ { ret[i] = a[i] } return ret @@ -255,18 +259,22 @@ func (bf *BinaryField[T]) Not(a T) T { } func (bf *BinaryField[T]) Add(a ...T) T { - va := make([]frontend.Variable, len(a)) + tLen := bf.lenBts() * 8 + inLen := len(a) + va := make([]frontend.Variable, inLen) for i := range a { va[i] = bf.ToValue(a[i]) } vres := bf.api.Add(va[0], va[1], va[2:]...) - res := bf.ValueOf(vres) - // TODO: should also check the that carry we omitted is correct. + maxBitlen := bits.Len(uint(inLen)) + tLen + // bitslice.Partition below checks that the input is less than 2^maxBitlen and that we have omitted carry correctly + vreslow, _ := bitslice.Partition(bf.api, vres, uint(tLen), bitslice.WithNbDigits(maxBitlen), bitslice.WithUnconstrainedOutputs()) + res := bf.ValueOf(vreslow) return res } func (bf *BinaryField[T]) Lrot(a T, c int) T { - l := len(a) + l := bf.lenBts() if c < 0 { c = l*8 + c } @@ -293,23 +301,24 @@ func (bf *BinaryField[T]) Lrot(a T, c int) T { } func (bf *BinaryField[T]) Rshift(a T, c int) T { + lenB := bf.lenBts() shiftBl := c / 8 shiftBt := c % 8 - partitioned := make([][2]frontend.Variable, len(a)-shiftBl) + partitioned := make([][2]frontend.Variable, lenB-shiftBl) for i := range partitioned { lower, upper := bitslice.Partition(bf.api, a[i+shiftBl].Val, uint(shiftBt), bitslice.WithNbDigits(8)) partitioned[i] = [2]frontend.Variable{lower, upper} } var ret T - for i := 0; i < len(a)-shiftBl-1; i++ { + for i := 0; i < bf.lenBts()-shiftBl-1; i++ { if shiftBt != 0 { ret[i].Val = bf.api.Add(partitioned[i][1], bf.api.Mul(1<<(8-shiftBt), partitioned[i+1][0])) } else { ret[i].Val = partitioned[i][1] } } - ret[len(a)-shiftBl-1].Val = partitioned[len(a)-shiftBl-1][1] - for i := len(a) - shiftBl; i < len(ret); i++ { + ret[lenB-shiftBl-1].Val = partitioned[lenB-shiftBl-1][1] + for i := lenB - shiftBl; i < lenB; i++ { ret[i] = NewU8(0) } return ret @@ -320,11 +329,16 @@ func (bf *BinaryField[T]) ByteAssertEq(a, b U8) { } func (bf *BinaryField[T]) AssertEq(a, b T) { - for i := 0; i < len(a); i++ { + for i := 0; i < bf.lenBts(); i++ { bf.ByteAssertEq(a[i], b[i]) } } +func (bf *BinaryField[T]) lenBts() int { + var a T + return len(a) +} + func reslice[T U32 | U64](in []T) [][]U8 { if len(in) == 0 { panic("zero-length input") diff --git a/galoisd/vendor/github.com/consensys/gnark/std/multicommit/nativecommit.go b/galoisd/vendor/github.com/consensys/gnark/std/multicommit/nativecommit.go index 4f8e56a0cc..c260a16f46 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/multicommit/nativecommit.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/multicommit/nativecommit.go @@ -89,15 +89,16 @@ func (mct *multicommitter) commitAndCall(api frontend.API) error { if !ok { panic("compiler doesn't implement frontend.Committer") } - cmt, err := commiter.Commit(mct.vars...) + rootCmt, err := commiter.Commit(mct.vars...) if err != nil { return fmt.Errorf("commit: %w", err) } + cmt := rootCmt if err = mct.cbs[0](api, cmt); err != nil { return fmt.Errorf("callback 0: %w", err) } for i := 1; i < len(mct.cbs); i++ { - cmt = api.Mul(cmt, cmt) + cmt = api.Mul(rootCmt, cmt) if err := mct.cbs[i](api, cmt); err != nil { return fmt.Errorf("callback %d: %w", i, err) } diff --git a/galoisd/vendor/github.com/consensys/gnark/std/rangecheck/rangecheck_commit.go b/galoisd/vendor/github.com/consensys/gnark/std/rangecheck/rangecheck_commit.go index 457c00ef36..acccb6bcca 100644 --- a/galoisd/vendor/github.com/consensys/gnark/std/rangecheck/rangecheck_commit.go +++ b/galoisd/vendor/github.com/consensys/gnark/std/rangecheck/rangecheck_commit.go @@ -154,10 +154,10 @@ func (c *commitChecker) getOptimalBasewidth(api frontend.API) int { } func optimalWidth(countFn func(baseLength int, collected []checkedVariable) int, collected []checkedVariable) int { - min := math.MaxInt64 + min := int64(math.MaxInt64) minVal := 0 for j := 2; j < 18; j++ { - current := countFn(j, collected) + current := int64(countFn(j, collected)) if current < min { min = current minVal = j diff --git a/galoisd/vendor/github.com/consensys/gnark/test/assert_checkcircuit.go b/galoisd/vendor/github.com/consensys/gnark/test/assert_checkcircuit.go index e666785294..d75700513b 100644 --- a/galoisd/vendor/github.com/consensys/gnark/test/assert_checkcircuit.go +++ b/galoisd/vendor/github.com/consensys/gnark/test/assert_checkcircuit.go @@ -1,10 +1,13 @@ package test import ( + "crypto/sha256" + "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/groth16" "github.com/consensys/gnark/backend/plonk" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/backend/witness" "github.com/consensys/gnark/constraint" "github.com/consensys/gnark/frontend" @@ -120,17 +123,26 @@ func (assert *Assert) CheckCircuit(circuit frontend.Circuit, opts ...TestingOpti w := w assert.Run(func(assert *Assert) { checkSolidity := opt.checkSolidity && curve == ecc.BN254 - proof, err := concreteBackend.prove(ccs, pk, w.full, opt.proverOpts...) + proverOpts := opt.proverOpts + verifierOpts := opt.verifierOpts + if b == backend.GROTH16 { + // currently groth16 Solidity checker only supports circuits with up to 1 commitment + checkSolidity = checkSolidity && (len(ccs.GetCommitments().CommitmentIndexes()) <= 1) + // additionally, we use sha256 as hash to field (fixed in Solidity contract) + proverOpts = append(proverOpts, backend.WithProverHashToFieldFunction(sha256.New())) + verifierOpts = append(verifierOpts, backend.WithVerifierHashToFieldFunction(sha256.New())) + } + proof, err := concreteBackend.prove(ccs, pk, w.full, proverOpts...) assert.noError(err, &w) - err = concreteBackend.verify(proof, vk, w.public, opt.verifierOpts...) + err = concreteBackend.verify(proof, vk, w.public, verifierOpts...) assert.noError(err, &w) if checkSolidity { // check that the proof can be verified by gnark-solidity-checker - if _vk, ok := vk.(verifyingKey); ok { + if _vk, ok := vk.(solidity.VerifyingKey); ok { assert.Run(func(assert *Assert) { - assert.solidityVerification(b, _vk, proof, w.public) + assert.solidityVerification(b, _vk, proof, w.public, opt.solidityOpts) }, "solidity") } } diff --git a/galoisd/vendor/github.com/consensys/gnark/test/assert_options.go b/galoisd/vendor/github.com/consensys/gnark/test/assert_options.go index 31d0226183..570b3bbaa9 100644 --- a/galoisd/vendor/github.com/consensys/gnark/test/assert_options.go +++ b/galoisd/vendor/github.com/consensys/gnark/test/assert_options.go @@ -5,6 +5,7 @@ import ( "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint/solver" "github.com/consensys/gnark/frontend" ) @@ -20,6 +21,7 @@ type testingConfig struct { proverOpts []backend.ProverOption verifierOpts []backend.VerifierOption compileOpts []frontend.CompileOption + solidityOpts []solidity.ExportOption validAssignments []frontend.Circuit invalidAssignments []frontend.Circuit @@ -176,3 +178,12 @@ func WithVerifierOpts(verifierOpts ...backend.VerifierOption) TestingOption { return nil } } + +// WithSolidityExportOptions is a testing option which uses the given solidityOpts when +// calling ExportSolidity method on the verification key. +func WithSolidityExportOptions(solidityOpts ...solidity.ExportOption) TestingOption { + return func(tc *testingConfig) error { + tc.solidityOpts = solidityOpts + return nil + } +} diff --git a/galoisd/vendor/github.com/consensys/gnark/test/assert_solidity.go b/galoisd/vendor/github.com/consensys/gnark/test/assert_solidity.go index 061b21a37b..f72818aae9 100644 --- a/galoisd/vendor/github.com/consensys/gnark/test/assert_solidity.go +++ b/galoisd/vendor/github.com/consensys/gnark/test/assert_solidity.go @@ -1,36 +1,36 @@ package test import ( - "bytes" "encoding/hex" - "io" "os" "os/exec" "path/filepath" "strconv" + fr_bn254 "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/consensys/gnark/backend" - groth16_bn254 "github.com/consensys/gnark/backend/groth16/bn254" - plonk_bn254 "github.com/consensys/gnark/backend/plonk/bn254" + "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/backend/witness" ) -type verifyingKey interface { - NbPublicWitness() int - ExportSolidity(io.Writer) error -} - // solidityVerification checks that the exported solidity contract can verify the proof // and that the proof is valid. // It uses gnark-solidity-checker see test.WithSolidity option. -func (assert *Assert) solidityVerification(b backend.ID, vk verifyingKey, +func (assert *Assert) solidityVerification(b backend.ID, vk solidity.VerifyingKey, proof any, - validPublicWitness witness.Witness) { - if !SolcCheck || vk.NbPublicWitness() == 0 { + validPublicWitness witness.Witness, + opts []solidity.ExportOption, +) { + if !SolcCheck || len(validPublicWitness.Vector().(fr_bn254.Vector)) == 0 { return // nothing to check, will make solc fail. } assert.t.Helper() + // set default options for CI when none are provided + if len(opts) == 0 { + opts = append(opts, solidity.WithPragmaVersion("^0.8.0")) // to avoid needing sync Solidity CI all the time + } + // make temp dir tmpDir, err := os.MkdirTemp("", "gnark-solidity-check*") assert.NoError(err) @@ -40,7 +40,7 @@ func (assert *Assert) solidityVerification(b backend.ID, vk verifyingKey, fSolidity, err := os.Create(filepath.Join(tmpDir, "gnark_verifier.sol")) assert.NoError(err) - err = vk.ExportSolidity(fSolidity) + err = vk.ExportSolidity(fSolidity, opts...) assert.NoError(err) err = fSolidity.Close() @@ -53,29 +53,30 @@ func (assert *Assert) solidityVerification(b backend.ID, vk verifyingKey, out, err := cmd.CombinedOutput() assert.NoError(err, string(out)) - // proof to hex - var proofStr string - var optBackend string + // len(vk.K) - 1 == len(publicWitness) + len(commitments) + numOfCommitments := vk.NbPublicWitness() - len(validPublicWitness.Vector().(fr_bn254.Vector)) + checkerOpts := []string{"verify"} if b == backend.GROTH16 { - optBackend = "--groth16" - var buf bytes.Buffer - _proof := proof.(*groth16_bn254.Proof) - _, err = _proof.WriteRawTo(&buf) - assert.NoError(err) - proofBytes := buf.Bytes() - // keep only fpSize * 8 bytes; for now solidity contract doesn't handle the commitment part. - proofBytes = proofBytes[:32*8] - proofStr = hex.EncodeToString(proofBytes) + checkerOpts = append(checkerOpts, "--groth16") } else if b == backend.PLONK { - optBackend = "--plonk" - _proof := proof.(*plonk_bn254.Proof) - // TODO @gbotrel make a single Marshal function for PlonK proof. - proofStr = hex.EncodeToString(_proof.MarshalSolidity()) + checkerOpts = append(checkerOpts, "--plonk") } else { panic("not implemented") } + // proof to hex + _proof, ok := proof.(interface{ MarshalSolidity() []byte }) + if !ok { + panic("proof does not implement MarshalSolidity()") + } + + proofStr := hex.EncodeToString(_proof.MarshalSolidity()) + + if numOfCommitments > 0 { + checkerOpts = append(checkerOpts, "--commitment", strconv.Itoa(numOfCommitments)) + } + // public witness to hex bPublicWitness, err := validPublicWitness.MarshalBinary() assert.NoError(err) @@ -86,14 +87,14 @@ func (assert *Assert) solidityVerification(b backend.ID, vk verifyingKey, bPublicWitness = bPublicWitness[12:] publicWitnessStr := hex.EncodeToString(bPublicWitness) + checkerOpts = append(checkerOpts, "--dir", tmpDir) + checkerOpts = append(checkerOpts, "--nb-public-inputs", strconv.Itoa(len(validPublicWitness.Vector().(fr_bn254.Vector)))) + checkerOpts = append(checkerOpts, "--proof", proofStr) + checkerOpts = append(checkerOpts, "--public-inputs", publicWitnessStr) + // verify proof // gnark-solidity-checker verify --dir tmdir --groth16 --nb-public-inputs 1 --proof 1234 --public-inputs dead - cmd = exec.Command("gnark-solidity-checker", "verify", - "--dir", tmpDir, - optBackend, - "--nb-public-inputs", strconv.Itoa(vk.NbPublicWitness()), - "--proof", proofStr, - "--public-inputs", publicWitnessStr) + cmd = exec.Command("gnark-solidity-checker", checkerOpts...) assert.t.Log("running ", cmd.String()) out, err = cmd.CombinedOutput() assert.NoError(err, string(out)) diff --git a/galoisd/vendor/github.com/ronanh/intcomp/.gitignore b/galoisd/vendor/github.com/ronanh/intcomp/.gitignore new file mode 100644 index 0000000000..77339a3b7f --- /dev/null +++ b/galoisd/vendor/github.com/ronanh/intcomp/.gitignore @@ -0,0 +1,16 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib +.vscode + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ diff --git a/galoisd/vendor/github.com/ronanh/intcomp/LICENSE b/galoisd/vendor/github.com/ronanh/intcomp/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/galoisd/vendor/github.com/ronanh/intcomp/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/galoisd/vendor/github.com/ronanh/intcomp/README.md b/galoisd/vendor/github.com/ronanh/intcomp/README.md new file mode 100644 index 0000000000..ae4f6b7675 --- /dev/null +++ b/galoisd/vendor/github.com/ronanh/intcomp/README.md @@ -0,0 +1,80 @@ +# Integer Compression + +[![Go Reference](https://pkg.go.dev/badge/github.com/ronanh/intcomp.svg)](https://pkg.go.dev/github.com/ronanh/intcomp) + +This library provides high performance (GB/s) compression and decompression of integers (int32/uint32/int64/uint64). + +Good compression factor can be achieved when, on average, the difference between 2 consecutive +values of the input remains small and thus can be encoded with fewer bits. + +Common use cases: + +- Timestamps +- Offsets +- Counter based identifiers + +The encoding schemes used here are based on [Dr. Daniel Lemire research](https://lemire.me/blog/2012/09/12/fast-integer-compression-decoding-billions-of-integers-per-second/). + +## Encoding Logic + +Data is encoded in blocks of multiple of 128x32bit or 256x64bits inputs in the +following manner: + +1. Difference of consecutive inputs is computed (differential coding) +2. ZigZag encoding is applied if a block contains at least one negative delta value +3. The result is bit packed into the optimal number of bits for the block + +The remaining input that won't fit within a 128x32bits or 256x64bits block will be encoded +in an additional block using Variable Byte encoding (with delta) + +## Append to compressed arrays + +In stream processing systems data is usually received by chunks. +Compressing and aggregating small chunks can be inneficient and impractical. + +This API provides a convenient way to handle such inputs: +When adding data to a compressed buffer, if the last block is a small block, encoded with Variable Byte, +it will be rewritten in order to provide better compression using bit packing. + +## Encoding of timestamps with nanosecond resolution + +Timestamps with nanosecond resolution sometimes have an actual lower internal resolution (eg. microsecond). +To provide better compression for that type of data, the encoding algorithm for int64 has a specific +optimization that will provide better compression factor in such case. + +## Usage + +```go +input := []int32{1, 2, 3} + +// compress +compressed := intcomp.CompressInt32(input, nil) +// compress more data (append) +compressed = intcomp.CompressInt32([]int32{4, 5, 6}, compressed) + +// uncompress +data := intcomp.UncompressInt32(compressed, nil) +// data: [1, 2, 3, 4, 5, 6] +``` + +## Performance + +Benchmarks for the bitpacking compression/decompression (MacBook pro M1). +The result vary depending on the number of bits used to encode integers. + +### Compression + +- 32bits: between 2.6 and 3.5 GB/s +- 64bits: between 5.1 and 8.1 GB/s + +### Decompression + +- 32bits: between 3.5 and 9.3 GB/s +- 64bits: between 12.3 and 23.8 GB/s + +## TODO + +- [ ] Support float32/64 (using something similar to Gorilla compression) +- [ ] Force creation of blocks at fixed boundaries to enable arbitrary position decoding and reversed iteration +- [ ] Implement Block iterators with low memory usage +- [ ] Add Binary search for sorted arrays diff --git a/galoisd/vendor/github.com/ronanh/intcomp/compress.go b/galoisd/vendor/github.com/ronanh/intcomp/compress.go new file mode 100644 index 0000000000..e499e5cb13 --- /dev/null +++ b/galoisd/vendor/github.com/ronanh/intcomp/compress.go @@ -0,0 +1,333 @@ +package intcomp + +// CompressInt32 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Compress as many input as possible using `CompressDeltaBinPackInt32` +// 2. Compress the remaining input with `CompressDeltaBinPackInt32` +func CompressInt32(in []int32, out []uint32) []uint32 { + if len(in) == 0 { + return out + } + deltaVarByteHeaderPos := -1 + if len(out) > 0 { + // truncate last value (lastBlockCompressedLen) + lastBlockCompressedLen := int(out[len(out)-1]) + out = out[:len(out)-1] + lastBlockHeaderPos := len(out) - lastBlockCompressedLen + + lastBlockUncompressedLen := int(out[lastBlockHeaderPos]) + if lastBlockUncompressedLen < BitPackingBlockSize32 && len(in) < BitPackingBlockSize32 { + if lastBlockUncompressedLen+len(in) >= BitPackingBlockSize32 { + // special case: both input and last compressed block + // are smaller than bitPackingBlockSize32 but the concat is bigger + // -> uncompress the last block and concat both buf + // before compressing with bit packing + _, tmpin := UncompressDeltaVarByteInt32(out[lastBlockHeaderPos:], make([]int32, 0, len(in)+lastBlockUncompressedLen+2)) + in = append(tmpin, in...) + out = out[:lastBlockHeaderPos] + } else { + deltaVarByteHeaderPos = lastBlockHeaderPos + } + } + } + + newBlockHeaderPos := len(out) + if len(in) >= BitPackingBlockSize32 { + in, out = CompressDeltaBinPackInt32(in, out) + } + if len(in) > 0 { + if deltaVarByteHeaderPos >= 0 { + newBlockHeaderPos = deltaVarByteHeaderPos + } else { + newBlockHeaderPos = len(out) + } + out = compressDeltaVarByteInt32(in, out, deltaVarByteHeaderPos) + } + return append(out, uint32(len(out)-newBlockHeaderPos)) +} + +// UncompressInt32 uncompress integers from `in` (compressed with `CompressInt32`) +// and append the result to `out`. +// `out` slice will be resized if necessary. +func UncompressInt32(in []uint32, out []int32) []int32 { + // truncate last value (lastblock compressed length) + if len(in) > 0 { + in = in[:len(in)-1] + } + // compute output len, using block headers + var iHeader, outlen int + for iHeader < len(in) { + outlen += int(int32(in[iHeader])) + iHeader += int(int32(in[iHeader+1])) + } + // ensure enough space in out + if cap(out) <= outlen { + tmpout := make([]int32, len(out), outlen+1) + copy(tmpout, out) + out = tmpout + } + + for len(in) > 0 { + uncompressedSize := in[0] + + if uncompressedSize < BitPackingBlockSize32 { + in, out = UncompressDeltaVarByteInt32(in, out) + } else { + in, out = UncompressDeltaBinPackInt32(in, out) + } + } + + return out +} + +// CompressUint32 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Compress as many input as possible using `CompressDeltaBinPackUint32` +// 2. Compress the remaining input with `CompressDeltaBinPackUint32` +func CompressUint32(in, out []uint32) []uint32 { + if len(in) == 0 { + return out + } + deltaVarByteHeaderPos := -1 + if len(out) > 0 { + // truncate last value (lastBlockCompressedLen) + lastBlockCompressedLen := int(out[len(out)-1]) + out = out[:len(out)-1] + lastBlockHeaderPos := len(out) - lastBlockCompressedLen + + lastBlockUncompressedLen := int(out[lastBlockHeaderPos]) + if lastBlockUncompressedLen < BitPackingBlockSize32 && len(in) < BitPackingBlockSize32 { + if lastBlockUncompressedLen+len(in) >= BitPackingBlockSize32 { + // special case: both input and last compressed block + // are smaller than bitPackingBlockSize32 but the concat is bigger + // -> uncompress the last block and concat both buf + // before compressing with bit packing + _, tmpin := UncompressDeltaVarByteUint32(out[lastBlockHeaderPos:], make([]uint32, 0, len(in)+lastBlockUncompressedLen+2)) + in = append(tmpin, in...) + out = out[:lastBlockHeaderPos] + } else { + deltaVarByteHeaderPos = lastBlockHeaderPos + } + } + } + + newBlockHeaderPos := len(out) + if len(in) >= BitPackingBlockSize32 { + in, out = CompressDeltaBinPackUint32(in, out) + } + if len(in) > 0 { + if deltaVarByteHeaderPos >= 0 { + newBlockHeaderPos = deltaVarByteHeaderPos + } else { + newBlockHeaderPos = len(out) + } + out = compressDeltaVarByteUint32(in, out, deltaVarByteHeaderPos) + } + return append(out, uint32(len(out)-newBlockHeaderPos)) +} + +// UncompressUint32 uncompress integers from `in` (compressed with `CompressUint32`) +// and append the result to `out`. +// `out` slice will be resized if necessary. +func UncompressUint32(in, out []uint32) []uint32 { + // truncate last value (lastblock compressed length) + if len(in) > 0 { + in = in[:len(in)-1] + } + // compute output len, using block headers + var iHeader, outlen int + for iHeader < len(in) { + outlen += int(in[iHeader]) + iHeader += int(in[iHeader+1]) + } + // ensure enough space in out + if cap(out) <= outlen { + tmpout := make([]uint32, len(out), outlen+1) + copy(tmpout, out) + out = tmpout + } + + for len(in) > 0 { + uncompressedSize := in[0] + + if uncompressedSize < BitPackingBlockSize32 { + in, out = UncompressDeltaVarByteUint32(in, out) + } else { + in, out = UncompressDeltaBinPackUint32(in, out) + } + } + + return out +} + +// CompressInt64 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Compress as many input as possible using `CompressDeltaBinPackInt64` +// 2. Compress the remaining input with `CompressDeltaBinPackInt64` +func CompressInt64(in []int64, out []uint64) []uint64 { + if len(in) == 0 { + return out + } + deltaVarByteHeaderPos := -1 + if len(out) > 0 { + // truncate last value (lastBlockCompressedLen) + lastBlockCompressedLen := int(int64(out[len(out)-1])) + out = out[:len(out)-1] + lastBlockHeaderPos := len(out) - lastBlockCompressedLen + + lastBlockUncompressedLen := int(int32(int64(out[lastBlockHeaderPos]))) + if lastBlockUncompressedLen < BitPackingBlockSize64 && len(in) < BitPackingBlockSize64 { + if lastBlockUncompressedLen+len(in) >= BitPackingBlockSize64 { + // special case: both input and last compressed block + // are smaller than bitPackingBlockSize64 but the concat is bigger + // -> uncompress the last block and concat both buf + // before compressing with bit packing + _, tmpin := UncompressDeltaVarByteInt64(out[lastBlockHeaderPos:], make([]int64, 0, len(in)+lastBlockUncompressedLen+2)) + in = append(tmpin, in...) + out = out[:lastBlockHeaderPos] + } else { + deltaVarByteHeaderPos = lastBlockHeaderPos + } + } + } + + newBlockHeaderPos := len(out) + if len(in) >= BitPackingBlockSize64 { + in, out = CompressDeltaBinPackInt64(in, out) + } + if len(in) > 0 { + if deltaVarByteHeaderPos >= 0 { + newBlockHeaderPos = deltaVarByteHeaderPos + } else { + newBlockHeaderPos = len(out) + } + out = compressDeltaVarByteInt64(in, out, deltaVarByteHeaderPos) + } + return append(out, uint64(len(out)-newBlockHeaderPos)) +} + +// UncompressInt64 uncompress integers from `in` (compressed with `CompressInt64`) +// and append the result to `out`. +// `out` slice will be resized if necessary. +func UncompressInt64(in []uint64, out []int64) []int64 { + // truncate last value (lastblock compressed length) + if len(in) > 0 { + in = in[:len(in)-1] + } + // compute output len, using block headers + var iHeader, outlen int + for iHeader < len(in) { + outlen += int(int32(int64(in[iHeader]))) + iHeader += int(in[iHeader] >> 32) + } + // ensure enough space in out + if cap(out) <= outlen { + tmpout := make([]int64, len(out), outlen+1) + copy(tmpout, out) + out = tmpout + } + + for len(in) > 0 { + uncompressedSize := int32(in[0]) + + if uncompressedSize < BitPackingBlockSize64 { + in, out = UncompressDeltaVarByteInt64(in, out) + } else { + in, out = UncompressDeltaBinPackInt64(in, out) + } + } + + return out +} + +// CompressUint64 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Compress as many input as possible using `CompressDeltaBinPackUint64` +// 2. Compress the remaining input with `CompressDeltaBinPackUint64` +func CompressUint64(in, out []uint64) []uint64 { + if len(in) == 0 { + return out + } + deltaVarByteHeaderPos := -1 + if len(out) > 0 { + // truncate last value (lastBlockCompressedLen) + lastBlockCompressedLen := int(out[len(out)-1]) + out = out[:len(out)-1] + lastBlockHeaderPos := len(out) - lastBlockCompressedLen + + lastBlockUncompressedLen := int(int32(out[lastBlockHeaderPos])) + if lastBlockUncompressedLen < BitPackingBlockSize64 && len(in) < BitPackingBlockSize64 { + if lastBlockUncompressedLen+len(in) >= BitPackingBlockSize64 { + // special case: both input and last compressed block + // are smaller than bitPackingBlockSize64 but the concat is bigger + // -> uncompress the last block and concat both buf + // before compressing with bit packing + _, tmpin := UncompressDeltaVarByteUint64(out[lastBlockHeaderPos:], make([]uint64, 0, len(in)+lastBlockUncompressedLen+2)) + in = append(tmpin, in...) + out = out[:lastBlockHeaderPos] + } else { + deltaVarByteHeaderPos = lastBlockHeaderPos + } + } + } + + newBlockHeaderPos := len(out) + if len(in) >= BitPackingBlockSize64 { + in, out = CompressDeltaBinPackUint64(in, out) + } + if len(in) > 0 { + if deltaVarByteHeaderPos >= 0 { + newBlockHeaderPos = deltaVarByteHeaderPos + } else { + newBlockHeaderPos = len(out) + } + out = compressDeltaVarByteUint64(in, out, deltaVarByteHeaderPos) + } + return append(out, uint64(len(out)-newBlockHeaderPos)) +} + +// UncompressUint64 uncompress integers from `in` (compressed with `CompressUint64`) +// and append the result to `out`. +// `out` slice will be resized if necessary. +func UncompressUint64(in, out []uint64) []uint64 { + // truncate last value (lastblock compressed length) + if len(in) > 0 { + in = in[:len(in)-1] + } + // compute output len, using block headers + var iHeader, outlen int + for iHeader < len(in) { + outlen += int(int32(in[iHeader])) + iHeader += int(in[iHeader] >> 32) + } + // ensure enough space in out + if cap(out) <= outlen { + tmpout := make([]uint64, len(out), outlen+1) + copy(tmpout, out) + out = tmpout + } + + for len(in) > 0 { + uncompressedSize := int32(in[0]) + + if uncompressedSize < BitPackingBlockSize64 { + in, out = UncompressDeltaVarByteUint64(in, out) + } else { + in, out = UncompressDeltaBinPackUint64(in, out) + } + } + + return out +} diff --git a/galoisd/vendor/github.com/ronanh/intcomp/delta_bitpacking.go b/galoisd/vendor/github.com/ronanh/intcomp/delta_bitpacking.go new file mode 100644 index 0000000000..632bdd2a08 --- /dev/null +++ b/galoisd/vendor/github.com/ronanh/intcomp/delta_bitpacking.go @@ -0,0 +1,797 @@ +package intcomp + +//go:generate go run gen/gendeltapack.go + +import "math/bits" + +const ( + BitPackingBlockSize32 = 128 + BitPackingBlockSize64 = 256 +) + +// CompressDeltaBinPackInt32 compress blocks of 128 integers from `in` +// and append to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not compressed (could +// not fit into a block), and the updated `out` slice. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. ZigZag encoding is applied if a block contains at least one negative delta value +// 3. The result is bit packed into the optimal number of bits for the block +func CompressDeltaBinPackInt32(in []int32, out []uint32) ([]int32, []uint32) { + inlength := len(in) - len(in)%BitPackingBlockSize32 + if inlength == 0 { + return in, out + } + + if out == nil { + out = make([]uint32, 0, len(in)/2) + } + + inpos, outpos := 0, len(out) + out = out[:cap(out)] + + // skip header (written at the end) + headerpos := outpos + outpos += 3 + + firstValue := in[0] + initoffset := firstValue + endpos := inpos + inlength + + for inpos < endpos { + // compute min/max bits for 4 groups of 32 inputs + inblock1 := in[inpos : inpos+32] + inblock2 := in[inpos+32 : inpos+64] + inblock3 := in[inpos+64 : inpos+96] + inblock4 := in[inpos+96 : inpos+128] + bitlen1, sign1 := deltaBitLenAndSignInt32(initoffset, inblock1) + bitlen2, sign2 := deltaBitLenAndSignInt32(inblock1[31], inblock2) + bitlen3, sign3 := deltaBitLenAndSignInt32(inblock2[31], inblock3) + bitlen4, sign4 := deltaBitLenAndSignInt32(inblock3[31], inblock4) + + if outsize := bitlen1 + bitlen2 + bitlen3 + bitlen4; outpos+outsize+1 >= len(out) { + // no more space in out, realloc a bigger slice + extrasize := outsize + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + tmpout := make([]uint32, outpos+extrasize+1) + copy(tmpout, out) + out = tmpout + } + + // write block header + out[outpos] = uint32((sign1 << 31) | (bitlen1 << 24) | + (sign2 << 23) | (bitlen2 << 16) | + (sign3 << 15) | (bitlen3 << 8) | + (sign4 << 7) | bitlen4) + outpos++ + + // write block (4 x 32 packed inputs) + if sign1 == 0 { + deltaPack_int32(initoffset, inblock1, out[outpos:], bitlen1) + } else { + deltaPackZigzag_int32(initoffset, inblock1, out[outpos:], bitlen1) + } + outpos += bitlen1 + + if sign2 == 0 { + deltaPack_int32(inblock1[31], inblock2, out[outpos:], bitlen2) + } else { + deltaPackZigzag_int32(inblock1[31], inblock2, out[outpos:], bitlen2) + } + outpos += bitlen2 + + if sign3 == 0 { + deltaPack_int32(inblock2[31], inblock3, out[outpos:], bitlen3) + } else { + deltaPackZigzag_int32(inblock2[31], inblock3, out[outpos:], bitlen3) + } + outpos += bitlen3 + + if sign4 == 0 { + deltaPack_int32(inblock3[31], inblock4, out[outpos:], bitlen4) + } else { + deltaPackZigzag_int32(inblock3[31], inblock4, out[outpos:], bitlen4) + } + outpos += bitlen4 + + inpos += 128 + initoffset = inblock4[31] + } + + // write header + out[headerpos] = uint32(inlength) + out[headerpos+1] = uint32(outpos - headerpos) + out[headerpos+2] = uint32(firstValue) + return in[inpos:], out[:outpos] +} + +// UncompressDeltaBinPackInt32 uncompress one ore more blocks of 128 integers from `in` +// and append the result to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaBinPackInt32(in []uint32, out []int32) ([]uint32, []int32) { + if len(in) == 0 { + return in, out + } + outlen := int(in[0]) + + // ensure enough space in out slice + if len(out) == 0 && cap(out) < outlen { + out = make([]int32, 0, outlen) + } else if extrasize := outlen + len(out) - cap(out); extrasize > 0 { + if extrasize < cap(out)/4 { + extrasize = cap(out) / 4 + } + tmpout := make([]int32, len(out), len(out)+extrasize) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 3, len(out) + out = out[:cap(out)] + + // Read header + endpos := outpos + outlen + initoffset := int32(in[2]) + + for outpos < endpos { + tmp := uint32(in[inpos]) + sign1 := int(tmp>>31) & 0x1 + sign2 := int(tmp>>23) & 0x1 + sign3 := int(tmp>>15) & 0x1 + sign4 := int(tmp>>7) & 0x1 + bitlen1 := int(tmp>>24) & 0x7F + bitlen2 := int(tmp>>16) & 0x7F + bitlen3 := int(tmp>>8) & 0x7F + bitlen4 := int(tmp & 0x7F) + inpos++ + + if sign1 == 0 { + deltaUnpack_int32(initoffset, in[inpos:], out[outpos:], bitlen1) + } else { + deltaUnpackZigzag_int32(initoffset, in[inpos:], out[outpos:], bitlen1) + } + inpos += int(bitlen1) + outpos += 32 + initoffset = out[outpos-1] + + if sign2 == 0 { + deltaUnpack_int32(initoffset, in[inpos:], out[outpos:], bitlen2) + } else { + deltaUnpackZigzag_int32(initoffset, in[inpos:], out[outpos:], bitlen2) + } + inpos += int(bitlen2) + outpos += 32 + initoffset = out[outpos-1] + + if sign3 == 0 { + deltaUnpack_int32(initoffset, in[inpos:], out[outpos:], bitlen3) + } else { + deltaUnpackZigzag_int32(initoffset, in[inpos:], out[outpos:], bitlen3) + } + inpos += int(bitlen3) + outpos += 32 + initoffset = out[outpos-1] + + if sign4 == 0 { + deltaUnpack_int32(initoffset, in[inpos:], out[outpos:], bitlen4) + } else { + deltaUnpackZigzag_int32(initoffset, in[inpos:], out[outpos:], bitlen4) + } + inpos += int(bitlen4) + outpos += 32 + initoffset = out[outpos-1] + } + return in[inpos:], out[:outpos] +} + +func deltaBitLenAndSignInt32(initoffset int32, buf []int32) (int, int) { + var mask uint32 + + for _, v := range buf { + diff := v - initoffset + // zigzag encoding + mask |= uint32((diff << 1) ^ (diff >> 31)) + initoffset = v + } + sign := int(mask & 1) + // remove sign in zigzag encoding + mask >>= 1 + + return bits.Len32(uint32(mask)) + sign, sign +} + +// CompressDeltaBinPackUInt32 compress blocks of 128 integers from `in` +// and append to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not compressed (could +// not fit into a block), and the updated `out` slice. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. ZigZag encoding is applied if a block contains at least one negative delta value +// 3. The result is bit packed into the optimal number of bits for the block +func CompressDeltaBinPackUint32(in, out []uint32) ([]uint32, []uint32) { + inlength := len(in) - len(in)%BitPackingBlockSize32 + if inlength == 0 { + return in, out + } + + if out == nil { + out = make([]uint32, 0, len(in)/2) + } + + inpos, outpos := 0, len(out) + out = out[:cap(out)] + + // skip header (written at the end) + headerpos := outpos + outpos += 3 + + firstValue := in[0] + initoffset := firstValue + endpos := inpos + inlength + + for inpos < endpos { + // compute min/max bits for 4 groups of 32 inputs + inblock1 := in[inpos : inpos+32] + inblock2 := in[inpos+32 : inpos+64] + inblock3 := in[inpos+64 : inpos+96] + inblock4 := in[inpos+96 : inpos+128] + bitlen1, sign1 := deltaBitLenAndSignUint32(initoffset, inblock1) + bitlen2, sign2 := deltaBitLenAndSignUint32(inblock1[31], inblock2) + bitlen3, sign3 := deltaBitLenAndSignUint32(inblock2[31], inblock3) + bitlen4, sign4 := deltaBitLenAndSignUint32(inblock3[31], inblock4) + + if outsize := bitlen1 + bitlen2 + bitlen3 + bitlen4; outpos+outsize+1 >= len(out) { + // no more space in out, realloc a bigger slice + extrasize := outsize + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + tmpout := make([]uint32, outpos+extrasize+1) + copy(tmpout, out) + out = tmpout + } + + // write block header + out[outpos] = uint32((sign1 << 31) | (bitlen1 << 24) | + (sign2 << 23) | (bitlen2 << 16) | + (sign3 << 15) | (bitlen3 << 8) | + (sign4 << 7) | bitlen4) + outpos++ + + // write block (4 x 32 packed inputs) + if sign1 == 0 { + deltaPack_uint32(initoffset, inblock1, out[outpos:], bitlen1) + } else { + deltaPackZigzag_uint32(initoffset, inblock1, out[outpos:], bitlen1) + } + outpos += bitlen1 + + if sign2 == 0 { + deltaPack_uint32(inblock1[31], inblock2, out[outpos:], bitlen2) + } else { + deltaPackZigzag_uint32(inblock1[31], inblock2, out[outpos:], bitlen2) + } + outpos += bitlen2 + + if sign3 == 0 { + deltaPack_uint32(inblock2[31], inblock3, out[outpos:], bitlen3) + } else { + deltaPackZigzag_uint32(inblock2[31], inblock3, out[outpos:], bitlen3) + } + outpos += bitlen3 + + if sign4 == 0 { + deltaPack_uint32(inblock3[31], inblock4, out[outpos:], bitlen4) + } else { + deltaPackZigzag_uint32(inblock3[31], inblock4, out[outpos:], bitlen4) + } + outpos += bitlen4 + + inpos += 128 + initoffset = inblock4[31] + } + + // write header + out[headerpos] = uint32(inlength) + out[headerpos+1] = uint32(outpos - headerpos) + out[headerpos+2] = firstValue + return in[inpos:], out[:outpos] +} + +// UncompressDeltaBinPackUint32 uncompress one ore more blocks of 128 integers from `in` +// and append the result to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaBinPackUint32(in, out []uint32) ([]uint32, []uint32) { + if len(in) == 0 { + return in, out + } + outlen := int(in[0]) + + // ensure enough space in out slice + if len(out) == 0 && cap(out) < outlen { + out = make([]uint32, 0, outlen) + } else if extrasize := outlen + len(out) - cap(out); extrasize > 0 { + if extrasize < cap(out)/4 { + extrasize = cap(out) / 4 + } + tmpout := make([]uint32, len(out), len(out)+extrasize) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 3, len(out) + out = out[:cap(out)] + + // Read header + endpos := outpos + outlen + initoffset := in[2] + + for outpos < endpos { + tmp := uint32(in[inpos]) + sign1 := int(tmp>>31) & 0x1 + sign2 := int(tmp>>23) & 0x1 + sign3 := int(tmp>>15) & 0x1 + sign4 := int(tmp>>7) & 0x1 + bitlen1 := int(tmp>>24) & 0x7F + bitlen2 := int(tmp>>16) & 0x7F + bitlen3 := int(tmp>>8) & 0x7F + bitlen4 := int(tmp & 0x7F) + inpos++ + + if sign1 == 0 { + deltaUnpack_uint32(initoffset, in[inpos:], out[outpos:], bitlen1) + } else { + deltaUnpackZigzag_uint32(initoffset, in[inpos:], out[outpos:], bitlen1) + } + inpos += bitlen1 + outpos += 32 + initoffset = out[outpos-1] + + if sign2 == 0 { + deltaUnpack_uint32(initoffset, in[inpos:], out[outpos:], bitlen2) + } else { + deltaUnpackZigzag_uint32(initoffset, in[inpos:], out[outpos:], bitlen2) + } + inpos += bitlen2 + outpos += 32 + initoffset = out[outpos-1] + + if sign3 == 0 { + deltaUnpack_uint32(initoffset, in[inpos:], out[outpos:], bitlen3) + } else { + deltaUnpackZigzag_uint32(initoffset, in[inpos:], out[outpos:], bitlen3) + } + inpos += bitlen3 + outpos += 32 + initoffset = out[outpos-1] + + if sign4 == 0 { + deltaUnpack_uint32(initoffset, in[inpos:], out[outpos:], bitlen4) + } else { + deltaUnpackZigzag_uint32(initoffset, in[inpos:], out[outpos:], bitlen4) + } + inpos += bitlen4 + outpos += 32 + initoffset = out[outpos-1] + } + return in[inpos:], out[:outpos] +} + +func deltaBitLenAndSignUint32(initoffset uint32, buf []uint32) (int, int) { + var mask uint32 + + for _, v := range buf { + diff := int32(v - initoffset) + // zigzag encoding + mask |= uint32((diff << 1) ^ (diff >> 31)) + initoffset = v + } + sign := int(mask & 1) + // remove sign in zigzag encoding + mask >>= 1 + + return bits.Len32(uint32(mask)) + sign, sign +} + +// CompressDeltaBinPackInt64 compress blocks of 256 integers from `in` +// and append to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not compressed (could +// not fit into a block), and the updated `out` slice. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. ZigZag encoding is applied if a block contains at least one negative delta value +// 3. The result is bit packed into the optimal number of bits for the block +func CompressDeltaBinPackInt64(in []int64, out []uint64) ([]int64, []uint64) { + inlength := len(in) - len(in)%BitPackingBlockSize64 + if inlength == 0 { + return in, out + } + + if out == nil { + out = make([]uint64, 0, len(in)/2) + } + + inpos, outpos := 0, len(out) + out = out[:cap(out)] + + // skip header (written at the end) + headerpos := outpos + outpos += 2 + + firstValue := in[0] + initoffset := firstValue + endpos := inpos + inlength + + for inpos < endpos { + // compute min/max bits for 4 groups of 64 inputs + inblock1 := in[inpos : inpos+64] + inblock2 := in[inpos+64 : inpos+128] + inblock3 := in[inpos+128 : inpos+192] + inblock4 := in[inpos+192 : inpos+256] + ntz1, bitlen1, sign1 := deltaBitTzAndLenAndSignInt64(initoffset, inblock1) + ntz2, bitlen2, sign2 := deltaBitTzAndLenAndSignInt64(inblock1[63], inblock2) + ntz3, bitlen3, sign3 := deltaBitTzAndLenAndSignInt64(inblock2[63], inblock3) + ntz4, bitlen4, sign4 := deltaBitTzAndLenAndSignInt64(inblock3[63], inblock4) + + if outsize := bitlen1 + bitlen2 + bitlen3 + bitlen4 - ntz1 - ntz2 - ntz3 - ntz4; outpos+outsize+1 >= len(out) { + // no more space in out, realloc a bigger slice + extrasize := outsize + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + tmpout := make([]uint64, outpos+extrasize+1) + copy(tmpout, out) + out = tmpout + } + + // write block header (min/max bits) + out[outpos] = uint64((ntz1 << 56) | (ntz2 << 48) | (ntz3 << 40) | (ntz4 << 32) | + (sign1 << 31) | (bitlen1 << 24) | + (sign2 << 23) | (bitlen2 << 16) | + (sign3 << 15) | (bitlen3 << 8) | + (sign4 << 7) | bitlen4) + outpos++ + + // write block (4 x 64 packed inputs) + if sign1 == 0 { + deltaPack_int64(initoffset, inblock1, out[outpos:], ntz1, bitlen1) + } else { + deltaPackZigzag_int64(initoffset, inblock1, out[outpos:], ntz1, bitlen1) + } + outpos += int(bitlen1 - ntz1) + + if sign2 == 0 { + deltaPack_int64(inblock1[63], inblock2, out[outpos:], ntz2, bitlen2) + } else { + deltaPackZigzag_int64(inblock1[63], inblock2, out[outpos:], ntz2, bitlen2) + } + outpos += int(bitlen2 - ntz2) + + if sign3 == 0 { + deltaPack_int64(inblock2[63], inblock3, out[outpos:], ntz3, bitlen3) + } else { + deltaPackZigzag_int64(inblock2[63], inblock3, out[outpos:], ntz3, bitlen3) + } + outpos += int(bitlen3 - ntz3) + + if sign4 == 0 { + deltaPack_int64(inblock3[63], inblock4, out[outpos:], ntz4, bitlen4) + } else { + deltaPackZigzag_int64(inblock3[63], inblock4, out[outpos:], ntz4, bitlen4) + } + outpos += int(bitlen4 - ntz4) + + inpos += 256 + initoffset = inblock4[63] + } + + // write header + out[headerpos] = uint64(inlength) + uint64(outpos-headerpos)<<32 + out[headerpos+1] = uint64(firstValue) + return in[inpos:], out[:outpos] +} + +// UncompressDeltaBinPackInt64 uncompress one ore more blocks of 256 integers from `in` +// and append the result to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaBinPackInt64(in []uint64, out []int64) ([]uint64, []int64) { + if len(in) == 0 { + return in, out + } + // read header + outlen := int(int32(in[0])) + + // ensure enough space in out slice + if len(out) == 0 && cap(out) < outlen { + out = make([]int64, 0, outlen) + } else if extrasize := outlen + len(out) - cap(out); extrasize > 0 { + if extrasize < cap(out)/4 { + extrasize = cap(out) / 4 + } + tmpout := make([]int64, len(out), len(out)+extrasize) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 2, len(out) + out = out[:cap(out)] + + // Read header + endpos := outpos + outlen + initoffset := int64(in[1]) + + for outpos < endpos { + tmp := uint64(in[inpos]) + ntz1 := int(tmp>>56) & 0xFF + ntz2 := int(tmp>>48) & 0xFF + ntz3 := int(tmp>>40) & 0xFF + ntz4 := int(tmp>>32) & 0xFF + sign1 := int(tmp>>31) & 1 + sign2 := int(tmp>>23) & 1 + sign3 := int(tmp>>15) & 1 + sign4 := int(tmp>>7) & 1 + bitlen1 := int(tmp>>24) & 0x7F + bitlen2 := int(tmp>>16) & 0x7F + bitlen3 := int(tmp>>8) & 0x7F + bitlen4 := int(tmp & 0x7F) + inpos++ + + if sign1 == 0 { + deltaUnpack_int64(initoffset, in[inpos:], out[outpos:], ntz1, bitlen1) + } else { + deltaUnpackZigzag_int64(initoffset, in[inpos:], out[outpos:], ntz1, bitlen1) + } + inpos += int(bitlen1 - ntz1) + outpos += 64 + initoffset = out[outpos-1] + + if sign2 == 0 { + deltaUnpack_int64(initoffset, in[inpos:], out[outpos:], ntz2, bitlen2) + } else { + deltaUnpackZigzag_int64(initoffset, in[inpos:], out[outpos:], ntz2, bitlen2) + } + inpos += int(bitlen2 - ntz2) + outpos += 64 + initoffset = out[outpos-1] + + if sign3 == 0 { + deltaUnpack_int64(initoffset, in[inpos:], out[outpos:], ntz3, bitlen3) + } else { + deltaUnpackZigzag_int64(initoffset, in[inpos:], out[outpos:], ntz3, bitlen3) + } + inpos += int(bitlen3 - ntz3) + outpos += 64 + initoffset = out[outpos-1] + + if sign4 == 0 { + deltaUnpack_int64(initoffset, in[inpos:], out[outpos:], ntz4, bitlen4) + } else { + deltaUnpackZigzag_int64(initoffset, in[inpos:], out[outpos:], ntz4, bitlen4) + } + inpos += int(bitlen4 - ntz4) + outpos += 64 + initoffset = out[outpos-1] + } + return in[inpos:], out[:outpos] +} + +func deltaBitTzAndLenAndSignInt64(initoffset int64, buf []int64) (int, int, int) { + var mask uint64 + + for _, v := range buf { + diff := v - initoffset + // zigzag encoding + mask |= uint64((diff << 1) ^ (diff >> 63)) + initoffset = v + } + sign := int(mask & 1) + // remove sign in zigzag encoding + mask >>= 1 + + var ntz int + if mask != 0 { + ntz = bits.TrailingZeros32(uint32(mask)) + } + + return ntz, bits.Len64(uint64(mask)) + sign, sign +} + +// CompressDeltaBinPackUint64 compress blocks of 256 integers from `in` +// and append to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not compressed (could +// not fit into a block), and the updated `out` slice. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. ZigZag encoding is applied if a block contains at least one negative delta value +// 3. The result is bit packed into the optimal number of bits for the block +func CompressDeltaBinPackUint64(in, out []uint64) ([]uint64, []uint64) { + inlength := len(in) - len(in)%BitPackingBlockSize64 + if inlength == 0 { + return in, out + } + + if out == nil { + out = make([]uint64, 0, len(in)/2) + } + + inpos, outpos := 0, len(out) + out = out[:cap(out)] + + // skip header (written at the end) + headerpos := outpos + outpos += 2 + + firstValue := in[0] + initoffset := firstValue + endpos := inpos + inlength + + for inpos < endpos { + // compute min/max bits for 4 groups of 64 inputs + inblock1 := in[inpos : inpos+64] + inblock2 := in[inpos+64 : inpos+128] + inblock3 := in[inpos+128 : inpos+192] + inblock4 := in[inpos+192 : inpos+256] + bitlen1, sign1 := deltaBitLenAndSignUint64(initoffset, inblock1) + bitlen2, sign2 := deltaBitLenAndSignUint64(inblock1[63], inblock2) + bitlen3, sign3 := deltaBitLenAndSignUint64(inblock2[63], inblock3) + bitlen4, sign4 := deltaBitLenAndSignUint64(inblock3[63], inblock4) + + if outsize := bitlen1 + bitlen2 + bitlen3 + bitlen4; outpos+outsize+1 >= len(out) { + // no more space in out, realloc a bigger slice + extrasize := outsize + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + tmpout := make([]uint64, outpos+extrasize+1) + copy(tmpout, out) + out = tmpout + } + + // write block header (min/max bits) + out[outpos] = uint64( + (sign1 << 31) | (bitlen1 << 24) | + (sign2 << 23) | (bitlen2 << 16) | + (sign3 << 15) | (bitlen3 << 8) | + (sign4 << 7) | bitlen4) + outpos++ + + // write block (4 x 64 packed inputs) + if sign1 == 0 { + deltaPack_uint64(initoffset, inblock1, out[outpos:], bitlen1) + } else { + deltaPackZigzag_uint64(initoffset, inblock1, out[outpos:], bitlen1) + } + outpos += bitlen1 + + if sign2 == 0 { + deltaPack_uint64(inblock1[63], inblock2, out[outpos:], bitlen2) + } else { + deltaPackZigzag_uint64(inblock1[63], inblock2, out[outpos:], bitlen2) + } + outpos += bitlen2 + + if sign3 == 0 { + deltaPack_uint64(inblock2[63], inblock3, out[outpos:], bitlen3) + } else { + deltaPackZigzag_uint64(inblock2[63], inblock3, out[outpos:], bitlen3) + } + outpos += bitlen3 + + if sign4 == 0 { + deltaPack_uint64(inblock3[63], inblock4, out[outpos:], bitlen4) + } else { + deltaPackZigzag_uint64(inblock3[63], inblock4, out[outpos:], bitlen4) + } + outpos += bitlen4 + + inpos += 256 + initoffset = inblock4[63] + } + + // write header + out[headerpos] = uint64(inlength) + uint64(outpos-headerpos)<<32 + out[headerpos+1] = firstValue + return in[inpos:], out[:outpos] +} + +// UncompressDeltaBinPackUint64 uncompress one ore more blocks of 256 integers from `in` +// and append the result to `out`. `out` slice will be resized if necessary. +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaBinPackUint64(in, out []uint64) ([]uint64, []uint64) { + if len(in) == 0 { + return in, out + } + // read header + outlen := int(int32(in[0])) + + // ensure enough space in out slice + if len(out) == 0 && cap(out) < outlen { + out = make([]uint64, 0, outlen) + } else if extrasize := outlen + len(out) - cap(out); extrasize > 0 { + if extrasize < cap(out)/4 { + extrasize = cap(out) / 4 + } + tmpout := make([]uint64, len(out), len(out)+extrasize) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 2, len(out) + out = out[:cap(out)] + + // Read header + endpos := outpos + outlen + initoffset := in[1] + + for outpos < endpos { + tmp := uint64(in[inpos]) + sign1 := int(tmp>>31) & 1 + sign2 := int(tmp>>23) & 1 + sign3 := int(tmp>>15) & 1 + sign4 := int(tmp>>7) & 1 + bitlen1 := int(tmp>>24) & 0x7F + bitlen2 := int(tmp>>16) & 0x7F + bitlen3 := int(tmp>>8) & 0x7F + bitlen4 := int(tmp & 0x7F) + inpos++ + + if sign1 == 0 { + deltaUnpack_uint64(initoffset, in[inpos:], out[outpos:], bitlen1) + } else { + deltaUnpackZigzag_uint64(initoffset, in[inpos:], out[outpos:], bitlen1) + } + inpos += bitlen1 + outpos += 64 + initoffset = out[outpos-1] + + if sign2 == 0 { + deltaUnpack_uint64(initoffset, in[inpos:], out[outpos:], bitlen2) + } else { + deltaUnpackZigzag_uint64(initoffset, in[inpos:], out[outpos:], bitlen2) + } + inpos += bitlen2 + outpos += 64 + initoffset = out[outpos-1] + + if sign3 == 0 { + deltaUnpack_uint64(initoffset, in[inpos:], out[outpos:], bitlen3) + } else { + deltaUnpackZigzag_uint64(initoffset, in[inpos:], out[outpos:], bitlen3) + } + inpos += bitlen3 + outpos += 64 + initoffset = out[outpos-1] + + if sign4 == 0 { + deltaUnpack_uint64(initoffset, in[inpos:], out[outpos:], bitlen4) + } else { + deltaUnpackZigzag_uint64(initoffset, in[inpos:], out[outpos:], bitlen4) + } + inpos += bitlen4 + outpos += 64 + initoffset = out[outpos-1] + } + return in[inpos:], out[:outpos] +} + +func deltaBitLenAndSignUint64(initoffset uint64, buf []uint64) (int, int) { + var mask uint64 + + for _, v := range buf { + diff := int64(v - initoffset) + // zigzag encoding + mask |= uint64((diff << 1) ^ (diff >> 63)) + initoffset = v + } + sign := int(mask & 1) + // remove sign in zigzag encoding + mask >>= 1 + + return bits.Len64(uint64(mask)) + sign, sign +} diff --git a/galoisd/vendor/github.com/ronanh/intcomp/delta_variablebyte.go b/galoisd/vendor/github.com/ronanh/intcomp/delta_variablebyte.go new file mode 100644 index 0000000000..5d473d29dc --- /dev/null +++ b/galoisd/vendor/github.com/ronanh/intcomp/delta_variablebyte.go @@ -0,0 +1,741 @@ +package intcomp + +// CompressDeltaVarByteInt32 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. Variable byte encoding is applied +func CompressDeltaVarByteInt32(in []int32, out []uint32) []uint32 { + return compressDeltaVarByteInt32(in, out, -1) +} + +func compressDeltaVarByteInt32(in []int32, out []uint32, lastBlockHeaderPos int) []uint32 { + if len(in) == 0 { + return out + } + + if out == nil { + out = make([]uint32, 0, 6+len(in)/2) + } + + var ( + prevInput int32 + ivout int + inputDelta uint32 + vout int32 + headerpos = len(out) + inpos int + outpos = headerpos + 2 + ) + + if lastBlockHeaderPos >= 0 { + // append to last block + headerpos = lastBlockHeaderPos + + outpos, ivout, prevInput, vout = getEncoderStateInt32(out, lastBlockHeaderPos) + } + out = out[:cap(out)] + + for { + if outpos+2 >= len(out) { // we may not have enough buffer to write the next bytes + extrasize := len(in) - inpos + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + if extrasize < 8 { + extrasize = 8 + } + tmpout := make([]uint32, outpos+extrasize) + copy(tmpout, out) + out = tmpout + } + + if inpos >= len(in) { + break + } + + prevInput, inputDelta = in[inpos], uint32(in[inpos]-prevInput) + for inputDelta >= 0x80 { + vout <<= 8 + vout |= int32(byte(inputDelta) | 0x80) + inputDelta >>= 7 + ivout++ + if ivout%4 == 0 { // vout is full + out[outpos] = uint32(vout) + outpos++ + vout = 0 + } + } + vout <<= 8 + vout |= int32(byte(inputDelta)) + ivout++ + if ivout%4 == 0 { // vout is full + out[outpos] = uint32(vout) + outpos++ + vout = 0 + } + inpos++ + } + + if ivout%4 != 0 { // vout is partially written + // pad vout + for ivout%4 != 0 { + vout <<= 8 + vout |= 0x80 + ivout++ + } + out[outpos] = uint32(vout) + outpos++ + } + // write header + if lastBlockHeaderPos < 0 { + out[headerpos] = 0 + } + out[headerpos] += uint32(len(in)) + out[headerpos+1] = uint32(outpos - headerpos) + return out[:outpos] +} + +func getEncoderStateInt32(out []uint32, lastBlockHeaderPos int) (outpos, ivout int, prevInput int32, vout int32) { + outpos = lastBlockHeaderPos + 2 + + var ( + prevBlockLen = int(out[lastBlockHeaderPos]) + shiftIn = 24 + shiftOut int + delta int32 + i int + ) + for i < prevBlockLen { + vout = int32(out[outpos]) >> shiftIn + + ivout++ + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 24 + outpos++ + } + + delta += ((vout & 0x7F) << shiftOut) + shiftOut += 7 + if vout&0x80 == 0 { + shiftOut = 0 + prevInput += delta + i++ + delta = 0 + } + } + return +} + +// UncompressDeltaVarByteInt32 uncompress one block of integers from `in` (compressed with `CompressDeltaVarByteInt32`) +// and append the result to `out`. `out` slice will be resized if necessary. +// +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaVarByteInt32(in []uint32, out []int32) ([]uint32, []int32) { + if len(in) == 0 { + return in, out + } + + // read header + outlen := int(in[0]) + inlen := int(in[1]) + resin := in[inlen:] + in = in[:inlen] + + if cap(out)-len(out) < outlen { + tmpout := make([]int32, len(out), len(out)+outlen) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 2, len(out) + out = out[:cap(out)] + + var ( + shiftIn int = 24 + inend = len(in) + initoffset int32 + delta int32 + shiftOut int + ) + + for inpos < inend { + v := int32(in[inpos]) >> shiftIn + + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 24 + inpos++ + } + + delta += ((v & 0x7F) << shiftOut) + shiftOut += 7 + if v&0x80 == 0 { + shiftOut = 0 + + out[outpos] = delta + initoffset + initoffset = out[outpos] + outpos++ + delta = 0 + } + } + return resin, out[:outpos] +} + +// CompressDeltaVarByteUint32 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. Variable byte encoding is applied +func CompressDeltaVarByteUint32(in, out []uint32) []uint32 { + return compressDeltaVarByteUint32(in, out, -1) +} + +func compressDeltaVarByteUint32(in, out []uint32, lastBlockHeaderPos int) []uint32 { + if len(in) == 0 { + return out + } + + if out == nil { + out = make([]uint32, 0, 6+len(in)/2) + } + + var ( + prevInput uint32 + ivout int + inputDelta uint32 + vout uint32 + headerpos = len(out) + inpos int + outpos = headerpos + 2 + ) + + if lastBlockHeaderPos >= 0 { + // append to last block + headerpos = lastBlockHeaderPos + + outpos, ivout, prevInput, vout = getEncoderStateUint32(out, lastBlockHeaderPos) + } + out = out[:cap(out)] + + for { + if outpos+2 >= len(out) { // we may not have enough buffer to write the next bytes + extrasize := len(in) - inpos + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + if extrasize < 8 { + extrasize = 8 + } + tmpout := make([]uint32, outpos+extrasize) + copy(tmpout, out) + out = tmpout + } + + if inpos >= len(in) { + break + } + + prevInput, inputDelta = in[inpos], uint32(in[inpos]-prevInput) + for inputDelta >= 0x80 { + vout <<= 8 + vout |= uint32(byte(inputDelta) | 0x80) + inputDelta >>= 7 + ivout++ + if ivout%4 == 0 { // vout is full + out[outpos] = vout + outpos++ + vout = 0 + } + } + vout <<= 8 + vout |= inputDelta & 0xFF + ivout++ + if ivout%4 == 0 { // vout is full + out[outpos] = vout + outpos++ + vout = 0 + } + inpos++ + } + + if ivout%4 != 0 { // vout is partially written + // pad vout + for ivout%4 != 0 { + vout <<= 8 + vout |= 0x80 + ivout++ + } + out[outpos] = vout + outpos++ + } + // write header + if lastBlockHeaderPos < 0 { + out[headerpos] = 0 + } + out[headerpos] += uint32(len(in)) + out[headerpos+1] = uint32(outpos - headerpos) + return out[:outpos] +} + +func getEncoderStateUint32(out []uint32, lastBlockHeaderPos int) (outpos, ivout int, prevInput, vout uint32) { + outpos = lastBlockHeaderPos + 2 + + var ( + prevBlockLen = int(out[lastBlockHeaderPos]) + shiftIn = 24 + shiftOut int + delta uint32 + i int + ) + for i < prevBlockLen { + vout = out[outpos] >> shiftIn + + ivout++ + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 24 + outpos++ + } + + delta += ((vout & 0x7F) << shiftOut) + shiftOut += 7 + if vout&0x80 == 0 { + shiftOut = 0 + prevInput += delta + i++ + delta = 0 + } + } + return +} + +// UncompressDeltaVarByteUint32 uncompress one block of integers from `in` (compressed with `CompressDeltaVarByteInt32`) +// and append the result to `out`. `out` slice will be resized if necessary. +// +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaVarByteUint32(in, out []uint32) ([]uint32, []uint32) { + if len(in) == 0 { + return in, out + } + // read header + outlen := int(in[0]) + inlen := int(in[1]) + resin := in[inlen:] + in = in[:inlen] + + if cap(out)-len(out) < outlen { + tmpout := make([]uint32, len(out), len(out)+outlen) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 2, len(out) + out = out[:cap(out)] + + var ( + shiftIn int = 24 + inend = len(in) + initoffset uint32 + delta uint32 + shiftOut int + ) + + for inpos < inend { + c := in[inpos] >> shiftIn + + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 24 + inpos++ + } + + delta += ((c & 0x7F) << shiftOut) + shiftOut += 7 + if c&0x80 == 0 { + shiftOut = 0 + + out[outpos] = delta + initoffset + initoffset = out[outpos] + outpos++ + delta = 0 + } + } + return resin, out[:outpos] +} + +// CompressDeltaVarByteInt64 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. Variable byte encoding is applied +func CompressDeltaVarByteInt64(in []int64, out []uint64) []uint64 { + return compressDeltaVarByteInt64(in, out, -1) +} + +func compressDeltaVarByteInt64(in []int64, out []uint64, lastBlockHeaderPos int) []uint64 { + if len(in) == 0 { + return out + } + + if out == nil { + out = make([]uint64, 0, 6+len(in)/2) + } + + var ( + prevInput int64 + ivout int + inputDelta uint64 + vout int64 + headerpos = len(out) + inpos int + outpos = headerpos + 1 + ) + + if lastBlockHeaderPos >= 0 { + // append to last block + headerpos = lastBlockHeaderPos + + outpos, ivout, prevInput, vout = getEncoderStateInt64(out, lastBlockHeaderPos) + } + out = out[:cap(out)] + + for { + if outpos+2 >= len(out) { // we may not have enough buffer to write the next bytes + extrasize := len(in) - inpos + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + if extrasize < 8 { + extrasize = 8 + } + tmpout := make([]uint64, outpos+extrasize) + copy(tmpout, out) + out = tmpout + } + + if inpos >= len(in) { + break + } + + prevInput, inputDelta = in[inpos], uint64(in[inpos]-prevInput) + for inputDelta >= 0x80 { + vout <<= 8 + vout |= int64(byte(inputDelta) | 0x80) + inputDelta >>= 7 + ivout++ + if ivout%8 == 0 { // vout is full + out[outpos] = uint64(vout) + outpos++ + vout = 0 + } + } + vout <<= 8 + vout |= int64(byte(inputDelta)) + ivout++ + if ivout%8 == 0 { // vout is full + out[outpos] = uint64(vout) + outpos++ + vout = 0 + } + inpos++ + } + + if ivout%8 != 0 { // vout is partially written + // pad vout + for ivout%8 != 0 { + vout <<= 8 + vout |= 0x80 + ivout++ + } + out[outpos] = uint64(vout) + outpos++ + } + // write header + var prevLen int + if lastBlockHeaderPos >= 0 { + prevLen = int(int32(out[headerpos])) + } + out[headerpos] = uint64(len(in)+prevLen) + uint64(outpos-headerpos)<<32 + return out[:outpos] +} + +func getEncoderStateInt64(out []uint64, lastBlockHeaderPos int) (outpos, ivout int, prevInput, vout int64) { + outpos = lastBlockHeaderPos + 1 + + var ( + prevBlockLen = int(int32(out[lastBlockHeaderPos])) + shiftIn = 56 + shiftOut int + delta int64 + i int + ) + for i < prevBlockLen { + vout = int64(out[outpos]) >> shiftIn + + ivout++ + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 56 + outpos++ + } + + delta += ((vout & 0x7F) << shiftOut) + shiftOut += 7 + if vout&0x80 == 0 { + shiftOut = 0 + prevInput += delta + i++ + delta = 0 + } + } + return +} + +// UncompressDeltaVarByteInt64 uncompress one block of integers from `in` (compressed with `CompressDeltaVarByteInt32`) +// and append the result to `out`. `out` slice will be resized if necessary. +// +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaVarByteInt64(in []uint64, out []int64) ([]uint64, []int64) { + if len(in) == 0 { + return in, out + } + + // read header + outlen := int(int32(in[0])) + inlen := int(in[0] >> 32) + resin := in[inlen:] + in = in[:inlen] + + if cap(out)-len(out) < outlen { + tmpout := make([]int64, len(out), len(out)+outlen) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 1, len(out) + out = out[:cap(out)] + + var ( + shiftIn int = 56 + inend = len(in) + initoffset int64 + delta int64 + shiftOut int + ) + + for inpos < inend { + c := int64(in[inpos]) >> shiftIn + + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 56 + inpos++ + } + + delta += ((c & 0x7F) << shiftOut) + shiftOut += 7 + if c&0x80 == 0 { + shiftOut = 0 + + out[outpos] = delta + initoffset + initoffset = out[outpos] + outpos++ + delta = 0 + } + } + return resin, out[:outpos] +} + +// CompressDeltaVarByteUint64 compress integers from `in` +// and append to `out`. `out` slice will be resized if necessary, the modified +// slice is returned. +// +// Compression logic: +// 1. Difference of consecutive inputs is computed (differential coding) +// 2. Variable byte encoding is applied +func CompressDeltaVarByteUint64(in, out []uint64) []uint64 { + return compressDeltaVarByteUint64(in, out, -1) +} + +func compressDeltaVarByteUint64(in, out []uint64, lastBlockHeaderPos int) []uint64 { + if len(in) == 0 { + return out + } + + if out == nil { + out = make([]uint64, 0, 6+len(in)/2) + } + + var ( + prevInput uint64 + ivout int + inputDelta uint64 + vout uint64 + headerpos = len(out) + inpos int + outpos = headerpos + 1 + ) + + if lastBlockHeaderPos >= 0 { + // append to last block + headerpos = lastBlockHeaderPos + + outpos, ivout, prevInput, vout = getEncoderStateUint64(out, lastBlockHeaderPos) + } + out = out[:cap(out)] + + for { + if outpos+2 >= len(out) { // we may not have enough buffer to write the next bytes + extrasize := len(in) - inpos + if extrasize < len(out)/4 { + extrasize = len(out) / 4 + } + if extrasize < 8 { + extrasize = 8 + } + tmpout := make([]uint64, outpos+extrasize) + copy(tmpout, out) + out = tmpout + } + + if inpos >= len(in) { + break + } + + prevInput, inputDelta = in[inpos], uint64(in[inpos]-prevInput) + for inputDelta >= 0x80 { + vout <<= 8 + vout |= uint64(byte(inputDelta) | 0x80) + inputDelta >>= 7 + ivout++ + if ivout%8 == 0 { // vout is full + out[outpos] = vout + outpos++ + vout = 0 + } + } + vout <<= 8 + vout |= uint64(byte(inputDelta)) + ivout++ + if ivout%8 == 0 { // vout is full + out[outpos] = vout + outpos++ + vout = 0 + } + inpos++ + } + + if ivout%8 != 0 { // vout is partially written + // pad vout + for ivout%8 != 0 { + vout <<= 8 + vout |= 0x80 + ivout++ + } + out[outpos] = vout + outpos++ + } + // write header + var prevLen int + if lastBlockHeaderPos >= 0 { + prevLen = int(int32(out[headerpos])) + } + out[headerpos] = uint64(len(in)+prevLen) + uint64(outpos-headerpos)<<32 + + return out[:outpos] +} + +func getEncoderStateUint64(out []uint64, lastBlockHeaderPos int) (outpos, ivout int, prevInput, vout uint64) { + outpos = lastBlockHeaderPos + 1 + + var ( + prevBlockLen = int(int32(out[lastBlockHeaderPos])) + shiftIn = 56 + shiftOut int + delta uint64 + i int + ) + for i < prevBlockLen { + vout = out[outpos] >> shiftIn + + ivout++ + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 56 + outpos++ + } + + delta += ((vout & 0x7F) << shiftOut) + shiftOut += 7 + if vout&0x80 == 0 { + shiftOut = 0 + prevInput += delta + i++ + delta = 0 + } + } + return +} + +// UncompressDeltaVarByteUint64 uncompress one block of integers from `in` (compressed with `CompressDeltaVarByteInt32`) +// and append the result to `out`. `out` slice will be resized if necessary. +// +// The function returns the values from `in` that were not uncompressed, and the updated `out` slice. +func UncompressDeltaVarByteUint64(in, out []uint64) ([]uint64, []uint64) { + if len(in) == 0 { + return in, out + } + + // read header + outlen := int(int32(in[0])) + inlen := int(in[0] >> 32) + resin := in[inlen:] + in = in[:inlen] + + if cap(out)-len(out) < outlen { + tmpout := make([]uint64, len(out), len(out)+outlen) + copy(tmpout, out) + out = tmpout + } + + inpos, outpos := 1, len(out) + out = out[:cap(out)] + + var ( + shiftIn int = 56 + inend = len(in) + initoffset uint64 + delta uint64 + shiftOut int + ) + + for inpos < inend { + c := in[inpos] >> shiftIn + + shiftIn -= 8 + if shiftIn < 0 { + shiftIn = 56 + inpos++ + } + + delta += ((c & 0x7F) << shiftOut) + shiftOut += 7 + if c&0x80 == 0 { + shiftOut = 0 + + out[outpos] = delta + initoffset + initoffset = out[outpos] + outpos++ + delta = 0 + } + } + return resin, out[:outpos] +} diff --git a/galoisd/vendor/github.com/ronanh/intcomp/deltapack.go b/galoisd/vendor/github.com/ronanh/intcomp/deltapack.go new file mode 100644 index 0000000000..656bde2187 --- /dev/null +++ b/galoisd/vendor/github.com/ronanh/intcomp/deltapack.go @@ -0,0 +1,63614 @@ +// This file is generated, do not modify directly +// go run gen/gendbp.go + +package intcomp + +import "unsafe" + +// deltaPack_int32 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first. +// Caller must give the proper `bitlen` of the block +func deltaPack_int32(initoffset int32, in []int32, out []uint32, bitlen int) { + switch bitlen { + case 0: + deltapack_int32_0(initoffset, (*[32]int32)(in), (*[0]uint32)(out)) + case 1: + deltapack_int32_1(initoffset, (*[32]int32)(in), (*[1]uint32)(out)) + case 2: + deltapack_int32_2(initoffset, (*[32]int32)(in), (*[2]uint32)(out)) + case 3: + deltapack_int32_3(initoffset, (*[32]int32)(in), (*[3]uint32)(out)) + case 4: + deltapack_int32_4(initoffset, (*[32]int32)(in), (*[4]uint32)(out)) + case 5: + deltapack_int32_5(initoffset, (*[32]int32)(in), (*[5]uint32)(out)) + case 6: + deltapack_int32_6(initoffset, (*[32]int32)(in), (*[6]uint32)(out)) + case 7: + deltapack_int32_7(initoffset, (*[32]int32)(in), (*[7]uint32)(out)) + case 8: + deltapack_int32_8(initoffset, (*[32]int32)(in), (*[8]uint32)(out)) + case 9: + deltapack_int32_9(initoffset, (*[32]int32)(in), (*[9]uint32)(out)) + case 10: + deltapack_int32_10(initoffset, (*[32]int32)(in), (*[10]uint32)(out)) + case 11: + deltapack_int32_11(initoffset, (*[32]int32)(in), (*[11]uint32)(out)) + case 12: + deltapack_int32_12(initoffset, (*[32]int32)(in), (*[12]uint32)(out)) + case 13: + deltapack_int32_13(initoffset, (*[32]int32)(in), (*[13]uint32)(out)) + case 14: + deltapack_int32_14(initoffset, (*[32]int32)(in), (*[14]uint32)(out)) + case 15: + deltapack_int32_15(initoffset, (*[32]int32)(in), (*[15]uint32)(out)) + case 16: + deltapack_int32_16(initoffset, (*[32]int32)(in), (*[16]uint32)(out)) + case 17: + deltapack_int32_17(initoffset, (*[32]int32)(in), (*[17]uint32)(out)) + case 18: + deltapack_int32_18(initoffset, (*[32]int32)(in), (*[18]uint32)(out)) + case 19: + deltapack_int32_19(initoffset, (*[32]int32)(in), (*[19]uint32)(out)) + case 20: + deltapack_int32_20(initoffset, (*[32]int32)(in), (*[20]uint32)(out)) + case 21: + deltapack_int32_21(initoffset, (*[32]int32)(in), (*[21]uint32)(out)) + case 22: + deltapack_int32_22(initoffset, (*[32]int32)(in), (*[22]uint32)(out)) + case 23: + deltapack_int32_23(initoffset, (*[32]int32)(in), (*[23]uint32)(out)) + case 24: + deltapack_int32_24(initoffset, (*[32]int32)(in), (*[24]uint32)(out)) + case 25: + deltapack_int32_25(initoffset, (*[32]int32)(in), (*[25]uint32)(out)) + case 26: + deltapack_int32_26(initoffset, (*[32]int32)(in), (*[26]uint32)(out)) + case 27: + deltapack_int32_27(initoffset, (*[32]int32)(in), (*[27]uint32)(out)) + case 28: + deltapack_int32_28(initoffset, (*[32]int32)(in), (*[28]uint32)(out)) + case 29: + deltapack_int32_29(initoffset, (*[32]int32)(in), (*[29]uint32)(out)) + case 30: + deltapack_int32_30(initoffset, (*[32]int32)(in), (*[30]uint32)(out)) + case 31: + deltapack_int32_31(initoffset, (*[32]int32)(in), (*[31]uint32)(out)) + case 32: + *(*[32]uint32)(out) = *((*[32]uint32)(unsafe.Pointer((*[32]int32)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpack_int32 Decoding operation for DeltaPack_int32 +func deltaUnpack_int32(initoffset int32, in []uint32, out []int32, bitlen int) { + switch bitlen { + case 0: + deltaunpack_int32_0(initoffset, (*[0]uint32)(in), (*[32]int32)(out)) + case 1: + deltaunpack_int32_1(initoffset, (*[1]uint32)(in), (*[32]int32)(out)) + case 2: + deltaunpack_int32_2(initoffset, (*[2]uint32)(in), (*[32]int32)(out)) + case 3: + deltaunpack_int32_3(initoffset, (*[3]uint32)(in), (*[32]int32)(out)) + case 4: + deltaunpack_int32_4(initoffset, (*[4]uint32)(in), (*[32]int32)(out)) + case 5: + deltaunpack_int32_5(initoffset, (*[5]uint32)(in), (*[32]int32)(out)) + case 6: + deltaunpack_int32_6(initoffset, (*[6]uint32)(in), (*[32]int32)(out)) + case 7: + deltaunpack_int32_7(initoffset, (*[7]uint32)(in), (*[32]int32)(out)) + case 8: + deltaunpack_int32_8(initoffset, (*[8]uint32)(in), (*[32]int32)(out)) + case 9: + deltaunpack_int32_9(initoffset, (*[9]uint32)(in), (*[32]int32)(out)) + case 10: + deltaunpack_int32_10(initoffset, (*[10]uint32)(in), (*[32]int32)(out)) + case 11: + deltaunpack_int32_11(initoffset, (*[11]uint32)(in), (*[32]int32)(out)) + case 12: + deltaunpack_int32_12(initoffset, (*[12]uint32)(in), (*[32]int32)(out)) + case 13: + deltaunpack_int32_13(initoffset, (*[13]uint32)(in), (*[32]int32)(out)) + case 14: + deltaunpack_int32_14(initoffset, (*[14]uint32)(in), (*[32]int32)(out)) + case 15: + deltaunpack_int32_15(initoffset, (*[15]uint32)(in), (*[32]int32)(out)) + case 16: + deltaunpack_int32_16(initoffset, (*[16]uint32)(in), (*[32]int32)(out)) + case 17: + deltaunpack_int32_17(initoffset, (*[17]uint32)(in), (*[32]int32)(out)) + case 18: + deltaunpack_int32_18(initoffset, (*[18]uint32)(in), (*[32]int32)(out)) + case 19: + deltaunpack_int32_19(initoffset, (*[19]uint32)(in), (*[32]int32)(out)) + case 20: + deltaunpack_int32_20(initoffset, (*[20]uint32)(in), (*[32]int32)(out)) + case 21: + deltaunpack_int32_21(initoffset, (*[21]uint32)(in), (*[32]int32)(out)) + case 22: + deltaunpack_int32_22(initoffset, (*[22]uint32)(in), (*[32]int32)(out)) + case 23: + deltaunpack_int32_23(initoffset, (*[23]uint32)(in), (*[32]int32)(out)) + case 24: + deltaunpack_int32_24(initoffset, (*[24]uint32)(in), (*[32]int32)(out)) + case 25: + deltaunpack_int32_25(initoffset, (*[25]uint32)(in), (*[32]int32)(out)) + case 26: + deltaunpack_int32_26(initoffset, (*[26]uint32)(in), (*[32]int32)(out)) + case 27: + deltaunpack_int32_27(initoffset, (*[27]uint32)(in), (*[32]int32)(out)) + case 28: + deltaunpack_int32_28(initoffset, (*[28]uint32)(in), (*[32]int32)(out)) + case 29: + deltaunpack_int32_29(initoffset, (*[29]uint32)(in), (*[32]int32)(out)) + case 30: + deltaunpack_int32_30(initoffset, (*[30]uint32)(in), (*[32]int32)(out)) + case 31: + deltaunpack_int32_31(initoffset, (*[31]uint32)(in), (*[32]int32)(out)) + case 32: + *(*[32]int32)(out) = *(*[32]int32)(unsafe.Pointer((*[32]uint32)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapack_int32_0(initoffset int32, in *[32]int32, out *[0]uint32) { +} + +func deltapack_int32_1(initoffset int32, in *[32]int32, out *[1]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 1) | + ((uint32(in[2] - in[1])) << 2) | + ((uint32(in[3] - in[2])) << 3) | + ((uint32(in[4] - in[3])) << 4) | + ((uint32(in[5] - in[4])) << 5) | + ((uint32(in[6] - in[5])) << 6) | + ((uint32(in[7] - in[6])) << 7) | + ((uint32(in[8] - in[7])) << 8) | + ((uint32(in[9] - in[8])) << 9) | + ((uint32(in[10] - in[9])) << 10) | + ((uint32(in[11] - in[10])) << 11) | + ((uint32(in[12] - in[11])) << 12) | + ((uint32(in[13] - in[12])) << 13) | + ((uint32(in[14] - in[13])) << 14) | + ((uint32(in[15] - in[14])) << 15) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 17) | + ((uint32(in[18] - in[17])) << 18) | + ((uint32(in[19] - in[18])) << 19) | + ((uint32(in[20] - in[19])) << 20) | + ((uint32(in[21] - in[20])) << 21) | + ((uint32(in[22] - in[21])) << 22) | + ((uint32(in[23] - in[22])) << 23) | + ((uint32(in[24] - in[23])) << 24) | + ((uint32(in[25] - in[24])) << 25) | + ((uint32(in[26] - in[25])) << 26) | + ((uint32(in[27] - in[26])) << 27) | + ((uint32(in[28] - in[27])) << 28) | + ((uint32(in[29] - in[28])) << 29) | + ((uint32(in[30] - in[29])) << 30) | + ((uint32(in[31] - in[30])) << 31) +} + +func deltapack_int32_2(initoffset int32, in *[32]int32, out *[2]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 2) | + ((uint32(in[2] - in[1])) << 4) | + ((uint32(in[3] - in[2])) << 6) | + ((uint32(in[4] - in[3])) << 8) | + ((uint32(in[5] - in[4])) << 10) | + ((uint32(in[6] - in[5])) << 12) | + ((uint32(in[7] - in[6])) << 14) | + ((uint32(in[8] - in[7])) << 16) | + ((uint32(in[9] - in[8])) << 18) | + ((uint32(in[10] - in[9])) << 20) | + ((uint32(in[11] - in[10])) << 22) | + ((uint32(in[12] - in[11])) << 24) | + ((uint32(in[13] - in[12])) << 26) | + ((uint32(in[14] - in[13])) << 28) | + ((uint32(in[15] - in[14])) << 30) + out[1] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 2) | + ((uint32(in[18] - in[17])) << 4) | + ((uint32(in[19] - in[18])) << 6) | + ((uint32(in[20] - in[19])) << 8) | + ((uint32(in[21] - in[20])) << 10) | + ((uint32(in[22] - in[21])) << 12) | + ((uint32(in[23] - in[22])) << 14) | + ((uint32(in[24] - in[23])) << 16) | + ((uint32(in[25] - in[24])) << 18) | + ((uint32(in[26] - in[25])) << 20) | + ((uint32(in[27] - in[26])) << 22) | + ((uint32(in[28] - in[27])) << 24) | + ((uint32(in[29] - in[28])) << 26) | + ((uint32(in[30] - in[29])) << 28) | + ((uint32(in[31] - in[30])) << 30) +} + +func deltapack_int32_3(initoffset int32, in *[32]int32, out *[3]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 3) | + ((uint32(in[2] - in[1])) << 6) | + ((uint32(in[3] - in[2])) << 9) | + ((uint32(in[4] - in[3])) << 12) | + ((uint32(in[5] - in[4])) << 15) | + ((uint32(in[6] - in[5])) << 18) | + ((uint32(in[7] - in[6])) << 21) | + ((uint32(in[8] - in[7])) << 24) | + ((uint32(in[9] - in[8])) << 27) | + ((uint32(in[10] - in[9])) << 30) + out[1] = + (uint32(in[10] - in[9])) >> 2 | + ((uint32(in[11] - in[10])) << 1) | + ((uint32(in[12] - in[11])) << 4) | + ((uint32(in[13] - in[12])) << 7) | + ((uint32(in[14] - in[13])) << 10) | + ((uint32(in[15] - in[14])) << 13) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 19) | + ((uint32(in[18] - in[17])) << 22) | + ((uint32(in[19] - in[18])) << 25) | + ((uint32(in[20] - in[19])) << 28) | + ((uint32(in[21] - in[20])) << 31) + out[2] = + (uint32(in[21] - in[20])) >> 1 | + ((uint32(in[22] - in[21])) << 2) | + ((uint32(in[23] - in[22])) << 5) | + ((uint32(in[24] - in[23])) << 8) | + ((uint32(in[25] - in[24])) << 11) | + ((uint32(in[26] - in[25])) << 14) | + ((uint32(in[27] - in[26])) << 17) | + ((uint32(in[28] - in[27])) << 20) | + ((uint32(in[29] - in[28])) << 23) | + ((uint32(in[30] - in[29])) << 26) | + ((uint32(in[31] - in[30])) << 29) +} + +func deltapack_int32_4(initoffset int32, in *[32]int32, out *[4]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 4) | + ((uint32(in[2] - in[1])) << 8) | + ((uint32(in[3] - in[2])) << 12) | + ((uint32(in[4] - in[3])) << 16) | + ((uint32(in[5] - in[4])) << 20) | + ((uint32(in[6] - in[5])) << 24) | + ((uint32(in[7] - in[6])) << 28) + out[1] = + uint32(in[8] - in[7]) | + ((uint32(in[9] - in[8])) << 4) | + ((uint32(in[10] - in[9])) << 8) | + ((uint32(in[11] - in[10])) << 12) | + ((uint32(in[12] - in[11])) << 16) | + ((uint32(in[13] - in[12])) << 20) | + ((uint32(in[14] - in[13])) << 24) | + ((uint32(in[15] - in[14])) << 28) + out[2] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 4) | + ((uint32(in[18] - in[17])) << 8) | + ((uint32(in[19] - in[18])) << 12) | + ((uint32(in[20] - in[19])) << 16) | + ((uint32(in[21] - in[20])) << 20) | + ((uint32(in[22] - in[21])) << 24) | + ((uint32(in[23] - in[22])) << 28) + out[3] = + uint32(in[24] - in[23]) | + ((uint32(in[25] - in[24])) << 4) | + ((uint32(in[26] - in[25])) << 8) | + ((uint32(in[27] - in[26])) << 12) | + ((uint32(in[28] - in[27])) << 16) | + ((uint32(in[29] - in[28])) << 20) | + ((uint32(in[30] - in[29])) << 24) | + ((uint32(in[31] - in[30])) << 28) +} + +func deltapack_int32_5(initoffset int32, in *[32]int32, out *[5]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 5) | + ((uint32(in[2] - in[1])) << 10) | + ((uint32(in[3] - in[2])) << 15) | + ((uint32(in[4] - in[3])) << 20) | + ((uint32(in[5] - in[4])) << 25) | + ((uint32(in[6] - in[5])) << 30) + out[1] = + (uint32(in[6] - in[5])) >> 2 | + ((uint32(in[7] - in[6])) << 3) | + ((uint32(in[8] - in[7])) << 8) | + ((uint32(in[9] - in[8])) << 13) | + ((uint32(in[10] - in[9])) << 18) | + ((uint32(in[11] - in[10])) << 23) | + ((uint32(in[12] - in[11])) << 28) + out[2] = + (uint32(in[12] - in[11])) >> 4 | + ((uint32(in[13] - in[12])) << 1) | + ((uint32(in[14] - in[13])) << 6) | + ((uint32(in[15] - in[14])) << 11) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 21) | + ((uint32(in[18] - in[17])) << 26) | + ((uint32(in[19] - in[18])) << 31) + out[3] = + (uint32(in[19] - in[18])) >> 1 | + ((uint32(in[20] - in[19])) << 4) | + ((uint32(in[21] - in[20])) << 9) | + ((uint32(in[22] - in[21])) << 14) | + ((uint32(in[23] - in[22])) << 19) | + ((uint32(in[24] - in[23])) << 24) | + ((uint32(in[25] - in[24])) << 29) + out[4] = + (uint32(in[25] - in[24])) >> 3 | + ((uint32(in[26] - in[25])) << 2) | + ((uint32(in[27] - in[26])) << 7) | + ((uint32(in[28] - in[27])) << 12) | + ((uint32(in[29] - in[28])) << 17) | + ((uint32(in[30] - in[29])) << 22) | + ((uint32(in[31] - in[30])) << 27) +} + +func deltapack_int32_6(initoffset int32, in *[32]int32, out *[6]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 6) | + ((uint32(in[2] - in[1])) << 12) | + ((uint32(in[3] - in[2])) << 18) | + ((uint32(in[4] - in[3])) << 24) | + ((uint32(in[5] - in[4])) << 30) + out[1] = + (uint32(in[5] - in[4])) >> 2 | + ((uint32(in[6] - in[5])) << 4) | + ((uint32(in[7] - in[6])) << 10) | + ((uint32(in[8] - in[7])) << 16) | + ((uint32(in[9] - in[8])) << 22) | + ((uint32(in[10] - in[9])) << 28) + out[2] = + (uint32(in[10] - in[9])) >> 4 | + ((uint32(in[11] - in[10])) << 2) | + ((uint32(in[12] - in[11])) << 8) | + ((uint32(in[13] - in[12])) << 14) | + ((uint32(in[14] - in[13])) << 20) | + ((uint32(in[15] - in[14])) << 26) + out[3] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 6) | + ((uint32(in[18] - in[17])) << 12) | + ((uint32(in[19] - in[18])) << 18) | + ((uint32(in[20] - in[19])) << 24) | + ((uint32(in[21] - in[20])) << 30) + out[4] = + (uint32(in[21] - in[20])) >> 2 | + ((uint32(in[22] - in[21])) << 4) | + ((uint32(in[23] - in[22])) << 10) | + ((uint32(in[24] - in[23])) << 16) | + ((uint32(in[25] - in[24])) << 22) | + ((uint32(in[26] - in[25])) << 28) + out[5] = + (uint32(in[26] - in[25])) >> 4 | + ((uint32(in[27] - in[26])) << 2) | + ((uint32(in[28] - in[27])) << 8) | + ((uint32(in[29] - in[28])) << 14) | + ((uint32(in[30] - in[29])) << 20) | + ((uint32(in[31] - in[30])) << 26) +} + +func deltapack_int32_7(initoffset int32, in *[32]int32, out *[7]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 7) | + ((uint32(in[2] - in[1])) << 14) | + ((uint32(in[3] - in[2])) << 21) | + ((uint32(in[4] - in[3])) << 28) + out[1] = + (uint32(in[4] - in[3])) >> 4 | + ((uint32(in[5] - in[4])) << 3) | + ((uint32(in[6] - in[5])) << 10) | + ((uint32(in[7] - in[6])) << 17) | + ((uint32(in[8] - in[7])) << 24) | + ((uint32(in[9] - in[8])) << 31) + out[2] = + (uint32(in[9] - in[8])) >> 1 | + ((uint32(in[10] - in[9])) << 6) | + ((uint32(in[11] - in[10])) << 13) | + ((uint32(in[12] - in[11])) << 20) | + ((uint32(in[13] - in[12])) << 27) + out[3] = + (uint32(in[13] - in[12])) >> 5 | + ((uint32(in[14] - in[13])) << 2) | + ((uint32(in[15] - in[14])) << 9) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 23) | + ((uint32(in[18] - in[17])) << 30) + out[4] = + (uint32(in[18] - in[17])) >> 2 | + ((uint32(in[19] - in[18])) << 5) | + ((uint32(in[20] - in[19])) << 12) | + ((uint32(in[21] - in[20])) << 19) | + ((uint32(in[22] - in[21])) << 26) + out[5] = + (uint32(in[22] - in[21])) >> 6 | + ((uint32(in[23] - in[22])) << 1) | + ((uint32(in[24] - in[23])) << 8) | + ((uint32(in[25] - in[24])) << 15) | + ((uint32(in[26] - in[25])) << 22) | + ((uint32(in[27] - in[26])) << 29) + out[6] = + (uint32(in[27] - in[26])) >> 3 | + ((uint32(in[28] - in[27])) << 4) | + ((uint32(in[29] - in[28])) << 11) | + ((uint32(in[30] - in[29])) << 18) | + ((uint32(in[31] - in[30])) << 25) +} + +func deltapack_int32_8(initoffset int32, in *[32]int32, out *[8]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 8) | + ((uint32(in[2] - in[1])) << 16) | + ((uint32(in[3] - in[2])) << 24) + out[1] = + uint32(in[4] - in[3]) | + ((uint32(in[5] - in[4])) << 8) | + ((uint32(in[6] - in[5])) << 16) | + ((uint32(in[7] - in[6])) << 24) + out[2] = + uint32(in[8] - in[7]) | + ((uint32(in[9] - in[8])) << 8) | + ((uint32(in[10] - in[9])) << 16) | + ((uint32(in[11] - in[10])) << 24) + out[3] = + uint32(in[12] - in[11]) | + ((uint32(in[13] - in[12])) << 8) | + ((uint32(in[14] - in[13])) << 16) | + ((uint32(in[15] - in[14])) << 24) + out[4] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 8) | + ((uint32(in[18] - in[17])) << 16) | + ((uint32(in[19] - in[18])) << 24) + out[5] = + uint32(in[20] - in[19]) | + ((uint32(in[21] - in[20])) << 8) | + ((uint32(in[22] - in[21])) << 16) | + ((uint32(in[23] - in[22])) << 24) + out[6] = + uint32(in[24] - in[23]) | + ((uint32(in[25] - in[24])) << 8) | + ((uint32(in[26] - in[25])) << 16) | + ((uint32(in[27] - in[26])) << 24) + out[7] = + uint32(in[28] - in[27]) | + ((uint32(in[29] - in[28])) << 8) | + ((uint32(in[30] - in[29])) << 16) | + ((uint32(in[31] - in[30])) << 24) +} + +func deltapack_int32_9(initoffset int32, in *[32]int32, out *[9]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 9) | + ((uint32(in[2] - in[1])) << 18) | + ((uint32(in[3] - in[2])) << 27) + out[1] = + (uint32(in[3] - in[2])) >> 5 | + ((uint32(in[4] - in[3])) << 4) | + ((uint32(in[5] - in[4])) << 13) | + ((uint32(in[6] - in[5])) << 22) | + ((uint32(in[7] - in[6])) << 31) + out[2] = + (uint32(in[7] - in[6])) >> 1 | + ((uint32(in[8] - in[7])) << 8) | + ((uint32(in[9] - in[8])) << 17) | + ((uint32(in[10] - in[9])) << 26) + out[3] = + (uint32(in[10] - in[9])) >> 6 | + ((uint32(in[11] - in[10])) << 3) | + ((uint32(in[12] - in[11])) << 12) | + ((uint32(in[13] - in[12])) << 21) | + ((uint32(in[14] - in[13])) << 30) + out[4] = + (uint32(in[14] - in[13])) >> 2 | + ((uint32(in[15] - in[14])) << 7) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 25) + out[5] = + (uint32(in[17] - in[16])) >> 7 | + ((uint32(in[18] - in[17])) << 2) | + ((uint32(in[19] - in[18])) << 11) | + ((uint32(in[20] - in[19])) << 20) | + ((uint32(in[21] - in[20])) << 29) + out[6] = + (uint32(in[21] - in[20])) >> 3 | + ((uint32(in[22] - in[21])) << 6) | + ((uint32(in[23] - in[22])) << 15) | + ((uint32(in[24] - in[23])) << 24) + out[7] = + (uint32(in[24] - in[23])) >> 8 | + ((uint32(in[25] - in[24])) << 1) | + ((uint32(in[26] - in[25])) << 10) | + ((uint32(in[27] - in[26])) << 19) | + ((uint32(in[28] - in[27])) << 28) + out[8] = + (uint32(in[28] - in[27])) >> 4 | + ((uint32(in[29] - in[28])) << 5) | + ((uint32(in[30] - in[29])) << 14) | + ((uint32(in[31] - in[30])) << 23) +} + +func deltapack_int32_10(initoffset int32, in *[32]int32, out *[10]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 10) | + ((uint32(in[2] - in[1])) << 20) | + ((uint32(in[3] - in[2])) << 30) + out[1] = + (uint32(in[3] - in[2])) >> 2 | + ((uint32(in[4] - in[3])) << 8) | + ((uint32(in[5] - in[4])) << 18) | + ((uint32(in[6] - in[5])) << 28) + out[2] = + (uint32(in[6] - in[5])) >> 4 | + ((uint32(in[7] - in[6])) << 6) | + ((uint32(in[8] - in[7])) << 16) | + ((uint32(in[9] - in[8])) << 26) + out[3] = + (uint32(in[9] - in[8])) >> 6 | + ((uint32(in[10] - in[9])) << 4) | + ((uint32(in[11] - in[10])) << 14) | + ((uint32(in[12] - in[11])) << 24) + out[4] = + (uint32(in[12] - in[11])) >> 8 | + ((uint32(in[13] - in[12])) << 2) | + ((uint32(in[14] - in[13])) << 12) | + ((uint32(in[15] - in[14])) << 22) + out[5] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 10) | + ((uint32(in[18] - in[17])) << 20) | + ((uint32(in[19] - in[18])) << 30) + out[6] = + (uint32(in[19] - in[18])) >> 2 | + ((uint32(in[20] - in[19])) << 8) | + ((uint32(in[21] - in[20])) << 18) | + ((uint32(in[22] - in[21])) << 28) + out[7] = + (uint32(in[22] - in[21])) >> 4 | + ((uint32(in[23] - in[22])) << 6) | + ((uint32(in[24] - in[23])) << 16) | + ((uint32(in[25] - in[24])) << 26) + out[8] = + (uint32(in[25] - in[24])) >> 6 | + ((uint32(in[26] - in[25])) << 4) | + ((uint32(in[27] - in[26])) << 14) | + ((uint32(in[28] - in[27])) << 24) + out[9] = + (uint32(in[28] - in[27])) >> 8 | + ((uint32(in[29] - in[28])) << 2) | + ((uint32(in[30] - in[29])) << 12) | + ((uint32(in[31] - in[30])) << 22) +} + +func deltapack_int32_11(initoffset int32, in *[32]int32, out *[11]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 11) | + ((uint32(in[2] - in[1])) << 22) + out[1] = + (uint32(in[2] - in[1])) >> 10 | + ((uint32(in[3] - in[2])) << 1) | + ((uint32(in[4] - in[3])) << 12) | + ((uint32(in[5] - in[4])) << 23) + out[2] = + (uint32(in[5] - in[4])) >> 9 | + ((uint32(in[6] - in[5])) << 2) | + ((uint32(in[7] - in[6])) << 13) | + ((uint32(in[8] - in[7])) << 24) + out[3] = + (uint32(in[8] - in[7])) >> 8 | + ((uint32(in[9] - in[8])) << 3) | + ((uint32(in[10] - in[9])) << 14) | + ((uint32(in[11] - in[10])) << 25) + out[4] = + (uint32(in[11] - in[10])) >> 7 | + ((uint32(in[12] - in[11])) << 4) | + ((uint32(in[13] - in[12])) << 15) | + ((uint32(in[14] - in[13])) << 26) + out[5] = + (uint32(in[14] - in[13])) >> 6 | + ((uint32(in[15] - in[14])) << 5) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 27) + out[6] = + (uint32(in[17] - in[16])) >> 5 | + ((uint32(in[18] - in[17])) << 6) | + ((uint32(in[19] - in[18])) << 17) | + ((uint32(in[20] - in[19])) << 28) + out[7] = + (uint32(in[20] - in[19])) >> 4 | + ((uint32(in[21] - in[20])) << 7) | + ((uint32(in[22] - in[21])) << 18) | + ((uint32(in[23] - in[22])) << 29) + out[8] = + (uint32(in[23] - in[22])) >> 3 | + ((uint32(in[24] - in[23])) << 8) | + ((uint32(in[25] - in[24])) << 19) | + ((uint32(in[26] - in[25])) << 30) + out[9] = + (uint32(in[26] - in[25])) >> 2 | + ((uint32(in[27] - in[26])) << 9) | + ((uint32(in[28] - in[27])) << 20) | + ((uint32(in[29] - in[28])) << 31) + out[10] = + (uint32(in[29] - in[28])) >> 1 | + ((uint32(in[30] - in[29])) << 10) | + ((uint32(in[31] - in[30])) << 21) +} + +func deltapack_int32_12(initoffset int32, in *[32]int32, out *[12]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 12) | + ((uint32(in[2] - in[1])) << 24) + out[1] = + (uint32(in[2] - in[1])) >> 8 | + ((uint32(in[3] - in[2])) << 4) | + ((uint32(in[4] - in[3])) << 16) | + ((uint32(in[5] - in[4])) << 28) + out[2] = + (uint32(in[5] - in[4])) >> 4 | + ((uint32(in[6] - in[5])) << 8) | + ((uint32(in[7] - in[6])) << 20) + out[3] = + uint32(in[8] - in[7]) | + ((uint32(in[9] - in[8])) << 12) | + ((uint32(in[10] - in[9])) << 24) + out[4] = + (uint32(in[10] - in[9])) >> 8 | + ((uint32(in[11] - in[10])) << 4) | + ((uint32(in[12] - in[11])) << 16) | + ((uint32(in[13] - in[12])) << 28) + out[5] = + (uint32(in[13] - in[12])) >> 4 | + ((uint32(in[14] - in[13])) << 8) | + ((uint32(in[15] - in[14])) << 20) + out[6] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 12) | + ((uint32(in[18] - in[17])) << 24) + out[7] = + (uint32(in[18] - in[17])) >> 8 | + ((uint32(in[19] - in[18])) << 4) | + ((uint32(in[20] - in[19])) << 16) | + ((uint32(in[21] - in[20])) << 28) + out[8] = + (uint32(in[21] - in[20])) >> 4 | + ((uint32(in[22] - in[21])) << 8) | + ((uint32(in[23] - in[22])) << 20) + out[9] = + uint32(in[24] - in[23]) | + ((uint32(in[25] - in[24])) << 12) | + ((uint32(in[26] - in[25])) << 24) + out[10] = + (uint32(in[26] - in[25])) >> 8 | + ((uint32(in[27] - in[26])) << 4) | + ((uint32(in[28] - in[27])) << 16) | + ((uint32(in[29] - in[28])) << 28) + out[11] = + (uint32(in[29] - in[28])) >> 4 | + ((uint32(in[30] - in[29])) << 8) | + ((uint32(in[31] - in[30])) << 20) +} + +func deltapack_int32_13(initoffset int32, in *[32]int32, out *[13]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 13) | + ((uint32(in[2] - in[1])) << 26) + out[1] = + (uint32(in[2] - in[1])) >> 6 | + ((uint32(in[3] - in[2])) << 7) | + ((uint32(in[4] - in[3])) << 20) + out[2] = + (uint32(in[4] - in[3])) >> 12 | + ((uint32(in[5] - in[4])) << 1) | + ((uint32(in[6] - in[5])) << 14) | + ((uint32(in[7] - in[6])) << 27) + out[3] = + (uint32(in[7] - in[6])) >> 5 | + ((uint32(in[8] - in[7])) << 8) | + ((uint32(in[9] - in[8])) << 21) + out[4] = + (uint32(in[9] - in[8])) >> 11 | + ((uint32(in[10] - in[9])) << 2) | + ((uint32(in[11] - in[10])) << 15) | + ((uint32(in[12] - in[11])) << 28) + out[5] = + (uint32(in[12] - in[11])) >> 4 | + ((uint32(in[13] - in[12])) << 9) | + ((uint32(in[14] - in[13])) << 22) + out[6] = + (uint32(in[14] - in[13])) >> 10 | + ((uint32(in[15] - in[14])) << 3) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 29) + out[7] = + (uint32(in[17] - in[16])) >> 3 | + ((uint32(in[18] - in[17])) << 10) | + ((uint32(in[19] - in[18])) << 23) + out[8] = + (uint32(in[19] - in[18])) >> 9 | + ((uint32(in[20] - in[19])) << 4) | + ((uint32(in[21] - in[20])) << 17) | + ((uint32(in[22] - in[21])) << 30) + out[9] = + (uint32(in[22] - in[21])) >> 2 | + ((uint32(in[23] - in[22])) << 11) | + ((uint32(in[24] - in[23])) << 24) + out[10] = + (uint32(in[24] - in[23])) >> 8 | + ((uint32(in[25] - in[24])) << 5) | + ((uint32(in[26] - in[25])) << 18) | + ((uint32(in[27] - in[26])) << 31) + out[11] = + (uint32(in[27] - in[26])) >> 1 | + ((uint32(in[28] - in[27])) << 12) | + ((uint32(in[29] - in[28])) << 25) + out[12] = + (uint32(in[29] - in[28])) >> 7 | + ((uint32(in[30] - in[29])) << 6) | + ((uint32(in[31] - in[30])) << 19) +} + +func deltapack_int32_14(initoffset int32, in *[32]int32, out *[14]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 14) | + ((uint32(in[2] - in[1])) << 28) + out[1] = + (uint32(in[2] - in[1])) >> 4 | + ((uint32(in[3] - in[2])) << 10) | + ((uint32(in[4] - in[3])) << 24) + out[2] = + (uint32(in[4] - in[3])) >> 8 | + ((uint32(in[5] - in[4])) << 6) | + ((uint32(in[6] - in[5])) << 20) + out[3] = + (uint32(in[6] - in[5])) >> 12 | + ((uint32(in[7] - in[6])) << 2) | + ((uint32(in[8] - in[7])) << 16) | + ((uint32(in[9] - in[8])) << 30) + out[4] = + (uint32(in[9] - in[8])) >> 2 | + ((uint32(in[10] - in[9])) << 12) | + ((uint32(in[11] - in[10])) << 26) + out[5] = + (uint32(in[11] - in[10])) >> 6 | + ((uint32(in[12] - in[11])) << 8) | + ((uint32(in[13] - in[12])) << 22) + out[6] = + (uint32(in[13] - in[12])) >> 10 | + ((uint32(in[14] - in[13])) << 4) | + ((uint32(in[15] - in[14])) << 18) + out[7] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 14) | + ((uint32(in[18] - in[17])) << 28) + out[8] = + (uint32(in[18] - in[17])) >> 4 | + ((uint32(in[19] - in[18])) << 10) | + ((uint32(in[20] - in[19])) << 24) + out[9] = + (uint32(in[20] - in[19])) >> 8 | + ((uint32(in[21] - in[20])) << 6) | + ((uint32(in[22] - in[21])) << 20) + out[10] = + (uint32(in[22] - in[21])) >> 12 | + ((uint32(in[23] - in[22])) << 2) | + ((uint32(in[24] - in[23])) << 16) | + ((uint32(in[25] - in[24])) << 30) + out[11] = + (uint32(in[25] - in[24])) >> 2 | + ((uint32(in[26] - in[25])) << 12) | + ((uint32(in[27] - in[26])) << 26) + out[12] = + (uint32(in[27] - in[26])) >> 6 | + ((uint32(in[28] - in[27])) << 8) | + ((uint32(in[29] - in[28])) << 22) + out[13] = + (uint32(in[29] - in[28])) >> 10 | + ((uint32(in[30] - in[29])) << 4) | + ((uint32(in[31] - in[30])) << 18) +} + +func deltapack_int32_15(initoffset int32, in *[32]int32, out *[15]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 15) | + ((uint32(in[2] - in[1])) << 30) + out[1] = + (uint32(in[2] - in[1])) >> 2 | + ((uint32(in[3] - in[2])) << 13) | + ((uint32(in[4] - in[3])) << 28) + out[2] = + (uint32(in[4] - in[3])) >> 4 | + ((uint32(in[5] - in[4])) << 11) | + ((uint32(in[6] - in[5])) << 26) + out[3] = + (uint32(in[6] - in[5])) >> 6 | + ((uint32(in[7] - in[6])) << 9) | + ((uint32(in[8] - in[7])) << 24) + out[4] = + (uint32(in[8] - in[7])) >> 8 | + ((uint32(in[9] - in[8])) << 7) | + ((uint32(in[10] - in[9])) << 22) + out[5] = + (uint32(in[10] - in[9])) >> 10 | + ((uint32(in[11] - in[10])) << 5) | + ((uint32(in[12] - in[11])) << 20) + out[6] = + (uint32(in[12] - in[11])) >> 12 | + ((uint32(in[13] - in[12])) << 3) | + ((uint32(in[14] - in[13])) << 18) + out[7] = + (uint32(in[14] - in[13])) >> 14 | + ((uint32(in[15] - in[14])) << 1) | + ((uint32(in[16] - in[15])) << 16) | + ((uint32(in[17] - in[16])) << 31) + out[8] = + (uint32(in[17] - in[16])) >> 1 | + ((uint32(in[18] - in[17])) << 14) | + ((uint32(in[19] - in[18])) << 29) + out[9] = + (uint32(in[19] - in[18])) >> 3 | + ((uint32(in[20] - in[19])) << 12) | + ((uint32(in[21] - in[20])) << 27) + out[10] = + (uint32(in[21] - in[20])) >> 5 | + ((uint32(in[22] - in[21])) << 10) | + ((uint32(in[23] - in[22])) << 25) + out[11] = + (uint32(in[23] - in[22])) >> 7 | + ((uint32(in[24] - in[23])) << 8) | + ((uint32(in[25] - in[24])) << 23) + out[12] = + (uint32(in[25] - in[24])) >> 9 | + ((uint32(in[26] - in[25])) << 6) | + ((uint32(in[27] - in[26])) << 21) + out[13] = + (uint32(in[27] - in[26])) >> 11 | + ((uint32(in[28] - in[27])) << 4) | + ((uint32(in[29] - in[28])) << 19) + out[14] = + (uint32(in[29] - in[28])) >> 13 | + ((uint32(in[30] - in[29])) << 2) | + ((uint32(in[31] - in[30])) << 17) +} + +func deltapack_int32_16(initoffset int32, in *[32]int32, out *[16]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 16) + out[1] = + uint32(in[2] - in[1]) | + ((uint32(in[3] - in[2])) << 16) + out[2] = + uint32(in[4] - in[3]) | + ((uint32(in[5] - in[4])) << 16) + out[3] = + uint32(in[6] - in[5]) | + ((uint32(in[7] - in[6])) << 16) + out[4] = + uint32(in[8] - in[7]) | + ((uint32(in[9] - in[8])) << 16) + out[5] = + uint32(in[10] - in[9]) | + ((uint32(in[11] - in[10])) << 16) + out[6] = + uint32(in[12] - in[11]) | + ((uint32(in[13] - in[12])) << 16) + out[7] = + uint32(in[14] - in[13]) | + ((uint32(in[15] - in[14])) << 16) + out[8] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 16) + out[9] = + uint32(in[18] - in[17]) | + ((uint32(in[19] - in[18])) << 16) + out[10] = + uint32(in[20] - in[19]) | + ((uint32(in[21] - in[20])) << 16) + out[11] = + uint32(in[22] - in[21]) | + ((uint32(in[23] - in[22])) << 16) + out[12] = + uint32(in[24] - in[23]) | + ((uint32(in[25] - in[24])) << 16) + out[13] = + uint32(in[26] - in[25]) | + ((uint32(in[27] - in[26])) << 16) + out[14] = + uint32(in[28] - in[27]) | + ((uint32(in[29] - in[28])) << 16) + out[15] = + uint32(in[30] - in[29]) | + ((uint32(in[31] - in[30])) << 16) +} + +func deltapack_int32_17(initoffset int32, in *[32]int32, out *[17]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 17) + out[1] = + (uint32(in[1] - in[0])) >> 15 | + ((uint32(in[2] - in[1])) << 2) | + ((uint32(in[3] - in[2])) << 19) + out[2] = + (uint32(in[3] - in[2])) >> 13 | + ((uint32(in[4] - in[3])) << 4) | + ((uint32(in[5] - in[4])) << 21) + out[3] = + (uint32(in[5] - in[4])) >> 11 | + ((uint32(in[6] - in[5])) << 6) | + ((uint32(in[7] - in[6])) << 23) + out[4] = + (uint32(in[7] - in[6])) >> 9 | + ((uint32(in[8] - in[7])) << 8) | + ((uint32(in[9] - in[8])) << 25) + out[5] = + (uint32(in[9] - in[8])) >> 7 | + ((uint32(in[10] - in[9])) << 10) | + ((uint32(in[11] - in[10])) << 27) + out[6] = + (uint32(in[11] - in[10])) >> 5 | + ((uint32(in[12] - in[11])) << 12) | + ((uint32(in[13] - in[12])) << 29) + out[7] = + (uint32(in[13] - in[12])) >> 3 | + ((uint32(in[14] - in[13])) << 14) | + ((uint32(in[15] - in[14])) << 31) + out[8] = + (uint32(in[15] - in[14])) >> 1 | + ((uint32(in[16] - in[15])) << 16) + out[9] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 1) | + ((uint32(in[18] - in[17])) << 18) + out[10] = + (uint32(in[18] - in[17])) >> 14 | + ((uint32(in[19] - in[18])) << 3) | + ((uint32(in[20] - in[19])) << 20) + out[11] = + (uint32(in[20] - in[19])) >> 12 | + ((uint32(in[21] - in[20])) << 5) | + ((uint32(in[22] - in[21])) << 22) + out[12] = + (uint32(in[22] - in[21])) >> 10 | + ((uint32(in[23] - in[22])) << 7) | + ((uint32(in[24] - in[23])) << 24) + out[13] = + (uint32(in[24] - in[23])) >> 8 | + ((uint32(in[25] - in[24])) << 9) | + ((uint32(in[26] - in[25])) << 26) + out[14] = + (uint32(in[26] - in[25])) >> 6 | + ((uint32(in[27] - in[26])) << 11) | + ((uint32(in[28] - in[27])) << 28) + out[15] = + (uint32(in[28] - in[27])) >> 4 | + ((uint32(in[29] - in[28])) << 13) | + ((uint32(in[30] - in[29])) << 30) + out[16] = + (uint32(in[30] - in[29])) >> 2 | + ((uint32(in[31] - in[30])) << 15) +} + +func deltapack_int32_18(initoffset int32, in *[32]int32, out *[18]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 18) + out[1] = + (uint32(in[1] - in[0])) >> 14 | + ((uint32(in[2] - in[1])) << 4) | + ((uint32(in[3] - in[2])) << 22) + out[2] = + (uint32(in[3] - in[2])) >> 10 | + ((uint32(in[4] - in[3])) << 8) | + ((uint32(in[5] - in[4])) << 26) + out[3] = + (uint32(in[5] - in[4])) >> 6 | + ((uint32(in[6] - in[5])) << 12) | + ((uint32(in[7] - in[6])) << 30) + out[4] = + (uint32(in[7] - in[6])) >> 2 | + ((uint32(in[8] - in[7])) << 16) + out[5] = + (uint32(in[8] - in[7])) >> 16 | + ((uint32(in[9] - in[8])) << 2) | + ((uint32(in[10] - in[9])) << 20) + out[6] = + (uint32(in[10] - in[9])) >> 12 | + ((uint32(in[11] - in[10])) << 6) | + ((uint32(in[12] - in[11])) << 24) + out[7] = + (uint32(in[12] - in[11])) >> 8 | + ((uint32(in[13] - in[12])) << 10) | + ((uint32(in[14] - in[13])) << 28) + out[8] = + (uint32(in[14] - in[13])) >> 4 | + ((uint32(in[15] - in[14])) << 14) + out[9] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 18) + out[10] = + (uint32(in[17] - in[16])) >> 14 | + ((uint32(in[18] - in[17])) << 4) | + ((uint32(in[19] - in[18])) << 22) + out[11] = + (uint32(in[19] - in[18])) >> 10 | + ((uint32(in[20] - in[19])) << 8) | + ((uint32(in[21] - in[20])) << 26) + out[12] = + (uint32(in[21] - in[20])) >> 6 | + ((uint32(in[22] - in[21])) << 12) | + ((uint32(in[23] - in[22])) << 30) + out[13] = + (uint32(in[23] - in[22])) >> 2 | + ((uint32(in[24] - in[23])) << 16) + out[14] = + (uint32(in[24] - in[23])) >> 16 | + ((uint32(in[25] - in[24])) << 2) | + ((uint32(in[26] - in[25])) << 20) + out[15] = + (uint32(in[26] - in[25])) >> 12 | + ((uint32(in[27] - in[26])) << 6) | + ((uint32(in[28] - in[27])) << 24) + out[16] = + (uint32(in[28] - in[27])) >> 8 | + ((uint32(in[29] - in[28])) << 10) | + ((uint32(in[30] - in[29])) << 28) + out[17] = + (uint32(in[30] - in[29])) >> 4 | + ((uint32(in[31] - in[30])) << 14) +} + +func deltapack_int32_19(initoffset int32, in *[32]int32, out *[19]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 19) + out[1] = + (uint32(in[1] - in[0])) >> 13 | + ((uint32(in[2] - in[1])) << 6) | + ((uint32(in[3] - in[2])) << 25) + out[2] = + (uint32(in[3] - in[2])) >> 7 | + ((uint32(in[4] - in[3])) << 12) | + ((uint32(in[5] - in[4])) << 31) + out[3] = + (uint32(in[5] - in[4])) >> 1 | + ((uint32(in[6] - in[5])) << 18) + out[4] = + (uint32(in[6] - in[5])) >> 14 | + ((uint32(in[7] - in[6])) << 5) | + ((uint32(in[8] - in[7])) << 24) + out[5] = + (uint32(in[8] - in[7])) >> 8 | + ((uint32(in[9] - in[8])) << 11) | + ((uint32(in[10] - in[9])) << 30) + out[6] = + (uint32(in[10] - in[9])) >> 2 | + ((uint32(in[11] - in[10])) << 17) + out[7] = + (uint32(in[11] - in[10])) >> 15 | + ((uint32(in[12] - in[11])) << 4) | + ((uint32(in[13] - in[12])) << 23) + out[8] = + (uint32(in[13] - in[12])) >> 9 | + ((uint32(in[14] - in[13])) << 10) | + ((uint32(in[15] - in[14])) << 29) + out[9] = + (uint32(in[15] - in[14])) >> 3 | + ((uint32(in[16] - in[15])) << 16) + out[10] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 3) | + ((uint32(in[18] - in[17])) << 22) + out[11] = + (uint32(in[18] - in[17])) >> 10 | + ((uint32(in[19] - in[18])) << 9) | + ((uint32(in[20] - in[19])) << 28) + out[12] = + (uint32(in[20] - in[19])) >> 4 | + ((uint32(in[21] - in[20])) << 15) + out[13] = + (uint32(in[21] - in[20])) >> 17 | + ((uint32(in[22] - in[21])) << 2) | + ((uint32(in[23] - in[22])) << 21) + out[14] = + (uint32(in[23] - in[22])) >> 11 | + ((uint32(in[24] - in[23])) << 8) | + ((uint32(in[25] - in[24])) << 27) + out[15] = + (uint32(in[25] - in[24])) >> 5 | + ((uint32(in[26] - in[25])) << 14) + out[16] = + (uint32(in[26] - in[25])) >> 18 | + ((uint32(in[27] - in[26])) << 1) | + ((uint32(in[28] - in[27])) << 20) + out[17] = + (uint32(in[28] - in[27])) >> 12 | + ((uint32(in[29] - in[28])) << 7) | + ((uint32(in[30] - in[29])) << 26) + out[18] = + (uint32(in[30] - in[29])) >> 6 | + ((uint32(in[31] - in[30])) << 13) +} + +func deltapack_int32_20(initoffset int32, in *[32]int32, out *[20]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 20) + out[1] = + (uint32(in[1] - in[0])) >> 12 | + ((uint32(in[2] - in[1])) << 8) | + ((uint32(in[3] - in[2])) << 28) + out[2] = + (uint32(in[3] - in[2])) >> 4 | + ((uint32(in[4] - in[3])) << 16) + out[3] = + (uint32(in[4] - in[3])) >> 16 | + ((uint32(in[5] - in[4])) << 4) | + ((uint32(in[6] - in[5])) << 24) + out[4] = + (uint32(in[6] - in[5])) >> 8 | + ((uint32(in[7] - in[6])) << 12) + out[5] = + uint32(in[8] - in[7]) | + ((uint32(in[9] - in[8])) << 20) + out[6] = + (uint32(in[9] - in[8])) >> 12 | + ((uint32(in[10] - in[9])) << 8) | + ((uint32(in[11] - in[10])) << 28) + out[7] = + (uint32(in[11] - in[10])) >> 4 | + ((uint32(in[12] - in[11])) << 16) + out[8] = + (uint32(in[12] - in[11])) >> 16 | + ((uint32(in[13] - in[12])) << 4) | + ((uint32(in[14] - in[13])) << 24) + out[9] = + (uint32(in[14] - in[13])) >> 8 | + ((uint32(in[15] - in[14])) << 12) + out[10] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 20) + out[11] = + (uint32(in[17] - in[16])) >> 12 | + ((uint32(in[18] - in[17])) << 8) | + ((uint32(in[19] - in[18])) << 28) + out[12] = + (uint32(in[19] - in[18])) >> 4 | + ((uint32(in[20] - in[19])) << 16) + out[13] = + (uint32(in[20] - in[19])) >> 16 | + ((uint32(in[21] - in[20])) << 4) | + ((uint32(in[22] - in[21])) << 24) + out[14] = + (uint32(in[22] - in[21])) >> 8 | + ((uint32(in[23] - in[22])) << 12) + out[15] = + uint32(in[24] - in[23]) | + ((uint32(in[25] - in[24])) << 20) + out[16] = + (uint32(in[25] - in[24])) >> 12 | + ((uint32(in[26] - in[25])) << 8) | + ((uint32(in[27] - in[26])) << 28) + out[17] = + (uint32(in[27] - in[26])) >> 4 | + ((uint32(in[28] - in[27])) << 16) + out[18] = + (uint32(in[28] - in[27])) >> 16 | + ((uint32(in[29] - in[28])) << 4) | + ((uint32(in[30] - in[29])) << 24) + out[19] = + (uint32(in[30] - in[29])) >> 8 | + ((uint32(in[31] - in[30])) << 12) +} + +func deltapack_int32_21(initoffset int32, in *[32]int32, out *[21]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 21) + out[1] = + (uint32(in[1] - in[0])) >> 11 | + ((uint32(in[2] - in[1])) << 10) | + ((uint32(in[3] - in[2])) << 31) + out[2] = + (uint32(in[3] - in[2])) >> 1 | + ((uint32(in[4] - in[3])) << 20) + out[3] = + (uint32(in[4] - in[3])) >> 12 | + ((uint32(in[5] - in[4])) << 9) | + ((uint32(in[6] - in[5])) << 30) + out[4] = + (uint32(in[6] - in[5])) >> 2 | + ((uint32(in[7] - in[6])) << 19) + out[5] = + (uint32(in[7] - in[6])) >> 13 | + ((uint32(in[8] - in[7])) << 8) | + ((uint32(in[9] - in[8])) << 29) + out[6] = + (uint32(in[9] - in[8])) >> 3 | + ((uint32(in[10] - in[9])) << 18) + out[7] = + (uint32(in[10] - in[9])) >> 14 | + ((uint32(in[11] - in[10])) << 7) | + ((uint32(in[12] - in[11])) << 28) + out[8] = + (uint32(in[12] - in[11])) >> 4 | + ((uint32(in[13] - in[12])) << 17) + out[9] = + (uint32(in[13] - in[12])) >> 15 | + ((uint32(in[14] - in[13])) << 6) | + ((uint32(in[15] - in[14])) << 27) + out[10] = + (uint32(in[15] - in[14])) >> 5 | + ((uint32(in[16] - in[15])) << 16) + out[11] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 5) | + ((uint32(in[18] - in[17])) << 26) + out[12] = + (uint32(in[18] - in[17])) >> 6 | + ((uint32(in[19] - in[18])) << 15) + out[13] = + (uint32(in[19] - in[18])) >> 17 | + ((uint32(in[20] - in[19])) << 4) | + ((uint32(in[21] - in[20])) << 25) + out[14] = + (uint32(in[21] - in[20])) >> 7 | + ((uint32(in[22] - in[21])) << 14) + out[15] = + (uint32(in[22] - in[21])) >> 18 | + ((uint32(in[23] - in[22])) << 3) | + ((uint32(in[24] - in[23])) << 24) + out[16] = + (uint32(in[24] - in[23])) >> 8 | + ((uint32(in[25] - in[24])) << 13) + out[17] = + (uint32(in[25] - in[24])) >> 19 | + ((uint32(in[26] - in[25])) << 2) | + ((uint32(in[27] - in[26])) << 23) + out[18] = + (uint32(in[27] - in[26])) >> 9 | + ((uint32(in[28] - in[27])) << 12) + out[19] = + (uint32(in[28] - in[27])) >> 20 | + ((uint32(in[29] - in[28])) << 1) | + ((uint32(in[30] - in[29])) << 22) + out[20] = + (uint32(in[30] - in[29])) >> 10 | + ((uint32(in[31] - in[30])) << 11) +} + +func deltapack_int32_22(initoffset int32, in *[32]int32, out *[22]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 22) + out[1] = + (uint32(in[1] - in[0])) >> 10 | + ((uint32(in[2] - in[1])) << 12) + out[2] = + (uint32(in[2] - in[1])) >> 20 | + ((uint32(in[3] - in[2])) << 2) | + ((uint32(in[4] - in[3])) << 24) + out[3] = + (uint32(in[4] - in[3])) >> 8 | + ((uint32(in[5] - in[4])) << 14) + out[4] = + (uint32(in[5] - in[4])) >> 18 | + ((uint32(in[6] - in[5])) << 4) | + ((uint32(in[7] - in[6])) << 26) + out[5] = + (uint32(in[7] - in[6])) >> 6 | + ((uint32(in[8] - in[7])) << 16) + out[6] = + (uint32(in[8] - in[7])) >> 16 | + ((uint32(in[9] - in[8])) << 6) | + ((uint32(in[10] - in[9])) << 28) + out[7] = + (uint32(in[10] - in[9])) >> 4 | + ((uint32(in[11] - in[10])) << 18) + out[8] = + (uint32(in[11] - in[10])) >> 14 | + ((uint32(in[12] - in[11])) << 8) | + ((uint32(in[13] - in[12])) << 30) + out[9] = + (uint32(in[13] - in[12])) >> 2 | + ((uint32(in[14] - in[13])) << 20) + out[10] = + (uint32(in[14] - in[13])) >> 12 | + ((uint32(in[15] - in[14])) << 10) + out[11] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 22) + out[12] = + (uint32(in[17] - in[16])) >> 10 | + ((uint32(in[18] - in[17])) << 12) + out[13] = + (uint32(in[18] - in[17])) >> 20 | + ((uint32(in[19] - in[18])) << 2) | + ((uint32(in[20] - in[19])) << 24) + out[14] = + (uint32(in[20] - in[19])) >> 8 | + ((uint32(in[21] - in[20])) << 14) + out[15] = + (uint32(in[21] - in[20])) >> 18 | + ((uint32(in[22] - in[21])) << 4) | + ((uint32(in[23] - in[22])) << 26) + out[16] = + (uint32(in[23] - in[22])) >> 6 | + ((uint32(in[24] - in[23])) << 16) + out[17] = + (uint32(in[24] - in[23])) >> 16 | + ((uint32(in[25] - in[24])) << 6) | + ((uint32(in[26] - in[25])) << 28) + out[18] = + (uint32(in[26] - in[25])) >> 4 | + ((uint32(in[27] - in[26])) << 18) + out[19] = + (uint32(in[27] - in[26])) >> 14 | + ((uint32(in[28] - in[27])) << 8) | + ((uint32(in[29] - in[28])) << 30) + out[20] = + (uint32(in[29] - in[28])) >> 2 | + ((uint32(in[30] - in[29])) << 20) + out[21] = + (uint32(in[30] - in[29])) >> 12 | + ((uint32(in[31] - in[30])) << 10) +} + +func deltapack_int32_23(initoffset int32, in *[32]int32, out *[23]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 23) + out[1] = + (uint32(in[1] - in[0])) >> 9 | + ((uint32(in[2] - in[1])) << 14) + out[2] = + (uint32(in[2] - in[1])) >> 18 | + ((uint32(in[3] - in[2])) << 5) | + ((uint32(in[4] - in[3])) << 28) + out[3] = + (uint32(in[4] - in[3])) >> 4 | + ((uint32(in[5] - in[4])) << 19) + out[4] = + (uint32(in[5] - in[4])) >> 13 | + ((uint32(in[6] - in[5])) << 10) + out[5] = + (uint32(in[6] - in[5])) >> 22 | + ((uint32(in[7] - in[6])) << 1) | + ((uint32(in[8] - in[7])) << 24) + out[6] = + (uint32(in[8] - in[7])) >> 8 | + ((uint32(in[9] - in[8])) << 15) + out[7] = + (uint32(in[9] - in[8])) >> 17 | + ((uint32(in[10] - in[9])) << 6) | + ((uint32(in[11] - in[10])) << 29) + out[8] = + (uint32(in[11] - in[10])) >> 3 | + ((uint32(in[12] - in[11])) << 20) + out[9] = + (uint32(in[12] - in[11])) >> 12 | + ((uint32(in[13] - in[12])) << 11) + out[10] = + (uint32(in[13] - in[12])) >> 21 | + ((uint32(in[14] - in[13])) << 2) | + ((uint32(in[15] - in[14])) << 25) + out[11] = + (uint32(in[15] - in[14])) >> 7 | + ((uint32(in[16] - in[15])) << 16) + out[12] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 7) | + ((uint32(in[18] - in[17])) << 30) + out[13] = + (uint32(in[18] - in[17])) >> 2 | + ((uint32(in[19] - in[18])) << 21) + out[14] = + (uint32(in[19] - in[18])) >> 11 | + ((uint32(in[20] - in[19])) << 12) + out[15] = + (uint32(in[20] - in[19])) >> 20 | + ((uint32(in[21] - in[20])) << 3) | + ((uint32(in[22] - in[21])) << 26) + out[16] = + (uint32(in[22] - in[21])) >> 6 | + ((uint32(in[23] - in[22])) << 17) + out[17] = + (uint32(in[23] - in[22])) >> 15 | + ((uint32(in[24] - in[23])) << 8) | + ((uint32(in[25] - in[24])) << 31) + out[18] = + (uint32(in[25] - in[24])) >> 1 | + ((uint32(in[26] - in[25])) << 22) + out[19] = + (uint32(in[26] - in[25])) >> 10 | + ((uint32(in[27] - in[26])) << 13) + out[20] = + (uint32(in[27] - in[26])) >> 19 | + ((uint32(in[28] - in[27])) << 4) | + ((uint32(in[29] - in[28])) << 27) + out[21] = + (uint32(in[29] - in[28])) >> 5 | + ((uint32(in[30] - in[29])) << 18) + out[22] = + (uint32(in[30] - in[29])) >> 14 | + ((uint32(in[31] - in[30])) << 9) +} + +func deltapack_int32_24(initoffset int32, in *[32]int32, out *[24]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 24) + out[1] = + (uint32(in[1] - in[0])) >> 8 | + ((uint32(in[2] - in[1])) << 16) + out[2] = + (uint32(in[2] - in[1])) >> 16 | + ((uint32(in[3] - in[2])) << 8) + out[3] = + uint32(in[4] - in[3]) | + ((uint32(in[5] - in[4])) << 24) + out[4] = + (uint32(in[5] - in[4])) >> 8 | + ((uint32(in[6] - in[5])) << 16) + out[5] = + (uint32(in[6] - in[5])) >> 16 | + ((uint32(in[7] - in[6])) << 8) + out[6] = + uint32(in[8] - in[7]) | + ((uint32(in[9] - in[8])) << 24) + out[7] = + (uint32(in[9] - in[8])) >> 8 | + ((uint32(in[10] - in[9])) << 16) + out[8] = + (uint32(in[10] - in[9])) >> 16 | + ((uint32(in[11] - in[10])) << 8) + out[9] = + uint32(in[12] - in[11]) | + ((uint32(in[13] - in[12])) << 24) + out[10] = + (uint32(in[13] - in[12])) >> 8 | + ((uint32(in[14] - in[13])) << 16) + out[11] = + (uint32(in[14] - in[13])) >> 16 | + ((uint32(in[15] - in[14])) << 8) + out[12] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 24) + out[13] = + (uint32(in[17] - in[16])) >> 8 | + ((uint32(in[18] - in[17])) << 16) + out[14] = + (uint32(in[18] - in[17])) >> 16 | + ((uint32(in[19] - in[18])) << 8) + out[15] = + uint32(in[20] - in[19]) | + ((uint32(in[21] - in[20])) << 24) + out[16] = + (uint32(in[21] - in[20])) >> 8 | + ((uint32(in[22] - in[21])) << 16) + out[17] = + (uint32(in[22] - in[21])) >> 16 | + ((uint32(in[23] - in[22])) << 8) + out[18] = + uint32(in[24] - in[23]) | + ((uint32(in[25] - in[24])) << 24) + out[19] = + (uint32(in[25] - in[24])) >> 8 | + ((uint32(in[26] - in[25])) << 16) + out[20] = + (uint32(in[26] - in[25])) >> 16 | + ((uint32(in[27] - in[26])) << 8) + out[21] = + uint32(in[28] - in[27]) | + ((uint32(in[29] - in[28])) << 24) + out[22] = + (uint32(in[29] - in[28])) >> 8 | + ((uint32(in[30] - in[29])) << 16) + out[23] = + (uint32(in[30] - in[29])) >> 16 | + ((uint32(in[31] - in[30])) << 8) +} + +func deltapack_int32_25(initoffset int32, in *[32]int32, out *[25]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 25) + out[1] = + (uint32(in[1] - in[0])) >> 7 | + ((uint32(in[2] - in[1])) << 18) + out[2] = + (uint32(in[2] - in[1])) >> 14 | + ((uint32(in[3] - in[2])) << 11) + out[3] = + (uint32(in[3] - in[2])) >> 21 | + ((uint32(in[4] - in[3])) << 4) | + ((uint32(in[5] - in[4])) << 29) + out[4] = + (uint32(in[5] - in[4])) >> 3 | + ((uint32(in[6] - in[5])) << 22) + out[5] = + (uint32(in[6] - in[5])) >> 10 | + ((uint32(in[7] - in[6])) << 15) + out[6] = + (uint32(in[7] - in[6])) >> 17 | + ((uint32(in[8] - in[7])) << 8) + out[7] = + (uint32(in[8] - in[7])) >> 24 | + ((uint32(in[9] - in[8])) << 1) | + ((uint32(in[10] - in[9])) << 26) + out[8] = + (uint32(in[10] - in[9])) >> 6 | + ((uint32(in[11] - in[10])) << 19) + out[9] = + (uint32(in[11] - in[10])) >> 13 | + ((uint32(in[12] - in[11])) << 12) + out[10] = + (uint32(in[12] - in[11])) >> 20 | + ((uint32(in[13] - in[12])) << 5) | + ((uint32(in[14] - in[13])) << 30) + out[11] = + (uint32(in[14] - in[13])) >> 2 | + ((uint32(in[15] - in[14])) << 23) + out[12] = + (uint32(in[15] - in[14])) >> 9 | + ((uint32(in[16] - in[15])) << 16) + out[13] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 9) + out[14] = + (uint32(in[17] - in[16])) >> 23 | + ((uint32(in[18] - in[17])) << 2) | + ((uint32(in[19] - in[18])) << 27) + out[15] = + (uint32(in[19] - in[18])) >> 5 | + ((uint32(in[20] - in[19])) << 20) + out[16] = + (uint32(in[20] - in[19])) >> 12 | + ((uint32(in[21] - in[20])) << 13) + out[17] = + (uint32(in[21] - in[20])) >> 19 | + ((uint32(in[22] - in[21])) << 6) | + ((uint32(in[23] - in[22])) << 31) + out[18] = + (uint32(in[23] - in[22])) >> 1 | + ((uint32(in[24] - in[23])) << 24) + out[19] = + (uint32(in[24] - in[23])) >> 8 | + ((uint32(in[25] - in[24])) << 17) + out[20] = + (uint32(in[25] - in[24])) >> 15 | + ((uint32(in[26] - in[25])) << 10) + out[21] = + (uint32(in[26] - in[25])) >> 22 | + ((uint32(in[27] - in[26])) << 3) | + ((uint32(in[28] - in[27])) << 28) + out[22] = + (uint32(in[28] - in[27])) >> 4 | + ((uint32(in[29] - in[28])) << 21) + out[23] = + (uint32(in[29] - in[28])) >> 11 | + ((uint32(in[30] - in[29])) << 14) + out[24] = + (uint32(in[30] - in[29])) >> 18 | + ((uint32(in[31] - in[30])) << 7) +} + +func deltapack_int32_26(initoffset int32, in *[32]int32, out *[26]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 26) + out[1] = + (uint32(in[1] - in[0])) >> 6 | + ((uint32(in[2] - in[1])) << 20) + out[2] = + (uint32(in[2] - in[1])) >> 12 | + ((uint32(in[3] - in[2])) << 14) + out[3] = + (uint32(in[3] - in[2])) >> 18 | + ((uint32(in[4] - in[3])) << 8) + out[4] = + (uint32(in[4] - in[3])) >> 24 | + ((uint32(in[5] - in[4])) << 2) | + ((uint32(in[6] - in[5])) << 28) + out[5] = + (uint32(in[6] - in[5])) >> 4 | + ((uint32(in[7] - in[6])) << 22) + out[6] = + (uint32(in[7] - in[6])) >> 10 | + ((uint32(in[8] - in[7])) << 16) + out[7] = + (uint32(in[8] - in[7])) >> 16 | + ((uint32(in[9] - in[8])) << 10) + out[8] = + (uint32(in[9] - in[8])) >> 22 | + ((uint32(in[10] - in[9])) << 4) | + ((uint32(in[11] - in[10])) << 30) + out[9] = + (uint32(in[11] - in[10])) >> 2 | + ((uint32(in[12] - in[11])) << 24) + out[10] = + (uint32(in[12] - in[11])) >> 8 | + ((uint32(in[13] - in[12])) << 18) + out[11] = + (uint32(in[13] - in[12])) >> 14 | + ((uint32(in[14] - in[13])) << 12) + out[12] = + (uint32(in[14] - in[13])) >> 20 | + ((uint32(in[15] - in[14])) << 6) + out[13] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 26) + out[14] = + (uint32(in[17] - in[16])) >> 6 | + ((uint32(in[18] - in[17])) << 20) + out[15] = + (uint32(in[18] - in[17])) >> 12 | + ((uint32(in[19] - in[18])) << 14) + out[16] = + (uint32(in[19] - in[18])) >> 18 | + ((uint32(in[20] - in[19])) << 8) + out[17] = + (uint32(in[20] - in[19])) >> 24 | + ((uint32(in[21] - in[20])) << 2) | + ((uint32(in[22] - in[21])) << 28) + out[18] = + (uint32(in[22] - in[21])) >> 4 | + ((uint32(in[23] - in[22])) << 22) + out[19] = + (uint32(in[23] - in[22])) >> 10 | + ((uint32(in[24] - in[23])) << 16) + out[20] = + (uint32(in[24] - in[23])) >> 16 | + ((uint32(in[25] - in[24])) << 10) + out[21] = + (uint32(in[25] - in[24])) >> 22 | + ((uint32(in[26] - in[25])) << 4) | + ((uint32(in[27] - in[26])) << 30) + out[22] = + (uint32(in[27] - in[26])) >> 2 | + ((uint32(in[28] - in[27])) << 24) + out[23] = + (uint32(in[28] - in[27])) >> 8 | + ((uint32(in[29] - in[28])) << 18) + out[24] = + (uint32(in[29] - in[28])) >> 14 | + ((uint32(in[30] - in[29])) << 12) + out[25] = + (uint32(in[30] - in[29])) >> 20 | + ((uint32(in[31] - in[30])) << 6) +} + +func deltapack_int32_27(initoffset int32, in *[32]int32, out *[27]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 27) + out[1] = + (uint32(in[1] - in[0])) >> 5 | + ((uint32(in[2] - in[1])) << 22) + out[2] = + (uint32(in[2] - in[1])) >> 10 | + ((uint32(in[3] - in[2])) << 17) + out[3] = + (uint32(in[3] - in[2])) >> 15 | + ((uint32(in[4] - in[3])) << 12) + out[4] = + (uint32(in[4] - in[3])) >> 20 | + ((uint32(in[5] - in[4])) << 7) + out[5] = + (uint32(in[5] - in[4])) >> 25 | + ((uint32(in[6] - in[5])) << 2) | + ((uint32(in[7] - in[6])) << 29) + out[6] = + (uint32(in[7] - in[6])) >> 3 | + ((uint32(in[8] - in[7])) << 24) + out[7] = + (uint32(in[8] - in[7])) >> 8 | + ((uint32(in[9] - in[8])) << 19) + out[8] = + (uint32(in[9] - in[8])) >> 13 | + ((uint32(in[10] - in[9])) << 14) + out[9] = + (uint32(in[10] - in[9])) >> 18 | + ((uint32(in[11] - in[10])) << 9) + out[10] = + (uint32(in[11] - in[10])) >> 23 | + ((uint32(in[12] - in[11])) << 4) | + ((uint32(in[13] - in[12])) << 31) + out[11] = + (uint32(in[13] - in[12])) >> 1 | + ((uint32(in[14] - in[13])) << 26) + out[12] = + (uint32(in[14] - in[13])) >> 6 | + ((uint32(in[15] - in[14])) << 21) + out[13] = + (uint32(in[15] - in[14])) >> 11 | + ((uint32(in[16] - in[15])) << 16) + out[14] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 11) + out[15] = + (uint32(in[17] - in[16])) >> 21 | + ((uint32(in[18] - in[17])) << 6) + out[16] = + (uint32(in[18] - in[17])) >> 26 | + ((uint32(in[19] - in[18])) << 1) | + ((uint32(in[20] - in[19])) << 28) + out[17] = + (uint32(in[20] - in[19])) >> 4 | + ((uint32(in[21] - in[20])) << 23) + out[18] = + (uint32(in[21] - in[20])) >> 9 | + ((uint32(in[22] - in[21])) << 18) + out[19] = + (uint32(in[22] - in[21])) >> 14 | + ((uint32(in[23] - in[22])) << 13) + out[20] = + (uint32(in[23] - in[22])) >> 19 | + ((uint32(in[24] - in[23])) << 8) + out[21] = + (uint32(in[24] - in[23])) >> 24 | + ((uint32(in[25] - in[24])) << 3) | + ((uint32(in[26] - in[25])) << 30) + out[22] = + (uint32(in[26] - in[25])) >> 2 | + ((uint32(in[27] - in[26])) << 25) + out[23] = + (uint32(in[27] - in[26])) >> 7 | + ((uint32(in[28] - in[27])) << 20) + out[24] = + (uint32(in[28] - in[27])) >> 12 | + ((uint32(in[29] - in[28])) << 15) + out[25] = + (uint32(in[29] - in[28])) >> 17 | + ((uint32(in[30] - in[29])) << 10) + out[26] = + (uint32(in[30] - in[29])) >> 22 | + ((uint32(in[31] - in[30])) << 5) +} + +func deltapack_int32_28(initoffset int32, in *[32]int32, out *[28]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 28) + out[1] = + (uint32(in[1] - in[0])) >> 4 | + ((uint32(in[2] - in[1])) << 24) + out[2] = + (uint32(in[2] - in[1])) >> 8 | + ((uint32(in[3] - in[2])) << 20) + out[3] = + (uint32(in[3] - in[2])) >> 12 | + ((uint32(in[4] - in[3])) << 16) + out[4] = + (uint32(in[4] - in[3])) >> 16 | + ((uint32(in[5] - in[4])) << 12) + out[5] = + (uint32(in[5] - in[4])) >> 20 | + ((uint32(in[6] - in[5])) << 8) + out[6] = + (uint32(in[6] - in[5])) >> 24 | + ((uint32(in[7] - in[6])) << 4) + out[7] = + uint32(in[8] - in[7]) | + ((uint32(in[9] - in[8])) << 28) + out[8] = + (uint32(in[9] - in[8])) >> 4 | + ((uint32(in[10] - in[9])) << 24) + out[9] = + (uint32(in[10] - in[9])) >> 8 | + ((uint32(in[11] - in[10])) << 20) + out[10] = + (uint32(in[11] - in[10])) >> 12 | + ((uint32(in[12] - in[11])) << 16) + out[11] = + (uint32(in[12] - in[11])) >> 16 | + ((uint32(in[13] - in[12])) << 12) + out[12] = + (uint32(in[13] - in[12])) >> 20 | + ((uint32(in[14] - in[13])) << 8) + out[13] = + (uint32(in[14] - in[13])) >> 24 | + ((uint32(in[15] - in[14])) << 4) + out[14] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 28) + out[15] = + (uint32(in[17] - in[16])) >> 4 | + ((uint32(in[18] - in[17])) << 24) + out[16] = + (uint32(in[18] - in[17])) >> 8 | + ((uint32(in[19] - in[18])) << 20) + out[17] = + (uint32(in[19] - in[18])) >> 12 | + ((uint32(in[20] - in[19])) << 16) + out[18] = + (uint32(in[20] - in[19])) >> 16 | + ((uint32(in[21] - in[20])) << 12) + out[19] = + (uint32(in[21] - in[20])) >> 20 | + ((uint32(in[22] - in[21])) << 8) + out[20] = + (uint32(in[22] - in[21])) >> 24 | + ((uint32(in[23] - in[22])) << 4) + out[21] = + uint32(in[24] - in[23]) | + ((uint32(in[25] - in[24])) << 28) + out[22] = + (uint32(in[25] - in[24])) >> 4 | + ((uint32(in[26] - in[25])) << 24) + out[23] = + (uint32(in[26] - in[25])) >> 8 | + ((uint32(in[27] - in[26])) << 20) + out[24] = + (uint32(in[27] - in[26])) >> 12 | + ((uint32(in[28] - in[27])) << 16) + out[25] = + (uint32(in[28] - in[27])) >> 16 | + ((uint32(in[29] - in[28])) << 12) + out[26] = + (uint32(in[29] - in[28])) >> 20 | + ((uint32(in[30] - in[29])) << 8) + out[27] = + (uint32(in[30] - in[29])) >> 24 | + ((uint32(in[31] - in[30])) << 4) +} + +func deltapack_int32_29(initoffset int32, in *[32]int32, out *[29]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 29) + out[1] = + (uint32(in[1] - in[0])) >> 3 | + ((uint32(in[2] - in[1])) << 26) + out[2] = + (uint32(in[2] - in[1])) >> 6 | + ((uint32(in[3] - in[2])) << 23) + out[3] = + (uint32(in[3] - in[2])) >> 9 | + ((uint32(in[4] - in[3])) << 20) + out[4] = + (uint32(in[4] - in[3])) >> 12 | + ((uint32(in[5] - in[4])) << 17) + out[5] = + (uint32(in[5] - in[4])) >> 15 | + ((uint32(in[6] - in[5])) << 14) + out[6] = + (uint32(in[6] - in[5])) >> 18 | + ((uint32(in[7] - in[6])) << 11) + out[7] = + (uint32(in[7] - in[6])) >> 21 | + ((uint32(in[8] - in[7])) << 8) + out[8] = + (uint32(in[8] - in[7])) >> 24 | + ((uint32(in[9] - in[8])) << 5) + out[9] = + (uint32(in[9] - in[8])) >> 27 | + ((uint32(in[10] - in[9])) << 2) | + ((uint32(in[11] - in[10])) << 31) + out[10] = + (uint32(in[11] - in[10])) >> 1 | + ((uint32(in[12] - in[11])) << 28) + out[11] = + (uint32(in[12] - in[11])) >> 4 | + ((uint32(in[13] - in[12])) << 25) + out[12] = + (uint32(in[13] - in[12])) >> 7 | + ((uint32(in[14] - in[13])) << 22) + out[13] = + (uint32(in[14] - in[13])) >> 10 | + ((uint32(in[15] - in[14])) << 19) + out[14] = + (uint32(in[15] - in[14])) >> 13 | + ((uint32(in[16] - in[15])) << 16) + out[15] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 13) + out[16] = + (uint32(in[17] - in[16])) >> 19 | + ((uint32(in[18] - in[17])) << 10) + out[17] = + (uint32(in[18] - in[17])) >> 22 | + ((uint32(in[19] - in[18])) << 7) + out[18] = + (uint32(in[19] - in[18])) >> 25 | + ((uint32(in[20] - in[19])) << 4) + out[19] = + (uint32(in[20] - in[19])) >> 28 | + ((uint32(in[21] - in[20])) << 1) | + ((uint32(in[22] - in[21])) << 30) + out[20] = + (uint32(in[22] - in[21])) >> 2 | + ((uint32(in[23] - in[22])) << 27) + out[21] = + (uint32(in[23] - in[22])) >> 5 | + ((uint32(in[24] - in[23])) << 24) + out[22] = + (uint32(in[24] - in[23])) >> 8 | + ((uint32(in[25] - in[24])) << 21) + out[23] = + (uint32(in[25] - in[24])) >> 11 | + ((uint32(in[26] - in[25])) << 18) + out[24] = + (uint32(in[26] - in[25])) >> 14 | + ((uint32(in[27] - in[26])) << 15) + out[25] = + (uint32(in[27] - in[26])) >> 17 | + ((uint32(in[28] - in[27])) << 12) + out[26] = + (uint32(in[28] - in[27])) >> 20 | + ((uint32(in[29] - in[28])) << 9) + out[27] = + (uint32(in[29] - in[28])) >> 23 | + ((uint32(in[30] - in[29])) << 6) + out[28] = + (uint32(in[30] - in[29])) >> 26 | + ((uint32(in[31] - in[30])) << 3) +} + +func deltapack_int32_30(initoffset int32, in *[32]int32, out *[30]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 30) + out[1] = + (uint32(in[1] - in[0])) >> 2 | + ((uint32(in[2] - in[1])) << 28) + out[2] = + (uint32(in[2] - in[1])) >> 4 | + ((uint32(in[3] - in[2])) << 26) + out[3] = + (uint32(in[3] - in[2])) >> 6 | + ((uint32(in[4] - in[3])) << 24) + out[4] = + (uint32(in[4] - in[3])) >> 8 | + ((uint32(in[5] - in[4])) << 22) + out[5] = + (uint32(in[5] - in[4])) >> 10 | + ((uint32(in[6] - in[5])) << 20) + out[6] = + (uint32(in[6] - in[5])) >> 12 | + ((uint32(in[7] - in[6])) << 18) + out[7] = + (uint32(in[7] - in[6])) >> 14 | + ((uint32(in[8] - in[7])) << 16) + out[8] = + (uint32(in[8] - in[7])) >> 16 | + ((uint32(in[9] - in[8])) << 14) + out[9] = + (uint32(in[9] - in[8])) >> 18 | + ((uint32(in[10] - in[9])) << 12) + out[10] = + (uint32(in[10] - in[9])) >> 20 | + ((uint32(in[11] - in[10])) << 10) + out[11] = + (uint32(in[11] - in[10])) >> 22 | + ((uint32(in[12] - in[11])) << 8) + out[12] = + (uint32(in[12] - in[11])) >> 24 | + ((uint32(in[13] - in[12])) << 6) + out[13] = + (uint32(in[13] - in[12])) >> 26 | + ((uint32(in[14] - in[13])) << 4) + out[14] = + (uint32(in[14] - in[13])) >> 28 | + ((uint32(in[15] - in[14])) << 2) + out[15] = + uint32(in[16] - in[15]) | + ((uint32(in[17] - in[16])) << 30) + out[16] = + (uint32(in[17] - in[16])) >> 2 | + ((uint32(in[18] - in[17])) << 28) + out[17] = + (uint32(in[18] - in[17])) >> 4 | + ((uint32(in[19] - in[18])) << 26) + out[18] = + (uint32(in[19] - in[18])) >> 6 | + ((uint32(in[20] - in[19])) << 24) + out[19] = + (uint32(in[20] - in[19])) >> 8 | + ((uint32(in[21] - in[20])) << 22) + out[20] = + (uint32(in[21] - in[20])) >> 10 | + ((uint32(in[22] - in[21])) << 20) + out[21] = + (uint32(in[22] - in[21])) >> 12 | + ((uint32(in[23] - in[22])) << 18) + out[22] = + (uint32(in[23] - in[22])) >> 14 | + ((uint32(in[24] - in[23])) << 16) + out[23] = + (uint32(in[24] - in[23])) >> 16 | + ((uint32(in[25] - in[24])) << 14) + out[24] = + (uint32(in[25] - in[24])) >> 18 | + ((uint32(in[26] - in[25])) << 12) + out[25] = + (uint32(in[26] - in[25])) >> 20 | + ((uint32(in[27] - in[26])) << 10) + out[26] = + (uint32(in[27] - in[26])) >> 22 | + ((uint32(in[28] - in[27])) << 8) + out[27] = + (uint32(in[28] - in[27])) >> 24 | + ((uint32(in[29] - in[28])) << 6) + out[28] = + (uint32(in[29] - in[28])) >> 26 | + ((uint32(in[30] - in[29])) << 4) + out[29] = + (uint32(in[30] - in[29])) >> 28 | + ((uint32(in[31] - in[30])) << 2) +} + +func deltapack_int32_31(initoffset int32, in *[32]int32, out *[31]uint32) { + out[0] = + uint32(in[0] - initoffset) | + ((uint32(in[1] - in[0])) << 31) + out[1] = + (uint32(in[1] - in[0])) >> 1 | + ((uint32(in[2] - in[1])) << 30) + out[2] = + (uint32(in[2] - in[1])) >> 2 | + ((uint32(in[3] - in[2])) << 29) + out[3] = + (uint32(in[3] - in[2])) >> 3 | + ((uint32(in[4] - in[3])) << 28) + out[4] = + (uint32(in[4] - in[3])) >> 4 | + ((uint32(in[5] - in[4])) << 27) + out[5] = + (uint32(in[5] - in[4])) >> 5 | + ((uint32(in[6] - in[5])) << 26) + out[6] = + (uint32(in[6] - in[5])) >> 6 | + ((uint32(in[7] - in[6])) << 25) + out[7] = + (uint32(in[7] - in[6])) >> 7 | + ((uint32(in[8] - in[7])) << 24) + out[8] = + (uint32(in[8] - in[7])) >> 8 | + ((uint32(in[9] - in[8])) << 23) + out[9] = + (uint32(in[9] - in[8])) >> 9 | + ((uint32(in[10] - in[9])) << 22) + out[10] = + (uint32(in[10] - in[9])) >> 10 | + ((uint32(in[11] - in[10])) << 21) + out[11] = + (uint32(in[11] - in[10])) >> 11 | + ((uint32(in[12] - in[11])) << 20) + out[12] = + (uint32(in[12] - in[11])) >> 12 | + ((uint32(in[13] - in[12])) << 19) + out[13] = + (uint32(in[13] - in[12])) >> 13 | + ((uint32(in[14] - in[13])) << 18) + out[14] = + (uint32(in[14] - in[13])) >> 14 | + ((uint32(in[15] - in[14])) << 17) + out[15] = + (uint32(in[15] - in[14])) >> 15 | + ((uint32(in[16] - in[15])) << 16) + out[16] = + (uint32(in[16] - in[15])) >> 16 | + ((uint32(in[17] - in[16])) << 15) + out[17] = + (uint32(in[17] - in[16])) >> 17 | + ((uint32(in[18] - in[17])) << 14) + out[18] = + (uint32(in[18] - in[17])) >> 18 | + ((uint32(in[19] - in[18])) << 13) + out[19] = + (uint32(in[19] - in[18])) >> 19 | + ((uint32(in[20] - in[19])) << 12) + out[20] = + (uint32(in[20] - in[19])) >> 20 | + ((uint32(in[21] - in[20])) << 11) + out[21] = + (uint32(in[21] - in[20])) >> 21 | + ((uint32(in[22] - in[21])) << 10) + out[22] = + (uint32(in[22] - in[21])) >> 22 | + ((uint32(in[23] - in[22])) << 9) + out[23] = + (uint32(in[23] - in[22])) >> 23 | + ((uint32(in[24] - in[23])) << 8) + out[24] = + (uint32(in[24] - in[23])) >> 24 | + ((uint32(in[25] - in[24])) << 7) + out[25] = + (uint32(in[25] - in[24])) >> 25 | + ((uint32(in[26] - in[25])) << 6) + out[26] = + (uint32(in[26] - in[25])) >> 26 | + ((uint32(in[27] - in[26])) << 5) + out[27] = + (uint32(in[27] - in[26])) >> 27 | + ((uint32(in[28] - in[27])) << 4) + out[28] = + (uint32(in[28] - in[27])) >> 28 | + ((uint32(in[29] - in[28])) << 3) + out[29] = + (uint32(in[29] - in[28])) >> 29 | + ((uint32(in[30] - in[29])) << 2) + out[30] = + (uint32(in[30] - in[29])) >> 30 | + ((uint32(in[31] - in[30])) << 1) +} + +func deltaunpack_int32_0(initoffset int32, in *[0]uint32, out *[32]int32) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset +} + +func deltaunpack_int32_1(initoffset int32, in *[1]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1) + initoffset + out[1] = int32((in[0] >> 1) & 0x1) + out[0] + out[2] = int32((in[0] >> 2) & 0x1) + out[1] + out[3] = int32((in[0] >> 3) & 0x1) + out[2] + out[4] = int32((in[0] >> 4) & 0x1) + out[3] + out[5] = int32((in[0] >> 5) & 0x1) + out[4] + out[6] = int32((in[0] >> 6) & 0x1) + out[5] + out[7] = int32((in[0] >> 7) & 0x1) + out[6] + out[8] = int32((in[0] >> 8) & 0x1) + out[7] + out[9] = int32((in[0] >> 9) & 0x1) + out[8] + out[10] = int32((in[0] >> 10) & 0x1) + out[9] + out[11] = int32((in[0] >> 11) & 0x1) + out[10] + out[12] = int32((in[0] >> 12) & 0x1) + out[11] + out[13] = int32((in[0] >> 13) & 0x1) + out[12] + out[14] = int32((in[0] >> 14) & 0x1) + out[13] + out[15] = int32((in[0] >> 15) & 0x1) + out[14] + out[16] = int32((in[0] >> 16) & 0x1) + out[15] + out[17] = int32((in[0] >> 17) & 0x1) + out[16] + out[18] = int32((in[0] >> 18) & 0x1) + out[17] + out[19] = int32((in[0] >> 19) & 0x1) + out[18] + out[20] = int32((in[0] >> 20) & 0x1) + out[19] + out[21] = int32((in[0] >> 21) & 0x1) + out[20] + out[22] = int32((in[0] >> 22) & 0x1) + out[21] + out[23] = int32((in[0] >> 23) & 0x1) + out[22] + out[24] = int32((in[0] >> 24) & 0x1) + out[23] + out[25] = int32((in[0] >> 25) & 0x1) + out[24] + out[26] = int32((in[0] >> 26) & 0x1) + out[25] + out[27] = int32((in[0] >> 27) & 0x1) + out[26] + out[28] = int32((in[0] >> 28) & 0x1) + out[27] + out[29] = int32((in[0] >> 29) & 0x1) + out[28] + out[30] = int32((in[0] >> 30) & 0x1) + out[29] + out[31] = int32((in[0] >> 31)) + out[30] +} + +func deltaunpack_int32_2(initoffset int32, in *[2]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3) + initoffset + out[1] = int32((in[0] >> 2) & 0x3) + out[0] + out[2] = int32((in[0] >> 4) & 0x3) + out[1] + out[3] = int32((in[0] >> 6) & 0x3) + out[2] + out[4] = int32((in[0] >> 8) & 0x3) + out[3] + out[5] = int32((in[0] >> 10) & 0x3) + out[4] + out[6] = int32((in[0] >> 12) & 0x3) + out[5] + out[7] = int32((in[0] >> 14) & 0x3) + out[6] + out[8] = int32((in[0] >> 16) & 0x3) + out[7] + out[9] = int32((in[0] >> 18) & 0x3) + out[8] + out[10] = int32((in[0] >> 20) & 0x3) + out[9] + out[11] = int32((in[0] >> 22) & 0x3) + out[10] + out[12] = int32((in[0] >> 24) & 0x3) + out[11] + out[13] = int32((in[0] >> 26) & 0x3) + out[12] + out[14] = int32((in[0] >> 28) & 0x3) + out[13] + out[15] = int32((in[0] >> 30)) + out[14] + out[16] = int32((in[1] >> 0) & 0x3) + out[15] + out[17] = int32((in[1] >> 2) & 0x3) + out[16] + out[18] = int32((in[1] >> 4) & 0x3) + out[17] + out[19] = int32((in[1] >> 6) & 0x3) + out[18] + out[20] = int32((in[1] >> 8) & 0x3) + out[19] + out[21] = int32((in[1] >> 10) & 0x3) + out[20] + out[22] = int32((in[1] >> 12) & 0x3) + out[21] + out[23] = int32((in[1] >> 14) & 0x3) + out[22] + out[24] = int32((in[1] >> 16) & 0x3) + out[23] + out[25] = int32((in[1] >> 18) & 0x3) + out[24] + out[26] = int32((in[1] >> 20) & 0x3) + out[25] + out[27] = int32((in[1] >> 22) & 0x3) + out[26] + out[28] = int32((in[1] >> 24) & 0x3) + out[27] + out[29] = int32((in[1] >> 26) & 0x3) + out[28] + out[30] = int32((in[1] >> 28) & 0x3) + out[29] + out[31] = int32((in[1] >> 30)) + out[30] +} + +func deltaunpack_int32_3(initoffset int32, in *[3]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7) + initoffset + out[1] = int32((in[0] >> 3) & 0x7) + out[0] + out[2] = int32((in[0] >> 6) & 0x7) + out[1] + out[3] = int32((in[0] >> 9) & 0x7) + out[2] + out[4] = int32((in[0] >> 12) & 0x7) + out[3] + out[5] = int32((in[0] >> 15) & 0x7) + out[4] + out[6] = int32((in[0] >> 18) & 0x7) + out[5] + out[7] = int32((in[0] >> 21) & 0x7) + out[6] + out[8] = int32((in[0] >> 24) & 0x7) + out[7] + out[9] = int32((in[0] >> 27) & 0x7) + out[8] + out[10] = int32(((in[0] >> 30) | ((in[1] & 0x1) << 2))) + out[9] + out[11] = int32((in[1] >> 1) & 0x7) + out[10] + out[12] = int32((in[1] >> 4) & 0x7) + out[11] + out[13] = int32((in[1] >> 7) & 0x7) + out[12] + out[14] = int32((in[1] >> 10) & 0x7) + out[13] + out[15] = int32((in[1] >> 13) & 0x7) + out[14] + out[16] = int32((in[1] >> 16) & 0x7) + out[15] + out[17] = int32((in[1] >> 19) & 0x7) + out[16] + out[18] = int32((in[1] >> 22) & 0x7) + out[17] + out[19] = int32((in[1] >> 25) & 0x7) + out[18] + out[20] = int32((in[1] >> 28) & 0x7) + out[19] + out[21] = int32(((in[1] >> 31) | ((in[2] & 0x3) << 1))) + out[20] + out[22] = int32((in[2] >> 2) & 0x7) + out[21] + out[23] = int32((in[2] >> 5) & 0x7) + out[22] + out[24] = int32((in[2] >> 8) & 0x7) + out[23] + out[25] = int32((in[2] >> 11) & 0x7) + out[24] + out[26] = int32((in[2] >> 14) & 0x7) + out[25] + out[27] = int32((in[2] >> 17) & 0x7) + out[26] + out[28] = int32((in[2] >> 20) & 0x7) + out[27] + out[29] = int32((in[2] >> 23) & 0x7) + out[28] + out[30] = int32((in[2] >> 26) & 0x7) + out[29] + out[31] = int32((in[2] >> 29)) + out[30] +} + +func deltaunpack_int32_4(initoffset int32, in *[4]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0xF) + initoffset + out[1] = int32((in[0] >> 4) & 0xF) + out[0] + out[2] = int32((in[0] >> 8) & 0xF) + out[1] + out[3] = int32((in[0] >> 12) & 0xF) + out[2] + out[4] = int32((in[0] >> 16) & 0xF) + out[3] + out[5] = int32((in[0] >> 20) & 0xF) + out[4] + out[6] = int32((in[0] >> 24) & 0xF) + out[5] + out[7] = int32((in[0] >> 28)) + out[6] + out[8] = int32((in[1] >> 0) & 0xF) + out[7] + out[9] = int32((in[1] >> 4) & 0xF) + out[8] + out[10] = int32((in[1] >> 8) & 0xF) + out[9] + out[11] = int32((in[1] >> 12) & 0xF) + out[10] + out[12] = int32((in[1] >> 16) & 0xF) + out[11] + out[13] = int32((in[1] >> 20) & 0xF) + out[12] + out[14] = int32((in[1] >> 24) & 0xF) + out[13] + out[15] = int32((in[1] >> 28)) + out[14] + out[16] = int32((in[2] >> 0) & 0xF) + out[15] + out[17] = int32((in[2] >> 4) & 0xF) + out[16] + out[18] = int32((in[2] >> 8) & 0xF) + out[17] + out[19] = int32((in[2] >> 12) & 0xF) + out[18] + out[20] = int32((in[2] >> 16) & 0xF) + out[19] + out[21] = int32((in[2] >> 20) & 0xF) + out[20] + out[22] = int32((in[2] >> 24) & 0xF) + out[21] + out[23] = int32((in[2] >> 28)) + out[22] + out[24] = int32((in[3] >> 0) & 0xF) + out[23] + out[25] = int32((in[3] >> 4) & 0xF) + out[24] + out[26] = int32((in[3] >> 8) & 0xF) + out[25] + out[27] = int32((in[3] >> 12) & 0xF) + out[26] + out[28] = int32((in[3] >> 16) & 0xF) + out[27] + out[29] = int32((in[3] >> 20) & 0xF) + out[28] + out[30] = int32((in[3] >> 24) & 0xF) + out[29] + out[31] = int32((in[3] >> 28)) + out[30] +} + +func deltaunpack_int32_5(initoffset int32, in *[5]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1F) + initoffset + out[1] = int32((in[0] >> 5) & 0x1F) + out[0] + out[2] = int32((in[0] >> 10) & 0x1F) + out[1] + out[3] = int32((in[0] >> 15) & 0x1F) + out[2] + out[4] = int32((in[0] >> 20) & 0x1F) + out[3] + out[5] = int32((in[0] >> 25) & 0x1F) + out[4] + out[6] = int32(((in[0] >> 30) | ((in[1] & 0x7) << 2))) + out[5] + out[7] = int32((in[1] >> 3) & 0x1F) + out[6] + out[8] = int32((in[1] >> 8) & 0x1F) + out[7] + out[9] = int32((in[1] >> 13) & 0x1F) + out[8] + out[10] = int32((in[1] >> 18) & 0x1F) + out[9] + out[11] = int32((in[1] >> 23) & 0x1F) + out[10] + out[12] = int32(((in[1] >> 28) | ((in[2] & 0x1) << 4))) + out[11] + out[13] = int32((in[2] >> 1) & 0x1F) + out[12] + out[14] = int32((in[2] >> 6) & 0x1F) + out[13] + out[15] = int32((in[2] >> 11) & 0x1F) + out[14] + out[16] = int32((in[2] >> 16) & 0x1F) + out[15] + out[17] = int32((in[2] >> 21) & 0x1F) + out[16] + out[18] = int32((in[2] >> 26) & 0x1F) + out[17] + out[19] = int32(((in[2] >> 31) | ((in[3] & 0xF) << 1))) + out[18] + out[20] = int32((in[3] >> 4) & 0x1F) + out[19] + out[21] = int32((in[3] >> 9) & 0x1F) + out[20] + out[22] = int32((in[3] >> 14) & 0x1F) + out[21] + out[23] = int32((in[3] >> 19) & 0x1F) + out[22] + out[24] = int32((in[3] >> 24) & 0x1F) + out[23] + out[25] = int32(((in[3] >> 29) | ((in[4] & 0x3) << 3))) + out[24] + out[26] = int32((in[4] >> 2) & 0x1F) + out[25] + out[27] = int32((in[4] >> 7) & 0x1F) + out[26] + out[28] = int32((in[4] >> 12) & 0x1F) + out[27] + out[29] = int32((in[4] >> 17) & 0x1F) + out[28] + out[30] = int32((in[4] >> 22) & 0x1F) + out[29] + out[31] = int32((in[4] >> 27)) + out[30] +} + +func deltaunpack_int32_6(initoffset int32, in *[6]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3F) + initoffset + out[1] = int32((in[0] >> 6) & 0x3F) + out[0] + out[2] = int32((in[0] >> 12) & 0x3F) + out[1] + out[3] = int32((in[0] >> 18) & 0x3F) + out[2] + out[4] = int32((in[0] >> 24) & 0x3F) + out[3] + out[5] = int32(((in[0] >> 30) | ((in[1] & 0xF) << 2))) + out[4] + out[6] = int32((in[1] >> 4) & 0x3F) + out[5] + out[7] = int32((in[1] >> 10) & 0x3F) + out[6] + out[8] = int32((in[1] >> 16) & 0x3F) + out[7] + out[9] = int32((in[1] >> 22) & 0x3F) + out[8] + out[10] = int32(((in[1] >> 28) | ((in[2] & 0x3) << 4))) + out[9] + out[11] = int32((in[2] >> 2) & 0x3F) + out[10] + out[12] = int32((in[2] >> 8) & 0x3F) + out[11] + out[13] = int32((in[2] >> 14) & 0x3F) + out[12] + out[14] = int32((in[2] >> 20) & 0x3F) + out[13] + out[15] = int32((in[2] >> 26)) + out[14] + out[16] = int32((in[3] >> 0) & 0x3F) + out[15] + out[17] = int32((in[3] >> 6) & 0x3F) + out[16] + out[18] = int32((in[3] >> 12) & 0x3F) + out[17] + out[19] = int32((in[3] >> 18) & 0x3F) + out[18] + out[20] = int32((in[3] >> 24) & 0x3F) + out[19] + out[21] = int32(((in[3] >> 30) | ((in[4] & 0xF) << 2))) + out[20] + out[22] = int32((in[4] >> 4) & 0x3F) + out[21] + out[23] = int32((in[4] >> 10) & 0x3F) + out[22] + out[24] = int32((in[4] >> 16) & 0x3F) + out[23] + out[25] = int32((in[4] >> 22) & 0x3F) + out[24] + out[26] = int32(((in[4] >> 28) | ((in[5] & 0x3) << 4))) + out[25] + out[27] = int32((in[5] >> 2) & 0x3F) + out[26] + out[28] = int32((in[5] >> 8) & 0x3F) + out[27] + out[29] = int32((in[5] >> 14) & 0x3F) + out[28] + out[30] = int32((in[5] >> 20) & 0x3F) + out[29] + out[31] = int32((in[5] >> 26)) + out[30] +} + +func deltaunpack_int32_7(initoffset int32, in *[7]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7F) + initoffset + out[1] = int32((in[0] >> 7) & 0x7F) + out[0] + out[2] = int32((in[0] >> 14) & 0x7F) + out[1] + out[3] = int32((in[0] >> 21) & 0x7F) + out[2] + out[4] = int32(((in[0] >> 28) | ((in[1] & 0x7) << 4))) + out[3] + out[5] = int32((in[1] >> 3) & 0x7F) + out[4] + out[6] = int32((in[1] >> 10) & 0x7F) + out[5] + out[7] = int32((in[1] >> 17) & 0x7F) + out[6] + out[8] = int32((in[1] >> 24) & 0x7F) + out[7] + out[9] = int32(((in[1] >> 31) | ((in[2] & 0x3F) << 1))) + out[8] + out[10] = int32((in[2] >> 6) & 0x7F) + out[9] + out[11] = int32((in[2] >> 13) & 0x7F) + out[10] + out[12] = int32((in[2] >> 20) & 0x7F) + out[11] + out[13] = int32(((in[2] >> 27) | ((in[3] & 0x3) << 5))) + out[12] + out[14] = int32((in[3] >> 2) & 0x7F) + out[13] + out[15] = int32((in[3] >> 9) & 0x7F) + out[14] + out[16] = int32((in[3] >> 16) & 0x7F) + out[15] + out[17] = int32((in[3] >> 23) & 0x7F) + out[16] + out[18] = int32(((in[3] >> 30) | ((in[4] & 0x1F) << 2))) + out[17] + out[19] = int32((in[4] >> 5) & 0x7F) + out[18] + out[20] = int32((in[4] >> 12) & 0x7F) + out[19] + out[21] = int32((in[4] >> 19) & 0x7F) + out[20] + out[22] = int32(((in[4] >> 26) | ((in[5] & 0x1) << 6))) + out[21] + out[23] = int32((in[5] >> 1) & 0x7F) + out[22] + out[24] = int32((in[5] >> 8) & 0x7F) + out[23] + out[25] = int32((in[5] >> 15) & 0x7F) + out[24] + out[26] = int32((in[5] >> 22) & 0x7F) + out[25] + out[27] = int32(((in[5] >> 29) | ((in[6] & 0xF) << 3))) + out[26] + out[28] = int32((in[6] >> 4) & 0x7F) + out[27] + out[29] = int32((in[6] >> 11) & 0x7F) + out[28] + out[30] = int32((in[6] >> 18) & 0x7F) + out[29] + out[31] = int32((in[6] >> 25)) + out[30] +} + +func deltaunpack_int32_8(initoffset int32, in *[8]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0xFF) + initoffset + out[1] = int32((in[0] >> 8) & 0xFF) + out[0] + out[2] = int32((in[0] >> 16) & 0xFF) + out[1] + out[3] = int32((in[0] >> 24)) + out[2] + out[4] = int32((in[1] >> 0) & 0xFF) + out[3] + out[5] = int32((in[1] >> 8) & 0xFF) + out[4] + out[6] = int32((in[1] >> 16) & 0xFF) + out[5] + out[7] = int32((in[1] >> 24)) + out[6] + out[8] = int32((in[2] >> 0) & 0xFF) + out[7] + out[9] = int32((in[2] >> 8) & 0xFF) + out[8] + out[10] = int32((in[2] >> 16) & 0xFF) + out[9] + out[11] = int32((in[2] >> 24)) + out[10] + out[12] = int32((in[3] >> 0) & 0xFF) + out[11] + out[13] = int32((in[3] >> 8) & 0xFF) + out[12] + out[14] = int32((in[3] >> 16) & 0xFF) + out[13] + out[15] = int32((in[3] >> 24)) + out[14] + out[16] = int32((in[4] >> 0) & 0xFF) + out[15] + out[17] = int32((in[4] >> 8) & 0xFF) + out[16] + out[18] = int32((in[4] >> 16) & 0xFF) + out[17] + out[19] = int32((in[4] >> 24)) + out[18] + out[20] = int32((in[5] >> 0) & 0xFF) + out[19] + out[21] = int32((in[5] >> 8) & 0xFF) + out[20] + out[22] = int32((in[5] >> 16) & 0xFF) + out[21] + out[23] = int32((in[5] >> 24)) + out[22] + out[24] = int32((in[6] >> 0) & 0xFF) + out[23] + out[25] = int32((in[6] >> 8) & 0xFF) + out[24] + out[26] = int32((in[6] >> 16) & 0xFF) + out[25] + out[27] = int32((in[6] >> 24)) + out[26] + out[28] = int32((in[7] >> 0) & 0xFF) + out[27] + out[29] = int32((in[7] >> 8) & 0xFF) + out[28] + out[30] = int32((in[7] >> 16) & 0xFF) + out[29] + out[31] = int32((in[7] >> 24)) + out[30] +} + +func deltaunpack_int32_9(initoffset int32, in *[9]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1FF) + initoffset + out[1] = int32((in[0] >> 9) & 0x1FF) + out[0] + out[2] = int32((in[0] >> 18) & 0x1FF) + out[1] + out[3] = int32(((in[0] >> 27) | ((in[1] & 0xF) << 5))) + out[2] + out[4] = int32((in[1] >> 4) & 0x1FF) + out[3] + out[5] = int32((in[1] >> 13) & 0x1FF) + out[4] + out[6] = int32((in[1] >> 22) & 0x1FF) + out[5] + out[7] = int32(((in[1] >> 31) | ((in[2] & 0xFF) << 1))) + out[6] + out[8] = int32((in[2] >> 8) & 0x1FF) + out[7] + out[9] = int32((in[2] >> 17) & 0x1FF) + out[8] + out[10] = int32(((in[2] >> 26) | ((in[3] & 0x7) << 6))) + out[9] + out[11] = int32((in[3] >> 3) & 0x1FF) + out[10] + out[12] = int32((in[3] >> 12) & 0x1FF) + out[11] + out[13] = int32((in[3] >> 21) & 0x1FF) + out[12] + out[14] = int32(((in[3] >> 30) | ((in[4] & 0x7F) << 2))) + out[13] + out[15] = int32((in[4] >> 7) & 0x1FF) + out[14] + out[16] = int32((in[4] >> 16) & 0x1FF) + out[15] + out[17] = int32(((in[4] >> 25) | ((in[5] & 0x3) << 7))) + out[16] + out[18] = int32((in[5] >> 2) & 0x1FF) + out[17] + out[19] = int32((in[5] >> 11) & 0x1FF) + out[18] + out[20] = int32((in[5] >> 20) & 0x1FF) + out[19] + out[21] = int32(((in[5] >> 29) | ((in[6] & 0x3F) << 3))) + out[20] + out[22] = int32((in[6] >> 6) & 0x1FF) + out[21] + out[23] = int32((in[6] >> 15) & 0x1FF) + out[22] + out[24] = int32(((in[6] >> 24) | ((in[7] & 0x1) << 8))) + out[23] + out[25] = int32((in[7] >> 1) & 0x1FF) + out[24] + out[26] = int32((in[7] >> 10) & 0x1FF) + out[25] + out[27] = int32((in[7] >> 19) & 0x1FF) + out[26] + out[28] = int32(((in[7] >> 28) | ((in[8] & 0x1F) << 4))) + out[27] + out[29] = int32((in[8] >> 5) & 0x1FF) + out[28] + out[30] = int32((in[8] >> 14) & 0x1FF) + out[29] + out[31] = int32((in[8] >> 23)) + out[30] +} + +func deltaunpack_int32_10(initoffset int32, in *[10]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3FF) + initoffset + out[1] = int32((in[0] >> 10) & 0x3FF) + out[0] + out[2] = int32((in[0] >> 20) & 0x3FF) + out[1] + out[3] = int32(((in[0] >> 30) | ((in[1] & 0xFF) << 2))) + out[2] + out[4] = int32((in[1] >> 8) & 0x3FF) + out[3] + out[5] = int32((in[1] >> 18) & 0x3FF) + out[4] + out[6] = int32(((in[1] >> 28) | ((in[2] & 0x3F) << 4))) + out[5] + out[7] = int32((in[2] >> 6) & 0x3FF) + out[6] + out[8] = int32((in[2] >> 16) & 0x3FF) + out[7] + out[9] = int32(((in[2] >> 26) | ((in[3] & 0xF) << 6))) + out[8] + out[10] = int32((in[3] >> 4) & 0x3FF) + out[9] + out[11] = int32((in[3] >> 14) & 0x3FF) + out[10] + out[12] = int32(((in[3] >> 24) | ((in[4] & 0x3) << 8))) + out[11] + out[13] = int32((in[4] >> 2) & 0x3FF) + out[12] + out[14] = int32((in[4] >> 12) & 0x3FF) + out[13] + out[15] = int32((in[4] >> 22)) + out[14] + out[16] = int32((in[5] >> 0) & 0x3FF) + out[15] + out[17] = int32((in[5] >> 10) & 0x3FF) + out[16] + out[18] = int32((in[5] >> 20) & 0x3FF) + out[17] + out[19] = int32(((in[5] >> 30) | ((in[6] & 0xFF) << 2))) + out[18] + out[20] = int32((in[6] >> 8) & 0x3FF) + out[19] + out[21] = int32((in[6] >> 18) & 0x3FF) + out[20] + out[22] = int32(((in[6] >> 28) | ((in[7] & 0x3F) << 4))) + out[21] + out[23] = int32((in[7] >> 6) & 0x3FF) + out[22] + out[24] = int32((in[7] >> 16) & 0x3FF) + out[23] + out[25] = int32(((in[7] >> 26) | ((in[8] & 0xF) << 6))) + out[24] + out[26] = int32((in[8] >> 4) & 0x3FF) + out[25] + out[27] = int32((in[8] >> 14) & 0x3FF) + out[26] + out[28] = int32(((in[8] >> 24) | ((in[9] & 0x3) << 8))) + out[27] + out[29] = int32((in[9] >> 2) & 0x3FF) + out[28] + out[30] = int32((in[9] >> 12) & 0x3FF) + out[29] + out[31] = int32((in[9] >> 22)) + out[30] +} + +func deltaunpack_int32_11(initoffset int32, in *[11]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7FF) + initoffset + out[1] = int32((in[0] >> 11) & 0x7FF) + out[0] + out[2] = int32(((in[0] >> 22) | ((in[1] & 0x1) << 10))) + out[1] + out[3] = int32((in[1] >> 1) & 0x7FF) + out[2] + out[4] = int32((in[1] >> 12) & 0x7FF) + out[3] + out[5] = int32(((in[1] >> 23) | ((in[2] & 0x3) << 9))) + out[4] + out[6] = int32((in[2] >> 2) & 0x7FF) + out[5] + out[7] = int32((in[2] >> 13) & 0x7FF) + out[6] + out[8] = int32(((in[2] >> 24) | ((in[3] & 0x7) << 8))) + out[7] + out[9] = int32((in[3] >> 3) & 0x7FF) + out[8] + out[10] = int32((in[3] >> 14) & 0x7FF) + out[9] + out[11] = int32(((in[3] >> 25) | ((in[4] & 0xF) << 7))) + out[10] + out[12] = int32((in[4] >> 4) & 0x7FF) + out[11] + out[13] = int32((in[4] >> 15) & 0x7FF) + out[12] + out[14] = int32(((in[4] >> 26) | ((in[5] & 0x1F) << 6))) + out[13] + out[15] = int32((in[5] >> 5) & 0x7FF) + out[14] + out[16] = int32((in[5] >> 16) & 0x7FF) + out[15] + out[17] = int32(((in[5] >> 27) | ((in[6] & 0x3F) << 5))) + out[16] + out[18] = int32((in[6] >> 6) & 0x7FF) + out[17] + out[19] = int32((in[6] >> 17) & 0x7FF) + out[18] + out[20] = int32(((in[6] >> 28) | ((in[7] & 0x7F) << 4))) + out[19] + out[21] = int32((in[7] >> 7) & 0x7FF) + out[20] + out[22] = int32((in[7] >> 18) & 0x7FF) + out[21] + out[23] = int32(((in[7] >> 29) | ((in[8] & 0xFF) << 3))) + out[22] + out[24] = int32((in[8] >> 8) & 0x7FF) + out[23] + out[25] = int32((in[8] >> 19) & 0x7FF) + out[24] + out[26] = int32(((in[8] >> 30) | ((in[9] & 0x1FF) << 2))) + out[25] + out[27] = int32((in[9] >> 9) & 0x7FF) + out[26] + out[28] = int32((in[9] >> 20) & 0x7FF) + out[27] + out[29] = int32(((in[9] >> 31) | ((in[10] & 0x3FF) << 1))) + out[28] + out[30] = int32((in[10] >> 10) & 0x7FF) + out[29] + out[31] = int32((in[10] >> 21)) + out[30] +} + +func deltaunpack_int32_12(initoffset int32, in *[12]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0xFFF) + initoffset + out[1] = int32((in[0] >> 12) & 0xFFF) + out[0] + out[2] = int32(((in[0] >> 24) | ((in[1] & 0xF) << 8))) + out[1] + out[3] = int32((in[1] >> 4) & 0xFFF) + out[2] + out[4] = int32((in[1] >> 16) & 0xFFF) + out[3] + out[5] = int32(((in[1] >> 28) | ((in[2] & 0xFF) << 4))) + out[4] + out[6] = int32((in[2] >> 8) & 0xFFF) + out[5] + out[7] = int32((in[2] >> 20)) + out[6] + out[8] = int32((in[3] >> 0) & 0xFFF) + out[7] + out[9] = int32((in[3] >> 12) & 0xFFF) + out[8] + out[10] = int32(((in[3] >> 24) | ((in[4] & 0xF) << 8))) + out[9] + out[11] = int32((in[4] >> 4) & 0xFFF) + out[10] + out[12] = int32((in[4] >> 16) & 0xFFF) + out[11] + out[13] = int32(((in[4] >> 28) | ((in[5] & 0xFF) << 4))) + out[12] + out[14] = int32((in[5] >> 8) & 0xFFF) + out[13] + out[15] = int32((in[5] >> 20)) + out[14] + out[16] = int32((in[6] >> 0) & 0xFFF) + out[15] + out[17] = int32((in[6] >> 12) & 0xFFF) + out[16] + out[18] = int32(((in[6] >> 24) | ((in[7] & 0xF) << 8))) + out[17] + out[19] = int32((in[7] >> 4) & 0xFFF) + out[18] + out[20] = int32((in[7] >> 16) & 0xFFF) + out[19] + out[21] = int32(((in[7] >> 28) | ((in[8] & 0xFF) << 4))) + out[20] + out[22] = int32((in[8] >> 8) & 0xFFF) + out[21] + out[23] = int32((in[8] >> 20)) + out[22] + out[24] = int32((in[9] >> 0) & 0xFFF) + out[23] + out[25] = int32((in[9] >> 12) & 0xFFF) + out[24] + out[26] = int32(((in[9] >> 24) | ((in[10] & 0xF) << 8))) + out[25] + out[27] = int32((in[10] >> 4) & 0xFFF) + out[26] + out[28] = int32((in[10] >> 16) & 0xFFF) + out[27] + out[29] = int32(((in[10] >> 28) | ((in[11] & 0xFF) << 4))) + out[28] + out[30] = int32((in[11] >> 8) & 0xFFF) + out[29] + out[31] = int32((in[11] >> 20)) + out[30] +} + +func deltaunpack_int32_13(initoffset int32, in *[13]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1FFF) + initoffset + out[1] = int32((in[0] >> 13) & 0x1FFF) + out[0] + out[2] = int32(((in[0] >> 26) | ((in[1] & 0x7F) << 6))) + out[1] + out[3] = int32((in[1] >> 7) & 0x1FFF) + out[2] + out[4] = int32(((in[1] >> 20) | ((in[2] & 0x1) << 12))) + out[3] + out[5] = int32((in[2] >> 1) & 0x1FFF) + out[4] + out[6] = int32((in[2] >> 14) & 0x1FFF) + out[5] + out[7] = int32(((in[2] >> 27) | ((in[3] & 0xFF) << 5))) + out[6] + out[8] = int32((in[3] >> 8) & 0x1FFF) + out[7] + out[9] = int32(((in[3] >> 21) | ((in[4] & 0x3) << 11))) + out[8] + out[10] = int32((in[4] >> 2) & 0x1FFF) + out[9] + out[11] = int32((in[4] >> 15) & 0x1FFF) + out[10] + out[12] = int32(((in[4] >> 28) | ((in[5] & 0x1FF) << 4))) + out[11] + out[13] = int32((in[5] >> 9) & 0x1FFF) + out[12] + out[14] = int32(((in[5] >> 22) | ((in[6] & 0x7) << 10))) + out[13] + out[15] = int32((in[6] >> 3) & 0x1FFF) + out[14] + out[16] = int32((in[6] >> 16) & 0x1FFF) + out[15] + out[17] = int32(((in[6] >> 29) | ((in[7] & 0x3FF) << 3))) + out[16] + out[18] = int32((in[7] >> 10) & 0x1FFF) + out[17] + out[19] = int32(((in[7] >> 23) | ((in[8] & 0xF) << 9))) + out[18] + out[20] = int32((in[8] >> 4) & 0x1FFF) + out[19] + out[21] = int32((in[8] >> 17) & 0x1FFF) + out[20] + out[22] = int32(((in[8] >> 30) | ((in[9] & 0x7FF) << 2))) + out[21] + out[23] = int32((in[9] >> 11) & 0x1FFF) + out[22] + out[24] = int32(((in[9] >> 24) | ((in[10] & 0x1F) << 8))) + out[23] + out[25] = int32((in[10] >> 5) & 0x1FFF) + out[24] + out[26] = int32((in[10] >> 18) & 0x1FFF) + out[25] + out[27] = int32(((in[10] >> 31) | ((in[11] & 0xFFF) << 1))) + out[26] + out[28] = int32((in[11] >> 12) & 0x1FFF) + out[27] + out[29] = int32(((in[11] >> 25) | ((in[12] & 0x3F) << 7))) + out[28] + out[30] = int32((in[12] >> 6) & 0x1FFF) + out[29] + out[31] = int32((in[12] >> 19)) + out[30] +} + +func deltaunpack_int32_14(initoffset int32, in *[14]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3FFF) + initoffset + out[1] = int32((in[0] >> 14) & 0x3FFF) + out[0] + out[2] = int32(((in[0] >> 28) | ((in[1] & 0x3FF) << 4))) + out[1] + out[3] = int32((in[1] >> 10) & 0x3FFF) + out[2] + out[4] = int32(((in[1] >> 24) | ((in[2] & 0x3F) << 8))) + out[3] + out[5] = int32((in[2] >> 6) & 0x3FFF) + out[4] + out[6] = int32(((in[2] >> 20) | ((in[3] & 0x3) << 12))) + out[5] + out[7] = int32((in[3] >> 2) & 0x3FFF) + out[6] + out[8] = int32((in[3] >> 16) & 0x3FFF) + out[7] + out[9] = int32(((in[3] >> 30) | ((in[4] & 0xFFF) << 2))) + out[8] + out[10] = int32((in[4] >> 12) & 0x3FFF) + out[9] + out[11] = int32(((in[4] >> 26) | ((in[5] & 0xFF) << 6))) + out[10] + out[12] = int32((in[5] >> 8) & 0x3FFF) + out[11] + out[13] = int32(((in[5] >> 22) | ((in[6] & 0xF) << 10))) + out[12] + out[14] = int32((in[6] >> 4) & 0x3FFF) + out[13] + out[15] = int32((in[6] >> 18)) + out[14] + out[16] = int32((in[7] >> 0) & 0x3FFF) + out[15] + out[17] = int32((in[7] >> 14) & 0x3FFF) + out[16] + out[18] = int32(((in[7] >> 28) | ((in[8] & 0x3FF) << 4))) + out[17] + out[19] = int32((in[8] >> 10) & 0x3FFF) + out[18] + out[20] = int32(((in[8] >> 24) | ((in[9] & 0x3F) << 8))) + out[19] + out[21] = int32((in[9] >> 6) & 0x3FFF) + out[20] + out[22] = int32(((in[9] >> 20) | ((in[10] & 0x3) << 12))) + out[21] + out[23] = int32((in[10] >> 2) & 0x3FFF) + out[22] + out[24] = int32((in[10] >> 16) & 0x3FFF) + out[23] + out[25] = int32(((in[10] >> 30) | ((in[11] & 0xFFF) << 2))) + out[24] + out[26] = int32((in[11] >> 12) & 0x3FFF) + out[25] + out[27] = int32(((in[11] >> 26) | ((in[12] & 0xFF) << 6))) + out[26] + out[28] = int32((in[12] >> 8) & 0x3FFF) + out[27] + out[29] = int32(((in[12] >> 22) | ((in[13] & 0xF) << 10))) + out[28] + out[30] = int32((in[13] >> 4) & 0x3FFF) + out[29] + out[31] = int32((in[13] >> 18)) + out[30] +} + +func deltaunpack_int32_15(initoffset int32, in *[15]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7FFF) + initoffset + out[1] = int32((in[0] >> 15) & 0x7FFF) + out[0] + out[2] = int32(((in[0] >> 30) | ((in[1] & 0x1FFF) << 2))) + out[1] + out[3] = int32((in[1] >> 13) & 0x7FFF) + out[2] + out[4] = int32(((in[1] >> 28) | ((in[2] & 0x7FF) << 4))) + out[3] + out[5] = int32((in[2] >> 11) & 0x7FFF) + out[4] + out[6] = int32(((in[2] >> 26) | ((in[3] & 0x1FF) << 6))) + out[5] + out[7] = int32((in[3] >> 9) & 0x7FFF) + out[6] + out[8] = int32(((in[3] >> 24) | ((in[4] & 0x7F) << 8))) + out[7] + out[9] = int32((in[4] >> 7) & 0x7FFF) + out[8] + out[10] = int32(((in[4] >> 22) | ((in[5] & 0x1F) << 10))) + out[9] + out[11] = int32((in[5] >> 5) & 0x7FFF) + out[10] + out[12] = int32(((in[5] >> 20) | ((in[6] & 0x7) << 12))) + out[11] + out[13] = int32((in[6] >> 3) & 0x7FFF) + out[12] + out[14] = int32(((in[6] >> 18) | ((in[7] & 0x1) << 14))) + out[13] + out[15] = int32((in[7] >> 1) & 0x7FFF) + out[14] + out[16] = int32((in[7] >> 16) & 0x7FFF) + out[15] + out[17] = int32(((in[7] >> 31) | ((in[8] & 0x3FFF) << 1))) + out[16] + out[18] = int32((in[8] >> 14) & 0x7FFF) + out[17] + out[19] = int32(((in[8] >> 29) | ((in[9] & 0xFFF) << 3))) + out[18] + out[20] = int32((in[9] >> 12) & 0x7FFF) + out[19] + out[21] = int32(((in[9] >> 27) | ((in[10] & 0x3FF) << 5))) + out[20] + out[22] = int32((in[10] >> 10) & 0x7FFF) + out[21] + out[23] = int32(((in[10] >> 25) | ((in[11] & 0xFF) << 7))) + out[22] + out[24] = int32((in[11] >> 8) & 0x7FFF) + out[23] + out[25] = int32(((in[11] >> 23) | ((in[12] & 0x3F) << 9))) + out[24] + out[26] = int32((in[12] >> 6) & 0x7FFF) + out[25] + out[27] = int32(((in[12] >> 21) | ((in[13] & 0xF) << 11))) + out[26] + out[28] = int32((in[13] >> 4) & 0x7FFF) + out[27] + out[29] = int32(((in[13] >> 19) | ((in[14] & 0x3) << 13))) + out[28] + out[30] = int32((in[14] >> 2) & 0x7FFF) + out[29] + out[31] = int32((in[14] >> 17)) + out[30] +} + +func deltaunpack_int32_16(initoffset int32, in *[16]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0xFFFF) + initoffset + out[1] = int32((in[0] >> 16)) + out[0] + out[2] = int32((in[1] >> 0) & 0xFFFF) + out[1] + out[3] = int32((in[1] >> 16)) + out[2] + out[4] = int32((in[2] >> 0) & 0xFFFF) + out[3] + out[5] = int32((in[2] >> 16)) + out[4] + out[6] = int32((in[3] >> 0) & 0xFFFF) + out[5] + out[7] = int32((in[3] >> 16)) + out[6] + out[8] = int32((in[4] >> 0) & 0xFFFF) + out[7] + out[9] = int32((in[4] >> 16)) + out[8] + out[10] = int32((in[5] >> 0) & 0xFFFF) + out[9] + out[11] = int32((in[5] >> 16)) + out[10] + out[12] = int32((in[6] >> 0) & 0xFFFF) + out[11] + out[13] = int32((in[6] >> 16)) + out[12] + out[14] = int32((in[7] >> 0) & 0xFFFF) + out[13] + out[15] = int32((in[7] >> 16)) + out[14] + out[16] = int32((in[8] >> 0) & 0xFFFF) + out[15] + out[17] = int32((in[8] >> 16)) + out[16] + out[18] = int32((in[9] >> 0) & 0xFFFF) + out[17] + out[19] = int32((in[9] >> 16)) + out[18] + out[20] = int32((in[10] >> 0) & 0xFFFF) + out[19] + out[21] = int32((in[10] >> 16)) + out[20] + out[22] = int32((in[11] >> 0) & 0xFFFF) + out[21] + out[23] = int32((in[11] >> 16)) + out[22] + out[24] = int32((in[12] >> 0) & 0xFFFF) + out[23] + out[25] = int32((in[12] >> 16)) + out[24] + out[26] = int32((in[13] >> 0) & 0xFFFF) + out[25] + out[27] = int32((in[13] >> 16)) + out[26] + out[28] = int32((in[14] >> 0) & 0xFFFF) + out[27] + out[29] = int32((in[14] >> 16)) + out[28] + out[30] = int32((in[15] >> 0) & 0xFFFF) + out[29] + out[31] = int32((in[15] >> 16)) + out[30] +} + +func deltaunpack_int32_17(initoffset int32, in *[17]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1FFFF) + initoffset + out[1] = int32(((in[0] >> 17) | ((in[1] & 0x3) << 15))) + out[0] + out[2] = int32((in[1] >> 2) & 0x1FFFF) + out[1] + out[3] = int32(((in[1] >> 19) | ((in[2] & 0xF) << 13))) + out[2] + out[4] = int32((in[2] >> 4) & 0x1FFFF) + out[3] + out[5] = int32(((in[2] >> 21) | ((in[3] & 0x3F) << 11))) + out[4] + out[6] = int32((in[3] >> 6) & 0x1FFFF) + out[5] + out[7] = int32(((in[3] >> 23) | ((in[4] & 0xFF) << 9))) + out[6] + out[8] = int32((in[4] >> 8) & 0x1FFFF) + out[7] + out[9] = int32(((in[4] >> 25) | ((in[5] & 0x3FF) << 7))) + out[8] + out[10] = int32((in[5] >> 10) & 0x1FFFF) + out[9] + out[11] = int32(((in[5] >> 27) | ((in[6] & 0xFFF) << 5))) + out[10] + out[12] = int32((in[6] >> 12) & 0x1FFFF) + out[11] + out[13] = int32(((in[6] >> 29) | ((in[7] & 0x3FFF) << 3))) + out[12] + out[14] = int32((in[7] >> 14) & 0x1FFFF) + out[13] + out[15] = int32(((in[7] >> 31) | ((in[8] & 0xFFFF) << 1))) + out[14] + out[16] = int32(((in[8] >> 16) | ((in[9] & 0x1) << 16))) + out[15] + out[17] = int32((in[9] >> 1) & 0x1FFFF) + out[16] + out[18] = int32(((in[9] >> 18) | ((in[10] & 0x7) << 14))) + out[17] + out[19] = int32((in[10] >> 3) & 0x1FFFF) + out[18] + out[20] = int32(((in[10] >> 20) | ((in[11] & 0x1F) << 12))) + out[19] + out[21] = int32((in[11] >> 5) & 0x1FFFF) + out[20] + out[22] = int32(((in[11] >> 22) | ((in[12] & 0x7F) << 10))) + out[21] + out[23] = int32((in[12] >> 7) & 0x1FFFF) + out[22] + out[24] = int32(((in[12] >> 24) | ((in[13] & 0x1FF) << 8))) + out[23] + out[25] = int32((in[13] >> 9) & 0x1FFFF) + out[24] + out[26] = int32(((in[13] >> 26) | ((in[14] & 0x7FF) << 6))) + out[25] + out[27] = int32((in[14] >> 11) & 0x1FFFF) + out[26] + out[28] = int32(((in[14] >> 28) | ((in[15] & 0x1FFF) << 4))) + out[27] + out[29] = int32((in[15] >> 13) & 0x1FFFF) + out[28] + out[30] = int32(((in[15] >> 30) | ((in[16] & 0x7FFF) << 2))) + out[29] + out[31] = int32((in[16] >> 15)) + out[30] +} + +func deltaunpack_int32_18(initoffset int32, in *[18]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3FFFF) + initoffset + out[1] = int32(((in[0] >> 18) | ((in[1] & 0xF) << 14))) + out[0] + out[2] = int32((in[1] >> 4) & 0x3FFFF) + out[1] + out[3] = int32(((in[1] >> 22) | ((in[2] & 0xFF) << 10))) + out[2] + out[4] = int32((in[2] >> 8) & 0x3FFFF) + out[3] + out[5] = int32(((in[2] >> 26) | ((in[3] & 0xFFF) << 6))) + out[4] + out[6] = int32((in[3] >> 12) & 0x3FFFF) + out[5] + out[7] = int32(((in[3] >> 30) | ((in[4] & 0xFFFF) << 2))) + out[6] + out[8] = int32(((in[4] >> 16) | ((in[5] & 0x3) << 16))) + out[7] + out[9] = int32((in[5] >> 2) & 0x3FFFF) + out[8] + out[10] = int32(((in[5] >> 20) | ((in[6] & 0x3F) << 12))) + out[9] + out[11] = int32((in[6] >> 6) & 0x3FFFF) + out[10] + out[12] = int32(((in[6] >> 24) | ((in[7] & 0x3FF) << 8))) + out[11] + out[13] = int32((in[7] >> 10) & 0x3FFFF) + out[12] + out[14] = int32(((in[7] >> 28) | ((in[8] & 0x3FFF) << 4))) + out[13] + out[15] = int32((in[8] >> 14)) + out[14] + out[16] = int32((in[9] >> 0) & 0x3FFFF) + out[15] + out[17] = int32(((in[9] >> 18) | ((in[10] & 0xF) << 14))) + out[16] + out[18] = int32((in[10] >> 4) & 0x3FFFF) + out[17] + out[19] = int32(((in[10] >> 22) | ((in[11] & 0xFF) << 10))) + out[18] + out[20] = int32((in[11] >> 8) & 0x3FFFF) + out[19] + out[21] = int32(((in[11] >> 26) | ((in[12] & 0xFFF) << 6))) + out[20] + out[22] = int32((in[12] >> 12) & 0x3FFFF) + out[21] + out[23] = int32(((in[12] >> 30) | ((in[13] & 0xFFFF) << 2))) + out[22] + out[24] = int32(((in[13] >> 16) | ((in[14] & 0x3) << 16))) + out[23] + out[25] = int32((in[14] >> 2) & 0x3FFFF) + out[24] + out[26] = int32(((in[14] >> 20) | ((in[15] & 0x3F) << 12))) + out[25] + out[27] = int32((in[15] >> 6) & 0x3FFFF) + out[26] + out[28] = int32(((in[15] >> 24) | ((in[16] & 0x3FF) << 8))) + out[27] + out[29] = int32((in[16] >> 10) & 0x3FFFF) + out[28] + out[30] = int32(((in[16] >> 28) | ((in[17] & 0x3FFF) << 4))) + out[29] + out[31] = int32((in[17] >> 14)) + out[30] +} + +func deltaunpack_int32_19(initoffset int32, in *[19]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7FFFF) + initoffset + out[1] = int32(((in[0] >> 19) | ((in[1] & 0x3F) << 13))) + out[0] + out[2] = int32((in[1] >> 6) & 0x7FFFF) + out[1] + out[3] = int32(((in[1] >> 25) | ((in[2] & 0xFFF) << 7))) + out[2] + out[4] = int32((in[2] >> 12) & 0x7FFFF) + out[3] + out[5] = int32(((in[2] >> 31) | ((in[3] & 0x3FFFF) << 1))) + out[4] + out[6] = int32(((in[3] >> 18) | ((in[4] & 0x1F) << 14))) + out[5] + out[7] = int32((in[4] >> 5) & 0x7FFFF) + out[6] + out[8] = int32(((in[4] >> 24) | ((in[5] & 0x7FF) << 8))) + out[7] + out[9] = int32((in[5] >> 11) & 0x7FFFF) + out[8] + out[10] = int32(((in[5] >> 30) | ((in[6] & 0x1FFFF) << 2))) + out[9] + out[11] = int32(((in[6] >> 17) | ((in[7] & 0xF) << 15))) + out[10] + out[12] = int32((in[7] >> 4) & 0x7FFFF) + out[11] + out[13] = int32(((in[7] >> 23) | ((in[8] & 0x3FF) << 9))) + out[12] + out[14] = int32((in[8] >> 10) & 0x7FFFF) + out[13] + out[15] = int32(((in[8] >> 29) | ((in[9] & 0xFFFF) << 3))) + out[14] + out[16] = int32(((in[9] >> 16) | ((in[10] & 0x7) << 16))) + out[15] + out[17] = int32((in[10] >> 3) & 0x7FFFF) + out[16] + out[18] = int32(((in[10] >> 22) | ((in[11] & 0x1FF) << 10))) + out[17] + out[19] = int32((in[11] >> 9) & 0x7FFFF) + out[18] + out[20] = int32(((in[11] >> 28) | ((in[12] & 0x7FFF) << 4))) + out[19] + out[21] = int32(((in[12] >> 15) | ((in[13] & 0x3) << 17))) + out[20] + out[22] = int32((in[13] >> 2) & 0x7FFFF) + out[21] + out[23] = int32(((in[13] >> 21) | ((in[14] & 0xFF) << 11))) + out[22] + out[24] = int32((in[14] >> 8) & 0x7FFFF) + out[23] + out[25] = int32(((in[14] >> 27) | ((in[15] & 0x3FFF) << 5))) + out[24] + out[26] = int32(((in[15] >> 14) | ((in[16] & 0x1) << 18))) + out[25] + out[27] = int32((in[16] >> 1) & 0x7FFFF) + out[26] + out[28] = int32(((in[16] >> 20) | ((in[17] & 0x7F) << 12))) + out[27] + out[29] = int32((in[17] >> 7) & 0x7FFFF) + out[28] + out[30] = int32(((in[17] >> 26) | ((in[18] & 0x1FFF) << 6))) + out[29] + out[31] = int32((in[18] >> 13)) + out[30] +} + +func deltaunpack_int32_20(initoffset int32, in *[20]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0xFFFFF) + initoffset + out[1] = int32(((in[0] >> 20) | ((in[1] & 0xFF) << 12))) + out[0] + out[2] = int32((in[1] >> 8) & 0xFFFFF) + out[1] + out[3] = int32(((in[1] >> 28) | ((in[2] & 0xFFFF) << 4))) + out[2] + out[4] = int32(((in[2] >> 16) | ((in[3] & 0xF) << 16))) + out[3] + out[5] = int32((in[3] >> 4) & 0xFFFFF) + out[4] + out[6] = int32(((in[3] >> 24) | ((in[4] & 0xFFF) << 8))) + out[5] + out[7] = int32((in[4] >> 12)) + out[6] + out[8] = int32((in[5] >> 0) & 0xFFFFF) + out[7] + out[9] = int32(((in[5] >> 20) | ((in[6] & 0xFF) << 12))) + out[8] + out[10] = int32((in[6] >> 8) & 0xFFFFF) + out[9] + out[11] = int32(((in[6] >> 28) | ((in[7] & 0xFFFF) << 4))) + out[10] + out[12] = int32(((in[7] >> 16) | ((in[8] & 0xF) << 16))) + out[11] + out[13] = int32((in[8] >> 4) & 0xFFFFF) + out[12] + out[14] = int32(((in[8] >> 24) | ((in[9] & 0xFFF) << 8))) + out[13] + out[15] = int32((in[9] >> 12)) + out[14] + out[16] = int32((in[10] >> 0) & 0xFFFFF) + out[15] + out[17] = int32(((in[10] >> 20) | ((in[11] & 0xFF) << 12))) + out[16] + out[18] = int32((in[11] >> 8) & 0xFFFFF) + out[17] + out[19] = int32(((in[11] >> 28) | ((in[12] & 0xFFFF) << 4))) + out[18] + out[20] = int32(((in[12] >> 16) | ((in[13] & 0xF) << 16))) + out[19] + out[21] = int32((in[13] >> 4) & 0xFFFFF) + out[20] + out[22] = int32(((in[13] >> 24) | ((in[14] & 0xFFF) << 8))) + out[21] + out[23] = int32((in[14] >> 12)) + out[22] + out[24] = int32((in[15] >> 0) & 0xFFFFF) + out[23] + out[25] = int32(((in[15] >> 20) | ((in[16] & 0xFF) << 12))) + out[24] + out[26] = int32((in[16] >> 8) & 0xFFFFF) + out[25] + out[27] = int32(((in[16] >> 28) | ((in[17] & 0xFFFF) << 4))) + out[26] + out[28] = int32(((in[17] >> 16) | ((in[18] & 0xF) << 16))) + out[27] + out[29] = int32((in[18] >> 4) & 0xFFFFF) + out[28] + out[30] = int32(((in[18] >> 24) | ((in[19] & 0xFFF) << 8))) + out[29] + out[31] = int32((in[19] >> 12)) + out[30] +} + +func deltaunpack_int32_21(initoffset int32, in *[21]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1FFFFF) + initoffset + out[1] = int32(((in[0] >> 21) | ((in[1] & 0x3FF) << 11))) + out[0] + out[2] = int32((in[1] >> 10) & 0x1FFFFF) + out[1] + out[3] = int32(((in[1] >> 31) | ((in[2] & 0xFFFFF) << 1))) + out[2] + out[4] = int32(((in[2] >> 20) | ((in[3] & 0x1FF) << 12))) + out[3] + out[5] = int32((in[3] >> 9) & 0x1FFFFF) + out[4] + out[6] = int32(((in[3] >> 30) | ((in[4] & 0x7FFFF) << 2))) + out[5] + out[7] = int32(((in[4] >> 19) | ((in[5] & 0xFF) << 13))) + out[6] + out[8] = int32((in[5] >> 8) & 0x1FFFFF) + out[7] + out[9] = int32(((in[5] >> 29) | ((in[6] & 0x3FFFF) << 3))) + out[8] + out[10] = int32(((in[6] >> 18) | ((in[7] & 0x7F) << 14))) + out[9] + out[11] = int32((in[7] >> 7) & 0x1FFFFF) + out[10] + out[12] = int32(((in[7] >> 28) | ((in[8] & 0x1FFFF) << 4))) + out[11] + out[13] = int32(((in[8] >> 17) | ((in[9] & 0x3F) << 15))) + out[12] + out[14] = int32((in[9] >> 6) & 0x1FFFFF) + out[13] + out[15] = int32(((in[9] >> 27) | ((in[10] & 0xFFFF) << 5))) + out[14] + out[16] = int32(((in[10] >> 16) | ((in[11] & 0x1F) << 16))) + out[15] + out[17] = int32((in[11] >> 5) & 0x1FFFFF) + out[16] + out[18] = int32(((in[11] >> 26) | ((in[12] & 0x7FFF) << 6))) + out[17] + out[19] = int32(((in[12] >> 15) | ((in[13] & 0xF) << 17))) + out[18] + out[20] = int32((in[13] >> 4) & 0x1FFFFF) + out[19] + out[21] = int32(((in[13] >> 25) | ((in[14] & 0x3FFF) << 7))) + out[20] + out[22] = int32(((in[14] >> 14) | ((in[15] & 0x7) << 18))) + out[21] + out[23] = int32((in[15] >> 3) & 0x1FFFFF) + out[22] + out[24] = int32(((in[15] >> 24) | ((in[16] & 0x1FFF) << 8))) + out[23] + out[25] = int32(((in[16] >> 13) | ((in[17] & 0x3) << 19))) + out[24] + out[26] = int32((in[17] >> 2) & 0x1FFFFF) + out[25] + out[27] = int32(((in[17] >> 23) | ((in[18] & 0xFFF) << 9))) + out[26] + out[28] = int32(((in[18] >> 12) | ((in[19] & 0x1) << 20))) + out[27] + out[29] = int32((in[19] >> 1) & 0x1FFFFF) + out[28] + out[30] = int32(((in[19] >> 22) | ((in[20] & 0x7FF) << 10))) + out[29] + out[31] = int32((in[20] >> 11)) + out[30] +} + +func deltaunpack_int32_22(initoffset int32, in *[22]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3FFFFF) + initoffset + out[1] = int32(((in[0] >> 22) | ((in[1] & 0xFFF) << 10))) + out[0] + out[2] = int32(((in[1] >> 12) | ((in[2] & 0x3) << 20))) + out[1] + out[3] = int32((in[2] >> 2) & 0x3FFFFF) + out[2] + out[4] = int32(((in[2] >> 24) | ((in[3] & 0x3FFF) << 8))) + out[3] + out[5] = int32(((in[3] >> 14) | ((in[4] & 0xF) << 18))) + out[4] + out[6] = int32((in[4] >> 4) & 0x3FFFFF) + out[5] + out[7] = int32(((in[4] >> 26) | ((in[5] & 0xFFFF) << 6))) + out[6] + out[8] = int32(((in[5] >> 16) | ((in[6] & 0x3F) << 16))) + out[7] + out[9] = int32((in[6] >> 6) & 0x3FFFFF) + out[8] + out[10] = int32(((in[6] >> 28) | ((in[7] & 0x3FFFF) << 4))) + out[9] + out[11] = int32(((in[7] >> 18) | ((in[8] & 0xFF) << 14))) + out[10] + out[12] = int32((in[8] >> 8) & 0x3FFFFF) + out[11] + out[13] = int32(((in[8] >> 30) | ((in[9] & 0xFFFFF) << 2))) + out[12] + out[14] = int32(((in[9] >> 20) | ((in[10] & 0x3FF) << 12))) + out[13] + out[15] = int32((in[10] >> 10)) + out[14] + out[16] = int32((in[11] >> 0) & 0x3FFFFF) + out[15] + out[17] = int32(((in[11] >> 22) | ((in[12] & 0xFFF) << 10))) + out[16] + out[18] = int32(((in[12] >> 12) | ((in[13] & 0x3) << 20))) + out[17] + out[19] = int32((in[13] >> 2) & 0x3FFFFF) + out[18] + out[20] = int32(((in[13] >> 24) | ((in[14] & 0x3FFF) << 8))) + out[19] + out[21] = int32(((in[14] >> 14) | ((in[15] & 0xF) << 18))) + out[20] + out[22] = int32((in[15] >> 4) & 0x3FFFFF) + out[21] + out[23] = int32(((in[15] >> 26) | ((in[16] & 0xFFFF) << 6))) + out[22] + out[24] = int32(((in[16] >> 16) | ((in[17] & 0x3F) << 16))) + out[23] + out[25] = int32((in[17] >> 6) & 0x3FFFFF) + out[24] + out[26] = int32(((in[17] >> 28) | ((in[18] & 0x3FFFF) << 4))) + out[25] + out[27] = int32(((in[18] >> 18) | ((in[19] & 0xFF) << 14))) + out[26] + out[28] = int32((in[19] >> 8) & 0x3FFFFF) + out[27] + out[29] = int32(((in[19] >> 30) | ((in[20] & 0xFFFFF) << 2))) + out[28] + out[30] = int32(((in[20] >> 20) | ((in[21] & 0x3FF) << 12))) + out[29] + out[31] = int32((in[21] >> 10)) + out[30] +} + +func deltaunpack_int32_23(initoffset int32, in *[23]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7FFFFF) + initoffset + out[1] = int32(((in[0] >> 23) | ((in[1] & 0x3FFF) << 9))) + out[0] + out[2] = int32(((in[1] >> 14) | ((in[2] & 0x1F) << 18))) + out[1] + out[3] = int32((in[2] >> 5) & 0x7FFFFF) + out[2] + out[4] = int32(((in[2] >> 28) | ((in[3] & 0x7FFFF) << 4))) + out[3] + out[5] = int32(((in[3] >> 19) | ((in[4] & 0x3FF) << 13))) + out[4] + out[6] = int32(((in[4] >> 10) | ((in[5] & 0x1) << 22))) + out[5] + out[7] = int32((in[5] >> 1) & 0x7FFFFF) + out[6] + out[8] = int32(((in[5] >> 24) | ((in[6] & 0x7FFF) << 8))) + out[7] + out[9] = int32(((in[6] >> 15) | ((in[7] & 0x3F) << 17))) + out[8] + out[10] = int32((in[7] >> 6) & 0x7FFFFF) + out[9] + out[11] = int32(((in[7] >> 29) | ((in[8] & 0xFFFFF) << 3))) + out[10] + out[12] = int32(((in[8] >> 20) | ((in[9] & 0x7FF) << 12))) + out[11] + out[13] = int32(((in[9] >> 11) | ((in[10] & 0x3) << 21))) + out[12] + out[14] = int32((in[10] >> 2) & 0x7FFFFF) + out[13] + out[15] = int32(((in[10] >> 25) | ((in[11] & 0xFFFF) << 7))) + out[14] + out[16] = int32(((in[11] >> 16) | ((in[12] & 0x7F) << 16))) + out[15] + out[17] = int32((in[12] >> 7) & 0x7FFFFF) + out[16] + out[18] = int32(((in[12] >> 30) | ((in[13] & 0x1FFFFF) << 2))) + out[17] + out[19] = int32(((in[13] >> 21) | ((in[14] & 0xFFF) << 11))) + out[18] + out[20] = int32(((in[14] >> 12) | ((in[15] & 0x7) << 20))) + out[19] + out[21] = int32((in[15] >> 3) & 0x7FFFFF) + out[20] + out[22] = int32(((in[15] >> 26) | ((in[16] & 0x1FFFF) << 6))) + out[21] + out[23] = int32(((in[16] >> 17) | ((in[17] & 0xFF) << 15))) + out[22] + out[24] = int32((in[17] >> 8) & 0x7FFFFF) + out[23] + out[25] = int32(((in[17] >> 31) | ((in[18] & 0x3FFFFF) << 1))) + out[24] + out[26] = int32(((in[18] >> 22) | ((in[19] & 0x1FFF) << 10))) + out[25] + out[27] = int32(((in[19] >> 13) | ((in[20] & 0xF) << 19))) + out[26] + out[28] = int32((in[20] >> 4) & 0x7FFFFF) + out[27] + out[29] = int32(((in[20] >> 27) | ((in[21] & 0x3FFFF) << 5))) + out[28] + out[30] = int32(((in[21] >> 18) | ((in[22] & 0x1FF) << 14))) + out[29] + out[31] = int32((in[22] >> 9)) + out[30] +} + +func deltaunpack_int32_24(initoffset int32, in *[24]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0xFFFFFF) + initoffset + out[1] = int32(((in[0] >> 24) | ((in[1] & 0xFFFF) << 8))) + out[0] + out[2] = int32(((in[1] >> 16) | ((in[2] & 0xFF) << 16))) + out[1] + out[3] = int32((in[2] >> 8)) + out[2] + out[4] = int32((in[3] >> 0) & 0xFFFFFF) + out[3] + out[5] = int32(((in[3] >> 24) | ((in[4] & 0xFFFF) << 8))) + out[4] + out[6] = int32(((in[4] >> 16) | ((in[5] & 0xFF) << 16))) + out[5] + out[7] = int32((in[5] >> 8)) + out[6] + out[8] = int32((in[6] >> 0) & 0xFFFFFF) + out[7] + out[9] = int32(((in[6] >> 24) | ((in[7] & 0xFFFF) << 8))) + out[8] + out[10] = int32(((in[7] >> 16) | ((in[8] & 0xFF) << 16))) + out[9] + out[11] = int32((in[8] >> 8)) + out[10] + out[12] = int32((in[9] >> 0) & 0xFFFFFF) + out[11] + out[13] = int32(((in[9] >> 24) | ((in[10] & 0xFFFF) << 8))) + out[12] + out[14] = int32(((in[10] >> 16) | ((in[11] & 0xFF) << 16))) + out[13] + out[15] = int32((in[11] >> 8)) + out[14] + out[16] = int32((in[12] >> 0) & 0xFFFFFF) + out[15] + out[17] = int32(((in[12] >> 24) | ((in[13] & 0xFFFF) << 8))) + out[16] + out[18] = int32(((in[13] >> 16) | ((in[14] & 0xFF) << 16))) + out[17] + out[19] = int32((in[14] >> 8)) + out[18] + out[20] = int32((in[15] >> 0) & 0xFFFFFF) + out[19] + out[21] = int32(((in[15] >> 24) | ((in[16] & 0xFFFF) << 8))) + out[20] + out[22] = int32(((in[16] >> 16) | ((in[17] & 0xFF) << 16))) + out[21] + out[23] = int32((in[17] >> 8)) + out[22] + out[24] = int32((in[18] >> 0) & 0xFFFFFF) + out[23] + out[25] = int32(((in[18] >> 24) | ((in[19] & 0xFFFF) << 8))) + out[24] + out[26] = int32(((in[19] >> 16) | ((in[20] & 0xFF) << 16))) + out[25] + out[27] = int32((in[20] >> 8)) + out[26] + out[28] = int32((in[21] >> 0) & 0xFFFFFF) + out[27] + out[29] = int32(((in[21] >> 24) | ((in[22] & 0xFFFF) << 8))) + out[28] + out[30] = int32(((in[22] >> 16) | ((in[23] & 0xFF) << 16))) + out[29] + out[31] = int32((in[23] >> 8)) + out[30] +} + +func deltaunpack_int32_25(initoffset int32, in *[25]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1FFFFFF) + initoffset + out[1] = int32(((in[0] >> 25) | ((in[1] & 0x3FFFF) << 7))) + out[0] + out[2] = int32(((in[1] >> 18) | ((in[2] & 0x7FF) << 14))) + out[1] + out[3] = int32(((in[2] >> 11) | ((in[3] & 0xF) << 21))) + out[2] + out[4] = int32((in[3] >> 4) & 0x1FFFFFF) + out[3] + out[5] = int32(((in[3] >> 29) | ((in[4] & 0x3FFFFF) << 3))) + out[4] + out[6] = int32(((in[4] >> 22) | ((in[5] & 0x7FFF) << 10))) + out[5] + out[7] = int32(((in[5] >> 15) | ((in[6] & 0xFF) << 17))) + out[6] + out[8] = int32(((in[6] >> 8) | ((in[7] & 0x1) << 24))) + out[7] + out[9] = int32((in[7] >> 1) & 0x1FFFFFF) + out[8] + out[10] = int32(((in[7] >> 26) | ((in[8] & 0x7FFFF) << 6))) + out[9] + out[11] = int32(((in[8] >> 19) | ((in[9] & 0xFFF) << 13))) + out[10] + out[12] = int32(((in[9] >> 12) | ((in[10] & 0x1F) << 20))) + out[11] + out[13] = int32((in[10] >> 5) & 0x1FFFFFF) + out[12] + out[14] = int32(((in[10] >> 30) | ((in[11] & 0x7FFFFF) << 2))) + out[13] + out[15] = int32(((in[11] >> 23) | ((in[12] & 0xFFFF) << 9))) + out[14] + out[16] = int32(((in[12] >> 16) | ((in[13] & 0x1FF) << 16))) + out[15] + out[17] = int32(((in[13] >> 9) | ((in[14] & 0x3) << 23))) + out[16] + out[18] = int32((in[14] >> 2) & 0x1FFFFFF) + out[17] + out[19] = int32(((in[14] >> 27) | ((in[15] & 0xFFFFF) << 5))) + out[18] + out[20] = int32(((in[15] >> 20) | ((in[16] & 0x1FFF) << 12))) + out[19] + out[21] = int32(((in[16] >> 13) | ((in[17] & 0x3F) << 19))) + out[20] + out[22] = int32((in[17] >> 6) & 0x1FFFFFF) + out[21] + out[23] = int32(((in[17] >> 31) | ((in[18] & 0xFFFFFF) << 1))) + out[22] + out[24] = int32(((in[18] >> 24) | ((in[19] & 0x1FFFF) << 8))) + out[23] + out[25] = int32(((in[19] >> 17) | ((in[20] & 0x3FF) << 15))) + out[24] + out[26] = int32(((in[20] >> 10) | ((in[21] & 0x7) << 22))) + out[25] + out[27] = int32((in[21] >> 3) & 0x1FFFFFF) + out[26] + out[28] = int32(((in[21] >> 28) | ((in[22] & 0x1FFFFF) << 4))) + out[27] + out[29] = int32(((in[22] >> 21) | ((in[23] & 0x3FFF) << 11))) + out[28] + out[30] = int32(((in[23] >> 14) | ((in[24] & 0x7F) << 18))) + out[29] + out[31] = int32((in[24] >> 7)) + out[30] +} + +func deltaunpack_int32_26(initoffset int32, in *[26]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3FFFFFF) + initoffset + out[1] = int32(((in[0] >> 26) | ((in[1] & 0xFFFFF) << 6))) + out[0] + out[2] = int32(((in[1] >> 20) | ((in[2] & 0x3FFF) << 12))) + out[1] + out[3] = int32(((in[2] >> 14) | ((in[3] & 0xFF) << 18))) + out[2] + out[4] = int32(((in[3] >> 8) | ((in[4] & 0x3) << 24))) + out[3] + out[5] = int32((in[4] >> 2) & 0x3FFFFFF) + out[4] + out[6] = int32(((in[4] >> 28) | ((in[5] & 0x3FFFFF) << 4))) + out[5] + out[7] = int32(((in[5] >> 22) | ((in[6] & 0xFFFF) << 10))) + out[6] + out[8] = int32(((in[6] >> 16) | ((in[7] & 0x3FF) << 16))) + out[7] + out[9] = int32(((in[7] >> 10) | ((in[8] & 0xF) << 22))) + out[8] + out[10] = int32((in[8] >> 4) & 0x3FFFFFF) + out[9] + out[11] = int32(((in[8] >> 30) | ((in[9] & 0xFFFFFF) << 2))) + out[10] + out[12] = int32(((in[9] >> 24) | ((in[10] & 0x3FFFF) << 8))) + out[11] + out[13] = int32(((in[10] >> 18) | ((in[11] & 0xFFF) << 14))) + out[12] + out[14] = int32(((in[11] >> 12) | ((in[12] & 0x3F) << 20))) + out[13] + out[15] = int32((in[12] >> 6)) + out[14] + out[16] = int32((in[13] >> 0) & 0x3FFFFFF) + out[15] + out[17] = int32(((in[13] >> 26) | ((in[14] & 0xFFFFF) << 6))) + out[16] + out[18] = int32(((in[14] >> 20) | ((in[15] & 0x3FFF) << 12))) + out[17] + out[19] = int32(((in[15] >> 14) | ((in[16] & 0xFF) << 18))) + out[18] + out[20] = int32(((in[16] >> 8) | ((in[17] & 0x3) << 24))) + out[19] + out[21] = int32((in[17] >> 2) & 0x3FFFFFF) + out[20] + out[22] = int32(((in[17] >> 28) | ((in[18] & 0x3FFFFF) << 4))) + out[21] + out[23] = int32(((in[18] >> 22) | ((in[19] & 0xFFFF) << 10))) + out[22] + out[24] = int32(((in[19] >> 16) | ((in[20] & 0x3FF) << 16))) + out[23] + out[25] = int32(((in[20] >> 10) | ((in[21] & 0xF) << 22))) + out[24] + out[26] = int32((in[21] >> 4) & 0x3FFFFFF) + out[25] + out[27] = int32(((in[21] >> 30) | ((in[22] & 0xFFFFFF) << 2))) + out[26] + out[28] = int32(((in[22] >> 24) | ((in[23] & 0x3FFFF) << 8))) + out[27] + out[29] = int32(((in[23] >> 18) | ((in[24] & 0xFFF) << 14))) + out[28] + out[30] = int32(((in[24] >> 12) | ((in[25] & 0x3F) << 20))) + out[29] + out[31] = int32((in[25] >> 6)) + out[30] +} + +func deltaunpack_int32_27(initoffset int32, in *[27]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7FFFFFF) + initoffset + out[1] = int32(((in[0] >> 27) | ((in[1] & 0x3FFFFF) << 5))) + out[0] + out[2] = int32(((in[1] >> 22) | ((in[2] & 0x1FFFF) << 10))) + out[1] + out[3] = int32(((in[2] >> 17) | ((in[3] & 0xFFF) << 15))) + out[2] + out[4] = int32(((in[3] >> 12) | ((in[4] & 0x7F) << 20))) + out[3] + out[5] = int32(((in[4] >> 7) | ((in[5] & 0x3) << 25))) + out[4] + out[6] = int32((in[5] >> 2) & 0x7FFFFFF) + out[5] + out[7] = int32(((in[5] >> 29) | ((in[6] & 0xFFFFFF) << 3))) + out[6] + out[8] = int32(((in[6] >> 24) | ((in[7] & 0x7FFFF) << 8))) + out[7] + out[9] = int32(((in[7] >> 19) | ((in[8] & 0x3FFF) << 13))) + out[8] + out[10] = int32(((in[8] >> 14) | ((in[9] & 0x1FF) << 18))) + out[9] + out[11] = int32(((in[9] >> 9) | ((in[10] & 0xF) << 23))) + out[10] + out[12] = int32((in[10] >> 4) & 0x7FFFFFF) + out[11] + out[13] = int32(((in[10] >> 31) | ((in[11] & 0x3FFFFFF) << 1))) + out[12] + out[14] = int32(((in[11] >> 26) | ((in[12] & 0x1FFFFF) << 6))) + out[13] + out[15] = int32(((in[12] >> 21) | ((in[13] & 0xFFFF) << 11))) + out[14] + out[16] = int32(((in[13] >> 16) | ((in[14] & 0x7FF) << 16))) + out[15] + out[17] = int32(((in[14] >> 11) | ((in[15] & 0x3F) << 21))) + out[16] + out[18] = int32(((in[15] >> 6) | ((in[16] & 0x1) << 26))) + out[17] + out[19] = int32((in[16] >> 1) & 0x7FFFFFF) + out[18] + out[20] = int32(((in[16] >> 28) | ((in[17] & 0x7FFFFF) << 4))) + out[19] + out[21] = int32(((in[17] >> 23) | ((in[18] & 0x3FFFF) << 9))) + out[20] + out[22] = int32(((in[18] >> 18) | ((in[19] & 0x1FFF) << 14))) + out[21] + out[23] = int32(((in[19] >> 13) | ((in[20] & 0xFF) << 19))) + out[22] + out[24] = int32(((in[20] >> 8) | ((in[21] & 0x7) << 24))) + out[23] + out[25] = int32((in[21] >> 3) & 0x7FFFFFF) + out[24] + out[26] = int32(((in[21] >> 30) | ((in[22] & 0x1FFFFFF) << 2))) + out[25] + out[27] = int32(((in[22] >> 25) | ((in[23] & 0xFFFFF) << 7))) + out[26] + out[28] = int32(((in[23] >> 20) | ((in[24] & 0x7FFF) << 12))) + out[27] + out[29] = int32(((in[24] >> 15) | ((in[25] & 0x3FF) << 17))) + out[28] + out[30] = int32(((in[25] >> 10) | ((in[26] & 0x1F) << 22))) + out[29] + out[31] = int32((in[26] >> 5)) + out[30] +} + +func deltaunpack_int32_28(initoffset int32, in *[28]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0xFFFFFFF) + initoffset + out[1] = int32(((in[0] >> 28) | ((in[1] & 0xFFFFFF) << 4))) + out[0] + out[2] = int32(((in[1] >> 24) | ((in[2] & 0xFFFFF) << 8))) + out[1] + out[3] = int32(((in[2] >> 20) | ((in[3] & 0xFFFF) << 12))) + out[2] + out[4] = int32(((in[3] >> 16) | ((in[4] & 0xFFF) << 16))) + out[3] + out[5] = int32(((in[4] >> 12) | ((in[5] & 0xFF) << 20))) + out[4] + out[6] = int32(((in[5] >> 8) | ((in[6] & 0xF) << 24))) + out[5] + out[7] = int32((in[6] >> 4)) + out[6] + out[8] = int32((in[7] >> 0) & 0xFFFFFFF) + out[7] + out[9] = int32(((in[7] >> 28) | ((in[8] & 0xFFFFFF) << 4))) + out[8] + out[10] = int32(((in[8] >> 24) | ((in[9] & 0xFFFFF) << 8))) + out[9] + out[11] = int32(((in[9] >> 20) | ((in[10] & 0xFFFF) << 12))) + out[10] + out[12] = int32(((in[10] >> 16) | ((in[11] & 0xFFF) << 16))) + out[11] + out[13] = int32(((in[11] >> 12) | ((in[12] & 0xFF) << 20))) + out[12] + out[14] = int32(((in[12] >> 8) | ((in[13] & 0xF) << 24))) + out[13] + out[15] = int32((in[13] >> 4)) + out[14] + out[16] = int32((in[14] >> 0) & 0xFFFFFFF) + out[15] + out[17] = int32(((in[14] >> 28) | ((in[15] & 0xFFFFFF) << 4))) + out[16] + out[18] = int32(((in[15] >> 24) | ((in[16] & 0xFFFFF) << 8))) + out[17] + out[19] = int32(((in[16] >> 20) | ((in[17] & 0xFFFF) << 12))) + out[18] + out[20] = int32(((in[17] >> 16) | ((in[18] & 0xFFF) << 16))) + out[19] + out[21] = int32(((in[18] >> 12) | ((in[19] & 0xFF) << 20))) + out[20] + out[22] = int32(((in[19] >> 8) | ((in[20] & 0xF) << 24))) + out[21] + out[23] = int32((in[20] >> 4)) + out[22] + out[24] = int32((in[21] >> 0) & 0xFFFFFFF) + out[23] + out[25] = int32(((in[21] >> 28) | ((in[22] & 0xFFFFFF) << 4))) + out[24] + out[26] = int32(((in[22] >> 24) | ((in[23] & 0xFFFFF) << 8))) + out[25] + out[27] = int32(((in[23] >> 20) | ((in[24] & 0xFFFF) << 12))) + out[26] + out[28] = int32(((in[24] >> 16) | ((in[25] & 0xFFF) << 16))) + out[27] + out[29] = int32(((in[25] >> 12) | ((in[26] & 0xFF) << 20))) + out[28] + out[30] = int32(((in[26] >> 8) | ((in[27] & 0xF) << 24))) + out[29] + out[31] = int32((in[27] >> 4)) + out[30] +} + +func deltaunpack_int32_29(initoffset int32, in *[29]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x1FFFFFFF) + initoffset + out[1] = int32(((in[0] >> 29) | ((in[1] & 0x3FFFFFF) << 3))) + out[0] + out[2] = int32(((in[1] >> 26) | ((in[2] & 0x7FFFFF) << 6))) + out[1] + out[3] = int32(((in[2] >> 23) | ((in[3] & 0xFFFFF) << 9))) + out[2] + out[4] = int32(((in[3] >> 20) | ((in[4] & 0x1FFFF) << 12))) + out[3] + out[5] = int32(((in[4] >> 17) | ((in[5] & 0x3FFF) << 15))) + out[4] + out[6] = int32(((in[5] >> 14) | ((in[6] & 0x7FF) << 18))) + out[5] + out[7] = int32(((in[6] >> 11) | ((in[7] & 0xFF) << 21))) + out[6] + out[8] = int32(((in[7] >> 8) | ((in[8] & 0x1F) << 24))) + out[7] + out[9] = int32(((in[8] >> 5) | ((in[9] & 0x3) << 27))) + out[8] + out[10] = int32((in[9] >> 2) & 0x1FFFFFFF) + out[9] + out[11] = int32(((in[9] >> 31) | ((in[10] & 0xFFFFFFF) << 1))) + out[10] + out[12] = int32(((in[10] >> 28) | ((in[11] & 0x1FFFFFF) << 4))) + out[11] + out[13] = int32(((in[11] >> 25) | ((in[12] & 0x3FFFFF) << 7))) + out[12] + out[14] = int32(((in[12] >> 22) | ((in[13] & 0x7FFFF) << 10))) + out[13] + out[15] = int32(((in[13] >> 19) | ((in[14] & 0xFFFF) << 13))) + out[14] + out[16] = int32(((in[14] >> 16) | ((in[15] & 0x1FFF) << 16))) + out[15] + out[17] = int32(((in[15] >> 13) | ((in[16] & 0x3FF) << 19))) + out[16] + out[18] = int32(((in[16] >> 10) | ((in[17] & 0x7F) << 22))) + out[17] + out[19] = int32(((in[17] >> 7) | ((in[18] & 0xF) << 25))) + out[18] + out[20] = int32(((in[18] >> 4) | ((in[19] & 0x1) << 28))) + out[19] + out[21] = int32((in[19] >> 1) & 0x1FFFFFFF) + out[20] + out[22] = int32(((in[19] >> 30) | ((in[20] & 0x7FFFFFF) << 2))) + out[21] + out[23] = int32(((in[20] >> 27) | ((in[21] & 0xFFFFFF) << 5))) + out[22] + out[24] = int32(((in[21] >> 24) | ((in[22] & 0x1FFFFF) << 8))) + out[23] + out[25] = int32(((in[22] >> 21) | ((in[23] & 0x3FFFF) << 11))) + out[24] + out[26] = int32(((in[23] >> 18) | ((in[24] & 0x7FFF) << 14))) + out[25] + out[27] = int32(((in[24] >> 15) | ((in[25] & 0xFFF) << 17))) + out[26] + out[28] = int32(((in[25] >> 12) | ((in[26] & 0x1FF) << 20))) + out[27] + out[29] = int32(((in[26] >> 9) | ((in[27] & 0x3F) << 23))) + out[28] + out[30] = int32(((in[27] >> 6) | ((in[28] & 0x7) << 26))) + out[29] + out[31] = int32((in[28] >> 3)) + out[30] +} + +func deltaunpack_int32_30(initoffset int32, in *[30]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x3FFFFFFF) + initoffset + out[1] = int32(((in[0] >> 30) | ((in[1] & 0xFFFFFFF) << 2))) + out[0] + out[2] = int32(((in[1] >> 28) | ((in[2] & 0x3FFFFFF) << 4))) + out[1] + out[3] = int32(((in[2] >> 26) | ((in[3] & 0xFFFFFF) << 6))) + out[2] + out[4] = int32(((in[3] >> 24) | ((in[4] & 0x3FFFFF) << 8))) + out[3] + out[5] = int32(((in[4] >> 22) | ((in[5] & 0xFFFFF) << 10))) + out[4] + out[6] = int32(((in[5] >> 20) | ((in[6] & 0x3FFFF) << 12))) + out[5] + out[7] = int32(((in[6] >> 18) | ((in[7] & 0xFFFF) << 14))) + out[6] + out[8] = int32(((in[7] >> 16) | ((in[8] & 0x3FFF) << 16))) + out[7] + out[9] = int32(((in[8] >> 14) | ((in[9] & 0xFFF) << 18))) + out[8] + out[10] = int32(((in[9] >> 12) | ((in[10] & 0x3FF) << 20))) + out[9] + out[11] = int32(((in[10] >> 10) | ((in[11] & 0xFF) << 22))) + out[10] + out[12] = int32(((in[11] >> 8) | ((in[12] & 0x3F) << 24))) + out[11] + out[13] = int32(((in[12] >> 6) | ((in[13] & 0xF) << 26))) + out[12] + out[14] = int32(((in[13] >> 4) | ((in[14] & 0x3) << 28))) + out[13] + out[15] = int32((in[14] >> 2)) + out[14] + out[16] = int32((in[15] >> 0) & 0x3FFFFFFF) + out[15] + out[17] = int32(((in[15] >> 30) | ((in[16] & 0xFFFFFFF) << 2))) + out[16] + out[18] = int32(((in[16] >> 28) | ((in[17] & 0x3FFFFFF) << 4))) + out[17] + out[19] = int32(((in[17] >> 26) | ((in[18] & 0xFFFFFF) << 6))) + out[18] + out[20] = int32(((in[18] >> 24) | ((in[19] & 0x3FFFFF) << 8))) + out[19] + out[21] = int32(((in[19] >> 22) | ((in[20] & 0xFFFFF) << 10))) + out[20] + out[22] = int32(((in[20] >> 20) | ((in[21] & 0x3FFFF) << 12))) + out[21] + out[23] = int32(((in[21] >> 18) | ((in[22] & 0xFFFF) << 14))) + out[22] + out[24] = int32(((in[22] >> 16) | ((in[23] & 0x3FFF) << 16))) + out[23] + out[25] = int32(((in[23] >> 14) | ((in[24] & 0xFFF) << 18))) + out[24] + out[26] = int32(((in[24] >> 12) | ((in[25] & 0x3FF) << 20))) + out[25] + out[27] = int32(((in[25] >> 10) | ((in[26] & 0xFF) << 22))) + out[26] + out[28] = int32(((in[26] >> 8) | ((in[27] & 0x3F) << 24))) + out[27] + out[29] = int32(((in[27] >> 6) | ((in[28] & 0xF) << 26))) + out[28] + out[30] = int32(((in[28] >> 4) | ((in[29] & 0x3) << 28))) + out[29] + out[31] = int32((in[29] >> 2)) + out[30] +} + +func deltaunpack_int32_31(initoffset int32, in *[31]uint32, out *[32]int32) { + out[0] = int32((in[0] >> 0) & 0x7FFFFFFF) + initoffset + out[1] = int32(((in[0] >> 31) | ((in[1] & 0x3FFFFFFF) << 1))) + out[0] + out[2] = int32(((in[1] >> 30) | ((in[2] & 0x1FFFFFFF) << 2))) + out[1] + out[3] = int32(((in[2] >> 29) | ((in[3] & 0xFFFFFFF) << 3))) + out[2] + out[4] = int32(((in[3] >> 28) | ((in[4] & 0x7FFFFFF) << 4))) + out[3] + out[5] = int32(((in[4] >> 27) | ((in[5] & 0x3FFFFFF) << 5))) + out[4] + out[6] = int32(((in[5] >> 26) | ((in[6] & 0x1FFFFFF) << 6))) + out[5] + out[7] = int32(((in[6] >> 25) | ((in[7] & 0xFFFFFF) << 7))) + out[6] + out[8] = int32(((in[7] >> 24) | ((in[8] & 0x7FFFFF) << 8))) + out[7] + out[9] = int32(((in[8] >> 23) | ((in[9] & 0x3FFFFF) << 9))) + out[8] + out[10] = int32(((in[9] >> 22) | ((in[10] & 0x1FFFFF) << 10))) + out[9] + out[11] = int32(((in[10] >> 21) | ((in[11] & 0xFFFFF) << 11))) + out[10] + out[12] = int32(((in[11] >> 20) | ((in[12] & 0x7FFFF) << 12))) + out[11] + out[13] = int32(((in[12] >> 19) | ((in[13] & 0x3FFFF) << 13))) + out[12] + out[14] = int32(((in[13] >> 18) | ((in[14] & 0x1FFFF) << 14))) + out[13] + out[15] = int32(((in[14] >> 17) | ((in[15] & 0xFFFF) << 15))) + out[14] + out[16] = int32(((in[15] >> 16) | ((in[16] & 0x7FFF) << 16))) + out[15] + out[17] = int32(((in[16] >> 15) | ((in[17] & 0x3FFF) << 17))) + out[16] + out[18] = int32(((in[17] >> 14) | ((in[18] & 0x1FFF) << 18))) + out[17] + out[19] = int32(((in[18] >> 13) | ((in[19] & 0xFFF) << 19))) + out[18] + out[20] = int32(((in[19] >> 12) | ((in[20] & 0x7FF) << 20))) + out[19] + out[21] = int32(((in[20] >> 11) | ((in[21] & 0x3FF) << 21))) + out[20] + out[22] = int32(((in[21] >> 10) | ((in[22] & 0x1FF) << 22))) + out[21] + out[23] = int32(((in[22] >> 9) | ((in[23] & 0xFF) << 23))) + out[22] + out[24] = int32(((in[23] >> 8) | ((in[24] & 0x7F) << 24))) + out[23] + out[25] = int32(((in[24] >> 7) | ((in[25] & 0x3F) << 25))) + out[24] + out[26] = int32(((in[25] >> 6) | ((in[26] & 0x1F) << 26))) + out[25] + out[27] = int32(((in[26] >> 5) | ((in[27] & 0xF) << 27))) + out[26] + out[28] = int32(((in[27] >> 4) | ((in[28] & 0x7) << 28))) + out[27] + out[29] = int32(((in[28] >> 3) | ((in[29] & 0x3) << 29))) + out[28] + out[30] = int32(((in[29] >> 2) | ((in[30] & 0x1) << 30))) + out[29] + out[31] = int32((in[30] >> 1)) + out[30] +} + +// --- zigzag + +// deltaPackZigzag_int32 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first, the difference is zigzag encoded. +// Caller must give the proper `bitlen` of the block +func deltaPackZigzag_int32(initoffset int32, in []int32, out []uint32, bitlen int) { + switch bitlen { + case 0: + deltapackzigzag_int32_0(initoffset, (*[32]int32)(in), (*[0]uint32)(out)) + case 1: + deltapackzigzag_int32_1(initoffset, (*[32]int32)(in), (*[1]uint32)(out)) + case 2: + deltapackzigzag_int32_2(initoffset, (*[32]int32)(in), (*[2]uint32)(out)) + case 3: + deltapackzigzag_int32_3(initoffset, (*[32]int32)(in), (*[3]uint32)(out)) + case 4: + deltapackzigzag_int32_4(initoffset, (*[32]int32)(in), (*[4]uint32)(out)) + case 5: + deltapackzigzag_int32_5(initoffset, (*[32]int32)(in), (*[5]uint32)(out)) + case 6: + deltapackzigzag_int32_6(initoffset, (*[32]int32)(in), (*[6]uint32)(out)) + case 7: + deltapackzigzag_int32_7(initoffset, (*[32]int32)(in), (*[7]uint32)(out)) + case 8: + deltapackzigzag_int32_8(initoffset, (*[32]int32)(in), (*[8]uint32)(out)) + case 9: + deltapackzigzag_int32_9(initoffset, (*[32]int32)(in), (*[9]uint32)(out)) + case 10: + deltapackzigzag_int32_10(initoffset, (*[32]int32)(in), (*[10]uint32)(out)) + case 11: + deltapackzigzag_int32_11(initoffset, (*[32]int32)(in), (*[11]uint32)(out)) + case 12: + deltapackzigzag_int32_12(initoffset, (*[32]int32)(in), (*[12]uint32)(out)) + case 13: + deltapackzigzag_int32_13(initoffset, (*[32]int32)(in), (*[13]uint32)(out)) + case 14: + deltapackzigzag_int32_14(initoffset, (*[32]int32)(in), (*[14]uint32)(out)) + case 15: + deltapackzigzag_int32_15(initoffset, (*[32]int32)(in), (*[15]uint32)(out)) + case 16: + deltapackzigzag_int32_16(initoffset, (*[32]int32)(in), (*[16]uint32)(out)) + case 17: + deltapackzigzag_int32_17(initoffset, (*[32]int32)(in), (*[17]uint32)(out)) + case 18: + deltapackzigzag_int32_18(initoffset, (*[32]int32)(in), (*[18]uint32)(out)) + case 19: + deltapackzigzag_int32_19(initoffset, (*[32]int32)(in), (*[19]uint32)(out)) + case 20: + deltapackzigzag_int32_20(initoffset, (*[32]int32)(in), (*[20]uint32)(out)) + case 21: + deltapackzigzag_int32_21(initoffset, (*[32]int32)(in), (*[21]uint32)(out)) + case 22: + deltapackzigzag_int32_22(initoffset, (*[32]int32)(in), (*[22]uint32)(out)) + case 23: + deltapackzigzag_int32_23(initoffset, (*[32]int32)(in), (*[23]uint32)(out)) + case 24: + deltapackzigzag_int32_24(initoffset, (*[32]int32)(in), (*[24]uint32)(out)) + case 25: + deltapackzigzag_int32_25(initoffset, (*[32]int32)(in), (*[25]uint32)(out)) + case 26: + deltapackzigzag_int32_26(initoffset, (*[32]int32)(in), (*[26]uint32)(out)) + case 27: + deltapackzigzag_int32_27(initoffset, (*[32]int32)(in), (*[27]uint32)(out)) + case 28: + deltapackzigzag_int32_28(initoffset, (*[32]int32)(in), (*[28]uint32)(out)) + case 29: + deltapackzigzag_int32_29(initoffset, (*[32]int32)(in), (*[29]uint32)(out)) + case 30: + deltapackzigzag_int32_30(initoffset, (*[32]int32)(in), (*[30]uint32)(out)) + case 31: + deltapackzigzag_int32_31(initoffset, (*[32]int32)(in), (*[31]uint32)(out)) + case 32: + *(*[32]uint32)(out) = *((*[32]uint32)(unsafe.Pointer((*[32]int32)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpackZigzag_int32 Decoding operation for DeltaPackZigzag_int32 +func deltaUnpackZigzag_int32(initoffset int32, in []uint32, out []int32, bitlen int) { + switch bitlen { + case 0: + deltaunpackzigzag_int32_0(initoffset, (*[0]uint32)(in), (*[32]int32)(out)) + case 1: + deltaunpackzigzag_int32_1(initoffset, (*[1]uint32)(in), (*[32]int32)(out)) + case 2: + deltaunpackzigzag_int32_2(initoffset, (*[2]uint32)(in), (*[32]int32)(out)) + case 3: + deltaunpackzigzag_int32_3(initoffset, (*[3]uint32)(in), (*[32]int32)(out)) + case 4: + deltaunpackzigzag_int32_4(initoffset, (*[4]uint32)(in), (*[32]int32)(out)) + case 5: + deltaunpackzigzag_int32_5(initoffset, (*[5]uint32)(in), (*[32]int32)(out)) + case 6: + deltaunpackzigzag_int32_6(initoffset, (*[6]uint32)(in), (*[32]int32)(out)) + case 7: + deltaunpackzigzag_int32_7(initoffset, (*[7]uint32)(in), (*[32]int32)(out)) + case 8: + deltaunpackzigzag_int32_8(initoffset, (*[8]uint32)(in), (*[32]int32)(out)) + case 9: + deltaunpackzigzag_int32_9(initoffset, (*[9]uint32)(in), (*[32]int32)(out)) + case 10: + deltaunpackzigzag_int32_10(initoffset, (*[10]uint32)(in), (*[32]int32)(out)) + case 11: + deltaunpackzigzag_int32_11(initoffset, (*[11]uint32)(in), (*[32]int32)(out)) + case 12: + deltaunpackzigzag_int32_12(initoffset, (*[12]uint32)(in), (*[32]int32)(out)) + case 13: + deltaunpackzigzag_int32_13(initoffset, (*[13]uint32)(in), (*[32]int32)(out)) + case 14: + deltaunpackzigzag_int32_14(initoffset, (*[14]uint32)(in), (*[32]int32)(out)) + case 15: + deltaunpackzigzag_int32_15(initoffset, (*[15]uint32)(in), (*[32]int32)(out)) + case 16: + deltaunpackzigzag_int32_16(initoffset, (*[16]uint32)(in), (*[32]int32)(out)) + case 17: + deltaunpackzigzag_int32_17(initoffset, (*[17]uint32)(in), (*[32]int32)(out)) + case 18: + deltaunpackzigzag_int32_18(initoffset, (*[18]uint32)(in), (*[32]int32)(out)) + case 19: + deltaunpackzigzag_int32_19(initoffset, (*[19]uint32)(in), (*[32]int32)(out)) + case 20: + deltaunpackzigzag_int32_20(initoffset, (*[20]uint32)(in), (*[32]int32)(out)) + case 21: + deltaunpackzigzag_int32_21(initoffset, (*[21]uint32)(in), (*[32]int32)(out)) + case 22: + deltaunpackzigzag_int32_22(initoffset, (*[22]uint32)(in), (*[32]int32)(out)) + case 23: + deltaunpackzigzag_int32_23(initoffset, (*[23]uint32)(in), (*[32]int32)(out)) + case 24: + deltaunpackzigzag_int32_24(initoffset, (*[24]uint32)(in), (*[32]int32)(out)) + case 25: + deltaunpackzigzag_int32_25(initoffset, (*[25]uint32)(in), (*[32]int32)(out)) + case 26: + deltaunpackzigzag_int32_26(initoffset, (*[26]uint32)(in), (*[32]int32)(out)) + case 27: + deltaunpackzigzag_int32_27(initoffset, (*[27]uint32)(in), (*[32]int32)(out)) + case 28: + deltaunpackzigzag_int32_28(initoffset, (*[28]uint32)(in), (*[32]int32)(out)) + case 29: + deltaunpackzigzag_int32_29(initoffset, (*[29]uint32)(in), (*[32]int32)(out)) + case 30: + deltaunpackzigzag_int32_30(initoffset, (*[30]uint32)(in), (*[32]int32)(out)) + case 31: + deltaunpackzigzag_int32_31(initoffset, (*[31]uint32)(in), (*[32]int32)(out)) + case 32: + *(*[32]int32)(out) = *(*[32]int32)(unsafe.Pointer((*[32]uint32)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapackzigzag_int32_0(initoffset int32, in *[32]int32, out *[0]uint32) { +} + +func deltapackzigzag_int32_1(initoffset int32, in *[32]int32, out *[1]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 1) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 2) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 3) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 4) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 5) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 6) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 7) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 9) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 10) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 11) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 12) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 13) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 14) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 15) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 17) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 18) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 19) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 20) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 21) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 22) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 23) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 25) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 26) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 27) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 28) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 29) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 30) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 31) +} + +func deltapackzigzag_int32_2(initoffset int32, in *[32]int32, out *[2]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 2) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 4) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 6) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 8) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 10) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 12) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 14) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 18) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 20) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 22) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 24) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 26) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 28) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 30) + out[1] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 2) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 4) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 6) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 8) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 10) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 12) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 14) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 18) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 20) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 22) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 24) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 26) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 28) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 30) +} + +func deltapackzigzag_int32_3(initoffset int32, in *[32]int32, out *[3]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 3) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 6) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 9) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 12) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 15) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 18) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 21) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 27) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 30) + out[1] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 2 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 1) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 4) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 7) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 10) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 13) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 19) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 22) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 25) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 28) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 31) + out[2] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 1 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 2) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 5) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 11) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 14) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 17) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 20) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 23) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 26) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 29) +} + +func deltapackzigzag_int32_4(initoffset int32, in *[32]int32, out *[4]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 4) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 8) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 12) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 16) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 20) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 24) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 28) + out[1] = + uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31)) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 4) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 8) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 12) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 16) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 20) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 24) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 28) + out[2] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 4) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 8) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 12) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 16) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 20) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 24) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 28) + out[3] = + uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31)) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 4) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 8) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 12) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 16) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 20) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 24) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 28) +} + +func deltapackzigzag_int32_5(initoffset int32, in *[32]int32, out *[5]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 5) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 10) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 15) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 20) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 25) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 30) + out[1] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 2 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 3) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 13) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 18) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 23) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 28) + out[2] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 4 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 1) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 6) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 11) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 21) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 26) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 31) + out[3] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 1 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 4) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 9) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 14) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 19) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 29) + out[4] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 3 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 2) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 7) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 12) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 17) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 22) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 27) +} + +func deltapackzigzag_int32_6(initoffset int32, in *[32]int32, out *[6]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 6) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 12) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 18) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 24) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 30) + out[1] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 2 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 4) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 10) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 22) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 28) + out[2] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 4 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 2) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 8) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 14) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 20) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 26) + out[3] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 6) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 12) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 18) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 24) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 30) + out[4] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 2 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 4) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 10) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 22) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 28) + out[5] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 4 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 2) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 8) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 14) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 20) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 26) +} + +func deltapackzigzag_int32_7(initoffset int32, in *[32]int32, out *[7]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 7) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 14) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 21) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 28) + out[1] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 4 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 3) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 10) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 17) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 31) + out[2] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 1 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 6) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 13) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 20) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 27) + out[3] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 5 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 2) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 9) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 23) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 30) + out[4] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 2 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 5) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 12) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 19) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 26) + out[5] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 6 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 1) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 15) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 22) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 29) + out[6] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 3 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 4) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 11) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 18) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 25) +} + +func deltapackzigzag_int32_8(initoffset int32, in *[32]int32, out *[8]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 8) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 16) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 24) + out[1] = + uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31)) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 8) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 16) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 24) + out[2] = + uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31)) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 8) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 16) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 24) + out[3] = + uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31)) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 8) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 16) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 24) + out[4] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 8) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 16) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 24) + out[5] = + uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31)) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 8) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 16) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 24) + out[6] = + uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31)) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 8) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 16) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 24) + out[7] = + uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31)) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 8) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 16) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 24) +} + +func deltapackzigzag_int32_9(initoffset int32, in *[32]int32, out *[9]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 9) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 18) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 27) + out[1] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 5 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 4) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 13) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 22) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 31) + out[2] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 1 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 17) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 26) + out[3] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 6 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 3) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 12) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 21) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 30) + out[4] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 2 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 7) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 25) + out[5] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 7 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 2) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 11) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 20) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 29) + out[6] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 3 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 6) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 15) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) + out[7] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 8 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 1) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 10) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 19) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 28) + out[8] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 4 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 5) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 14) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 23) +} + +func deltapackzigzag_int32_10(initoffset int32, in *[32]int32, out *[10]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 10) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 20) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 30) + out[1] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 2 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 8) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 18) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 28) + out[2] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 4 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 6) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 26) + out[3] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 6 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 4) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 14) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 24) + out[4] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 8 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 2) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 12) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 22) + out[5] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 10) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 20) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 30) + out[6] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 2 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 8) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 18) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 28) + out[7] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 4 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 6) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 26) + out[8] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 6 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 4) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 14) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 24) + out[9] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 8 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 2) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 12) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 22) +} + +func deltapackzigzag_int32_11(initoffset int32, in *[32]int32, out *[11]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 11) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 22) + out[1] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 10 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 1) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 12) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 23) + out[2] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 9 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 2) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 13) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) + out[3] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 8 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 3) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 14) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 25) + out[4] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 7 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 4) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 15) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 26) + out[5] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 6 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 5) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 27) + out[6] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 5 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 6) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 17) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 28) + out[7] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 4 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 7) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 18) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 29) + out[8] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 3 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 19) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 30) + out[9] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 2 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 9) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 20) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 31) + out[10] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 1 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 10) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 21) +} + +func deltapackzigzag_int32_12(initoffset int32, in *[32]int32, out *[12]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 12) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 24) + out[1] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 8 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 4) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 16) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 28) + out[2] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 4 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 8) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 20) + out[3] = + uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31)) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 12) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 24) + out[4] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 8 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 4) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 16) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 28) + out[5] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 4 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 8) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 20) + out[6] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 12) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 24) + out[7] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 8 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 4) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 16) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 28) + out[8] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 4 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 8) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 20) + out[9] = + uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31)) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 12) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 24) + out[10] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 8 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 4) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 16) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 28) + out[11] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 4 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 8) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 20) +} + +func deltapackzigzag_int32_13(initoffset int32, in *[32]int32, out *[13]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 13) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 26) + out[1] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 6 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 7) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 20) + out[2] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 12 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 1) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 14) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 27) + out[3] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 5 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 21) + out[4] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 11 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 2) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 15) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 28) + out[5] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 4 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 9) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 22) + out[6] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 10 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 3) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 29) + out[7] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 3 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 10) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 23) + out[8] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 9 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 4) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 17) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 30) + out[9] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 2 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 11) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) + out[10] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 8 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 5) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 18) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 31) + out[11] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 1 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 12) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 25) + out[12] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 7 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 6) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 19) +} + +func deltapackzigzag_int32_14(initoffset int32, in *[32]int32, out *[14]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 14) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 28) + out[1] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 4 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 10) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 24) + out[2] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 8 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 6) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 20) + out[3] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 12 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 2) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 30) + out[4] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 2 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 12) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 26) + out[5] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 6 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 8) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 22) + out[6] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 10 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 4) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 18) + out[7] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 14) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 28) + out[8] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 4 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 10) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 24) + out[9] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 8 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 6) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 20) + out[10] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 12 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 2) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 30) + out[11] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 2 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 12) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 26) + out[12] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 6 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 8) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 22) + out[13] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 10 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 4) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 18) +} + +func deltapackzigzag_int32_15(initoffset int32, in *[32]int32, out *[15]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 15) | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 30) + out[1] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 2 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 13) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 28) + out[2] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 4 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 11) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 26) + out[3] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 6 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 9) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) + out[4] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 8 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 7) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 22) + out[5] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 10 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 5) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 20) + out[6] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 12 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 3) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 18) + out[7] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 14 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 1) | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 31) + out[8] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 1 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 14) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 29) + out[9] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 3 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 12) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 27) + out[10] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 5 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 10) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 25) + out[11] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 7 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 23) + out[12] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 9 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 6) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 21) + out[13] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 11 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 4) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 19) + out[14] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 13 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 2) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 17) +} + +func deltapackzigzag_int32_16(initoffset int32, in *[32]int32, out *[16]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 16) + out[1] = + uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31)) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 16) + out[2] = + uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31)) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 16) + out[3] = + uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31)) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 16) + out[4] = + uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31)) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 16) + out[5] = + uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31)) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 16) + out[6] = + uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31)) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 16) + out[7] = + uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31)) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 16) + out[8] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 16) + out[9] = + uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31)) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 16) + out[10] = + uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31)) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 16) + out[11] = + uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31)) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 16) + out[12] = + uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31)) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 16) + out[13] = + uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31)) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 16) + out[14] = + uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31)) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 16) + out[15] = + uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31)) | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 16) +} + +func deltapackzigzag_int32_17(initoffset int32, in *[32]int32, out *[17]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 17) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 15 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 2) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 19) + out[2] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 13 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 4) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 21) + out[3] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 11 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 6) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 23) + out[4] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 9 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 25) + out[5] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 7 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 10) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 27) + out[6] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 5 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 12) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 29) + out[7] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 3 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 14) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 31) + out[8] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 1 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[9] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 1) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 18) + out[10] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 14 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 3) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 20) + out[11] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 12 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 5) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 22) + out[12] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 10 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 7) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) + out[13] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 8 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 9) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 26) + out[14] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 6 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 11) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 28) + out[15] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 4 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 13) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 30) + out[16] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 2 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 15) +} + +func deltapackzigzag_int32_18(initoffset int32, in *[32]int32, out *[18]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 18) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 14 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 4) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 22) + out[2] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 10 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 8) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 26) + out[3] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 6 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 12) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 30) + out[4] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 2 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) + out[5] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 16 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 2) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 20) + out[6] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 12 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 6) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 24) + out[7] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 8 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 10) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 28) + out[8] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 4 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 14) + out[9] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 18) + out[10] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 14 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 4) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 22) + out[11] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 10 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 8) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 26) + out[12] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 6 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 12) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 30) + out[13] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 2 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) + out[14] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 16 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 2) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 20) + out[15] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 12 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 6) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 24) + out[16] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 8 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 10) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 28) + out[17] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 4 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 14) +} + +func deltapackzigzag_int32_19(initoffset int32, in *[32]int32, out *[19]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 19) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 13 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 6) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 25) + out[2] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 7 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 12) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 31) + out[3] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 1 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 18) + out[4] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 14 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 5) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) + out[5] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 8 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 11) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 30) + out[6] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 2 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 17) + out[7] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 15 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 4) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 23) + out[8] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 9 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 10) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 29) + out[9] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 3 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[10] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 3) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 22) + out[11] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 10 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 9) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 28) + out[12] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 4 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 15) + out[13] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 17 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 2) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 21) + out[14] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 11 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 27) + out[15] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 5 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 14) + out[16] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 18 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 1) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 20) + out[17] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 12 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 7) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 26) + out[18] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 6 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 13) +} + +func deltapackzigzag_int32_20(initoffset int32, in *[32]int32, out *[20]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 20) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 12 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 8) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 28) + out[2] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 4 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 16) + out[3] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 16 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 4) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 24) + out[4] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 8 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 12) + out[5] = + uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31)) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 20) + out[6] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 12 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 8) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 28) + out[7] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 4 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 16) + out[8] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 16 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 4) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 24) + out[9] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 8 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 12) + out[10] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 20) + out[11] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 12 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 8) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 28) + out[12] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 4 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 16) + out[13] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 16 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 4) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 24) + out[14] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 8 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 12) + out[15] = + uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31)) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 20) + out[16] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 12 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 8) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 28) + out[17] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 4 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 16) + out[18] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 16 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 4) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 24) + out[19] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 8 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 12) +} + +func deltapackzigzag_int32_21(initoffset int32, in *[32]int32, out *[21]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 21) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 11 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 10) | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 31) + out[2] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 1 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 20) + out[3] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 12 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 9) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 30) + out[4] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 2 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 19) + out[5] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 13 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 29) + out[6] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 3 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 18) + out[7] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 14 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 7) | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 28) + out[8] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 4 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 17) + out[9] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 15 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 6) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 27) + out[10] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 5 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[11] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 5) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 26) + out[12] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 6 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 15) + out[13] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 17 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 4) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 25) + out[14] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 7 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 14) + out[15] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 18 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 3) | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) + out[16] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 8 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 13) + out[17] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 19 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 2) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 23) + out[18] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 9 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 12) + out[19] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 20 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 1) | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 22) + out[20] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 10 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 11) +} + +func deltapackzigzag_int32_22(initoffset int32, in *[32]int32, out *[22]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 22) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 10 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 12) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 20 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 2) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 24) + out[3] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 8 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 14) + out[4] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 18 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 4) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 26) + out[5] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 6 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) + out[6] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 16 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 6) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 28) + out[7] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 4 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 18) + out[8] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 14 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 8) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 30) + out[9] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 2 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 20) + out[10] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 12 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 10) + out[11] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 22) + out[12] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 10 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 12) + out[13] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 20 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 2) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 24) + out[14] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 8 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 14) + out[15] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 18 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 4) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 26) + out[16] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 6 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) + out[17] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 16 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 6) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 28) + out[18] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 4 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 18) + out[19] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 14 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 8) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 30) + out[20] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 2 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 20) + out[21] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 12 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 10) +} + +func deltapackzigzag_int32_23(initoffset int32, in *[32]int32, out *[23]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 23) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 9 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 14) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 18 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 5) | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 28) + out[3] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 4 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 19) + out[4] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 13 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 10) + out[5] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 22 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 1) | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) + out[6] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 8 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 15) + out[7] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 17 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 6) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 29) + out[8] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 3 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 20) + out[9] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 12 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 11) + out[10] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 21 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 2) | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 25) + out[11] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 7 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[12] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 7) | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 30) + out[13] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 2 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 21) + out[14] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 11 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 12) + out[15] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 20 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 3) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 26) + out[16] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 6 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 17) + out[17] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 15 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 31) + out[18] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 1 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 22) + out[19] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 10 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 13) + out[20] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 19 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 4) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 27) + out[21] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 5 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 18) + out[22] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 14 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 9) +} + +func deltapackzigzag_int32_24(initoffset int32, in *[32]int32, out *[24]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 24) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 8 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 16) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 16 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 8) + out[3] = + uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31)) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 24) + out[4] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 8 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 16) + out[5] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 16 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 8) + out[6] = + uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31)) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 24) + out[7] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 8 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 16) + out[8] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 16 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 8) + out[9] = + uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31)) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 24) + out[10] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 8 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 16) + out[11] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 16 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 8) + out[12] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 24) + out[13] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 8 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 16) + out[14] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 16 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 8) + out[15] = + uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31)) | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 24) + out[16] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 8 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 16) + out[17] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 16 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 8) + out[18] = + uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31)) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 24) + out[19] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 8 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 16) + out[20] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 16 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 8) + out[21] = + uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31)) | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 24) + out[22] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 8 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 16) + out[23] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 16 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 8) +} + +func deltapackzigzag_int32_25(initoffset int32, in *[32]int32, out *[25]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 25) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 7 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 18) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 14 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 11) + out[3] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 21 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 4) | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 29) + out[4] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 3 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 22) + out[5] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 10 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 15) + out[6] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 17 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) + out[7] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 24 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 1) | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 26) + out[8] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 6 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 19) + out[9] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 13 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 12) + out[10] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 20 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 5) | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 30) + out[11] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 2 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 23) + out[12] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 9 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[13] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 9) + out[14] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 23 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 2) | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 27) + out[15] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 5 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 20) + out[16] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 12 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 13) + out[17] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 19 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 6) | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 31) + out[18] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 1 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) + out[19] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 8 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 17) + out[20] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 15 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 10) + out[21] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 22 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 3) | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 28) + out[22] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 4 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 21) + out[23] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 11 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 14) + out[24] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 18 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 7) +} + +func deltapackzigzag_int32_26(initoffset int32, in *[32]int32, out *[26]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 26) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 6 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 20) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 12 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 14) + out[3] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 18 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 8) + out[4] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 24 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 2) | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 28) + out[5] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 4 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 22) + out[6] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 10 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) + out[7] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 16 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 10) + out[8] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 22 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 4) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 30) + out[9] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 2 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 24) + out[10] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 8 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 18) + out[11] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 14 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 12) + out[12] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 20 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 6) + out[13] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 26) + out[14] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 6 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 20) + out[15] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 12 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 14) + out[16] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 18 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 8) + out[17] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 24 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 2) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 28) + out[18] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 4 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 22) + out[19] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 10 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) + out[20] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 16 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 10) + out[21] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 22 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 4) | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 30) + out[22] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 2 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 24) + out[23] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 8 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 18) + out[24] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 14 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 12) + out[25] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 20 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 6) +} + +func deltapackzigzag_int32_27(initoffset int32, in *[32]int32, out *[27]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 27) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 5 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 22) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 10 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 17) + out[3] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 15 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 12) + out[4] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 20 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 7) + out[5] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 25 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 2) | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 29) + out[6] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 3 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) + out[7] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 8 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 19) + out[8] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 13 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 14) + out[9] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 18 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 9) + out[10] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 23 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 4) | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 31) + out[11] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 1 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 26) + out[12] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 6 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 21) + out[13] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 11 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[14] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 11) + out[15] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 21 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 6) + out[16] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 26 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 1) | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 28) + out[17] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 4 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 23) + out[18] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 9 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 18) + out[19] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 14 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 13) + out[20] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 19 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) + out[21] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 24 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 3) | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 30) + out[22] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 2 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 25) + out[23] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 7 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 20) + out[24] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 12 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 15) + out[25] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 17 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 10) + out[26] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 22 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 5) +} + +func deltapackzigzag_int32_28(initoffset int32, in *[32]int32, out *[28]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 28) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 4 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 24) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 8 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 20) + out[3] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 12 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 16) + out[4] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 16 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 12) + out[5] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 20 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 8) + out[6] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 24 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 4) + out[7] = + uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31)) | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 28) + out[8] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 4 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 24) + out[9] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 8 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 20) + out[10] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 12 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 16) + out[11] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 16 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 12) + out[12] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 20 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 8) + out[13] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 24 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 4) + out[14] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 28) + out[15] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 4 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 24) + out[16] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 8 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 20) + out[17] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 12 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 16) + out[18] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 16 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 12) + out[19] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 20 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 8) + out[20] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 24 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 4) + out[21] = + uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31)) | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 28) + out[22] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 4 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 24) + out[23] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 8 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 20) + out[24] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 12 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 16) + out[25] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 16 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 12) + out[26] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 20 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 8) + out[27] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 24 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 4) +} + +func deltapackzigzag_int32_29(initoffset int32, in *[32]int32, out *[29]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 29) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 3 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 26) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 6 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 23) + out[3] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 9 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 20) + out[4] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 12 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 17) + out[5] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 15 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 14) + out[6] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 18 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 11) + out[7] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 21 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 8) + out[8] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 24 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 5) + out[9] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 27 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 2) | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 31) + out[10] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 1 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 28) + out[11] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 4 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 25) + out[12] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 7 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 22) + out[13] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 10 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 19) + out[14] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 13 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[15] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 13) + out[16] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 19 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 10) + out[17] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 22 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 7) + out[18] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 25 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 4) + out[19] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 28 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 1) | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 30) + out[20] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 2 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 27) + out[21] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 5 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 24) + out[22] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 8 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 21) + out[23] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 11 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 18) + out[24] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 14 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 15) + out[25] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 17 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 12) + out[26] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 20 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 9) + out[27] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 23 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 6) + out[28] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 26 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 3) +} + +func deltapackzigzag_int32_30(initoffset int32, in *[32]int32, out *[30]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 30) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 2 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 28) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 4 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 26) + out[3] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 6 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 24) + out[4] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 8 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 22) + out[5] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 10 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 20) + out[6] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 12 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 18) + out[7] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 14 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 16) + out[8] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 16 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 14) + out[9] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 18 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 12) + out[10] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 20 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 10) + out[11] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 22 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 8) + out[12] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 24 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 6) + out[13] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 26 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 4) + out[14] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 28 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 2) + out[15] = + uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31)) | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 30) + out[16] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 2 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 28) + out[17] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 4 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 26) + out[18] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 6 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 24) + out[19] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 8 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 22) + out[20] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 10 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 20) + out[21] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 12 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 18) + out[22] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 14 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 16) + out[23] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 16 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 14) + out[24] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 18 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 12) + out[25] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 20 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 10) + out[26] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 22 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 8) + out[27] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 24 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 6) + out[28] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 26 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 4) + out[29] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 28 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 2) +} + +func deltapackzigzag_int32_31(initoffset int32, in *[32]int32, out *[31]uint32) { + out[0] = + uint32(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 31)) | + ((uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) << 31) + out[1] = + (uint32(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 31))) >> 1 | + ((uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) << 30) + out[2] = + (uint32(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 31))) >> 2 | + ((uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) << 29) + out[3] = + (uint32(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 31))) >> 3 | + ((uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) << 28) + out[4] = + (uint32(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 31))) >> 4 | + ((uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) << 27) + out[5] = + (uint32(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 31))) >> 5 | + ((uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) << 26) + out[6] = + (uint32(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 31))) >> 6 | + ((uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) << 25) + out[7] = + (uint32(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 31))) >> 7 | + ((uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) << 24) + out[8] = + (uint32(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 31))) >> 8 | + ((uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) << 23) + out[9] = + (uint32(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 31))) >> 9 | + ((uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) << 22) + out[10] = + (uint32(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 31))) >> 10 | + ((uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) << 21) + out[11] = + (uint32(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 31))) >> 11 | + ((uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) << 20) + out[12] = + (uint32(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 31))) >> 12 | + ((uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) << 19) + out[13] = + (uint32(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 31))) >> 13 | + ((uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) << 18) + out[14] = + (uint32(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 31))) >> 14 | + ((uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) << 17) + out[15] = + (uint32(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 31))) >> 15 | + ((uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) << 16) + out[16] = + (uint32(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 31))) >> 16 | + ((uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) << 15) + out[17] = + (uint32(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 31))) >> 17 | + ((uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) << 14) + out[18] = + (uint32(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 31))) >> 18 | + ((uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) << 13) + out[19] = + (uint32(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 31))) >> 19 | + ((uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) << 12) + out[20] = + (uint32(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 31))) >> 20 | + ((uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) << 11) + out[21] = + (uint32(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 31))) >> 21 | + ((uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) << 10) + out[22] = + (uint32(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 31))) >> 22 | + ((uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) << 9) + out[23] = + (uint32(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 31))) >> 23 | + ((uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) << 8) + out[24] = + (uint32(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 31))) >> 24 | + ((uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) << 7) + out[25] = + (uint32(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 31))) >> 25 | + ((uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) << 6) + out[26] = + (uint32(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 31))) >> 26 | + ((uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) << 5) + out[27] = + (uint32(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 31))) >> 27 | + ((uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) << 4) + out[28] = + (uint32(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 31))) >> 28 | + ((uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) << 3) + out[29] = + (uint32(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 31))) >> 29 | + ((uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) << 2) + out[30] = + (uint32(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 31))) >> 30 | + ((uint32(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 31))) << 1) +} + +func deltaunpackzigzag_int32_0(initoffset int32, in *[0]uint32, out *[32]int32) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset +} + +func deltaunpackzigzag_int32_1(initoffset int32, in *[1]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1) & 1))^(((in[0] >> 0) & 0x1)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 1) & 0x1) & 1))^(((in[0] >> 1) & 0x1)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 2) & 0x1) & 1))^(((in[0] >> 2) & 0x1)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 3) & 0x1) & 1))^(((in[0] >> 3) & 0x1)>>1))) + out[2] + out[4] = int32(((-(((in[0] >> 4) & 0x1) & 1))^(((in[0] >> 4) & 0x1)>>1))) + out[3] + out[5] = int32(((-(((in[0] >> 5) & 0x1) & 1))^(((in[0] >> 5) & 0x1)>>1))) + out[4] + out[6] = int32(((-(((in[0] >> 6) & 0x1) & 1))^(((in[0] >> 6) & 0x1)>>1))) + out[5] + out[7] = int32(((-(((in[0] >> 7) & 0x1) & 1))^(((in[0] >> 7) & 0x1)>>1))) + out[6] + out[8] = int32(((-(((in[0] >> 8) & 0x1) & 1))^(((in[0] >> 8) & 0x1)>>1))) + out[7] + out[9] = int32(((-(((in[0] >> 9) & 0x1) & 1))^(((in[0] >> 9) & 0x1)>>1))) + out[8] + out[10] = int32(((-(((in[0] >> 10) & 0x1) & 1))^(((in[0] >> 10) & 0x1)>>1))) + out[9] + out[11] = int32(((-(((in[0] >> 11) & 0x1) & 1))^(((in[0] >> 11) & 0x1)>>1))) + out[10] + out[12] = int32(((-(((in[0] >> 12) & 0x1) & 1))^(((in[0] >> 12) & 0x1)>>1))) + out[11] + out[13] = int32(((-(((in[0] >> 13) & 0x1) & 1))^(((in[0] >> 13) & 0x1)>>1))) + out[12] + out[14] = int32(((-(((in[0] >> 14) & 0x1) & 1))^(((in[0] >> 14) & 0x1)>>1))) + out[13] + out[15] = int32(((-(((in[0] >> 15) & 0x1) & 1))^(((in[0] >> 15) & 0x1)>>1))) + out[14] + out[16] = int32(((-(((in[0] >> 16) & 0x1) & 1))^(((in[0] >> 16) & 0x1)>>1))) + out[15] + out[17] = int32(((-(((in[0] >> 17) & 0x1) & 1))^(((in[0] >> 17) & 0x1)>>1))) + out[16] + out[18] = int32(((-(((in[0] >> 18) & 0x1) & 1))^(((in[0] >> 18) & 0x1)>>1))) + out[17] + out[19] = int32(((-(((in[0] >> 19) & 0x1) & 1))^(((in[0] >> 19) & 0x1)>>1))) + out[18] + out[20] = int32(((-(((in[0] >> 20) & 0x1) & 1))^(((in[0] >> 20) & 0x1)>>1))) + out[19] + out[21] = int32(((-(((in[0] >> 21) & 0x1) & 1))^(((in[0] >> 21) & 0x1)>>1))) + out[20] + out[22] = int32(((-(((in[0] >> 22) & 0x1) & 1))^(((in[0] >> 22) & 0x1)>>1))) + out[21] + out[23] = int32(((-(((in[0] >> 23) & 0x1) & 1))^(((in[0] >> 23) & 0x1)>>1))) + out[22] + out[24] = int32(((-(((in[0] >> 24) & 0x1) & 1))^(((in[0] >> 24) & 0x1)>>1))) + out[23] + out[25] = int32(((-(((in[0] >> 25) & 0x1) & 1))^(((in[0] >> 25) & 0x1)>>1))) + out[24] + out[26] = int32(((-(((in[0] >> 26) & 0x1) & 1))^(((in[0] >> 26) & 0x1)>>1))) + out[25] + out[27] = int32(((-(((in[0] >> 27) & 0x1) & 1))^(((in[0] >> 27) & 0x1)>>1))) + out[26] + out[28] = int32(((-(((in[0] >> 28) & 0x1) & 1))^(((in[0] >> 28) & 0x1)>>1))) + out[27] + out[29] = int32(((-(((in[0] >> 29) & 0x1) & 1))^(((in[0] >> 29) & 0x1)>>1))) + out[28] + out[30] = int32(((-(((in[0] >> 30) & 0x1) & 1))^(((in[0] >> 30) & 0x1)>>1))) + out[29] + out[31] = int32(((-(((in[0] >> 31)) & 1))^(((in[0] >> 31))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_2(initoffset int32, in *[2]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3) & 1))^(((in[0] >> 0) & 0x3)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 2) & 0x3) & 1))^(((in[0] >> 2) & 0x3)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 4) & 0x3) & 1))^(((in[0] >> 4) & 0x3)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 6) & 0x3) & 1))^(((in[0] >> 6) & 0x3)>>1))) + out[2] + out[4] = int32(((-(((in[0] >> 8) & 0x3) & 1))^(((in[0] >> 8) & 0x3)>>1))) + out[3] + out[5] = int32(((-(((in[0] >> 10) & 0x3) & 1))^(((in[0] >> 10) & 0x3)>>1))) + out[4] + out[6] = int32(((-(((in[0] >> 12) & 0x3) & 1))^(((in[0] >> 12) & 0x3)>>1))) + out[5] + out[7] = int32(((-(((in[0] >> 14) & 0x3) & 1))^(((in[0] >> 14) & 0x3)>>1))) + out[6] + out[8] = int32(((-(((in[0] >> 16) & 0x3) & 1))^(((in[0] >> 16) & 0x3)>>1))) + out[7] + out[9] = int32(((-(((in[0] >> 18) & 0x3) & 1))^(((in[0] >> 18) & 0x3)>>1))) + out[8] + out[10] = int32(((-(((in[0] >> 20) & 0x3) & 1))^(((in[0] >> 20) & 0x3)>>1))) + out[9] + out[11] = int32(((-(((in[0] >> 22) & 0x3) & 1))^(((in[0] >> 22) & 0x3)>>1))) + out[10] + out[12] = int32(((-(((in[0] >> 24) & 0x3) & 1))^(((in[0] >> 24) & 0x3)>>1))) + out[11] + out[13] = int32(((-(((in[0] >> 26) & 0x3) & 1))^(((in[0] >> 26) & 0x3)>>1))) + out[12] + out[14] = int32(((-(((in[0] >> 28) & 0x3) & 1))^(((in[0] >> 28) & 0x3)>>1))) + out[13] + out[15] = int32(((-(((in[0] >> 30)) & 1))^(((in[0] >> 30))>>1))) + out[14] + out[16] = int32(((-(((in[1] >> 0) & 0x3) & 1))^(((in[1] >> 0) & 0x3)>>1))) + out[15] + out[17] = int32(((-(((in[1] >> 2) & 0x3) & 1))^(((in[1] >> 2) & 0x3)>>1))) + out[16] + out[18] = int32(((-(((in[1] >> 4) & 0x3) & 1))^(((in[1] >> 4) & 0x3)>>1))) + out[17] + out[19] = int32(((-(((in[1] >> 6) & 0x3) & 1))^(((in[1] >> 6) & 0x3)>>1))) + out[18] + out[20] = int32(((-(((in[1] >> 8) & 0x3) & 1))^(((in[1] >> 8) & 0x3)>>1))) + out[19] + out[21] = int32(((-(((in[1] >> 10) & 0x3) & 1))^(((in[1] >> 10) & 0x3)>>1))) + out[20] + out[22] = int32(((-(((in[1] >> 12) & 0x3) & 1))^(((in[1] >> 12) & 0x3)>>1))) + out[21] + out[23] = int32(((-(((in[1] >> 14) & 0x3) & 1))^(((in[1] >> 14) & 0x3)>>1))) + out[22] + out[24] = int32(((-(((in[1] >> 16) & 0x3) & 1))^(((in[1] >> 16) & 0x3)>>1))) + out[23] + out[25] = int32(((-(((in[1] >> 18) & 0x3) & 1))^(((in[1] >> 18) & 0x3)>>1))) + out[24] + out[26] = int32(((-(((in[1] >> 20) & 0x3) & 1))^(((in[1] >> 20) & 0x3)>>1))) + out[25] + out[27] = int32(((-(((in[1] >> 22) & 0x3) & 1))^(((in[1] >> 22) & 0x3)>>1))) + out[26] + out[28] = int32(((-(((in[1] >> 24) & 0x3) & 1))^(((in[1] >> 24) & 0x3)>>1))) + out[27] + out[29] = int32(((-(((in[1] >> 26) & 0x3) & 1))^(((in[1] >> 26) & 0x3)>>1))) + out[28] + out[30] = int32(((-(((in[1] >> 28) & 0x3) & 1))^(((in[1] >> 28) & 0x3)>>1))) + out[29] + out[31] = int32(((-(((in[1] >> 30)) & 1))^(((in[1] >> 30))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_3(initoffset int32, in *[3]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7) & 1))^(((in[0] >> 0) & 0x7)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 3) & 0x7) & 1))^(((in[0] >> 3) & 0x7)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 6) & 0x7) & 1))^(((in[0] >> 6) & 0x7)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 9) & 0x7) & 1))^(((in[0] >> 9) & 0x7)>>1))) + out[2] + out[4] = int32(((-(((in[0] >> 12) & 0x7) & 1))^(((in[0] >> 12) & 0x7)>>1))) + out[3] + out[5] = int32(((-(((in[0] >> 15) & 0x7) & 1))^(((in[0] >> 15) & 0x7)>>1))) + out[4] + out[6] = int32(((-(((in[0] >> 18) & 0x7) & 1))^(((in[0] >> 18) & 0x7)>>1))) + out[5] + out[7] = int32(((-(((in[0] >> 21) & 0x7) & 1))^(((in[0] >> 21) & 0x7)>>1))) + out[6] + out[8] = int32(((-(((in[0] >> 24) & 0x7) & 1))^(((in[0] >> 24) & 0x7)>>1))) + out[7] + out[9] = int32(((-(((in[0] >> 27) & 0x7) & 1))^(((in[0] >> 27) & 0x7)>>1))) + out[8] + out[10] = int32(((-((((in[0] >> 30) | ((in[1] & 0x1) << 2))) & 1))^((((in[0] >> 30) | ((in[1] & 0x1) << 2)))>>1))) + out[9] + out[11] = int32(((-(((in[1] >> 1) & 0x7) & 1))^(((in[1] >> 1) & 0x7)>>1))) + out[10] + out[12] = int32(((-(((in[1] >> 4) & 0x7) & 1))^(((in[1] >> 4) & 0x7)>>1))) + out[11] + out[13] = int32(((-(((in[1] >> 7) & 0x7) & 1))^(((in[1] >> 7) & 0x7)>>1))) + out[12] + out[14] = int32(((-(((in[1] >> 10) & 0x7) & 1))^(((in[1] >> 10) & 0x7)>>1))) + out[13] + out[15] = int32(((-(((in[1] >> 13) & 0x7) & 1))^(((in[1] >> 13) & 0x7)>>1))) + out[14] + out[16] = int32(((-(((in[1] >> 16) & 0x7) & 1))^(((in[1] >> 16) & 0x7)>>1))) + out[15] + out[17] = int32(((-(((in[1] >> 19) & 0x7) & 1))^(((in[1] >> 19) & 0x7)>>1))) + out[16] + out[18] = int32(((-(((in[1] >> 22) & 0x7) & 1))^(((in[1] >> 22) & 0x7)>>1))) + out[17] + out[19] = int32(((-(((in[1] >> 25) & 0x7) & 1))^(((in[1] >> 25) & 0x7)>>1))) + out[18] + out[20] = int32(((-(((in[1] >> 28) & 0x7) & 1))^(((in[1] >> 28) & 0x7)>>1))) + out[19] + out[21] = int32(((-((((in[1] >> 31) | ((in[2] & 0x3) << 1))) & 1))^((((in[1] >> 31) | ((in[2] & 0x3) << 1)))>>1))) + out[20] + out[22] = int32(((-(((in[2] >> 2) & 0x7) & 1))^(((in[2] >> 2) & 0x7)>>1))) + out[21] + out[23] = int32(((-(((in[2] >> 5) & 0x7) & 1))^(((in[2] >> 5) & 0x7)>>1))) + out[22] + out[24] = int32(((-(((in[2] >> 8) & 0x7) & 1))^(((in[2] >> 8) & 0x7)>>1))) + out[23] + out[25] = int32(((-(((in[2] >> 11) & 0x7) & 1))^(((in[2] >> 11) & 0x7)>>1))) + out[24] + out[26] = int32(((-(((in[2] >> 14) & 0x7) & 1))^(((in[2] >> 14) & 0x7)>>1))) + out[25] + out[27] = int32(((-(((in[2] >> 17) & 0x7) & 1))^(((in[2] >> 17) & 0x7)>>1))) + out[26] + out[28] = int32(((-(((in[2] >> 20) & 0x7) & 1))^(((in[2] >> 20) & 0x7)>>1))) + out[27] + out[29] = int32(((-(((in[2] >> 23) & 0x7) & 1))^(((in[2] >> 23) & 0x7)>>1))) + out[28] + out[30] = int32(((-(((in[2] >> 26) & 0x7) & 1))^(((in[2] >> 26) & 0x7)>>1))) + out[29] + out[31] = int32(((-(((in[2] >> 29)) & 1))^(((in[2] >> 29))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_4(initoffset int32, in *[4]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0xF) & 1))^(((in[0] >> 0) & 0xF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 4) & 0xF) & 1))^(((in[0] >> 4) & 0xF)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 8) & 0xF) & 1))^(((in[0] >> 8) & 0xF)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 12) & 0xF) & 1))^(((in[0] >> 12) & 0xF)>>1))) + out[2] + out[4] = int32(((-(((in[0] >> 16) & 0xF) & 1))^(((in[0] >> 16) & 0xF)>>1))) + out[3] + out[5] = int32(((-(((in[0] >> 20) & 0xF) & 1))^(((in[0] >> 20) & 0xF)>>1))) + out[4] + out[6] = int32(((-(((in[0] >> 24) & 0xF) & 1))^(((in[0] >> 24) & 0xF)>>1))) + out[5] + out[7] = int32(((-(((in[0] >> 28)) & 1))^(((in[0] >> 28))>>1))) + out[6] + out[8] = int32(((-(((in[1] >> 0) & 0xF) & 1))^(((in[1] >> 0) & 0xF)>>1))) + out[7] + out[9] = int32(((-(((in[1] >> 4) & 0xF) & 1))^(((in[1] >> 4) & 0xF)>>1))) + out[8] + out[10] = int32(((-(((in[1] >> 8) & 0xF) & 1))^(((in[1] >> 8) & 0xF)>>1))) + out[9] + out[11] = int32(((-(((in[1] >> 12) & 0xF) & 1))^(((in[1] >> 12) & 0xF)>>1))) + out[10] + out[12] = int32(((-(((in[1] >> 16) & 0xF) & 1))^(((in[1] >> 16) & 0xF)>>1))) + out[11] + out[13] = int32(((-(((in[1] >> 20) & 0xF) & 1))^(((in[1] >> 20) & 0xF)>>1))) + out[12] + out[14] = int32(((-(((in[1] >> 24) & 0xF) & 1))^(((in[1] >> 24) & 0xF)>>1))) + out[13] + out[15] = int32(((-(((in[1] >> 28)) & 1))^(((in[1] >> 28))>>1))) + out[14] + out[16] = int32(((-(((in[2] >> 0) & 0xF) & 1))^(((in[2] >> 0) & 0xF)>>1))) + out[15] + out[17] = int32(((-(((in[2] >> 4) & 0xF) & 1))^(((in[2] >> 4) & 0xF)>>1))) + out[16] + out[18] = int32(((-(((in[2] >> 8) & 0xF) & 1))^(((in[2] >> 8) & 0xF)>>1))) + out[17] + out[19] = int32(((-(((in[2] >> 12) & 0xF) & 1))^(((in[2] >> 12) & 0xF)>>1))) + out[18] + out[20] = int32(((-(((in[2] >> 16) & 0xF) & 1))^(((in[2] >> 16) & 0xF)>>1))) + out[19] + out[21] = int32(((-(((in[2] >> 20) & 0xF) & 1))^(((in[2] >> 20) & 0xF)>>1))) + out[20] + out[22] = int32(((-(((in[2] >> 24) & 0xF) & 1))^(((in[2] >> 24) & 0xF)>>1))) + out[21] + out[23] = int32(((-(((in[2] >> 28)) & 1))^(((in[2] >> 28))>>1))) + out[22] + out[24] = int32(((-(((in[3] >> 0) & 0xF) & 1))^(((in[3] >> 0) & 0xF)>>1))) + out[23] + out[25] = int32(((-(((in[3] >> 4) & 0xF) & 1))^(((in[3] >> 4) & 0xF)>>1))) + out[24] + out[26] = int32(((-(((in[3] >> 8) & 0xF) & 1))^(((in[3] >> 8) & 0xF)>>1))) + out[25] + out[27] = int32(((-(((in[3] >> 12) & 0xF) & 1))^(((in[3] >> 12) & 0xF)>>1))) + out[26] + out[28] = int32(((-(((in[3] >> 16) & 0xF) & 1))^(((in[3] >> 16) & 0xF)>>1))) + out[27] + out[29] = int32(((-(((in[3] >> 20) & 0xF) & 1))^(((in[3] >> 20) & 0xF)>>1))) + out[28] + out[30] = int32(((-(((in[3] >> 24) & 0xF) & 1))^(((in[3] >> 24) & 0xF)>>1))) + out[29] + out[31] = int32(((-(((in[3] >> 28)) & 1))^(((in[3] >> 28))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_5(initoffset int32, in *[5]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1F) & 1))^(((in[0] >> 0) & 0x1F)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 5) & 0x1F) & 1))^(((in[0] >> 5) & 0x1F)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 10) & 0x1F) & 1))^(((in[0] >> 10) & 0x1F)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 15) & 0x1F) & 1))^(((in[0] >> 15) & 0x1F)>>1))) + out[2] + out[4] = int32(((-(((in[0] >> 20) & 0x1F) & 1))^(((in[0] >> 20) & 0x1F)>>1))) + out[3] + out[5] = int32(((-(((in[0] >> 25) & 0x1F) & 1))^(((in[0] >> 25) & 0x1F)>>1))) + out[4] + out[6] = int32(((-((((in[0] >> 30) | ((in[1] & 0x7) << 2))) & 1))^((((in[0] >> 30) | ((in[1] & 0x7) << 2)))>>1))) + out[5] + out[7] = int32(((-(((in[1] >> 3) & 0x1F) & 1))^(((in[1] >> 3) & 0x1F)>>1))) + out[6] + out[8] = int32(((-(((in[1] >> 8) & 0x1F) & 1))^(((in[1] >> 8) & 0x1F)>>1))) + out[7] + out[9] = int32(((-(((in[1] >> 13) & 0x1F) & 1))^(((in[1] >> 13) & 0x1F)>>1))) + out[8] + out[10] = int32(((-(((in[1] >> 18) & 0x1F) & 1))^(((in[1] >> 18) & 0x1F)>>1))) + out[9] + out[11] = int32(((-(((in[1] >> 23) & 0x1F) & 1))^(((in[1] >> 23) & 0x1F)>>1))) + out[10] + out[12] = int32(((-((((in[1] >> 28) | ((in[2] & 0x1) << 4))) & 1))^((((in[1] >> 28) | ((in[2] & 0x1) << 4)))>>1))) + out[11] + out[13] = int32(((-(((in[2] >> 1) & 0x1F) & 1))^(((in[2] >> 1) & 0x1F)>>1))) + out[12] + out[14] = int32(((-(((in[2] >> 6) & 0x1F) & 1))^(((in[2] >> 6) & 0x1F)>>1))) + out[13] + out[15] = int32(((-(((in[2] >> 11) & 0x1F) & 1))^(((in[2] >> 11) & 0x1F)>>1))) + out[14] + out[16] = int32(((-(((in[2] >> 16) & 0x1F) & 1))^(((in[2] >> 16) & 0x1F)>>1))) + out[15] + out[17] = int32(((-(((in[2] >> 21) & 0x1F) & 1))^(((in[2] >> 21) & 0x1F)>>1))) + out[16] + out[18] = int32(((-(((in[2] >> 26) & 0x1F) & 1))^(((in[2] >> 26) & 0x1F)>>1))) + out[17] + out[19] = int32(((-((((in[2] >> 31) | ((in[3] & 0xF) << 1))) & 1))^((((in[2] >> 31) | ((in[3] & 0xF) << 1)))>>1))) + out[18] + out[20] = int32(((-(((in[3] >> 4) & 0x1F) & 1))^(((in[3] >> 4) & 0x1F)>>1))) + out[19] + out[21] = int32(((-(((in[3] >> 9) & 0x1F) & 1))^(((in[3] >> 9) & 0x1F)>>1))) + out[20] + out[22] = int32(((-(((in[3] >> 14) & 0x1F) & 1))^(((in[3] >> 14) & 0x1F)>>1))) + out[21] + out[23] = int32(((-(((in[3] >> 19) & 0x1F) & 1))^(((in[3] >> 19) & 0x1F)>>1))) + out[22] + out[24] = int32(((-(((in[3] >> 24) & 0x1F) & 1))^(((in[3] >> 24) & 0x1F)>>1))) + out[23] + out[25] = int32(((-((((in[3] >> 29) | ((in[4] & 0x3) << 3))) & 1))^((((in[3] >> 29) | ((in[4] & 0x3) << 3)))>>1))) + out[24] + out[26] = int32(((-(((in[4] >> 2) & 0x1F) & 1))^(((in[4] >> 2) & 0x1F)>>1))) + out[25] + out[27] = int32(((-(((in[4] >> 7) & 0x1F) & 1))^(((in[4] >> 7) & 0x1F)>>1))) + out[26] + out[28] = int32(((-(((in[4] >> 12) & 0x1F) & 1))^(((in[4] >> 12) & 0x1F)>>1))) + out[27] + out[29] = int32(((-(((in[4] >> 17) & 0x1F) & 1))^(((in[4] >> 17) & 0x1F)>>1))) + out[28] + out[30] = int32(((-(((in[4] >> 22) & 0x1F) & 1))^(((in[4] >> 22) & 0x1F)>>1))) + out[29] + out[31] = int32(((-(((in[4] >> 27)) & 1))^(((in[4] >> 27))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_6(initoffset int32, in *[6]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3F) & 1))^(((in[0] >> 0) & 0x3F)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 6) & 0x3F) & 1))^(((in[0] >> 6) & 0x3F)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 12) & 0x3F) & 1))^(((in[0] >> 12) & 0x3F)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 18) & 0x3F) & 1))^(((in[0] >> 18) & 0x3F)>>1))) + out[2] + out[4] = int32(((-(((in[0] >> 24) & 0x3F) & 1))^(((in[0] >> 24) & 0x3F)>>1))) + out[3] + out[5] = int32(((-((((in[0] >> 30) | ((in[1] & 0xF) << 2))) & 1))^((((in[0] >> 30) | ((in[1] & 0xF) << 2)))>>1))) + out[4] + out[6] = int32(((-(((in[1] >> 4) & 0x3F) & 1))^(((in[1] >> 4) & 0x3F)>>1))) + out[5] + out[7] = int32(((-(((in[1] >> 10) & 0x3F) & 1))^(((in[1] >> 10) & 0x3F)>>1))) + out[6] + out[8] = int32(((-(((in[1] >> 16) & 0x3F) & 1))^(((in[1] >> 16) & 0x3F)>>1))) + out[7] + out[9] = int32(((-(((in[1] >> 22) & 0x3F) & 1))^(((in[1] >> 22) & 0x3F)>>1))) + out[8] + out[10] = int32(((-((((in[1] >> 28) | ((in[2] & 0x3) << 4))) & 1))^((((in[1] >> 28) | ((in[2] & 0x3) << 4)))>>1))) + out[9] + out[11] = int32(((-(((in[2] >> 2) & 0x3F) & 1))^(((in[2] >> 2) & 0x3F)>>1))) + out[10] + out[12] = int32(((-(((in[2] >> 8) & 0x3F) & 1))^(((in[2] >> 8) & 0x3F)>>1))) + out[11] + out[13] = int32(((-(((in[2] >> 14) & 0x3F) & 1))^(((in[2] >> 14) & 0x3F)>>1))) + out[12] + out[14] = int32(((-(((in[2] >> 20) & 0x3F) & 1))^(((in[2] >> 20) & 0x3F)>>1))) + out[13] + out[15] = int32(((-(((in[2] >> 26)) & 1))^(((in[2] >> 26))>>1))) + out[14] + out[16] = int32(((-(((in[3] >> 0) & 0x3F) & 1))^(((in[3] >> 0) & 0x3F)>>1))) + out[15] + out[17] = int32(((-(((in[3] >> 6) & 0x3F) & 1))^(((in[3] >> 6) & 0x3F)>>1))) + out[16] + out[18] = int32(((-(((in[3] >> 12) & 0x3F) & 1))^(((in[3] >> 12) & 0x3F)>>1))) + out[17] + out[19] = int32(((-(((in[3] >> 18) & 0x3F) & 1))^(((in[3] >> 18) & 0x3F)>>1))) + out[18] + out[20] = int32(((-(((in[3] >> 24) & 0x3F) & 1))^(((in[3] >> 24) & 0x3F)>>1))) + out[19] + out[21] = int32(((-((((in[3] >> 30) | ((in[4] & 0xF) << 2))) & 1))^((((in[3] >> 30) | ((in[4] & 0xF) << 2)))>>1))) + out[20] + out[22] = int32(((-(((in[4] >> 4) & 0x3F) & 1))^(((in[4] >> 4) & 0x3F)>>1))) + out[21] + out[23] = int32(((-(((in[4] >> 10) & 0x3F) & 1))^(((in[4] >> 10) & 0x3F)>>1))) + out[22] + out[24] = int32(((-(((in[4] >> 16) & 0x3F) & 1))^(((in[4] >> 16) & 0x3F)>>1))) + out[23] + out[25] = int32(((-(((in[4] >> 22) & 0x3F) & 1))^(((in[4] >> 22) & 0x3F)>>1))) + out[24] + out[26] = int32(((-((((in[4] >> 28) | ((in[5] & 0x3) << 4))) & 1))^((((in[4] >> 28) | ((in[5] & 0x3) << 4)))>>1))) + out[25] + out[27] = int32(((-(((in[5] >> 2) & 0x3F) & 1))^(((in[5] >> 2) & 0x3F)>>1))) + out[26] + out[28] = int32(((-(((in[5] >> 8) & 0x3F) & 1))^(((in[5] >> 8) & 0x3F)>>1))) + out[27] + out[29] = int32(((-(((in[5] >> 14) & 0x3F) & 1))^(((in[5] >> 14) & 0x3F)>>1))) + out[28] + out[30] = int32(((-(((in[5] >> 20) & 0x3F) & 1))^(((in[5] >> 20) & 0x3F)>>1))) + out[29] + out[31] = int32(((-(((in[5] >> 26)) & 1))^(((in[5] >> 26))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_7(initoffset int32, in *[7]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7F) & 1))^(((in[0] >> 0) & 0x7F)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 7) & 0x7F) & 1))^(((in[0] >> 7) & 0x7F)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 14) & 0x7F) & 1))^(((in[0] >> 14) & 0x7F)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 21) & 0x7F) & 1))^(((in[0] >> 21) & 0x7F)>>1))) + out[2] + out[4] = int32(((-((((in[0] >> 28) | ((in[1] & 0x7) << 4))) & 1))^((((in[0] >> 28) | ((in[1] & 0x7) << 4)))>>1))) + out[3] + out[5] = int32(((-(((in[1] >> 3) & 0x7F) & 1))^(((in[1] >> 3) & 0x7F)>>1))) + out[4] + out[6] = int32(((-(((in[1] >> 10) & 0x7F) & 1))^(((in[1] >> 10) & 0x7F)>>1))) + out[5] + out[7] = int32(((-(((in[1] >> 17) & 0x7F) & 1))^(((in[1] >> 17) & 0x7F)>>1))) + out[6] + out[8] = int32(((-(((in[1] >> 24) & 0x7F) & 1))^(((in[1] >> 24) & 0x7F)>>1))) + out[7] + out[9] = int32(((-((((in[1] >> 31) | ((in[2] & 0x3F) << 1))) & 1))^((((in[1] >> 31) | ((in[2] & 0x3F) << 1)))>>1))) + out[8] + out[10] = int32(((-(((in[2] >> 6) & 0x7F) & 1))^(((in[2] >> 6) & 0x7F)>>1))) + out[9] + out[11] = int32(((-(((in[2] >> 13) & 0x7F) & 1))^(((in[2] >> 13) & 0x7F)>>1))) + out[10] + out[12] = int32(((-(((in[2] >> 20) & 0x7F) & 1))^(((in[2] >> 20) & 0x7F)>>1))) + out[11] + out[13] = int32(((-((((in[2] >> 27) | ((in[3] & 0x3) << 5))) & 1))^((((in[2] >> 27) | ((in[3] & 0x3) << 5)))>>1))) + out[12] + out[14] = int32(((-(((in[3] >> 2) & 0x7F) & 1))^(((in[3] >> 2) & 0x7F)>>1))) + out[13] + out[15] = int32(((-(((in[3] >> 9) & 0x7F) & 1))^(((in[3] >> 9) & 0x7F)>>1))) + out[14] + out[16] = int32(((-(((in[3] >> 16) & 0x7F) & 1))^(((in[3] >> 16) & 0x7F)>>1))) + out[15] + out[17] = int32(((-(((in[3] >> 23) & 0x7F) & 1))^(((in[3] >> 23) & 0x7F)>>1))) + out[16] + out[18] = int32(((-((((in[3] >> 30) | ((in[4] & 0x1F) << 2))) & 1))^((((in[3] >> 30) | ((in[4] & 0x1F) << 2)))>>1))) + out[17] + out[19] = int32(((-(((in[4] >> 5) & 0x7F) & 1))^(((in[4] >> 5) & 0x7F)>>1))) + out[18] + out[20] = int32(((-(((in[4] >> 12) & 0x7F) & 1))^(((in[4] >> 12) & 0x7F)>>1))) + out[19] + out[21] = int32(((-(((in[4] >> 19) & 0x7F) & 1))^(((in[4] >> 19) & 0x7F)>>1))) + out[20] + out[22] = int32(((-((((in[4] >> 26) | ((in[5] & 0x1) << 6))) & 1))^((((in[4] >> 26) | ((in[5] & 0x1) << 6)))>>1))) + out[21] + out[23] = int32(((-(((in[5] >> 1) & 0x7F) & 1))^(((in[5] >> 1) & 0x7F)>>1))) + out[22] + out[24] = int32(((-(((in[5] >> 8) & 0x7F) & 1))^(((in[5] >> 8) & 0x7F)>>1))) + out[23] + out[25] = int32(((-(((in[5] >> 15) & 0x7F) & 1))^(((in[5] >> 15) & 0x7F)>>1))) + out[24] + out[26] = int32(((-(((in[5] >> 22) & 0x7F) & 1))^(((in[5] >> 22) & 0x7F)>>1))) + out[25] + out[27] = int32(((-((((in[5] >> 29) | ((in[6] & 0xF) << 3))) & 1))^((((in[5] >> 29) | ((in[6] & 0xF) << 3)))>>1))) + out[26] + out[28] = int32(((-(((in[6] >> 4) & 0x7F) & 1))^(((in[6] >> 4) & 0x7F)>>1))) + out[27] + out[29] = int32(((-(((in[6] >> 11) & 0x7F) & 1))^(((in[6] >> 11) & 0x7F)>>1))) + out[28] + out[30] = int32(((-(((in[6] >> 18) & 0x7F) & 1))^(((in[6] >> 18) & 0x7F)>>1))) + out[29] + out[31] = int32(((-(((in[6] >> 25)) & 1))^(((in[6] >> 25))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_8(initoffset int32, in *[8]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0xFF) & 1))^(((in[0] >> 0) & 0xFF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 8) & 0xFF) & 1))^(((in[0] >> 8) & 0xFF)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 16) & 0xFF) & 1))^(((in[0] >> 16) & 0xFF)>>1))) + out[1] + out[3] = int32(((-(((in[0] >> 24)) & 1))^(((in[0] >> 24))>>1))) + out[2] + out[4] = int32(((-(((in[1] >> 0) & 0xFF) & 1))^(((in[1] >> 0) & 0xFF)>>1))) + out[3] + out[5] = int32(((-(((in[1] >> 8) & 0xFF) & 1))^(((in[1] >> 8) & 0xFF)>>1))) + out[4] + out[6] = int32(((-(((in[1] >> 16) & 0xFF) & 1))^(((in[1] >> 16) & 0xFF)>>1))) + out[5] + out[7] = int32(((-(((in[1] >> 24)) & 1))^(((in[1] >> 24))>>1))) + out[6] + out[8] = int32(((-(((in[2] >> 0) & 0xFF) & 1))^(((in[2] >> 0) & 0xFF)>>1))) + out[7] + out[9] = int32(((-(((in[2] >> 8) & 0xFF) & 1))^(((in[2] >> 8) & 0xFF)>>1))) + out[8] + out[10] = int32(((-(((in[2] >> 16) & 0xFF) & 1))^(((in[2] >> 16) & 0xFF)>>1))) + out[9] + out[11] = int32(((-(((in[2] >> 24)) & 1))^(((in[2] >> 24))>>1))) + out[10] + out[12] = int32(((-(((in[3] >> 0) & 0xFF) & 1))^(((in[3] >> 0) & 0xFF)>>1))) + out[11] + out[13] = int32(((-(((in[3] >> 8) & 0xFF) & 1))^(((in[3] >> 8) & 0xFF)>>1))) + out[12] + out[14] = int32(((-(((in[3] >> 16) & 0xFF) & 1))^(((in[3] >> 16) & 0xFF)>>1))) + out[13] + out[15] = int32(((-(((in[3] >> 24)) & 1))^(((in[3] >> 24))>>1))) + out[14] + out[16] = int32(((-(((in[4] >> 0) & 0xFF) & 1))^(((in[4] >> 0) & 0xFF)>>1))) + out[15] + out[17] = int32(((-(((in[4] >> 8) & 0xFF) & 1))^(((in[4] >> 8) & 0xFF)>>1))) + out[16] + out[18] = int32(((-(((in[4] >> 16) & 0xFF) & 1))^(((in[4] >> 16) & 0xFF)>>1))) + out[17] + out[19] = int32(((-(((in[4] >> 24)) & 1))^(((in[4] >> 24))>>1))) + out[18] + out[20] = int32(((-(((in[5] >> 0) & 0xFF) & 1))^(((in[5] >> 0) & 0xFF)>>1))) + out[19] + out[21] = int32(((-(((in[5] >> 8) & 0xFF) & 1))^(((in[5] >> 8) & 0xFF)>>1))) + out[20] + out[22] = int32(((-(((in[5] >> 16) & 0xFF) & 1))^(((in[5] >> 16) & 0xFF)>>1))) + out[21] + out[23] = int32(((-(((in[5] >> 24)) & 1))^(((in[5] >> 24))>>1))) + out[22] + out[24] = int32(((-(((in[6] >> 0) & 0xFF) & 1))^(((in[6] >> 0) & 0xFF)>>1))) + out[23] + out[25] = int32(((-(((in[6] >> 8) & 0xFF) & 1))^(((in[6] >> 8) & 0xFF)>>1))) + out[24] + out[26] = int32(((-(((in[6] >> 16) & 0xFF) & 1))^(((in[6] >> 16) & 0xFF)>>1))) + out[25] + out[27] = int32(((-(((in[6] >> 24)) & 1))^(((in[6] >> 24))>>1))) + out[26] + out[28] = int32(((-(((in[7] >> 0) & 0xFF) & 1))^(((in[7] >> 0) & 0xFF)>>1))) + out[27] + out[29] = int32(((-(((in[7] >> 8) & 0xFF) & 1))^(((in[7] >> 8) & 0xFF)>>1))) + out[28] + out[30] = int32(((-(((in[7] >> 16) & 0xFF) & 1))^(((in[7] >> 16) & 0xFF)>>1))) + out[29] + out[31] = int32(((-(((in[7] >> 24)) & 1))^(((in[7] >> 24))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_9(initoffset int32, in *[9]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1FF) & 1))^(((in[0] >> 0) & 0x1FF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 9) & 0x1FF) & 1))^(((in[0] >> 9) & 0x1FF)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 18) & 0x1FF) & 1))^(((in[0] >> 18) & 0x1FF)>>1))) + out[1] + out[3] = int32(((-((((in[0] >> 27) | ((in[1] & 0xF) << 5))) & 1))^((((in[0] >> 27) | ((in[1] & 0xF) << 5)))>>1))) + out[2] + out[4] = int32(((-(((in[1] >> 4) & 0x1FF) & 1))^(((in[1] >> 4) & 0x1FF)>>1))) + out[3] + out[5] = int32(((-(((in[1] >> 13) & 0x1FF) & 1))^(((in[1] >> 13) & 0x1FF)>>1))) + out[4] + out[6] = int32(((-(((in[1] >> 22) & 0x1FF) & 1))^(((in[1] >> 22) & 0x1FF)>>1))) + out[5] + out[7] = int32(((-((((in[1] >> 31) | ((in[2] & 0xFF) << 1))) & 1))^((((in[1] >> 31) | ((in[2] & 0xFF) << 1)))>>1))) + out[6] + out[8] = int32(((-(((in[2] >> 8) & 0x1FF) & 1))^(((in[2] >> 8) & 0x1FF)>>1))) + out[7] + out[9] = int32(((-(((in[2] >> 17) & 0x1FF) & 1))^(((in[2] >> 17) & 0x1FF)>>1))) + out[8] + out[10] = int32(((-((((in[2] >> 26) | ((in[3] & 0x7) << 6))) & 1))^((((in[2] >> 26) | ((in[3] & 0x7) << 6)))>>1))) + out[9] + out[11] = int32(((-(((in[3] >> 3) & 0x1FF) & 1))^(((in[3] >> 3) & 0x1FF)>>1))) + out[10] + out[12] = int32(((-(((in[3] >> 12) & 0x1FF) & 1))^(((in[3] >> 12) & 0x1FF)>>1))) + out[11] + out[13] = int32(((-(((in[3] >> 21) & 0x1FF) & 1))^(((in[3] >> 21) & 0x1FF)>>1))) + out[12] + out[14] = int32(((-((((in[3] >> 30) | ((in[4] & 0x7F) << 2))) & 1))^((((in[3] >> 30) | ((in[4] & 0x7F) << 2)))>>1))) + out[13] + out[15] = int32(((-(((in[4] >> 7) & 0x1FF) & 1))^(((in[4] >> 7) & 0x1FF)>>1))) + out[14] + out[16] = int32(((-(((in[4] >> 16) & 0x1FF) & 1))^(((in[4] >> 16) & 0x1FF)>>1))) + out[15] + out[17] = int32(((-((((in[4] >> 25) | ((in[5] & 0x3) << 7))) & 1))^((((in[4] >> 25) | ((in[5] & 0x3) << 7)))>>1))) + out[16] + out[18] = int32(((-(((in[5] >> 2) & 0x1FF) & 1))^(((in[5] >> 2) & 0x1FF)>>1))) + out[17] + out[19] = int32(((-(((in[5] >> 11) & 0x1FF) & 1))^(((in[5] >> 11) & 0x1FF)>>1))) + out[18] + out[20] = int32(((-(((in[5] >> 20) & 0x1FF) & 1))^(((in[5] >> 20) & 0x1FF)>>1))) + out[19] + out[21] = int32(((-((((in[5] >> 29) | ((in[6] & 0x3F) << 3))) & 1))^((((in[5] >> 29) | ((in[6] & 0x3F) << 3)))>>1))) + out[20] + out[22] = int32(((-(((in[6] >> 6) & 0x1FF) & 1))^(((in[6] >> 6) & 0x1FF)>>1))) + out[21] + out[23] = int32(((-(((in[6] >> 15) & 0x1FF) & 1))^(((in[6] >> 15) & 0x1FF)>>1))) + out[22] + out[24] = int32(((-((((in[6] >> 24) | ((in[7] & 0x1) << 8))) & 1))^((((in[6] >> 24) | ((in[7] & 0x1) << 8)))>>1))) + out[23] + out[25] = int32(((-(((in[7] >> 1) & 0x1FF) & 1))^(((in[7] >> 1) & 0x1FF)>>1))) + out[24] + out[26] = int32(((-(((in[7] >> 10) & 0x1FF) & 1))^(((in[7] >> 10) & 0x1FF)>>1))) + out[25] + out[27] = int32(((-(((in[7] >> 19) & 0x1FF) & 1))^(((in[7] >> 19) & 0x1FF)>>1))) + out[26] + out[28] = int32(((-((((in[7] >> 28) | ((in[8] & 0x1F) << 4))) & 1))^((((in[7] >> 28) | ((in[8] & 0x1F) << 4)))>>1))) + out[27] + out[29] = int32(((-(((in[8] >> 5) & 0x1FF) & 1))^(((in[8] >> 5) & 0x1FF)>>1))) + out[28] + out[30] = int32(((-(((in[8] >> 14) & 0x1FF) & 1))^(((in[8] >> 14) & 0x1FF)>>1))) + out[29] + out[31] = int32(((-(((in[8] >> 23)) & 1))^(((in[8] >> 23))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_10(initoffset int32, in *[10]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3FF) & 1))^(((in[0] >> 0) & 0x3FF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 10) & 0x3FF) & 1))^(((in[0] >> 10) & 0x3FF)>>1))) + out[0] + out[2] = int32(((-(((in[0] >> 20) & 0x3FF) & 1))^(((in[0] >> 20) & 0x3FF)>>1))) + out[1] + out[3] = int32(((-((((in[0] >> 30) | ((in[1] & 0xFF) << 2))) & 1))^((((in[0] >> 30) | ((in[1] & 0xFF) << 2)))>>1))) + out[2] + out[4] = int32(((-(((in[1] >> 8) & 0x3FF) & 1))^(((in[1] >> 8) & 0x3FF)>>1))) + out[3] + out[5] = int32(((-(((in[1] >> 18) & 0x3FF) & 1))^(((in[1] >> 18) & 0x3FF)>>1))) + out[4] + out[6] = int32(((-((((in[1] >> 28) | ((in[2] & 0x3F) << 4))) & 1))^((((in[1] >> 28) | ((in[2] & 0x3F) << 4)))>>1))) + out[5] + out[7] = int32(((-(((in[2] >> 6) & 0x3FF) & 1))^(((in[2] >> 6) & 0x3FF)>>1))) + out[6] + out[8] = int32(((-(((in[2] >> 16) & 0x3FF) & 1))^(((in[2] >> 16) & 0x3FF)>>1))) + out[7] + out[9] = int32(((-((((in[2] >> 26) | ((in[3] & 0xF) << 6))) & 1))^((((in[2] >> 26) | ((in[3] & 0xF) << 6)))>>1))) + out[8] + out[10] = int32(((-(((in[3] >> 4) & 0x3FF) & 1))^(((in[3] >> 4) & 0x3FF)>>1))) + out[9] + out[11] = int32(((-(((in[3] >> 14) & 0x3FF) & 1))^(((in[3] >> 14) & 0x3FF)>>1))) + out[10] + out[12] = int32(((-((((in[3] >> 24) | ((in[4] & 0x3) << 8))) & 1))^((((in[3] >> 24) | ((in[4] & 0x3) << 8)))>>1))) + out[11] + out[13] = int32(((-(((in[4] >> 2) & 0x3FF) & 1))^(((in[4] >> 2) & 0x3FF)>>1))) + out[12] + out[14] = int32(((-(((in[4] >> 12) & 0x3FF) & 1))^(((in[4] >> 12) & 0x3FF)>>1))) + out[13] + out[15] = int32(((-(((in[4] >> 22)) & 1))^(((in[4] >> 22))>>1))) + out[14] + out[16] = int32(((-(((in[5] >> 0) & 0x3FF) & 1))^(((in[5] >> 0) & 0x3FF)>>1))) + out[15] + out[17] = int32(((-(((in[5] >> 10) & 0x3FF) & 1))^(((in[5] >> 10) & 0x3FF)>>1))) + out[16] + out[18] = int32(((-(((in[5] >> 20) & 0x3FF) & 1))^(((in[5] >> 20) & 0x3FF)>>1))) + out[17] + out[19] = int32(((-((((in[5] >> 30) | ((in[6] & 0xFF) << 2))) & 1))^((((in[5] >> 30) | ((in[6] & 0xFF) << 2)))>>1))) + out[18] + out[20] = int32(((-(((in[6] >> 8) & 0x3FF) & 1))^(((in[6] >> 8) & 0x3FF)>>1))) + out[19] + out[21] = int32(((-(((in[6] >> 18) & 0x3FF) & 1))^(((in[6] >> 18) & 0x3FF)>>1))) + out[20] + out[22] = int32(((-((((in[6] >> 28) | ((in[7] & 0x3F) << 4))) & 1))^((((in[6] >> 28) | ((in[7] & 0x3F) << 4)))>>1))) + out[21] + out[23] = int32(((-(((in[7] >> 6) & 0x3FF) & 1))^(((in[7] >> 6) & 0x3FF)>>1))) + out[22] + out[24] = int32(((-(((in[7] >> 16) & 0x3FF) & 1))^(((in[7] >> 16) & 0x3FF)>>1))) + out[23] + out[25] = int32(((-((((in[7] >> 26) | ((in[8] & 0xF) << 6))) & 1))^((((in[7] >> 26) | ((in[8] & 0xF) << 6)))>>1))) + out[24] + out[26] = int32(((-(((in[8] >> 4) & 0x3FF) & 1))^(((in[8] >> 4) & 0x3FF)>>1))) + out[25] + out[27] = int32(((-(((in[8] >> 14) & 0x3FF) & 1))^(((in[8] >> 14) & 0x3FF)>>1))) + out[26] + out[28] = int32(((-((((in[8] >> 24) | ((in[9] & 0x3) << 8))) & 1))^((((in[8] >> 24) | ((in[9] & 0x3) << 8)))>>1))) + out[27] + out[29] = int32(((-(((in[9] >> 2) & 0x3FF) & 1))^(((in[9] >> 2) & 0x3FF)>>1))) + out[28] + out[30] = int32(((-(((in[9] >> 12) & 0x3FF) & 1))^(((in[9] >> 12) & 0x3FF)>>1))) + out[29] + out[31] = int32(((-(((in[9] >> 22)) & 1))^(((in[9] >> 22))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_11(initoffset int32, in *[11]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7FF) & 1))^(((in[0] >> 0) & 0x7FF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 11) & 0x7FF) & 1))^(((in[0] >> 11) & 0x7FF)>>1))) + out[0] + out[2] = int32(((-((((in[0] >> 22) | ((in[1] & 0x1) << 10))) & 1))^((((in[0] >> 22) | ((in[1] & 0x1) << 10)))>>1))) + out[1] + out[3] = int32(((-(((in[1] >> 1) & 0x7FF) & 1))^(((in[1] >> 1) & 0x7FF)>>1))) + out[2] + out[4] = int32(((-(((in[1] >> 12) & 0x7FF) & 1))^(((in[1] >> 12) & 0x7FF)>>1))) + out[3] + out[5] = int32(((-((((in[1] >> 23) | ((in[2] & 0x3) << 9))) & 1))^((((in[1] >> 23) | ((in[2] & 0x3) << 9)))>>1))) + out[4] + out[6] = int32(((-(((in[2] >> 2) & 0x7FF) & 1))^(((in[2] >> 2) & 0x7FF)>>1))) + out[5] + out[7] = int32(((-(((in[2] >> 13) & 0x7FF) & 1))^(((in[2] >> 13) & 0x7FF)>>1))) + out[6] + out[8] = int32(((-((((in[2] >> 24) | ((in[3] & 0x7) << 8))) & 1))^((((in[2] >> 24) | ((in[3] & 0x7) << 8)))>>1))) + out[7] + out[9] = int32(((-(((in[3] >> 3) & 0x7FF) & 1))^(((in[3] >> 3) & 0x7FF)>>1))) + out[8] + out[10] = int32(((-(((in[3] >> 14) & 0x7FF) & 1))^(((in[3] >> 14) & 0x7FF)>>1))) + out[9] + out[11] = int32(((-((((in[3] >> 25) | ((in[4] & 0xF) << 7))) & 1))^((((in[3] >> 25) | ((in[4] & 0xF) << 7)))>>1))) + out[10] + out[12] = int32(((-(((in[4] >> 4) & 0x7FF) & 1))^(((in[4] >> 4) & 0x7FF)>>1))) + out[11] + out[13] = int32(((-(((in[4] >> 15) & 0x7FF) & 1))^(((in[4] >> 15) & 0x7FF)>>1))) + out[12] + out[14] = int32(((-((((in[4] >> 26) | ((in[5] & 0x1F) << 6))) & 1))^((((in[4] >> 26) | ((in[5] & 0x1F) << 6)))>>1))) + out[13] + out[15] = int32(((-(((in[5] >> 5) & 0x7FF) & 1))^(((in[5] >> 5) & 0x7FF)>>1))) + out[14] + out[16] = int32(((-(((in[5] >> 16) & 0x7FF) & 1))^(((in[5] >> 16) & 0x7FF)>>1))) + out[15] + out[17] = int32(((-((((in[5] >> 27) | ((in[6] & 0x3F) << 5))) & 1))^((((in[5] >> 27) | ((in[6] & 0x3F) << 5)))>>1))) + out[16] + out[18] = int32(((-(((in[6] >> 6) & 0x7FF) & 1))^(((in[6] >> 6) & 0x7FF)>>1))) + out[17] + out[19] = int32(((-(((in[6] >> 17) & 0x7FF) & 1))^(((in[6] >> 17) & 0x7FF)>>1))) + out[18] + out[20] = int32(((-((((in[6] >> 28) | ((in[7] & 0x7F) << 4))) & 1))^((((in[6] >> 28) | ((in[7] & 0x7F) << 4)))>>1))) + out[19] + out[21] = int32(((-(((in[7] >> 7) & 0x7FF) & 1))^(((in[7] >> 7) & 0x7FF)>>1))) + out[20] + out[22] = int32(((-(((in[7] >> 18) & 0x7FF) & 1))^(((in[7] >> 18) & 0x7FF)>>1))) + out[21] + out[23] = int32(((-((((in[7] >> 29) | ((in[8] & 0xFF) << 3))) & 1))^((((in[7] >> 29) | ((in[8] & 0xFF) << 3)))>>1))) + out[22] + out[24] = int32(((-(((in[8] >> 8) & 0x7FF) & 1))^(((in[8] >> 8) & 0x7FF)>>1))) + out[23] + out[25] = int32(((-(((in[8] >> 19) & 0x7FF) & 1))^(((in[8] >> 19) & 0x7FF)>>1))) + out[24] + out[26] = int32(((-((((in[8] >> 30) | ((in[9] & 0x1FF) << 2))) & 1))^((((in[8] >> 30) | ((in[9] & 0x1FF) << 2)))>>1))) + out[25] + out[27] = int32(((-(((in[9] >> 9) & 0x7FF) & 1))^(((in[9] >> 9) & 0x7FF)>>1))) + out[26] + out[28] = int32(((-(((in[9] >> 20) & 0x7FF) & 1))^(((in[9] >> 20) & 0x7FF)>>1))) + out[27] + out[29] = int32(((-((((in[9] >> 31) | ((in[10] & 0x3FF) << 1))) & 1))^((((in[9] >> 31) | ((in[10] & 0x3FF) << 1)))>>1))) + out[28] + out[30] = int32(((-(((in[10] >> 10) & 0x7FF) & 1))^(((in[10] >> 10) & 0x7FF)>>1))) + out[29] + out[31] = int32(((-(((in[10] >> 21)) & 1))^(((in[10] >> 21))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_12(initoffset int32, in *[12]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0xFFF) & 1))^(((in[0] >> 0) & 0xFFF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 12) & 0xFFF) & 1))^(((in[0] >> 12) & 0xFFF)>>1))) + out[0] + out[2] = int32(((-((((in[0] >> 24) | ((in[1] & 0xF) << 8))) & 1))^((((in[0] >> 24) | ((in[1] & 0xF) << 8)))>>1))) + out[1] + out[3] = int32(((-(((in[1] >> 4) & 0xFFF) & 1))^(((in[1] >> 4) & 0xFFF)>>1))) + out[2] + out[4] = int32(((-(((in[1] >> 16) & 0xFFF) & 1))^(((in[1] >> 16) & 0xFFF)>>1))) + out[3] + out[5] = int32(((-((((in[1] >> 28) | ((in[2] & 0xFF) << 4))) & 1))^((((in[1] >> 28) | ((in[2] & 0xFF) << 4)))>>1))) + out[4] + out[6] = int32(((-(((in[2] >> 8) & 0xFFF) & 1))^(((in[2] >> 8) & 0xFFF)>>1))) + out[5] + out[7] = int32(((-(((in[2] >> 20)) & 1))^(((in[2] >> 20))>>1))) + out[6] + out[8] = int32(((-(((in[3] >> 0) & 0xFFF) & 1))^(((in[3] >> 0) & 0xFFF)>>1))) + out[7] + out[9] = int32(((-(((in[3] >> 12) & 0xFFF) & 1))^(((in[3] >> 12) & 0xFFF)>>1))) + out[8] + out[10] = int32(((-((((in[3] >> 24) | ((in[4] & 0xF) << 8))) & 1))^((((in[3] >> 24) | ((in[4] & 0xF) << 8)))>>1))) + out[9] + out[11] = int32(((-(((in[4] >> 4) & 0xFFF) & 1))^(((in[4] >> 4) & 0xFFF)>>1))) + out[10] + out[12] = int32(((-(((in[4] >> 16) & 0xFFF) & 1))^(((in[4] >> 16) & 0xFFF)>>1))) + out[11] + out[13] = int32(((-((((in[4] >> 28) | ((in[5] & 0xFF) << 4))) & 1))^((((in[4] >> 28) | ((in[5] & 0xFF) << 4)))>>1))) + out[12] + out[14] = int32(((-(((in[5] >> 8) & 0xFFF) & 1))^(((in[5] >> 8) & 0xFFF)>>1))) + out[13] + out[15] = int32(((-(((in[5] >> 20)) & 1))^(((in[5] >> 20))>>1))) + out[14] + out[16] = int32(((-(((in[6] >> 0) & 0xFFF) & 1))^(((in[6] >> 0) & 0xFFF)>>1))) + out[15] + out[17] = int32(((-(((in[6] >> 12) & 0xFFF) & 1))^(((in[6] >> 12) & 0xFFF)>>1))) + out[16] + out[18] = int32(((-((((in[6] >> 24) | ((in[7] & 0xF) << 8))) & 1))^((((in[6] >> 24) | ((in[7] & 0xF) << 8)))>>1))) + out[17] + out[19] = int32(((-(((in[7] >> 4) & 0xFFF) & 1))^(((in[7] >> 4) & 0xFFF)>>1))) + out[18] + out[20] = int32(((-(((in[7] >> 16) & 0xFFF) & 1))^(((in[7] >> 16) & 0xFFF)>>1))) + out[19] + out[21] = int32(((-((((in[7] >> 28) | ((in[8] & 0xFF) << 4))) & 1))^((((in[7] >> 28) | ((in[8] & 0xFF) << 4)))>>1))) + out[20] + out[22] = int32(((-(((in[8] >> 8) & 0xFFF) & 1))^(((in[8] >> 8) & 0xFFF)>>1))) + out[21] + out[23] = int32(((-(((in[8] >> 20)) & 1))^(((in[8] >> 20))>>1))) + out[22] + out[24] = int32(((-(((in[9] >> 0) & 0xFFF) & 1))^(((in[9] >> 0) & 0xFFF)>>1))) + out[23] + out[25] = int32(((-(((in[9] >> 12) & 0xFFF) & 1))^(((in[9] >> 12) & 0xFFF)>>1))) + out[24] + out[26] = int32(((-((((in[9] >> 24) | ((in[10] & 0xF) << 8))) & 1))^((((in[9] >> 24) | ((in[10] & 0xF) << 8)))>>1))) + out[25] + out[27] = int32(((-(((in[10] >> 4) & 0xFFF) & 1))^(((in[10] >> 4) & 0xFFF)>>1))) + out[26] + out[28] = int32(((-(((in[10] >> 16) & 0xFFF) & 1))^(((in[10] >> 16) & 0xFFF)>>1))) + out[27] + out[29] = int32(((-((((in[10] >> 28) | ((in[11] & 0xFF) << 4))) & 1))^((((in[10] >> 28) | ((in[11] & 0xFF) << 4)))>>1))) + out[28] + out[30] = int32(((-(((in[11] >> 8) & 0xFFF) & 1))^(((in[11] >> 8) & 0xFFF)>>1))) + out[29] + out[31] = int32(((-(((in[11] >> 20)) & 1))^(((in[11] >> 20))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_13(initoffset int32, in *[13]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1FFF) & 1))^(((in[0] >> 0) & 0x1FFF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 13) & 0x1FFF) & 1))^(((in[0] >> 13) & 0x1FFF)>>1))) + out[0] + out[2] = int32(((-((((in[0] >> 26) | ((in[1] & 0x7F) << 6))) & 1))^((((in[0] >> 26) | ((in[1] & 0x7F) << 6)))>>1))) + out[1] + out[3] = int32(((-(((in[1] >> 7) & 0x1FFF) & 1))^(((in[1] >> 7) & 0x1FFF)>>1))) + out[2] + out[4] = int32(((-((((in[1] >> 20) | ((in[2] & 0x1) << 12))) & 1))^((((in[1] >> 20) | ((in[2] & 0x1) << 12)))>>1))) + out[3] + out[5] = int32(((-(((in[2] >> 1) & 0x1FFF) & 1))^(((in[2] >> 1) & 0x1FFF)>>1))) + out[4] + out[6] = int32(((-(((in[2] >> 14) & 0x1FFF) & 1))^(((in[2] >> 14) & 0x1FFF)>>1))) + out[5] + out[7] = int32(((-((((in[2] >> 27) | ((in[3] & 0xFF) << 5))) & 1))^((((in[2] >> 27) | ((in[3] & 0xFF) << 5)))>>1))) + out[6] + out[8] = int32(((-(((in[3] >> 8) & 0x1FFF) & 1))^(((in[3] >> 8) & 0x1FFF)>>1))) + out[7] + out[9] = int32(((-((((in[3] >> 21) | ((in[4] & 0x3) << 11))) & 1))^((((in[3] >> 21) | ((in[4] & 0x3) << 11)))>>1))) + out[8] + out[10] = int32(((-(((in[4] >> 2) & 0x1FFF) & 1))^(((in[4] >> 2) & 0x1FFF)>>1))) + out[9] + out[11] = int32(((-(((in[4] >> 15) & 0x1FFF) & 1))^(((in[4] >> 15) & 0x1FFF)>>1))) + out[10] + out[12] = int32(((-((((in[4] >> 28) | ((in[5] & 0x1FF) << 4))) & 1))^((((in[4] >> 28) | ((in[5] & 0x1FF) << 4)))>>1))) + out[11] + out[13] = int32(((-(((in[5] >> 9) & 0x1FFF) & 1))^(((in[5] >> 9) & 0x1FFF)>>1))) + out[12] + out[14] = int32(((-((((in[5] >> 22) | ((in[6] & 0x7) << 10))) & 1))^((((in[5] >> 22) | ((in[6] & 0x7) << 10)))>>1))) + out[13] + out[15] = int32(((-(((in[6] >> 3) & 0x1FFF) & 1))^(((in[6] >> 3) & 0x1FFF)>>1))) + out[14] + out[16] = int32(((-(((in[6] >> 16) & 0x1FFF) & 1))^(((in[6] >> 16) & 0x1FFF)>>1))) + out[15] + out[17] = int32(((-((((in[6] >> 29) | ((in[7] & 0x3FF) << 3))) & 1))^((((in[6] >> 29) | ((in[7] & 0x3FF) << 3)))>>1))) + out[16] + out[18] = int32(((-(((in[7] >> 10) & 0x1FFF) & 1))^(((in[7] >> 10) & 0x1FFF)>>1))) + out[17] + out[19] = int32(((-((((in[7] >> 23) | ((in[8] & 0xF) << 9))) & 1))^((((in[7] >> 23) | ((in[8] & 0xF) << 9)))>>1))) + out[18] + out[20] = int32(((-(((in[8] >> 4) & 0x1FFF) & 1))^(((in[8] >> 4) & 0x1FFF)>>1))) + out[19] + out[21] = int32(((-(((in[8] >> 17) & 0x1FFF) & 1))^(((in[8] >> 17) & 0x1FFF)>>1))) + out[20] + out[22] = int32(((-((((in[8] >> 30) | ((in[9] & 0x7FF) << 2))) & 1))^((((in[8] >> 30) | ((in[9] & 0x7FF) << 2)))>>1))) + out[21] + out[23] = int32(((-(((in[9] >> 11) & 0x1FFF) & 1))^(((in[9] >> 11) & 0x1FFF)>>1))) + out[22] + out[24] = int32(((-((((in[9] >> 24) | ((in[10] & 0x1F) << 8))) & 1))^((((in[9] >> 24) | ((in[10] & 0x1F) << 8)))>>1))) + out[23] + out[25] = int32(((-(((in[10] >> 5) & 0x1FFF) & 1))^(((in[10] >> 5) & 0x1FFF)>>1))) + out[24] + out[26] = int32(((-(((in[10] >> 18) & 0x1FFF) & 1))^(((in[10] >> 18) & 0x1FFF)>>1))) + out[25] + out[27] = int32(((-((((in[10] >> 31) | ((in[11] & 0xFFF) << 1))) & 1))^((((in[10] >> 31) | ((in[11] & 0xFFF) << 1)))>>1))) + out[26] + out[28] = int32(((-(((in[11] >> 12) & 0x1FFF) & 1))^(((in[11] >> 12) & 0x1FFF)>>1))) + out[27] + out[29] = int32(((-((((in[11] >> 25) | ((in[12] & 0x3F) << 7))) & 1))^((((in[11] >> 25) | ((in[12] & 0x3F) << 7)))>>1))) + out[28] + out[30] = int32(((-(((in[12] >> 6) & 0x1FFF) & 1))^(((in[12] >> 6) & 0x1FFF)>>1))) + out[29] + out[31] = int32(((-(((in[12] >> 19)) & 1))^(((in[12] >> 19))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_14(initoffset int32, in *[14]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3FFF) & 1))^(((in[0] >> 0) & 0x3FFF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 14) & 0x3FFF) & 1))^(((in[0] >> 14) & 0x3FFF)>>1))) + out[0] + out[2] = int32(((-((((in[0] >> 28) | ((in[1] & 0x3FF) << 4))) & 1))^((((in[0] >> 28) | ((in[1] & 0x3FF) << 4)))>>1))) + out[1] + out[3] = int32(((-(((in[1] >> 10) & 0x3FFF) & 1))^(((in[1] >> 10) & 0x3FFF)>>1))) + out[2] + out[4] = int32(((-((((in[1] >> 24) | ((in[2] & 0x3F) << 8))) & 1))^((((in[1] >> 24) | ((in[2] & 0x3F) << 8)))>>1))) + out[3] + out[5] = int32(((-(((in[2] >> 6) & 0x3FFF) & 1))^(((in[2] >> 6) & 0x3FFF)>>1))) + out[4] + out[6] = int32(((-((((in[2] >> 20) | ((in[3] & 0x3) << 12))) & 1))^((((in[2] >> 20) | ((in[3] & 0x3) << 12)))>>1))) + out[5] + out[7] = int32(((-(((in[3] >> 2) & 0x3FFF) & 1))^(((in[3] >> 2) & 0x3FFF)>>1))) + out[6] + out[8] = int32(((-(((in[3] >> 16) & 0x3FFF) & 1))^(((in[3] >> 16) & 0x3FFF)>>1))) + out[7] + out[9] = int32(((-((((in[3] >> 30) | ((in[4] & 0xFFF) << 2))) & 1))^((((in[3] >> 30) | ((in[4] & 0xFFF) << 2)))>>1))) + out[8] + out[10] = int32(((-(((in[4] >> 12) & 0x3FFF) & 1))^(((in[4] >> 12) & 0x3FFF)>>1))) + out[9] + out[11] = int32(((-((((in[4] >> 26) | ((in[5] & 0xFF) << 6))) & 1))^((((in[4] >> 26) | ((in[5] & 0xFF) << 6)))>>1))) + out[10] + out[12] = int32(((-(((in[5] >> 8) & 0x3FFF) & 1))^(((in[5] >> 8) & 0x3FFF)>>1))) + out[11] + out[13] = int32(((-((((in[5] >> 22) | ((in[6] & 0xF) << 10))) & 1))^((((in[5] >> 22) | ((in[6] & 0xF) << 10)))>>1))) + out[12] + out[14] = int32(((-(((in[6] >> 4) & 0x3FFF) & 1))^(((in[6] >> 4) & 0x3FFF)>>1))) + out[13] + out[15] = int32(((-(((in[6] >> 18)) & 1))^(((in[6] >> 18))>>1))) + out[14] + out[16] = int32(((-(((in[7] >> 0) & 0x3FFF) & 1))^(((in[7] >> 0) & 0x3FFF)>>1))) + out[15] + out[17] = int32(((-(((in[7] >> 14) & 0x3FFF) & 1))^(((in[7] >> 14) & 0x3FFF)>>1))) + out[16] + out[18] = int32(((-((((in[7] >> 28) | ((in[8] & 0x3FF) << 4))) & 1))^((((in[7] >> 28) | ((in[8] & 0x3FF) << 4)))>>1))) + out[17] + out[19] = int32(((-(((in[8] >> 10) & 0x3FFF) & 1))^(((in[8] >> 10) & 0x3FFF)>>1))) + out[18] + out[20] = int32(((-((((in[8] >> 24) | ((in[9] & 0x3F) << 8))) & 1))^((((in[8] >> 24) | ((in[9] & 0x3F) << 8)))>>1))) + out[19] + out[21] = int32(((-(((in[9] >> 6) & 0x3FFF) & 1))^(((in[9] >> 6) & 0x3FFF)>>1))) + out[20] + out[22] = int32(((-((((in[9] >> 20) | ((in[10] & 0x3) << 12))) & 1))^((((in[9] >> 20) | ((in[10] & 0x3) << 12)))>>1))) + out[21] + out[23] = int32(((-(((in[10] >> 2) & 0x3FFF) & 1))^(((in[10] >> 2) & 0x3FFF)>>1))) + out[22] + out[24] = int32(((-(((in[10] >> 16) & 0x3FFF) & 1))^(((in[10] >> 16) & 0x3FFF)>>1))) + out[23] + out[25] = int32(((-((((in[10] >> 30) | ((in[11] & 0xFFF) << 2))) & 1))^((((in[10] >> 30) | ((in[11] & 0xFFF) << 2)))>>1))) + out[24] + out[26] = int32(((-(((in[11] >> 12) & 0x3FFF) & 1))^(((in[11] >> 12) & 0x3FFF)>>1))) + out[25] + out[27] = int32(((-((((in[11] >> 26) | ((in[12] & 0xFF) << 6))) & 1))^((((in[11] >> 26) | ((in[12] & 0xFF) << 6)))>>1))) + out[26] + out[28] = int32(((-(((in[12] >> 8) & 0x3FFF) & 1))^(((in[12] >> 8) & 0x3FFF)>>1))) + out[27] + out[29] = int32(((-((((in[12] >> 22) | ((in[13] & 0xF) << 10))) & 1))^((((in[12] >> 22) | ((in[13] & 0xF) << 10)))>>1))) + out[28] + out[30] = int32(((-(((in[13] >> 4) & 0x3FFF) & 1))^(((in[13] >> 4) & 0x3FFF)>>1))) + out[29] + out[31] = int32(((-(((in[13] >> 18)) & 1))^(((in[13] >> 18))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_15(initoffset int32, in *[15]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7FFF) & 1))^(((in[0] >> 0) & 0x7FFF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 15) & 0x7FFF) & 1))^(((in[0] >> 15) & 0x7FFF)>>1))) + out[0] + out[2] = int32(((-((((in[0] >> 30) | ((in[1] & 0x1FFF) << 2))) & 1))^((((in[0] >> 30) | ((in[1] & 0x1FFF) << 2)))>>1))) + out[1] + out[3] = int32(((-(((in[1] >> 13) & 0x7FFF) & 1))^(((in[1] >> 13) & 0x7FFF)>>1))) + out[2] + out[4] = int32(((-((((in[1] >> 28) | ((in[2] & 0x7FF) << 4))) & 1))^((((in[1] >> 28) | ((in[2] & 0x7FF) << 4)))>>1))) + out[3] + out[5] = int32(((-(((in[2] >> 11) & 0x7FFF) & 1))^(((in[2] >> 11) & 0x7FFF)>>1))) + out[4] + out[6] = int32(((-((((in[2] >> 26) | ((in[3] & 0x1FF) << 6))) & 1))^((((in[2] >> 26) | ((in[3] & 0x1FF) << 6)))>>1))) + out[5] + out[7] = int32(((-(((in[3] >> 9) & 0x7FFF) & 1))^(((in[3] >> 9) & 0x7FFF)>>1))) + out[6] + out[8] = int32(((-((((in[3] >> 24) | ((in[4] & 0x7F) << 8))) & 1))^((((in[3] >> 24) | ((in[4] & 0x7F) << 8)))>>1))) + out[7] + out[9] = int32(((-(((in[4] >> 7) & 0x7FFF) & 1))^(((in[4] >> 7) & 0x7FFF)>>1))) + out[8] + out[10] = int32(((-((((in[4] >> 22) | ((in[5] & 0x1F) << 10))) & 1))^((((in[4] >> 22) | ((in[5] & 0x1F) << 10)))>>1))) + out[9] + out[11] = int32(((-(((in[5] >> 5) & 0x7FFF) & 1))^(((in[5] >> 5) & 0x7FFF)>>1))) + out[10] + out[12] = int32(((-((((in[5] >> 20) | ((in[6] & 0x7) << 12))) & 1))^((((in[5] >> 20) | ((in[6] & 0x7) << 12)))>>1))) + out[11] + out[13] = int32(((-(((in[6] >> 3) & 0x7FFF) & 1))^(((in[6] >> 3) & 0x7FFF)>>1))) + out[12] + out[14] = int32(((-((((in[6] >> 18) | ((in[7] & 0x1) << 14))) & 1))^((((in[6] >> 18) | ((in[7] & 0x1) << 14)))>>1))) + out[13] + out[15] = int32(((-(((in[7] >> 1) & 0x7FFF) & 1))^(((in[7] >> 1) & 0x7FFF)>>1))) + out[14] + out[16] = int32(((-(((in[7] >> 16) & 0x7FFF) & 1))^(((in[7] >> 16) & 0x7FFF)>>1))) + out[15] + out[17] = int32(((-((((in[7] >> 31) | ((in[8] & 0x3FFF) << 1))) & 1))^((((in[7] >> 31) | ((in[8] & 0x3FFF) << 1)))>>1))) + out[16] + out[18] = int32(((-(((in[8] >> 14) & 0x7FFF) & 1))^(((in[8] >> 14) & 0x7FFF)>>1))) + out[17] + out[19] = int32(((-((((in[8] >> 29) | ((in[9] & 0xFFF) << 3))) & 1))^((((in[8] >> 29) | ((in[9] & 0xFFF) << 3)))>>1))) + out[18] + out[20] = int32(((-(((in[9] >> 12) & 0x7FFF) & 1))^(((in[9] >> 12) & 0x7FFF)>>1))) + out[19] + out[21] = int32(((-((((in[9] >> 27) | ((in[10] & 0x3FF) << 5))) & 1))^((((in[9] >> 27) | ((in[10] & 0x3FF) << 5)))>>1))) + out[20] + out[22] = int32(((-(((in[10] >> 10) & 0x7FFF) & 1))^(((in[10] >> 10) & 0x7FFF)>>1))) + out[21] + out[23] = int32(((-((((in[10] >> 25) | ((in[11] & 0xFF) << 7))) & 1))^((((in[10] >> 25) | ((in[11] & 0xFF) << 7)))>>1))) + out[22] + out[24] = int32(((-(((in[11] >> 8) & 0x7FFF) & 1))^(((in[11] >> 8) & 0x7FFF)>>1))) + out[23] + out[25] = int32(((-((((in[11] >> 23) | ((in[12] & 0x3F) << 9))) & 1))^((((in[11] >> 23) | ((in[12] & 0x3F) << 9)))>>1))) + out[24] + out[26] = int32(((-(((in[12] >> 6) & 0x7FFF) & 1))^(((in[12] >> 6) & 0x7FFF)>>1))) + out[25] + out[27] = int32(((-((((in[12] >> 21) | ((in[13] & 0xF) << 11))) & 1))^((((in[12] >> 21) | ((in[13] & 0xF) << 11)))>>1))) + out[26] + out[28] = int32(((-(((in[13] >> 4) & 0x7FFF) & 1))^(((in[13] >> 4) & 0x7FFF)>>1))) + out[27] + out[29] = int32(((-((((in[13] >> 19) | ((in[14] & 0x3) << 13))) & 1))^((((in[13] >> 19) | ((in[14] & 0x3) << 13)))>>1))) + out[28] + out[30] = int32(((-(((in[14] >> 2) & 0x7FFF) & 1))^(((in[14] >> 2) & 0x7FFF)>>1))) + out[29] + out[31] = int32(((-(((in[14] >> 17)) & 1))^(((in[14] >> 17))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_16(initoffset int32, in *[16]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0xFFFF) & 1))^(((in[0] >> 0) & 0xFFFF)>>1))) + initoffset + out[1] = int32(((-(((in[0] >> 16)) & 1))^(((in[0] >> 16))>>1))) + out[0] + out[2] = int32(((-(((in[1] >> 0) & 0xFFFF) & 1))^(((in[1] >> 0) & 0xFFFF)>>1))) + out[1] + out[3] = int32(((-(((in[1] >> 16)) & 1))^(((in[1] >> 16))>>1))) + out[2] + out[4] = int32(((-(((in[2] >> 0) & 0xFFFF) & 1))^(((in[2] >> 0) & 0xFFFF)>>1))) + out[3] + out[5] = int32(((-(((in[2] >> 16)) & 1))^(((in[2] >> 16))>>1))) + out[4] + out[6] = int32(((-(((in[3] >> 0) & 0xFFFF) & 1))^(((in[3] >> 0) & 0xFFFF)>>1))) + out[5] + out[7] = int32(((-(((in[3] >> 16)) & 1))^(((in[3] >> 16))>>1))) + out[6] + out[8] = int32(((-(((in[4] >> 0) & 0xFFFF) & 1))^(((in[4] >> 0) & 0xFFFF)>>1))) + out[7] + out[9] = int32(((-(((in[4] >> 16)) & 1))^(((in[4] >> 16))>>1))) + out[8] + out[10] = int32(((-(((in[5] >> 0) & 0xFFFF) & 1))^(((in[5] >> 0) & 0xFFFF)>>1))) + out[9] + out[11] = int32(((-(((in[5] >> 16)) & 1))^(((in[5] >> 16))>>1))) + out[10] + out[12] = int32(((-(((in[6] >> 0) & 0xFFFF) & 1))^(((in[6] >> 0) & 0xFFFF)>>1))) + out[11] + out[13] = int32(((-(((in[6] >> 16)) & 1))^(((in[6] >> 16))>>1))) + out[12] + out[14] = int32(((-(((in[7] >> 0) & 0xFFFF) & 1))^(((in[7] >> 0) & 0xFFFF)>>1))) + out[13] + out[15] = int32(((-(((in[7] >> 16)) & 1))^(((in[7] >> 16))>>1))) + out[14] + out[16] = int32(((-(((in[8] >> 0) & 0xFFFF) & 1))^(((in[8] >> 0) & 0xFFFF)>>1))) + out[15] + out[17] = int32(((-(((in[8] >> 16)) & 1))^(((in[8] >> 16))>>1))) + out[16] + out[18] = int32(((-(((in[9] >> 0) & 0xFFFF) & 1))^(((in[9] >> 0) & 0xFFFF)>>1))) + out[17] + out[19] = int32(((-(((in[9] >> 16)) & 1))^(((in[9] >> 16))>>1))) + out[18] + out[20] = int32(((-(((in[10] >> 0) & 0xFFFF) & 1))^(((in[10] >> 0) & 0xFFFF)>>1))) + out[19] + out[21] = int32(((-(((in[10] >> 16)) & 1))^(((in[10] >> 16))>>1))) + out[20] + out[22] = int32(((-(((in[11] >> 0) & 0xFFFF) & 1))^(((in[11] >> 0) & 0xFFFF)>>1))) + out[21] + out[23] = int32(((-(((in[11] >> 16)) & 1))^(((in[11] >> 16))>>1))) + out[22] + out[24] = int32(((-(((in[12] >> 0) & 0xFFFF) & 1))^(((in[12] >> 0) & 0xFFFF)>>1))) + out[23] + out[25] = int32(((-(((in[12] >> 16)) & 1))^(((in[12] >> 16))>>1))) + out[24] + out[26] = int32(((-(((in[13] >> 0) & 0xFFFF) & 1))^(((in[13] >> 0) & 0xFFFF)>>1))) + out[25] + out[27] = int32(((-(((in[13] >> 16)) & 1))^(((in[13] >> 16))>>1))) + out[26] + out[28] = int32(((-(((in[14] >> 0) & 0xFFFF) & 1))^(((in[14] >> 0) & 0xFFFF)>>1))) + out[27] + out[29] = int32(((-(((in[14] >> 16)) & 1))^(((in[14] >> 16))>>1))) + out[28] + out[30] = int32(((-(((in[15] >> 0) & 0xFFFF) & 1))^(((in[15] >> 0) & 0xFFFF)>>1))) + out[29] + out[31] = int32(((-(((in[15] >> 16)) & 1))^(((in[15] >> 16))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_17(initoffset int32, in *[17]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1FFFF) & 1))^(((in[0] >> 0) & 0x1FFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 17) | ((in[1] & 0x3) << 15))) & 1))^((((in[0] >> 17) | ((in[1] & 0x3) << 15)))>>1))) + out[0] + out[2] = int32(((-(((in[1] >> 2) & 0x1FFFF) & 1))^(((in[1] >> 2) & 0x1FFFF)>>1))) + out[1] + out[3] = int32(((-((((in[1] >> 19) | ((in[2] & 0xF) << 13))) & 1))^((((in[1] >> 19) | ((in[2] & 0xF) << 13)))>>1))) + out[2] + out[4] = int32(((-(((in[2] >> 4) & 0x1FFFF) & 1))^(((in[2] >> 4) & 0x1FFFF)>>1))) + out[3] + out[5] = int32(((-((((in[2] >> 21) | ((in[3] & 0x3F) << 11))) & 1))^((((in[2] >> 21) | ((in[3] & 0x3F) << 11)))>>1))) + out[4] + out[6] = int32(((-(((in[3] >> 6) & 0x1FFFF) & 1))^(((in[3] >> 6) & 0x1FFFF)>>1))) + out[5] + out[7] = int32(((-((((in[3] >> 23) | ((in[4] & 0xFF) << 9))) & 1))^((((in[3] >> 23) | ((in[4] & 0xFF) << 9)))>>1))) + out[6] + out[8] = int32(((-(((in[4] >> 8) & 0x1FFFF) & 1))^(((in[4] >> 8) & 0x1FFFF)>>1))) + out[7] + out[9] = int32(((-((((in[4] >> 25) | ((in[5] & 0x3FF) << 7))) & 1))^((((in[4] >> 25) | ((in[5] & 0x3FF) << 7)))>>1))) + out[8] + out[10] = int32(((-(((in[5] >> 10) & 0x1FFFF) & 1))^(((in[5] >> 10) & 0x1FFFF)>>1))) + out[9] + out[11] = int32(((-((((in[5] >> 27) | ((in[6] & 0xFFF) << 5))) & 1))^((((in[5] >> 27) | ((in[6] & 0xFFF) << 5)))>>1))) + out[10] + out[12] = int32(((-(((in[6] >> 12) & 0x1FFFF) & 1))^(((in[6] >> 12) & 0x1FFFF)>>1))) + out[11] + out[13] = int32(((-((((in[6] >> 29) | ((in[7] & 0x3FFF) << 3))) & 1))^((((in[6] >> 29) | ((in[7] & 0x3FFF) << 3)))>>1))) + out[12] + out[14] = int32(((-(((in[7] >> 14) & 0x1FFFF) & 1))^(((in[7] >> 14) & 0x1FFFF)>>1))) + out[13] + out[15] = int32(((-((((in[7] >> 31) | ((in[8] & 0xFFFF) << 1))) & 1))^((((in[7] >> 31) | ((in[8] & 0xFFFF) << 1)))>>1))) + out[14] + out[16] = int32(((-((((in[8] >> 16) | ((in[9] & 0x1) << 16))) & 1))^((((in[8] >> 16) | ((in[9] & 0x1) << 16)))>>1))) + out[15] + out[17] = int32(((-(((in[9] >> 1) & 0x1FFFF) & 1))^(((in[9] >> 1) & 0x1FFFF)>>1))) + out[16] + out[18] = int32(((-((((in[9] >> 18) | ((in[10] & 0x7) << 14))) & 1))^((((in[9] >> 18) | ((in[10] & 0x7) << 14)))>>1))) + out[17] + out[19] = int32(((-(((in[10] >> 3) & 0x1FFFF) & 1))^(((in[10] >> 3) & 0x1FFFF)>>1))) + out[18] + out[20] = int32(((-((((in[10] >> 20) | ((in[11] & 0x1F) << 12))) & 1))^((((in[10] >> 20) | ((in[11] & 0x1F) << 12)))>>1))) + out[19] + out[21] = int32(((-(((in[11] >> 5) & 0x1FFFF) & 1))^(((in[11] >> 5) & 0x1FFFF)>>1))) + out[20] + out[22] = int32(((-((((in[11] >> 22) | ((in[12] & 0x7F) << 10))) & 1))^((((in[11] >> 22) | ((in[12] & 0x7F) << 10)))>>1))) + out[21] + out[23] = int32(((-(((in[12] >> 7) & 0x1FFFF) & 1))^(((in[12] >> 7) & 0x1FFFF)>>1))) + out[22] + out[24] = int32(((-((((in[12] >> 24) | ((in[13] & 0x1FF) << 8))) & 1))^((((in[12] >> 24) | ((in[13] & 0x1FF) << 8)))>>1))) + out[23] + out[25] = int32(((-(((in[13] >> 9) & 0x1FFFF) & 1))^(((in[13] >> 9) & 0x1FFFF)>>1))) + out[24] + out[26] = int32(((-((((in[13] >> 26) | ((in[14] & 0x7FF) << 6))) & 1))^((((in[13] >> 26) | ((in[14] & 0x7FF) << 6)))>>1))) + out[25] + out[27] = int32(((-(((in[14] >> 11) & 0x1FFFF) & 1))^(((in[14] >> 11) & 0x1FFFF)>>1))) + out[26] + out[28] = int32(((-((((in[14] >> 28) | ((in[15] & 0x1FFF) << 4))) & 1))^((((in[14] >> 28) | ((in[15] & 0x1FFF) << 4)))>>1))) + out[27] + out[29] = int32(((-(((in[15] >> 13) & 0x1FFFF) & 1))^(((in[15] >> 13) & 0x1FFFF)>>1))) + out[28] + out[30] = int32(((-((((in[15] >> 30) | ((in[16] & 0x7FFF) << 2))) & 1))^((((in[15] >> 30) | ((in[16] & 0x7FFF) << 2)))>>1))) + out[29] + out[31] = int32(((-(((in[16] >> 15)) & 1))^(((in[16] >> 15))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_18(initoffset int32, in *[18]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3FFFF) & 1))^(((in[0] >> 0) & 0x3FFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 18) | ((in[1] & 0xF) << 14))) & 1))^((((in[0] >> 18) | ((in[1] & 0xF) << 14)))>>1))) + out[0] + out[2] = int32(((-(((in[1] >> 4) & 0x3FFFF) & 1))^(((in[1] >> 4) & 0x3FFFF)>>1))) + out[1] + out[3] = int32(((-((((in[1] >> 22) | ((in[2] & 0xFF) << 10))) & 1))^((((in[1] >> 22) | ((in[2] & 0xFF) << 10)))>>1))) + out[2] + out[4] = int32(((-(((in[2] >> 8) & 0x3FFFF) & 1))^(((in[2] >> 8) & 0x3FFFF)>>1))) + out[3] + out[5] = int32(((-((((in[2] >> 26) | ((in[3] & 0xFFF) << 6))) & 1))^((((in[2] >> 26) | ((in[3] & 0xFFF) << 6)))>>1))) + out[4] + out[6] = int32(((-(((in[3] >> 12) & 0x3FFFF) & 1))^(((in[3] >> 12) & 0x3FFFF)>>1))) + out[5] + out[7] = int32(((-((((in[3] >> 30) | ((in[4] & 0xFFFF) << 2))) & 1))^((((in[3] >> 30) | ((in[4] & 0xFFFF) << 2)))>>1))) + out[6] + out[8] = int32(((-((((in[4] >> 16) | ((in[5] & 0x3) << 16))) & 1))^((((in[4] >> 16) | ((in[5] & 0x3) << 16)))>>1))) + out[7] + out[9] = int32(((-(((in[5] >> 2) & 0x3FFFF) & 1))^(((in[5] >> 2) & 0x3FFFF)>>1))) + out[8] + out[10] = int32(((-((((in[5] >> 20) | ((in[6] & 0x3F) << 12))) & 1))^((((in[5] >> 20) | ((in[6] & 0x3F) << 12)))>>1))) + out[9] + out[11] = int32(((-(((in[6] >> 6) & 0x3FFFF) & 1))^(((in[6] >> 6) & 0x3FFFF)>>1))) + out[10] + out[12] = int32(((-((((in[6] >> 24) | ((in[7] & 0x3FF) << 8))) & 1))^((((in[6] >> 24) | ((in[7] & 0x3FF) << 8)))>>1))) + out[11] + out[13] = int32(((-(((in[7] >> 10) & 0x3FFFF) & 1))^(((in[7] >> 10) & 0x3FFFF)>>1))) + out[12] + out[14] = int32(((-((((in[7] >> 28) | ((in[8] & 0x3FFF) << 4))) & 1))^((((in[7] >> 28) | ((in[8] & 0x3FFF) << 4)))>>1))) + out[13] + out[15] = int32(((-(((in[8] >> 14)) & 1))^(((in[8] >> 14))>>1))) + out[14] + out[16] = int32(((-(((in[9] >> 0) & 0x3FFFF) & 1))^(((in[9] >> 0) & 0x3FFFF)>>1))) + out[15] + out[17] = int32(((-((((in[9] >> 18) | ((in[10] & 0xF) << 14))) & 1))^((((in[9] >> 18) | ((in[10] & 0xF) << 14)))>>1))) + out[16] + out[18] = int32(((-(((in[10] >> 4) & 0x3FFFF) & 1))^(((in[10] >> 4) & 0x3FFFF)>>1))) + out[17] + out[19] = int32(((-((((in[10] >> 22) | ((in[11] & 0xFF) << 10))) & 1))^((((in[10] >> 22) | ((in[11] & 0xFF) << 10)))>>1))) + out[18] + out[20] = int32(((-(((in[11] >> 8) & 0x3FFFF) & 1))^(((in[11] >> 8) & 0x3FFFF)>>1))) + out[19] + out[21] = int32(((-((((in[11] >> 26) | ((in[12] & 0xFFF) << 6))) & 1))^((((in[11] >> 26) | ((in[12] & 0xFFF) << 6)))>>1))) + out[20] + out[22] = int32(((-(((in[12] >> 12) & 0x3FFFF) & 1))^(((in[12] >> 12) & 0x3FFFF)>>1))) + out[21] + out[23] = int32(((-((((in[12] >> 30) | ((in[13] & 0xFFFF) << 2))) & 1))^((((in[12] >> 30) | ((in[13] & 0xFFFF) << 2)))>>1))) + out[22] + out[24] = int32(((-((((in[13] >> 16) | ((in[14] & 0x3) << 16))) & 1))^((((in[13] >> 16) | ((in[14] & 0x3) << 16)))>>1))) + out[23] + out[25] = int32(((-(((in[14] >> 2) & 0x3FFFF) & 1))^(((in[14] >> 2) & 0x3FFFF)>>1))) + out[24] + out[26] = int32(((-((((in[14] >> 20) | ((in[15] & 0x3F) << 12))) & 1))^((((in[14] >> 20) | ((in[15] & 0x3F) << 12)))>>1))) + out[25] + out[27] = int32(((-(((in[15] >> 6) & 0x3FFFF) & 1))^(((in[15] >> 6) & 0x3FFFF)>>1))) + out[26] + out[28] = int32(((-((((in[15] >> 24) | ((in[16] & 0x3FF) << 8))) & 1))^((((in[15] >> 24) | ((in[16] & 0x3FF) << 8)))>>1))) + out[27] + out[29] = int32(((-(((in[16] >> 10) & 0x3FFFF) & 1))^(((in[16] >> 10) & 0x3FFFF)>>1))) + out[28] + out[30] = int32(((-((((in[16] >> 28) | ((in[17] & 0x3FFF) << 4))) & 1))^((((in[16] >> 28) | ((in[17] & 0x3FFF) << 4)))>>1))) + out[29] + out[31] = int32(((-(((in[17] >> 14)) & 1))^(((in[17] >> 14))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_19(initoffset int32, in *[19]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7FFFF) & 1))^(((in[0] >> 0) & 0x7FFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 19) | ((in[1] & 0x3F) << 13))) & 1))^((((in[0] >> 19) | ((in[1] & 0x3F) << 13)))>>1))) + out[0] + out[2] = int32(((-(((in[1] >> 6) & 0x7FFFF) & 1))^(((in[1] >> 6) & 0x7FFFF)>>1))) + out[1] + out[3] = int32(((-((((in[1] >> 25) | ((in[2] & 0xFFF) << 7))) & 1))^((((in[1] >> 25) | ((in[2] & 0xFFF) << 7)))>>1))) + out[2] + out[4] = int32(((-(((in[2] >> 12) & 0x7FFFF) & 1))^(((in[2] >> 12) & 0x7FFFF)>>1))) + out[3] + out[5] = int32(((-((((in[2] >> 31) | ((in[3] & 0x3FFFF) << 1))) & 1))^((((in[2] >> 31) | ((in[3] & 0x3FFFF) << 1)))>>1))) + out[4] + out[6] = int32(((-((((in[3] >> 18) | ((in[4] & 0x1F) << 14))) & 1))^((((in[3] >> 18) | ((in[4] & 0x1F) << 14)))>>1))) + out[5] + out[7] = int32(((-(((in[4] >> 5) & 0x7FFFF) & 1))^(((in[4] >> 5) & 0x7FFFF)>>1))) + out[6] + out[8] = int32(((-((((in[4] >> 24) | ((in[5] & 0x7FF) << 8))) & 1))^((((in[4] >> 24) | ((in[5] & 0x7FF) << 8)))>>1))) + out[7] + out[9] = int32(((-(((in[5] >> 11) & 0x7FFFF) & 1))^(((in[5] >> 11) & 0x7FFFF)>>1))) + out[8] + out[10] = int32(((-((((in[5] >> 30) | ((in[6] & 0x1FFFF) << 2))) & 1))^((((in[5] >> 30) | ((in[6] & 0x1FFFF) << 2)))>>1))) + out[9] + out[11] = int32(((-((((in[6] >> 17) | ((in[7] & 0xF) << 15))) & 1))^((((in[6] >> 17) | ((in[7] & 0xF) << 15)))>>1))) + out[10] + out[12] = int32(((-(((in[7] >> 4) & 0x7FFFF) & 1))^(((in[7] >> 4) & 0x7FFFF)>>1))) + out[11] + out[13] = int32(((-((((in[7] >> 23) | ((in[8] & 0x3FF) << 9))) & 1))^((((in[7] >> 23) | ((in[8] & 0x3FF) << 9)))>>1))) + out[12] + out[14] = int32(((-(((in[8] >> 10) & 0x7FFFF) & 1))^(((in[8] >> 10) & 0x7FFFF)>>1))) + out[13] + out[15] = int32(((-((((in[8] >> 29) | ((in[9] & 0xFFFF) << 3))) & 1))^((((in[8] >> 29) | ((in[9] & 0xFFFF) << 3)))>>1))) + out[14] + out[16] = int32(((-((((in[9] >> 16) | ((in[10] & 0x7) << 16))) & 1))^((((in[9] >> 16) | ((in[10] & 0x7) << 16)))>>1))) + out[15] + out[17] = int32(((-(((in[10] >> 3) & 0x7FFFF) & 1))^(((in[10] >> 3) & 0x7FFFF)>>1))) + out[16] + out[18] = int32(((-((((in[10] >> 22) | ((in[11] & 0x1FF) << 10))) & 1))^((((in[10] >> 22) | ((in[11] & 0x1FF) << 10)))>>1))) + out[17] + out[19] = int32(((-(((in[11] >> 9) & 0x7FFFF) & 1))^(((in[11] >> 9) & 0x7FFFF)>>1))) + out[18] + out[20] = int32(((-((((in[11] >> 28) | ((in[12] & 0x7FFF) << 4))) & 1))^((((in[11] >> 28) | ((in[12] & 0x7FFF) << 4)))>>1))) + out[19] + out[21] = int32(((-((((in[12] >> 15) | ((in[13] & 0x3) << 17))) & 1))^((((in[12] >> 15) | ((in[13] & 0x3) << 17)))>>1))) + out[20] + out[22] = int32(((-(((in[13] >> 2) & 0x7FFFF) & 1))^(((in[13] >> 2) & 0x7FFFF)>>1))) + out[21] + out[23] = int32(((-((((in[13] >> 21) | ((in[14] & 0xFF) << 11))) & 1))^((((in[13] >> 21) | ((in[14] & 0xFF) << 11)))>>1))) + out[22] + out[24] = int32(((-(((in[14] >> 8) & 0x7FFFF) & 1))^(((in[14] >> 8) & 0x7FFFF)>>1))) + out[23] + out[25] = int32(((-((((in[14] >> 27) | ((in[15] & 0x3FFF) << 5))) & 1))^((((in[14] >> 27) | ((in[15] & 0x3FFF) << 5)))>>1))) + out[24] + out[26] = int32(((-((((in[15] >> 14) | ((in[16] & 0x1) << 18))) & 1))^((((in[15] >> 14) | ((in[16] & 0x1) << 18)))>>1))) + out[25] + out[27] = int32(((-(((in[16] >> 1) & 0x7FFFF) & 1))^(((in[16] >> 1) & 0x7FFFF)>>1))) + out[26] + out[28] = int32(((-((((in[16] >> 20) | ((in[17] & 0x7F) << 12))) & 1))^((((in[16] >> 20) | ((in[17] & 0x7F) << 12)))>>1))) + out[27] + out[29] = int32(((-(((in[17] >> 7) & 0x7FFFF) & 1))^(((in[17] >> 7) & 0x7FFFF)>>1))) + out[28] + out[30] = int32(((-((((in[17] >> 26) | ((in[18] & 0x1FFF) << 6))) & 1))^((((in[17] >> 26) | ((in[18] & 0x1FFF) << 6)))>>1))) + out[29] + out[31] = int32(((-(((in[18] >> 13)) & 1))^(((in[18] >> 13))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_20(initoffset int32, in *[20]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0xFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 20) | ((in[1] & 0xFF) << 12))) & 1))^((((in[0] >> 20) | ((in[1] & 0xFF) << 12)))>>1))) + out[0] + out[2] = int32(((-(((in[1] >> 8) & 0xFFFFF) & 1))^(((in[1] >> 8) & 0xFFFFF)>>1))) + out[1] + out[3] = int32(((-((((in[1] >> 28) | ((in[2] & 0xFFFF) << 4))) & 1))^((((in[1] >> 28) | ((in[2] & 0xFFFF) << 4)))>>1))) + out[2] + out[4] = int32(((-((((in[2] >> 16) | ((in[3] & 0xF) << 16))) & 1))^((((in[2] >> 16) | ((in[3] & 0xF) << 16)))>>1))) + out[3] + out[5] = int32(((-(((in[3] >> 4) & 0xFFFFF) & 1))^(((in[3] >> 4) & 0xFFFFF)>>1))) + out[4] + out[6] = int32(((-((((in[3] >> 24) | ((in[4] & 0xFFF) << 8))) & 1))^((((in[3] >> 24) | ((in[4] & 0xFFF) << 8)))>>1))) + out[5] + out[7] = int32(((-(((in[4] >> 12)) & 1))^(((in[4] >> 12))>>1))) + out[6] + out[8] = int32(((-(((in[5] >> 0) & 0xFFFFF) & 1))^(((in[5] >> 0) & 0xFFFFF)>>1))) + out[7] + out[9] = int32(((-((((in[5] >> 20) | ((in[6] & 0xFF) << 12))) & 1))^((((in[5] >> 20) | ((in[6] & 0xFF) << 12)))>>1))) + out[8] + out[10] = int32(((-(((in[6] >> 8) & 0xFFFFF) & 1))^(((in[6] >> 8) & 0xFFFFF)>>1))) + out[9] + out[11] = int32(((-((((in[6] >> 28) | ((in[7] & 0xFFFF) << 4))) & 1))^((((in[6] >> 28) | ((in[7] & 0xFFFF) << 4)))>>1))) + out[10] + out[12] = int32(((-((((in[7] >> 16) | ((in[8] & 0xF) << 16))) & 1))^((((in[7] >> 16) | ((in[8] & 0xF) << 16)))>>1))) + out[11] + out[13] = int32(((-(((in[8] >> 4) & 0xFFFFF) & 1))^(((in[8] >> 4) & 0xFFFFF)>>1))) + out[12] + out[14] = int32(((-((((in[8] >> 24) | ((in[9] & 0xFFF) << 8))) & 1))^((((in[8] >> 24) | ((in[9] & 0xFFF) << 8)))>>1))) + out[13] + out[15] = int32(((-(((in[9] >> 12)) & 1))^(((in[9] >> 12))>>1))) + out[14] + out[16] = int32(((-(((in[10] >> 0) & 0xFFFFF) & 1))^(((in[10] >> 0) & 0xFFFFF)>>1))) + out[15] + out[17] = int32(((-((((in[10] >> 20) | ((in[11] & 0xFF) << 12))) & 1))^((((in[10] >> 20) | ((in[11] & 0xFF) << 12)))>>1))) + out[16] + out[18] = int32(((-(((in[11] >> 8) & 0xFFFFF) & 1))^(((in[11] >> 8) & 0xFFFFF)>>1))) + out[17] + out[19] = int32(((-((((in[11] >> 28) | ((in[12] & 0xFFFF) << 4))) & 1))^((((in[11] >> 28) | ((in[12] & 0xFFFF) << 4)))>>1))) + out[18] + out[20] = int32(((-((((in[12] >> 16) | ((in[13] & 0xF) << 16))) & 1))^((((in[12] >> 16) | ((in[13] & 0xF) << 16)))>>1))) + out[19] + out[21] = int32(((-(((in[13] >> 4) & 0xFFFFF) & 1))^(((in[13] >> 4) & 0xFFFFF)>>1))) + out[20] + out[22] = int32(((-((((in[13] >> 24) | ((in[14] & 0xFFF) << 8))) & 1))^((((in[13] >> 24) | ((in[14] & 0xFFF) << 8)))>>1))) + out[21] + out[23] = int32(((-(((in[14] >> 12)) & 1))^(((in[14] >> 12))>>1))) + out[22] + out[24] = int32(((-(((in[15] >> 0) & 0xFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFF)>>1))) + out[23] + out[25] = int32(((-((((in[15] >> 20) | ((in[16] & 0xFF) << 12))) & 1))^((((in[15] >> 20) | ((in[16] & 0xFF) << 12)))>>1))) + out[24] + out[26] = int32(((-(((in[16] >> 8) & 0xFFFFF) & 1))^(((in[16] >> 8) & 0xFFFFF)>>1))) + out[25] + out[27] = int32(((-((((in[16] >> 28) | ((in[17] & 0xFFFF) << 4))) & 1))^((((in[16] >> 28) | ((in[17] & 0xFFFF) << 4)))>>1))) + out[26] + out[28] = int32(((-((((in[17] >> 16) | ((in[18] & 0xF) << 16))) & 1))^((((in[17] >> 16) | ((in[18] & 0xF) << 16)))>>1))) + out[27] + out[29] = int32(((-(((in[18] >> 4) & 0xFFFFF) & 1))^(((in[18] >> 4) & 0xFFFFF)>>1))) + out[28] + out[30] = int32(((-((((in[18] >> 24) | ((in[19] & 0xFFF) << 8))) & 1))^((((in[18] >> 24) | ((in[19] & 0xFFF) << 8)))>>1))) + out[29] + out[31] = int32(((-(((in[19] >> 12)) & 1))^(((in[19] >> 12))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_21(initoffset int32, in *[21]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1FFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 21) | ((in[1] & 0x3FF) << 11))) & 1))^((((in[0] >> 21) | ((in[1] & 0x3FF) << 11)))>>1))) + out[0] + out[2] = int32(((-(((in[1] >> 10) & 0x1FFFFF) & 1))^(((in[1] >> 10) & 0x1FFFFF)>>1))) + out[1] + out[3] = int32(((-((((in[1] >> 31) | ((in[2] & 0xFFFFF) << 1))) & 1))^((((in[1] >> 31) | ((in[2] & 0xFFFFF) << 1)))>>1))) + out[2] + out[4] = int32(((-((((in[2] >> 20) | ((in[3] & 0x1FF) << 12))) & 1))^((((in[2] >> 20) | ((in[3] & 0x1FF) << 12)))>>1))) + out[3] + out[5] = int32(((-(((in[3] >> 9) & 0x1FFFFF) & 1))^(((in[3] >> 9) & 0x1FFFFF)>>1))) + out[4] + out[6] = int32(((-((((in[3] >> 30) | ((in[4] & 0x7FFFF) << 2))) & 1))^((((in[3] >> 30) | ((in[4] & 0x7FFFF) << 2)))>>1))) + out[5] + out[7] = int32(((-((((in[4] >> 19) | ((in[5] & 0xFF) << 13))) & 1))^((((in[4] >> 19) | ((in[5] & 0xFF) << 13)))>>1))) + out[6] + out[8] = int32(((-(((in[5] >> 8) & 0x1FFFFF) & 1))^(((in[5] >> 8) & 0x1FFFFF)>>1))) + out[7] + out[9] = int32(((-((((in[5] >> 29) | ((in[6] & 0x3FFFF) << 3))) & 1))^((((in[5] >> 29) | ((in[6] & 0x3FFFF) << 3)))>>1))) + out[8] + out[10] = int32(((-((((in[6] >> 18) | ((in[7] & 0x7F) << 14))) & 1))^((((in[6] >> 18) | ((in[7] & 0x7F) << 14)))>>1))) + out[9] + out[11] = int32(((-(((in[7] >> 7) & 0x1FFFFF) & 1))^(((in[7] >> 7) & 0x1FFFFF)>>1))) + out[10] + out[12] = int32(((-((((in[7] >> 28) | ((in[8] & 0x1FFFF) << 4))) & 1))^((((in[7] >> 28) | ((in[8] & 0x1FFFF) << 4)))>>1))) + out[11] + out[13] = int32(((-((((in[8] >> 17) | ((in[9] & 0x3F) << 15))) & 1))^((((in[8] >> 17) | ((in[9] & 0x3F) << 15)))>>1))) + out[12] + out[14] = int32(((-(((in[9] >> 6) & 0x1FFFFF) & 1))^(((in[9] >> 6) & 0x1FFFFF)>>1))) + out[13] + out[15] = int32(((-((((in[9] >> 27) | ((in[10] & 0xFFFF) << 5))) & 1))^((((in[9] >> 27) | ((in[10] & 0xFFFF) << 5)))>>1))) + out[14] + out[16] = int32(((-((((in[10] >> 16) | ((in[11] & 0x1F) << 16))) & 1))^((((in[10] >> 16) | ((in[11] & 0x1F) << 16)))>>1))) + out[15] + out[17] = int32(((-(((in[11] >> 5) & 0x1FFFFF) & 1))^(((in[11] >> 5) & 0x1FFFFF)>>1))) + out[16] + out[18] = int32(((-((((in[11] >> 26) | ((in[12] & 0x7FFF) << 6))) & 1))^((((in[11] >> 26) | ((in[12] & 0x7FFF) << 6)))>>1))) + out[17] + out[19] = int32(((-((((in[12] >> 15) | ((in[13] & 0xF) << 17))) & 1))^((((in[12] >> 15) | ((in[13] & 0xF) << 17)))>>1))) + out[18] + out[20] = int32(((-(((in[13] >> 4) & 0x1FFFFF) & 1))^(((in[13] >> 4) & 0x1FFFFF)>>1))) + out[19] + out[21] = int32(((-((((in[13] >> 25) | ((in[14] & 0x3FFF) << 7))) & 1))^((((in[13] >> 25) | ((in[14] & 0x3FFF) << 7)))>>1))) + out[20] + out[22] = int32(((-((((in[14] >> 14) | ((in[15] & 0x7) << 18))) & 1))^((((in[14] >> 14) | ((in[15] & 0x7) << 18)))>>1))) + out[21] + out[23] = int32(((-(((in[15] >> 3) & 0x1FFFFF) & 1))^(((in[15] >> 3) & 0x1FFFFF)>>1))) + out[22] + out[24] = int32(((-((((in[15] >> 24) | ((in[16] & 0x1FFF) << 8))) & 1))^((((in[15] >> 24) | ((in[16] & 0x1FFF) << 8)))>>1))) + out[23] + out[25] = int32(((-((((in[16] >> 13) | ((in[17] & 0x3) << 19))) & 1))^((((in[16] >> 13) | ((in[17] & 0x3) << 19)))>>1))) + out[24] + out[26] = int32(((-(((in[17] >> 2) & 0x1FFFFF) & 1))^(((in[17] >> 2) & 0x1FFFFF)>>1))) + out[25] + out[27] = int32(((-((((in[17] >> 23) | ((in[18] & 0xFFF) << 9))) & 1))^((((in[17] >> 23) | ((in[18] & 0xFFF) << 9)))>>1))) + out[26] + out[28] = int32(((-((((in[18] >> 12) | ((in[19] & 0x1) << 20))) & 1))^((((in[18] >> 12) | ((in[19] & 0x1) << 20)))>>1))) + out[27] + out[29] = int32(((-(((in[19] >> 1) & 0x1FFFFF) & 1))^(((in[19] >> 1) & 0x1FFFFF)>>1))) + out[28] + out[30] = int32(((-((((in[19] >> 22) | ((in[20] & 0x7FF) << 10))) & 1))^((((in[19] >> 22) | ((in[20] & 0x7FF) << 10)))>>1))) + out[29] + out[31] = int32(((-(((in[20] >> 11)) & 1))^(((in[20] >> 11))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_22(initoffset int32, in *[22]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3FFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 22) | ((in[1] & 0xFFF) << 10))) & 1))^((((in[0] >> 22) | ((in[1] & 0xFFF) << 10)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 12) | ((in[2] & 0x3) << 20))) & 1))^((((in[1] >> 12) | ((in[2] & 0x3) << 20)))>>1))) + out[1] + out[3] = int32(((-(((in[2] >> 2) & 0x3FFFFF) & 1))^(((in[2] >> 2) & 0x3FFFFF)>>1))) + out[2] + out[4] = int32(((-((((in[2] >> 24) | ((in[3] & 0x3FFF) << 8))) & 1))^((((in[2] >> 24) | ((in[3] & 0x3FFF) << 8)))>>1))) + out[3] + out[5] = int32(((-((((in[3] >> 14) | ((in[4] & 0xF) << 18))) & 1))^((((in[3] >> 14) | ((in[4] & 0xF) << 18)))>>1))) + out[4] + out[6] = int32(((-(((in[4] >> 4) & 0x3FFFFF) & 1))^(((in[4] >> 4) & 0x3FFFFF)>>1))) + out[5] + out[7] = int32(((-((((in[4] >> 26) | ((in[5] & 0xFFFF) << 6))) & 1))^((((in[4] >> 26) | ((in[5] & 0xFFFF) << 6)))>>1))) + out[6] + out[8] = int32(((-((((in[5] >> 16) | ((in[6] & 0x3F) << 16))) & 1))^((((in[5] >> 16) | ((in[6] & 0x3F) << 16)))>>1))) + out[7] + out[9] = int32(((-(((in[6] >> 6) & 0x3FFFFF) & 1))^(((in[6] >> 6) & 0x3FFFFF)>>1))) + out[8] + out[10] = int32(((-((((in[6] >> 28) | ((in[7] & 0x3FFFF) << 4))) & 1))^((((in[6] >> 28) | ((in[7] & 0x3FFFF) << 4)))>>1))) + out[9] + out[11] = int32(((-((((in[7] >> 18) | ((in[8] & 0xFF) << 14))) & 1))^((((in[7] >> 18) | ((in[8] & 0xFF) << 14)))>>1))) + out[10] + out[12] = int32(((-(((in[8] >> 8) & 0x3FFFFF) & 1))^(((in[8] >> 8) & 0x3FFFFF)>>1))) + out[11] + out[13] = int32(((-((((in[8] >> 30) | ((in[9] & 0xFFFFF) << 2))) & 1))^((((in[8] >> 30) | ((in[9] & 0xFFFFF) << 2)))>>1))) + out[12] + out[14] = int32(((-((((in[9] >> 20) | ((in[10] & 0x3FF) << 12))) & 1))^((((in[9] >> 20) | ((in[10] & 0x3FF) << 12)))>>1))) + out[13] + out[15] = int32(((-(((in[10] >> 10)) & 1))^(((in[10] >> 10))>>1))) + out[14] + out[16] = int32(((-(((in[11] >> 0) & 0x3FFFFF) & 1))^(((in[11] >> 0) & 0x3FFFFF)>>1))) + out[15] + out[17] = int32(((-((((in[11] >> 22) | ((in[12] & 0xFFF) << 10))) & 1))^((((in[11] >> 22) | ((in[12] & 0xFFF) << 10)))>>1))) + out[16] + out[18] = int32(((-((((in[12] >> 12) | ((in[13] & 0x3) << 20))) & 1))^((((in[12] >> 12) | ((in[13] & 0x3) << 20)))>>1))) + out[17] + out[19] = int32(((-(((in[13] >> 2) & 0x3FFFFF) & 1))^(((in[13] >> 2) & 0x3FFFFF)>>1))) + out[18] + out[20] = int32(((-((((in[13] >> 24) | ((in[14] & 0x3FFF) << 8))) & 1))^((((in[13] >> 24) | ((in[14] & 0x3FFF) << 8)))>>1))) + out[19] + out[21] = int32(((-((((in[14] >> 14) | ((in[15] & 0xF) << 18))) & 1))^((((in[14] >> 14) | ((in[15] & 0xF) << 18)))>>1))) + out[20] + out[22] = int32(((-(((in[15] >> 4) & 0x3FFFFF) & 1))^(((in[15] >> 4) & 0x3FFFFF)>>1))) + out[21] + out[23] = int32(((-((((in[15] >> 26) | ((in[16] & 0xFFFF) << 6))) & 1))^((((in[15] >> 26) | ((in[16] & 0xFFFF) << 6)))>>1))) + out[22] + out[24] = int32(((-((((in[16] >> 16) | ((in[17] & 0x3F) << 16))) & 1))^((((in[16] >> 16) | ((in[17] & 0x3F) << 16)))>>1))) + out[23] + out[25] = int32(((-(((in[17] >> 6) & 0x3FFFFF) & 1))^(((in[17] >> 6) & 0x3FFFFF)>>1))) + out[24] + out[26] = int32(((-((((in[17] >> 28) | ((in[18] & 0x3FFFF) << 4))) & 1))^((((in[17] >> 28) | ((in[18] & 0x3FFFF) << 4)))>>1))) + out[25] + out[27] = int32(((-((((in[18] >> 18) | ((in[19] & 0xFF) << 14))) & 1))^((((in[18] >> 18) | ((in[19] & 0xFF) << 14)))>>1))) + out[26] + out[28] = int32(((-(((in[19] >> 8) & 0x3FFFFF) & 1))^(((in[19] >> 8) & 0x3FFFFF)>>1))) + out[27] + out[29] = int32(((-((((in[19] >> 30) | ((in[20] & 0xFFFFF) << 2))) & 1))^((((in[19] >> 30) | ((in[20] & 0xFFFFF) << 2)))>>1))) + out[28] + out[30] = int32(((-((((in[20] >> 20) | ((in[21] & 0x3FF) << 12))) & 1))^((((in[20] >> 20) | ((in[21] & 0x3FF) << 12)))>>1))) + out[29] + out[31] = int32(((-(((in[21] >> 10)) & 1))^(((in[21] >> 10))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_23(initoffset int32, in *[23]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7FFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 23) | ((in[1] & 0x3FFF) << 9))) & 1))^((((in[0] >> 23) | ((in[1] & 0x3FFF) << 9)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 14) | ((in[2] & 0x1F) << 18))) & 1))^((((in[1] >> 14) | ((in[2] & 0x1F) << 18)))>>1))) + out[1] + out[3] = int32(((-(((in[2] >> 5) & 0x7FFFFF) & 1))^(((in[2] >> 5) & 0x7FFFFF)>>1))) + out[2] + out[4] = int32(((-((((in[2] >> 28) | ((in[3] & 0x7FFFF) << 4))) & 1))^((((in[2] >> 28) | ((in[3] & 0x7FFFF) << 4)))>>1))) + out[3] + out[5] = int32(((-((((in[3] >> 19) | ((in[4] & 0x3FF) << 13))) & 1))^((((in[3] >> 19) | ((in[4] & 0x3FF) << 13)))>>1))) + out[4] + out[6] = int32(((-((((in[4] >> 10) | ((in[5] & 0x1) << 22))) & 1))^((((in[4] >> 10) | ((in[5] & 0x1) << 22)))>>1))) + out[5] + out[7] = int32(((-(((in[5] >> 1) & 0x7FFFFF) & 1))^(((in[5] >> 1) & 0x7FFFFF)>>1))) + out[6] + out[8] = int32(((-((((in[5] >> 24) | ((in[6] & 0x7FFF) << 8))) & 1))^((((in[5] >> 24) | ((in[6] & 0x7FFF) << 8)))>>1))) + out[7] + out[9] = int32(((-((((in[6] >> 15) | ((in[7] & 0x3F) << 17))) & 1))^((((in[6] >> 15) | ((in[7] & 0x3F) << 17)))>>1))) + out[8] + out[10] = int32(((-(((in[7] >> 6) & 0x7FFFFF) & 1))^(((in[7] >> 6) & 0x7FFFFF)>>1))) + out[9] + out[11] = int32(((-((((in[7] >> 29) | ((in[8] & 0xFFFFF) << 3))) & 1))^((((in[7] >> 29) | ((in[8] & 0xFFFFF) << 3)))>>1))) + out[10] + out[12] = int32(((-((((in[8] >> 20) | ((in[9] & 0x7FF) << 12))) & 1))^((((in[8] >> 20) | ((in[9] & 0x7FF) << 12)))>>1))) + out[11] + out[13] = int32(((-((((in[9] >> 11) | ((in[10] & 0x3) << 21))) & 1))^((((in[9] >> 11) | ((in[10] & 0x3) << 21)))>>1))) + out[12] + out[14] = int32(((-(((in[10] >> 2) & 0x7FFFFF) & 1))^(((in[10] >> 2) & 0x7FFFFF)>>1))) + out[13] + out[15] = int32(((-((((in[10] >> 25) | ((in[11] & 0xFFFF) << 7))) & 1))^((((in[10] >> 25) | ((in[11] & 0xFFFF) << 7)))>>1))) + out[14] + out[16] = int32(((-((((in[11] >> 16) | ((in[12] & 0x7F) << 16))) & 1))^((((in[11] >> 16) | ((in[12] & 0x7F) << 16)))>>1))) + out[15] + out[17] = int32(((-(((in[12] >> 7) & 0x7FFFFF) & 1))^(((in[12] >> 7) & 0x7FFFFF)>>1))) + out[16] + out[18] = int32(((-((((in[12] >> 30) | ((in[13] & 0x1FFFFF) << 2))) & 1))^((((in[12] >> 30) | ((in[13] & 0x1FFFFF) << 2)))>>1))) + out[17] + out[19] = int32(((-((((in[13] >> 21) | ((in[14] & 0xFFF) << 11))) & 1))^((((in[13] >> 21) | ((in[14] & 0xFFF) << 11)))>>1))) + out[18] + out[20] = int32(((-((((in[14] >> 12) | ((in[15] & 0x7) << 20))) & 1))^((((in[14] >> 12) | ((in[15] & 0x7) << 20)))>>1))) + out[19] + out[21] = int32(((-(((in[15] >> 3) & 0x7FFFFF) & 1))^(((in[15] >> 3) & 0x7FFFFF)>>1))) + out[20] + out[22] = int32(((-((((in[15] >> 26) | ((in[16] & 0x1FFFF) << 6))) & 1))^((((in[15] >> 26) | ((in[16] & 0x1FFFF) << 6)))>>1))) + out[21] + out[23] = int32(((-((((in[16] >> 17) | ((in[17] & 0xFF) << 15))) & 1))^((((in[16] >> 17) | ((in[17] & 0xFF) << 15)))>>1))) + out[22] + out[24] = int32(((-(((in[17] >> 8) & 0x7FFFFF) & 1))^(((in[17] >> 8) & 0x7FFFFF)>>1))) + out[23] + out[25] = int32(((-((((in[17] >> 31) | ((in[18] & 0x3FFFFF) << 1))) & 1))^((((in[17] >> 31) | ((in[18] & 0x3FFFFF) << 1)))>>1))) + out[24] + out[26] = int32(((-((((in[18] >> 22) | ((in[19] & 0x1FFF) << 10))) & 1))^((((in[18] >> 22) | ((in[19] & 0x1FFF) << 10)))>>1))) + out[25] + out[27] = int32(((-((((in[19] >> 13) | ((in[20] & 0xF) << 19))) & 1))^((((in[19] >> 13) | ((in[20] & 0xF) << 19)))>>1))) + out[26] + out[28] = int32(((-(((in[20] >> 4) & 0x7FFFFF) & 1))^(((in[20] >> 4) & 0x7FFFFF)>>1))) + out[27] + out[29] = int32(((-((((in[20] >> 27) | ((in[21] & 0x3FFFF) << 5))) & 1))^((((in[20] >> 27) | ((in[21] & 0x3FFFF) << 5)))>>1))) + out[28] + out[30] = int32(((-((((in[21] >> 18) | ((in[22] & 0x1FF) << 14))) & 1))^((((in[21] >> 18) | ((in[22] & 0x1FF) << 14)))>>1))) + out[29] + out[31] = int32(((-(((in[22] >> 9)) & 1))^(((in[22] >> 9))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_24(initoffset int32, in *[24]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0xFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 24) | ((in[1] & 0xFFFF) << 8))) & 1))^((((in[0] >> 24) | ((in[1] & 0xFFFF) << 8)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 16) | ((in[2] & 0xFF) << 16))) & 1))^((((in[1] >> 16) | ((in[2] & 0xFF) << 16)))>>1))) + out[1] + out[3] = int32(((-(((in[2] >> 8)) & 1))^(((in[2] >> 8))>>1))) + out[2] + out[4] = int32(((-(((in[3] >> 0) & 0xFFFFFF) & 1))^(((in[3] >> 0) & 0xFFFFFF)>>1))) + out[3] + out[5] = int32(((-((((in[3] >> 24) | ((in[4] & 0xFFFF) << 8))) & 1))^((((in[3] >> 24) | ((in[4] & 0xFFFF) << 8)))>>1))) + out[4] + out[6] = int32(((-((((in[4] >> 16) | ((in[5] & 0xFF) << 16))) & 1))^((((in[4] >> 16) | ((in[5] & 0xFF) << 16)))>>1))) + out[5] + out[7] = int32(((-(((in[5] >> 8)) & 1))^(((in[5] >> 8))>>1))) + out[6] + out[8] = int32(((-(((in[6] >> 0) & 0xFFFFFF) & 1))^(((in[6] >> 0) & 0xFFFFFF)>>1))) + out[7] + out[9] = int32(((-((((in[6] >> 24) | ((in[7] & 0xFFFF) << 8))) & 1))^((((in[6] >> 24) | ((in[7] & 0xFFFF) << 8)))>>1))) + out[8] + out[10] = int32(((-((((in[7] >> 16) | ((in[8] & 0xFF) << 16))) & 1))^((((in[7] >> 16) | ((in[8] & 0xFF) << 16)))>>1))) + out[9] + out[11] = int32(((-(((in[8] >> 8)) & 1))^(((in[8] >> 8))>>1))) + out[10] + out[12] = int32(((-(((in[9] >> 0) & 0xFFFFFF) & 1))^(((in[9] >> 0) & 0xFFFFFF)>>1))) + out[11] + out[13] = int32(((-((((in[9] >> 24) | ((in[10] & 0xFFFF) << 8))) & 1))^((((in[9] >> 24) | ((in[10] & 0xFFFF) << 8)))>>1))) + out[12] + out[14] = int32(((-((((in[10] >> 16) | ((in[11] & 0xFF) << 16))) & 1))^((((in[10] >> 16) | ((in[11] & 0xFF) << 16)))>>1))) + out[13] + out[15] = int32(((-(((in[11] >> 8)) & 1))^(((in[11] >> 8))>>1))) + out[14] + out[16] = int32(((-(((in[12] >> 0) & 0xFFFFFF) & 1))^(((in[12] >> 0) & 0xFFFFFF)>>1))) + out[15] + out[17] = int32(((-((((in[12] >> 24) | ((in[13] & 0xFFFF) << 8))) & 1))^((((in[12] >> 24) | ((in[13] & 0xFFFF) << 8)))>>1))) + out[16] + out[18] = int32(((-((((in[13] >> 16) | ((in[14] & 0xFF) << 16))) & 1))^((((in[13] >> 16) | ((in[14] & 0xFF) << 16)))>>1))) + out[17] + out[19] = int32(((-(((in[14] >> 8)) & 1))^(((in[14] >> 8))>>1))) + out[18] + out[20] = int32(((-(((in[15] >> 0) & 0xFFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFFF)>>1))) + out[19] + out[21] = int32(((-((((in[15] >> 24) | ((in[16] & 0xFFFF) << 8))) & 1))^((((in[15] >> 24) | ((in[16] & 0xFFFF) << 8)))>>1))) + out[20] + out[22] = int32(((-((((in[16] >> 16) | ((in[17] & 0xFF) << 16))) & 1))^((((in[16] >> 16) | ((in[17] & 0xFF) << 16)))>>1))) + out[21] + out[23] = int32(((-(((in[17] >> 8)) & 1))^(((in[17] >> 8))>>1))) + out[22] + out[24] = int32(((-(((in[18] >> 0) & 0xFFFFFF) & 1))^(((in[18] >> 0) & 0xFFFFFF)>>1))) + out[23] + out[25] = int32(((-((((in[18] >> 24) | ((in[19] & 0xFFFF) << 8))) & 1))^((((in[18] >> 24) | ((in[19] & 0xFFFF) << 8)))>>1))) + out[24] + out[26] = int32(((-((((in[19] >> 16) | ((in[20] & 0xFF) << 16))) & 1))^((((in[19] >> 16) | ((in[20] & 0xFF) << 16)))>>1))) + out[25] + out[27] = int32(((-(((in[20] >> 8)) & 1))^(((in[20] >> 8))>>1))) + out[26] + out[28] = int32(((-(((in[21] >> 0) & 0xFFFFFF) & 1))^(((in[21] >> 0) & 0xFFFFFF)>>1))) + out[27] + out[29] = int32(((-((((in[21] >> 24) | ((in[22] & 0xFFFF) << 8))) & 1))^((((in[21] >> 24) | ((in[22] & 0xFFFF) << 8)))>>1))) + out[28] + out[30] = int32(((-((((in[22] >> 16) | ((in[23] & 0xFF) << 16))) & 1))^((((in[22] >> 16) | ((in[23] & 0xFF) << 16)))>>1))) + out[29] + out[31] = int32(((-(((in[23] >> 8)) & 1))^(((in[23] >> 8))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_25(initoffset int32, in *[25]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1FFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 25) | ((in[1] & 0x3FFFF) << 7))) & 1))^((((in[0] >> 25) | ((in[1] & 0x3FFFF) << 7)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 18) | ((in[2] & 0x7FF) << 14))) & 1))^((((in[1] >> 18) | ((in[2] & 0x7FF) << 14)))>>1))) + out[1] + out[3] = int32(((-((((in[2] >> 11) | ((in[3] & 0xF) << 21))) & 1))^((((in[2] >> 11) | ((in[3] & 0xF) << 21)))>>1))) + out[2] + out[4] = int32(((-(((in[3] >> 4) & 0x1FFFFFF) & 1))^(((in[3] >> 4) & 0x1FFFFFF)>>1))) + out[3] + out[5] = int32(((-((((in[3] >> 29) | ((in[4] & 0x3FFFFF) << 3))) & 1))^((((in[3] >> 29) | ((in[4] & 0x3FFFFF) << 3)))>>1))) + out[4] + out[6] = int32(((-((((in[4] >> 22) | ((in[5] & 0x7FFF) << 10))) & 1))^((((in[4] >> 22) | ((in[5] & 0x7FFF) << 10)))>>1))) + out[5] + out[7] = int32(((-((((in[5] >> 15) | ((in[6] & 0xFF) << 17))) & 1))^((((in[5] >> 15) | ((in[6] & 0xFF) << 17)))>>1))) + out[6] + out[8] = int32(((-((((in[6] >> 8) | ((in[7] & 0x1) << 24))) & 1))^((((in[6] >> 8) | ((in[7] & 0x1) << 24)))>>1))) + out[7] + out[9] = int32(((-(((in[7] >> 1) & 0x1FFFFFF) & 1))^(((in[7] >> 1) & 0x1FFFFFF)>>1))) + out[8] + out[10] = int32(((-((((in[7] >> 26) | ((in[8] & 0x7FFFF) << 6))) & 1))^((((in[7] >> 26) | ((in[8] & 0x7FFFF) << 6)))>>1))) + out[9] + out[11] = int32(((-((((in[8] >> 19) | ((in[9] & 0xFFF) << 13))) & 1))^((((in[8] >> 19) | ((in[9] & 0xFFF) << 13)))>>1))) + out[10] + out[12] = int32(((-((((in[9] >> 12) | ((in[10] & 0x1F) << 20))) & 1))^((((in[9] >> 12) | ((in[10] & 0x1F) << 20)))>>1))) + out[11] + out[13] = int32(((-(((in[10] >> 5) & 0x1FFFFFF) & 1))^(((in[10] >> 5) & 0x1FFFFFF)>>1))) + out[12] + out[14] = int32(((-((((in[10] >> 30) | ((in[11] & 0x7FFFFF) << 2))) & 1))^((((in[10] >> 30) | ((in[11] & 0x7FFFFF) << 2)))>>1))) + out[13] + out[15] = int32(((-((((in[11] >> 23) | ((in[12] & 0xFFFF) << 9))) & 1))^((((in[11] >> 23) | ((in[12] & 0xFFFF) << 9)))>>1))) + out[14] + out[16] = int32(((-((((in[12] >> 16) | ((in[13] & 0x1FF) << 16))) & 1))^((((in[12] >> 16) | ((in[13] & 0x1FF) << 16)))>>1))) + out[15] + out[17] = int32(((-((((in[13] >> 9) | ((in[14] & 0x3) << 23))) & 1))^((((in[13] >> 9) | ((in[14] & 0x3) << 23)))>>1))) + out[16] + out[18] = int32(((-(((in[14] >> 2) & 0x1FFFFFF) & 1))^(((in[14] >> 2) & 0x1FFFFFF)>>1))) + out[17] + out[19] = int32(((-((((in[14] >> 27) | ((in[15] & 0xFFFFF) << 5))) & 1))^((((in[14] >> 27) | ((in[15] & 0xFFFFF) << 5)))>>1))) + out[18] + out[20] = int32(((-((((in[15] >> 20) | ((in[16] & 0x1FFF) << 12))) & 1))^((((in[15] >> 20) | ((in[16] & 0x1FFF) << 12)))>>1))) + out[19] + out[21] = int32(((-((((in[16] >> 13) | ((in[17] & 0x3F) << 19))) & 1))^((((in[16] >> 13) | ((in[17] & 0x3F) << 19)))>>1))) + out[20] + out[22] = int32(((-(((in[17] >> 6) & 0x1FFFFFF) & 1))^(((in[17] >> 6) & 0x1FFFFFF)>>1))) + out[21] + out[23] = int32(((-((((in[17] >> 31) | ((in[18] & 0xFFFFFF) << 1))) & 1))^((((in[17] >> 31) | ((in[18] & 0xFFFFFF) << 1)))>>1))) + out[22] + out[24] = int32(((-((((in[18] >> 24) | ((in[19] & 0x1FFFF) << 8))) & 1))^((((in[18] >> 24) | ((in[19] & 0x1FFFF) << 8)))>>1))) + out[23] + out[25] = int32(((-((((in[19] >> 17) | ((in[20] & 0x3FF) << 15))) & 1))^((((in[19] >> 17) | ((in[20] & 0x3FF) << 15)))>>1))) + out[24] + out[26] = int32(((-((((in[20] >> 10) | ((in[21] & 0x7) << 22))) & 1))^((((in[20] >> 10) | ((in[21] & 0x7) << 22)))>>1))) + out[25] + out[27] = int32(((-(((in[21] >> 3) & 0x1FFFFFF) & 1))^(((in[21] >> 3) & 0x1FFFFFF)>>1))) + out[26] + out[28] = int32(((-((((in[21] >> 28) | ((in[22] & 0x1FFFFF) << 4))) & 1))^((((in[21] >> 28) | ((in[22] & 0x1FFFFF) << 4)))>>1))) + out[27] + out[29] = int32(((-((((in[22] >> 21) | ((in[23] & 0x3FFF) << 11))) & 1))^((((in[22] >> 21) | ((in[23] & 0x3FFF) << 11)))>>1))) + out[28] + out[30] = int32(((-((((in[23] >> 14) | ((in[24] & 0x7F) << 18))) & 1))^((((in[23] >> 14) | ((in[24] & 0x7F) << 18)))>>1))) + out[29] + out[31] = int32(((-(((in[24] >> 7)) & 1))^(((in[24] >> 7))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_26(initoffset int32, in *[26]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3FFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 26) | ((in[1] & 0xFFFFF) << 6))) & 1))^((((in[0] >> 26) | ((in[1] & 0xFFFFF) << 6)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 20) | ((in[2] & 0x3FFF) << 12))) & 1))^((((in[1] >> 20) | ((in[2] & 0x3FFF) << 12)))>>1))) + out[1] + out[3] = int32(((-((((in[2] >> 14) | ((in[3] & 0xFF) << 18))) & 1))^((((in[2] >> 14) | ((in[3] & 0xFF) << 18)))>>1))) + out[2] + out[4] = int32(((-((((in[3] >> 8) | ((in[4] & 0x3) << 24))) & 1))^((((in[3] >> 8) | ((in[4] & 0x3) << 24)))>>1))) + out[3] + out[5] = int32(((-(((in[4] >> 2) & 0x3FFFFFF) & 1))^(((in[4] >> 2) & 0x3FFFFFF)>>1))) + out[4] + out[6] = int32(((-((((in[4] >> 28) | ((in[5] & 0x3FFFFF) << 4))) & 1))^((((in[4] >> 28) | ((in[5] & 0x3FFFFF) << 4)))>>1))) + out[5] + out[7] = int32(((-((((in[5] >> 22) | ((in[6] & 0xFFFF) << 10))) & 1))^((((in[5] >> 22) | ((in[6] & 0xFFFF) << 10)))>>1))) + out[6] + out[8] = int32(((-((((in[6] >> 16) | ((in[7] & 0x3FF) << 16))) & 1))^((((in[6] >> 16) | ((in[7] & 0x3FF) << 16)))>>1))) + out[7] + out[9] = int32(((-((((in[7] >> 10) | ((in[8] & 0xF) << 22))) & 1))^((((in[7] >> 10) | ((in[8] & 0xF) << 22)))>>1))) + out[8] + out[10] = int32(((-(((in[8] >> 4) & 0x3FFFFFF) & 1))^(((in[8] >> 4) & 0x3FFFFFF)>>1))) + out[9] + out[11] = int32(((-((((in[8] >> 30) | ((in[9] & 0xFFFFFF) << 2))) & 1))^((((in[8] >> 30) | ((in[9] & 0xFFFFFF) << 2)))>>1))) + out[10] + out[12] = int32(((-((((in[9] >> 24) | ((in[10] & 0x3FFFF) << 8))) & 1))^((((in[9] >> 24) | ((in[10] & 0x3FFFF) << 8)))>>1))) + out[11] + out[13] = int32(((-((((in[10] >> 18) | ((in[11] & 0xFFF) << 14))) & 1))^((((in[10] >> 18) | ((in[11] & 0xFFF) << 14)))>>1))) + out[12] + out[14] = int32(((-((((in[11] >> 12) | ((in[12] & 0x3F) << 20))) & 1))^((((in[11] >> 12) | ((in[12] & 0x3F) << 20)))>>1))) + out[13] + out[15] = int32(((-(((in[12] >> 6)) & 1))^(((in[12] >> 6))>>1))) + out[14] + out[16] = int32(((-(((in[13] >> 0) & 0x3FFFFFF) & 1))^(((in[13] >> 0) & 0x3FFFFFF)>>1))) + out[15] + out[17] = int32(((-((((in[13] >> 26) | ((in[14] & 0xFFFFF) << 6))) & 1))^((((in[13] >> 26) | ((in[14] & 0xFFFFF) << 6)))>>1))) + out[16] + out[18] = int32(((-((((in[14] >> 20) | ((in[15] & 0x3FFF) << 12))) & 1))^((((in[14] >> 20) | ((in[15] & 0x3FFF) << 12)))>>1))) + out[17] + out[19] = int32(((-((((in[15] >> 14) | ((in[16] & 0xFF) << 18))) & 1))^((((in[15] >> 14) | ((in[16] & 0xFF) << 18)))>>1))) + out[18] + out[20] = int32(((-((((in[16] >> 8) | ((in[17] & 0x3) << 24))) & 1))^((((in[16] >> 8) | ((in[17] & 0x3) << 24)))>>1))) + out[19] + out[21] = int32(((-(((in[17] >> 2) & 0x3FFFFFF) & 1))^(((in[17] >> 2) & 0x3FFFFFF)>>1))) + out[20] + out[22] = int32(((-((((in[17] >> 28) | ((in[18] & 0x3FFFFF) << 4))) & 1))^((((in[17] >> 28) | ((in[18] & 0x3FFFFF) << 4)))>>1))) + out[21] + out[23] = int32(((-((((in[18] >> 22) | ((in[19] & 0xFFFF) << 10))) & 1))^((((in[18] >> 22) | ((in[19] & 0xFFFF) << 10)))>>1))) + out[22] + out[24] = int32(((-((((in[19] >> 16) | ((in[20] & 0x3FF) << 16))) & 1))^((((in[19] >> 16) | ((in[20] & 0x3FF) << 16)))>>1))) + out[23] + out[25] = int32(((-((((in[20] >> 10) | ((in[21] & 0xF) << 22))) & 1))^((((in[20] >> 10) | ((in[21] & 0xF) << 22)))>>1))) + out[24] + out[26] = int32(((-(((in[21] >> 4) & 0x3FFFFFF) & 1))^(((in[21] >> 4) & 0x3FFFFFF)>>1))) + out[25] + out[27] = int32(((-((((in[21] >> 30) | ((in[22] & 0xFFFFFF) << 2))) & 1))^((((in[21] >> 30) | ((in[22] & 0xFFFFFF) << 2)))>>1))) + out[26] + out[28] = int32(((-((((in[22] >> 24) | ((in[23] & 0x3FFFF) << 8))) & 1))^((((in[22] >> 24) | ((in[23] & 0x3FFFF) << 8)))>>1))) + out[27] + out[29] = int32(((-((((in[23] >> 18) | ((in[24] & 0xFFF) << 14))) & 1))^((((in[23] >> 18) | ((in[24] & 0xFFF) << 14)))>>1))) + out[28] + out[30] = int32(((-((((in[24] >> 12) | ((in[25] & 0x3F) << 20))) & 1))^((((in[24] >> 12) | ((in[25] & 0x3F) << 20)))>>1))) + out[29] + out[31] = int32(((-(((in[25] >> 6)) & 1))^(((in[25] >> 6))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_27(initoffset int32, in *[27]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7FFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 27) | ((in[1] & 0x3FFFFF) << 5))) & 1))^((((in[0] >> 27) | ((in[1] & 0x3FFFFF) << 5)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 22) | ((in[2] & 0x1FFFF) << 10))) & 1))^((((in[1] >> 22) | ((in[2] & 0x1FFFF) << 10)))>>1))) + out[1] + out[3] = int32(((-((((in[2] >> 17) | ((in[3] & 0xFFF) << 15))) & 1))^((((in[2] >> 17) | ((in[3] & 0xFFF) << 15)))>>1))) + out[2] + out[4] = int32(((-((((in[3] >> 12) | ((in[4] & 0x7F) << 20))) & 1))^((((in[3] >> 12) | ((in[4] & 0x7F) << 20)))>>1))) + out[3] + out[5] = int32(((-((((in[4] >> 7) | ((in[5] & 0x3) << 25))) & 1))^((((in[4] >> 7) | ((in[5] & 0x3) << 25)))>>1))) + out[4] + out[6] = int32(((-(((in[5] >> 2) & 0x7FFFFFF) & 1))^(((in[5] >> 2) & 0x7FFFFFF)>>1))) + out[5] + out[7] = int32(((-((((in[5] >> 29) | ((in[6] & 0xFFFFFF) << 3))) & 1))^((((in[5] >> 29) | ((in[6] & 0xFFFFFF) << 3)))>>1))) + out[6] + out[8] = int32(((-((((in[6] >> 24) | ((in[7] & 0x7FFFF) << 8))) & 1))^((((in[6] >> 24) | ((in[7] & 0x7FFFF) << 8)))>>1))) + out[7] + out[9] = int32(((-((((in[7] >> 19) | ((in[8] & 0x3FFF) << 13))) & 1))^((((in[7] >> 19) | ((in[8] & 0x3FFF) << 13)))>>1))) + out[8] + out[10] = int32(((-((((in[8] >> 14) | ((in[9] & 0x1FF) << 18))) & 1))^((((in[8] >> 14) | ((in[9] & 0x1FF) << 18)))>>1))) + out[9] + out[11] = int32(((-((((in[9] >> 9) | ((in[10] & 0xF) << 23))) & 1))^((((in[9] >> 9) | ((in[10] & 0xF) << 23)))>>1))) + out[10] + out[12] = int32(((-(((in[10] >> 4) & 0x7FFFFFF) & 1))^(((in[10] >> 4) & 0x7FFFFFF)>>1))) + out[11] + out[13] = int32(((-((((in[10] >> 31) | ((in[11] & 0x3FFFFFF) << 1))) & 1))^((((in[10] >> 31) | ((in[11] & 0x3FFFFFF) << 1)))>>1))) + out[12] + out[14] = int32(((-((((in[11] >> 26) | ((in[12] & 0x1FFFFF) << 6))) & 1))^((((in[11] >> 26) | ((in[12] & 0x1FFFFF) << 6)))>>1))) + out[13] + out[15] = int32(((-((((in[12] >> 21) | ((in[13] & 0xFFFF) << 11))) & 1))^((((in[12] >> 21) | ((in[13] & 0xFFFF) << 11)))>>1))) + out[14] + out[16] = int32(((-((((in[13] >> 16) | ((in[14] & 0x7FF) << 16))) & 1))^((((in[13] >> 16) | ((in[14] & 0x7FF) << 16)))>>1))) + out[15] + out[17] = int32(((-((((in[14] >> 11) | ((in[15] & 0x3F) << 21))) & 1))^((((in[14] >> 11) | ((in[15] & 0x3F) << 21)))>>1))) + out[16] + out[18] = int32(((-((((in[15] >> 6) | ((in[16] & 0x1) << 26))) & 1))^((((in[15] >> 6) | ((in[16] & 0x1) << 26)))>>1))) + out[17] + out[19] = int32(((-(((in[16] >> 1) & 0x7FFFFFF) & 1))^(((in[16] >> 1) & 0x7FFFFFF)>>1))) + out[18] + out[20] = int32(((-((((in[16] >> 28) | ((in[17] & 0x7FFFFF) << 4))) & 1))^((((in[16] >> 28) | ((in[17] & 0x7FFFFF) << 4)))>>1))) + out[19] + out[21] = int32(((-((((in[17] >> 23) | ((in[18] & 0x3FFFF) << 9))) & 1))^((((in[17] >> 23) | ((in[18] & 0x3FFFF) << 9)))>>1))) + out[20] + out[22] = int32(((-((((in[18] >> 18) | ((in[19] & 0x1FFF) << 14))) & 1))^((((in[18] >> 18) | ((in[19] & 0x1FFF) << 14)))>>1))) + out[21] + out[23] = int32(((-((((in[19] >> 13) | ((in[20] & 0xFF) << 19))) & 1))^((((in[19] >> 13) | ((in[20] & 0xFF) << 19)))>>1))) + out[22] + out[24] = int32(((-((((in[20] >> 8) | ((in[21] & 0x7) << 24))) & 1))^((((in[20] >> 8) | ((in[21] & 0x7) << 24)))>>1))) + out[23] + out[25] = int32(((-(((in[21] >> 3) & 0x7FFFFFF) & 1))^(((in[21] >> 3) & 0x7FFFFFF)>>1))) + out[24] + out[26] = int32(((-((((in[21] >> 30) | ((in[22] & 0x1FFFFFF) << 2))) & 1))^((((in[21] >> 30) | ((in[22] & 0x1FFFFFF) << 2)))>>1))) + out[25] + out[27] = int32(((-((((in[22] >> 25) | ((in[23] & 0xFFFFF) << 7))) & 1))^((((in[22] >> 25) | ((in[23] & 0xFFFFF) << 7)))>>1))) + out[26] + out[28] = int32(((-((((in[23] >> 20) | ((in[24] & 0x7FFF) << 12))) & 1))^((((in[23] >> 20) | ((in[24] & 0x7FFF) << 12)))>>1))) + out[27] + out[29] = int32(((-((((in[24] >> 15) | ((in[25] & 0x3FF) << 17))) & 1))^((((in[24] >> 15) | ((in[25] & 0x3FF) << 17)))>>1))) + out[28] + out[30] = int32(((-((((in[25] >> 10) | ((in[26] & 0x1F) << 22))) & 1))^((((in[25] >> 10) | ((in[26] & 0x1F) << 22)))>>1))) + out[29] + out[31] = int32(((-(((in[26] >> 5)) & 1))^(((in[26] >> 5))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_28(initoffset int32, in *[28]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0xFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 28) | ((in[1] & 0xFFFFFF) << 4))) & 1))^((((in[0] >> 28) | ((in[1] & 0xFFFFFF) << 4)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 24) | ((in[2] & 0xFFFFF) << 8))) & 1))^((((in[1] >> 24) | ((in[2] & 0xFFFFF) << 8)))>>1))) + out[1] + out[3] = int32(((-((((in[2] >> 20) | ((in[3] & 0xFFFF) << 12))) & 1))^((((in[2] >> 20) | ((in[3] & 0xFFFF) << 12)))>>1))) + out[2] + out[4] = int32(((-((((in[3] >> 16) | ((in[4] & 0xFFF) << 16))) & 1))^((((in[3] >> 16) | ((in[4] & 0xFFF) << 16)))>>1))) + out[3] + out[5] = int32(((-((((in[4] >> 12) | ((in[5] & 0xFF) << 20))) & 1))^((((in[4] >> 12) | ((in[5] & 0xFF) << 20)))>>1))) + out[4] + out[6] = int32(((-((((in[5] >> 8) | ((in[6] & 0xF) << 24))) & 1))^((((in[5] >> 8) | ((in[6] & 0xF) << 24)))>>1))) + out[5] + out[7] = int32(((-(((in[6] >> 4)) & 1))^(((in[6] >> 4))>>1))) + out[6] + out[8] = int32(((-(((in[7] >> 0) & 0xFFFFFFF) & 1))^(((in[7] >> 0) & 0xFFFFFFF)>>1))) + out[7] + out[9] = int32(((-((((in[7] >> 28) | ((in[8] & 0xFFFFFF) << 4))) & 1))^((((in[7] >> 28) | ((in[8] & 0xFFFFFF) << 4)))>>1))) + out[8] + out[10] = int32(((-((((in[8] >> 24) | ((in[9] & 0xFFFFF) << 8))) & 1))^((((in[8] >> 24) | ((in[9] & 0xFFFFF) << 8)))>>1))) + out[9] + out[11] = int32(((-((((in[9] >> 20) | ((in[10] & 0xFFFF) << 12))) & 1))^((((in[9] >> 20) | ((in[10] & 0xFFFF) << 12)))>>1))) + out[10] + out[12] = int32(((-((((in[10] >> 16) | ((in[11] & 0xFFF) << 16))) & 1))^((((in[10] >> 16) | ((in[11] & 0xFFF) << 16)))>>1))) + out[11] + out[13] = int32(((-((((in[11] >> 12) | ((in[12] & 0xFF) << 20))) & 1))^((((in[11] >> 12) | ((in[12] & 0xFF) << 20)))>>1))) + out[12] + out[14] = int32(((-((((in[12] >> 8) | ((in[13] & 0xF) << 24))) & 1))^((((in[12] >> 8) | ((in[13] & 0xF) << 24)))>>1))) + out[13] + out[15] = int32(((-(((in[13] >> 4)) & 1))^(((in[13] >> 4))>>1))) + out[14] + out[16] = int32(((-(((in[14] >> 0) & 0xFFFFFFF) & 1))^(((in[14] >> 0) & 0xFFFFFFF)>>1))) + out[15] + out[17] = int32(((-((((in[14] >> 28) | ((in[15] & 0xFFFFFF) << 4))) & 1))^((((in[14] >> 28) | ((in[15] & 0xFFFFFF) << 4)))>>1))) + out[16] + out[18] = int32(((-((((in[15] >> 24) | ((in[16] & 0xFFFFF) << 8))) & 1))^((((in[15] >> 24) | ((in[16] & 0xFFFFF) << 8)))>>1))) + out[17] + out[19] = int32(((-((((in[16] >> 20) | ((in[17] & 0xFFFF) << 12))) & 1))^((((in[16] >> 20) | ((in[17] & 0xFFFF) << 12)))>>1))) + out[18] + out[20] = int32(((-((((in[17] >> 16) | ((in[18] & 0xFFF) << 16))) & 1))^((((in[17] >> 16) | ((in[18] & 0xFFF) << 16)))>>1))) + out[19] + out[21] = int32(((-((((in[18] >> 12) | ((in[19] & 0xFF) << 20))) & 1))^((((in[18] >> 12) | ((in[19] & 0xFF) << 20)))>>1))) + out[20] + out[22] = int32(((-((((in[19] >> 8) | ((in[20] & 0xF) << 24))) & 1))^((((in[19] >> 8) | ((in[20] & 0xF) << 24)))>>1))) + out[21] + out[23] = int32(((-(((in[20] >> 4)) & 1))^(((in[20] >> 4))>>1))) + out[22] + out[24] = int32(((-(((in[21] >> 0) & 0xFFFFFFF) & 1))^(((in[21] >> 0) & 0xFFFFFFF)>>1))) + out[23] + out[25] = int32(((-((((in[21] >> 28) | ((in[22] & 0xFFFFFF) << 4))) & 1))^((((in[21] >> 28) | ((in[22] & 0xFFFFFF) << 4)))>>1))) + out[24] + out[26] = int32(((-((((in[22] >> 24) | ((in[23] & 0xFFFFF) << 8))) & 1))^((((in[22] >> 24) | ((in[23] & 0xFFFFF) << 8)))>>1))) + out[25] + out[27] = int32(((-((((in[23] >> 20) | ((in[24] & 0xFFFF) << 12))) & 1))^((((in[23] >> 20) | ((in[24] & 0xFFFF) << 12)))>>1))) + out[26] + out[28] = int32(((-((((in[24] >> 16) | ((in[25] & 0xFFF) << 16))) & 1))^((((in[24] >> 16) | ((in[25] & 0xFFF) << 16)))>>1))) + out[27] + out[29] = int32(((-((((in[25] >> 12) | ((in[26] & 0xFF) << 20))) & 1))^((((in[25] >> 12) | ((in[26] & 0xFF) << 20)))>>1))) + out[28] + out[30] = int32(((-((((in[26] >> 8) | ((in[27] & 0xF) << 24))) & 1))^((((in[26] >> 8) | ((in[27] & 0xF) << 24)))>>1))) + out[29] + out[31] = int32(((-(((in[27] >> 4)) & 1))^(((in[27] >> 4))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_29(initoffset int32, in *[29]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x1FFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 29) | ((in[1] & 0x3FFFFFF) << 3))) & 1))^((((in[0] >> 29) | ((in[1] & 0x3FFFFFF) << 3)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 26) | ((in[2] & 0x7FFFFF) << 6))) & 1))^((((in[1] >> 26) | ((in[2] & 0x7FFFFF) << 6)))>>1))) + out[1] + out[3] = int32(((-((((in[2] >> 23) | ((in[3] & 0xFFFFF) << 9))) & 1))^((((in[2] >> 23) | ((in[3] & 0xFFFFF) << 9)))>>1))) + out[2] + out[4] = int32(((-((((in[3] >> 20) | ((in[4] & 0x1FFFF) << 12))) & 1))^((((in[3] >> 20) | ((in[4] & 0x1FFFF) << 12)))>>1))) + out[3] + out[5] = int32(((-((((in[4] >> 17) | ((in[5] & 0x3FFF) << 15))) & 1))^((((in[4] >> 17) | ((in[5] & 0x3FFF) << 15)))>>1))) + out[4] + out[6] = int32(((-((((in[5] >> 14) | ((in[6] & 0x7FF) << 18))) & 1))^((((in[5] >> 14) | ((in[6] & 0x7FF) << 18)))>>1))) + out[5] + out[7] = int32(((-((((in[6] >> 11) | ((in[7] & 0xFF) << 21))) & 1))^((((in[6] >> 11) | ((in[7] & 0xFF) << 21)))>>1))) + out[6] + out[8] = int32(((-((((in[7] >> 8) | ((in[8] & 0x1F) << 24))) & 1))^((((in[7] >> 8) | ((in[8] & 0x1F) << 24)))>>1))) + out[7] + out[9] = int32(((-((((in[8] >> 5) | ((in[9] & 0x3) << 27))) & 1))^((((in[8] >> 5) | ((in[9] & 0x3) << 27)))>>1))) + out[8] + out[10] = int32(((-(((in[9] >> 2) & 0x1FFFFFFF) & 1))^(((in[9] >> 2) & 0x1FFFFFFF)>>1))) + out[9] + out[11] = int32(((-((((in[9] >> 31) | ((in[10] & 0xFFFFFFF) << 1))) & 1))^((((in[9] >> 31) | ((in[10] & 0xFFFFFFF) << 1)))>>1))) + out[10] + out[12] = int32(((-((((in[10] >> 28) | ((in[11] & 0x1FFFFFF) << 4))) & 1))^((((in[10] >> 28) | ((in[11] & 0x1FFFFFF) << 4)))>>1))) + out[11] + out[13] = int32(((-((((in[11] >> 25) | ((in[12] & 0x3FFFFF) << 7))) & 1))^((((in[11] >> 25) | ((in[12] & 0x3FFFFF) << 7)))>>1))) + out[12] + out[14] = int32(((-((((in[12] >> 22) | ((in[13] & 0x7FFFF) << 10))) & 1))^((((in[12] >> 22) | ((in[13] & 0x7FFFF) << 10)))>>1))) + out[13] + out[15] = int32(((-((((in[13] >> 19) | ((in[14] & 0xFFFF) << 13))) & 1))^((((in[13] >> 19) | ((in[14] & 0xFFFF) << 13)))>>1))) + out[14] + out[16] = int32(((-((((in[14] >> 16) | ((in[15] & 0x1FFF) << 16))) & 1))^((((in[14] >> 16) | ((in[15] & 0x1FFF) << 16)))>>1))) + out[15] + out[17] = int32(((-((((in[15] >> 13) | ((in[16] & 0x3FF) << 19))) & 1))^((((in[15] >> 13) | ((in[16] & 0x3FF) << 19)))>>1))) + out[16] + out[18] = int32(((-((((in[16] >> 10) | ((in[17] & 0x7F) << 22))) & 1))^((((in[16] >> 10) | ((in[17] & 0x7F) << 22)))>>1))) + out[17] + out[19] = int32(((-((((in[17] >> 7) | ((in[18] & 0xF) << 25))) & 1))^((((in[17] >> 7) | ((in[18] & 0xF) << 25)))>>1))) + out[18] + out[20] = int32(((-((((in[18] >> 4) | ((in[19] & 0x1) << 28))) & 1))^((((in[18] >> 4) | ((in[19] & 0x1) << 28)))>>1))) + out[19] + out[21] = int32(((-(((in[19] >> 1) & 0x1FFFFFFF) & 1))^(((in[19] >> 1) & 0x1FFFFFFF)>>1))) + out[20] + out[22] = int32(((-((((in[19] >> 30) | ((in[20] & 0x7FFFFFF) << 2))) & 1))^((((in[19] >> 30) | ((in[20] & 0x7FFFFFF) << 2)))>>1))) + out[21] + out[23] = int32(((-((((in[20] >> 27) | ((in[21] & 0xFFFFFF) << 5))) & 1))^((((in[20] >> 27) | ((in[21] & 0xFFFFFF) << 5)))>>1))) + out[22] + out[24] = int32(((-((((in[21] >> 24) | ((in[22] & 0x1FFFFF) << 8))) & 1))^((((in[21] >> 24) | ((in[22] & 0x1FFFFF) << 8)))>>1))) + out[23] + out[25] = int32(((-((((in[22] >> 21) | ((in[23] & 0x3FFFF) << 11))) & 1))^((((in[22] >> 21) | ((in[23] & 0x3FFFF) << 11)))>>1))) + out[24] + out[26] = int32(((-((((in[23] >> 18) | ((in[24] & 0x7FFF) << 14))) & 1))^((((in[23] >> 18) | ((in[24] & 0x7FFF) << 14)))>>1))) + out[25] + out[27] = int32(((-((((in[24] >> 15) | ((in[25] & 0xFFF) << 17))) & 1))^((((in[24] >> 15) | ((in[25] & 0xFFF) << 17)))>>1))) + out[26] + out[28] = int32(((-((((in[25] >> 12) | ((in[26] & 0x1FF) << 20))) & 1))^((((in[25] >> 12) | ((in[26] & 0x1FF) << 20)))>>1))) + out[27] + out[29] = int32(((-((((in[26] >> 9) | ((in[27] & 0x3F) << 23))) & 1))^((((in[26] >> 9) | ((in[27] & 0x3F) << 23)))>>1))) + out[28] + out[30] = int32(((-((((in[27] >> 6) | ((in[28] & 0x7) << 26))) & 1))^((((in[27] >> 6) | ((in[28] & 0x7) << 26)))>>1))) + out[29] + out[31] = int32(((-(((in[28] >> 3)) & 1))^(((in[28] >> 3))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_30(initoffset int32, in *[30]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x3FFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 30) | ((in[1] & 0xFFFFFFF) << 2))) & 1))^((((in[0] >> 30) | ((in[1] & 0xFFFFFFF) << 2)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 28) | ((in[2] & 0x3FFFFFF) << 4))) & 1))^((((in[1] >> 28) | ((in[2] & 0x3FFFFFF) << 4)))>>1))) + out[1] + out[3] = int32(((-((((in[2] >> 26) | ((in[3] & 0xFFFFFF) << 6))) & 1))^((((in[2] >> 26) | ((in[3] & 0xFFFFFF) << 6)))>>1))) + out[2] + out[4] = int32(((-((((in[3] >> 24) | ((in[4] & 0x3FFFFF) << 8))) & 1))^((((in[3] >> 24) | ((in[4] & 0x3FFFFF) << 8)))>>1))) + out[3] + out[5] = int32(((-((((in[4] >> 22) | ((in[5] & 0xFFFFF) << 10))) & 1))^((((in[4] >> 22) | ((in[5] & 0xFFFFF) << 10)))>>1))) + out[4] + out[6] = int32(((-((((in[5] >> 20) | ((in[6] & 0x3FFFF) << 12))) & 1))^((((in[5] >> 20) | ((in[6] & 0x3FFFF) << 12)))>>1))) + out[5] + out[7] = int32(((-((((in[6] >> 18) | ((in[7] & 0xFFFF) << 14))) & 1))^((((in[6] >> 18) | ((in[7] & 0xFFFF) << 14)))>>1))) + out[6] + out[8] = int32(((-((((in[7] >> 16) | ((in[8] & 0x3FFF) << 16))) & 1))^((((in[7] >> 16) | ((in[8] & 0x3FFF) << 16)))>>1))) + out[7] + out[9] = int32(((-((((in[8] >> 14) | ((in[9] & 0xFFF) << 18))) & 1))^((((in[8] >> 14) | ((in[9] & 0xFFF) << 18)))>>1))) + out[8] + out[10] = int32(((-((((in[9] >> 12) | ((in[10] & 0x3FF) << 20))) & 1))^((((in[9] >> 12) | ((in[10] & 0x3FF) << 20)))>>1))) + out[9] + out[11] = int32(((-((((in[10] >> 10) | ((in[11] & 0xFF) << 22))) & 1))^((((in[10] >> 10) | ((in[11] & 0xFF) << 22)))>>1))) + out[10] + out[12] = int32(((-((((in[11] >> 8) | ((in[12] & 0x3F) << 24))) & 1))^((((in[11] >> 8) | ((in[12] & 0x3F) << 24)))>>1))) + out[11] + out[13] = int32(((-((((in[12] >> 6) | ((in[13] & 0xF) << 26))) & 1))^((((in[12] >> 6) | ((in[13] & 0xF) << 26)))>>1))) + out[12] + out[14] = int32(((-((((in[13] >> 4) | ((in[14] & 0x3) << 28))) & 1))^((((in[13] >> 4) | ((in[14] & 0x3) << 28)))>>1))) + out[13] + out[15] = int32(((-(((in[14] >> 2)) & 1))^(((in[14] >> 2))>>1))) + out[14] + out[16] = int32(((-(((in[15] >> 0) & 0x3FFFFFFF) & 1))^(((in[15] >> 0) & 0x3FFFFFFF)>>1))) + out[15] + out[17] = int32(((-((((in[15] >> 30) | ((in[16] & 0xFFFFFFF) << 2))) & 1))^((((in[15] >> 30) | ((in[16] & 0xFFFFFFF) << 2)))>>1))) + out[16] + out[18] = int32(((-((((in[16] >> 28) | ((in[17] & 0x3FFFFFF) << 4))) & 1))^((((in[16] >> 28) | ((in[17] & 0x3FFFFFF) << 4)))>>1))) + out[17] + out[19] = int32(((-((((in[17] >> 26) | ((in[18] & 0xFFFFFF) << 6))) & 1))^((((in[17] >> 26) | ((in[18] & 0xFFFFFF) << 6)))>>1))) + out[18] + out[20] = int32(((-((((in[18] >> 24) | ((in[19] & 0x3FFFFF) << 8))) & 1))^((((in[18] >> 24) | ((in[19] & 0x3FFFFF) << 8)))>>1))) + out[19] + out[21] = int32(((-((((in[19] >> 22) | ((in[20] & 0xFFFFF) << 10))) & 1))^((((in[19] >> 22) | ((in[20] & 0xFFFFF) << 10)))>>1))) + out[20] + out[22] = int32(((-((((in[20] >> 20) | ((in[21] & 0x3FFFF) << 12))) & 1))^((((in[20] >> 20) | ((in[21] & 0x3FFFF) << 12)))>>1))) + out[21] + out[23] = int32(((-((((in[21] >> 18) | ((in[22] & 0xFFFF) << 14))) & 1))^((((in[21] >> 18) | ((in[22] & 0xFFFF) << 14)))>>1))) + out[22] + out[24] = int32(((-((((in[22] >> 16) | ((in[23] & 0x3FFF) << 16))) & 1))^((((in[22] >> 16) | ((in[23] & 0x3FFF) << 16)))>>1))) + out[23] + out[25] = int32(((-((((in[23] >> 14) | ((in[24] & 0xFFF) << 18))) & 1))^((((in[23] >> 14) | ((in[24] & 0xFFF) << 18)))>>1))) + out[24] + out[26] = int32(((-((((in[24] >> 12) | ((in[25] & 0x3FF) << 20))) & 1))^((((in[24] >> 12) | ((in[25] & 0x3FF) << 20)))>>1))) + out[25] + out[27] = int32(((-((((in[25] >> 10) | ((in[26] & 0xFF) << 22))) & 1))^((((in[25] >> 10) | ((in[26] & 0xFF) << 22)))>>1))) + out[26] + out[28] = int32(((-((((in[26] >> 8) | ((in[27] & 0x3F) << 24))) & 1))^((((in[26] >> 8) | ((in[27] & 0x3F) << 24)))>>1))) + out[27] + out[29] = int32(((-((((in[27] >> 6) | ((in[28] & 0xF) << 26))) & 1))^((((in[27] >> 6) | ((in[28] & 0xF) << 26)))>>1))) + out[28] + out[30] = int32(((-((((in[28] >> 4) | ((in[29] & 0x3) << 28))) & 1))^((((in[28] >> 4) | ((in[29] & 0x3) << 28)))>>1))) + out[29] + out[31] = int32(((-(((in[29] >> 2)) & 1))^(((in[29] >> 2))>>1))) + out[30] +} + +func deltaunpackzigzag_int32_31(initoffset int32, in *[31]uint32, out *[32]int32) { + out[0] = int32(((-(((in[0] >> 0) & 0x7FFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFF)>>1))) + initoffset + out[1] = int32(((-((((in[0] >> 31) | ((in[1] & 0x3FFFFFFF) << 1))) & 1))^((((in[0] >> 31) | ((in[1] & 0x3FFFFFFF) << 1)))>>1))) + out[0] + out[2] = int32(((-((((in[1] >> 30) | ((in[2] & 0x1FFFFFFF) << 2))) & 1))^((((in[1] >> 30) | ((in[2] & 0x1FFFFFFF) << 2)))>>1))) + out[1] + out[3] = int32(((-((((in[2] >> 29) | ((in[3] & 0xFFFFFFF) << 3))) & 1))^((((in[2] >> 29) | ((in[3] & 0xFFFFFFF) << 3)))>>1))) + out[2] + out[4] = int32(((-((((in[3] >> 28) | ((in[4] & 0x7FFFFFF) << 4))) & 1))^((((in[3] >> 28) | ((in[4] & 0x7FFFFFF) << 4)))>>1))) + out[3] + out[5] = int32(((-((((in[4] >> 27) | ((in[5] & 0x3FFFFFF) << 5))) & 1))^((((in[4] >> 27) | ((in[5] & 0x3FFFFFF) << 5)))>>1))) + out[4] + out[6] = int32(((-((((in[5] >> 26) | ((in[6] & 0x1FFFFFF) << 6))) & 1))^((((in[5] >> 26) | ((in[6] & 0x1FFFFFF) << 6)))>>1))) + out[5] + out[7] = int32(((-((((in[6] >> 25) | ((in[7] & 0xFFFFFF) << 7))) & 1))^((((in[6] >> 25) | ((in[7] & 0xFFFFFF) << 7)))>>1))) + out[6] + out[8] = int32(((-((((in[7] >> 24) | ((in[8] & 0x7FFFFF) << 8))) & 1))^((((in[7] >> 24) | ((in[8] & 0x7FFFFF) << 8)))>>1))) + out[7] + out[9] = int32(((-((((in[8] >> 23) | ((in[9] & 0x3FFFFF) << 9))) & 1))^((((in[8] >> 23) | ((in[9] & 0x3FFFFF) << 9)))>>1))) + out[8] + out[10] = int32(((-((((in[9] >> 22) | ((in[10] & 0x1FFFFF) << 10))) & 1))^((((in[9] >> 22) | ((in[10] & 0x1FFFFF) << 10)))>>1))) + out[9] + out[11] = int32(((-((((in[10] >> 21) | ((in[11] & 0xFFFFF) << 11))) & 1))^((((in[10] >> 21) | ((in[11] & 0xFFFFF) << 11)))>>1))) + out[10] + out[12] = int32(((-((((in[11] >> 20) | ((in[12] & 0x7FFFF) << 12))) & 1))^((((in[11] >> 20) | ((in[12] & 0x7FFFF) << 12)))>>1))) + out[11] + out[13] = int32(((-((((in[12] >> 19) | ((in[13] & 0x3FFFF) << 13))) & 1))^((((in[12] >> 19) | ((in[13] & 0x3FFFF) << 13)))>>1))) + out[12] + out[14] = int32(((-((((in[13] >> 18) | ((in[14] & 0x1FFFF) << 14))) & 1))^((((in[13] >> 18) | ((in[14] & 0x1FFFF) << 14)))>>1))) + out[13] + out[15] = int32(((-((((in[14] >> 17) | ((in[15] & 0xFFFF) << 15))) & 1))^((((in[14] >> 17) | ((in[15] & 0xFFFF) << 15)))>>1))) + out[14] + out[16] = int32(((-((((in[15] >> 16) | ((in[16] & 0x7FFF) << 16))) & 1))^((((in[15] >> 16) | ((in[16] & 0x7FFF) << 16)))>>1))) + out[15] + out[17] = int32(((-((((in[16] >> 15) | ((in[17] & 0x3FFF) << 17))) & 1))^((((in[16] >> 15) | ((in[17] & 0x3FFF) << 17)))>>1))) + out[16] + out[18] = int32(((-((((in[17] >> 14) | ((in[18] & 0x1FFF) << 18))) & 1))^((((in[17] >> 14) | ((in[18] & 0x1FFF) << 18)))>>1))) + out[17] + out[19] = int32(((-((((in[18] >> 13) | ((in[19] & 0xFFF) << 19))) & 1))^((((in[18] >> 13) | ((in[19] & 0xFFF) << 19)))>>1))) + out[18] + out[20] = int32(((-((((in[19] >> 12) | ((in[20] & 0x7FF) << 20))) & 1))^((((in[19] >> 12) | ((in[20] & 0x7FF) << 20)))>>1))) + out[19] + out[21] = int32(((-((((in[20] >> 11) | ((in[21] & 0x3FF) << 21))) & 1))^((((in[20] >> 11) | ((in[21] & 0x3FF) << 21)))>>1))) + out[20] + out[22] = int32(((-((((in[21] >> 10) | ((in[22] & 0x1FF) << 22))) & 1))^((((in[21] >> 10) | ((in[22] & 0x1FF) << 22)))>>1))) + out[21] + out[23] = int32(((-((((in[22] >> 9) | ((in[23] & 0xFF) << 23))) & 1))^((((in[22] >> 9) | ((in[23] & 0xFF) << 23)))>>1))) + out[22] + out[24] = int32(((-((((in[23] >> 8) | ((in[24] & 0x7F) << 24))) & 1))^((((in[23] >> 8) | ((in[24] & 0x7F) << 24)))>>1))) + out[23] + out[25] = int32(((-((((in[24] >> 7) | ((in[25] & 0x3F) << 25))) & 1))^((((in[24] >> 7) | ((in[25] & 0x3F) << 25)))>>1))) + out[24] + out[26] = int32(((-((((in[25] >> 6) | ((in[26] & 0x1F) << 26))) & 1))^((((in[25] >> 6) | ((in[26] & 0x1F) << 26)))>>1))) + out[25] + out[27] = int32(((-((((in[26] >> 5) | ((in[27] & 0xF) << 27))) & 1))^((((in[26] >> 5) | ((in[27] & 0xF) << 27)))>>1))) + out[26] + out[28] = int32(((-((((in[27] >> 4) | ((in[28] & 0x7) << 28))) & 1))^((((in[27] >> 4) | ((in[28] & 0x7) << 28)))>>1))) + out[27] + out[29] = int32(((-((((in[28] >> 3) | ((in[29] & 0x3) << 29))) & 1))^((((in[28] >> 3) | ((in[29] & 0x3) << 29)))>>1))) + out[28] + out[30] = int32(((-((((in[29] >> 2) | ((in[30] & 0x1) << 30))) & 1))^((((in[29] >> 2) | ((in[30] & 0x1) << 30)))>>1))) + out[29] + out[31] = int32(((-(((in[30] >> 1)) & 1))^(((in[30] >> 1))>>1))) + out[30] +} + +// deltaPack_uint32 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first. +// Caller must give the proper `bitlen` of the block +func deltaPack_uint32(initoffset uint32, in []uint32, out []uint32, bitlen int) { + switch bitlen { + case 0: + deltapack_uint32_0(initoffset, (*[32]uint32)(in), (*[0]uint32)(out)) + case 1: + deltapack_uint32_1(initoffset, (*[32]uint32)(in), (*[1]uint32)(out)) + case 2: + deltapack_uint32_2(initoffset, (*[32]uint32)(in), (*[2]uint32)(out)) + case 3: + deltapack_uint32_3(initoffset, (*[32]uint32)(in), (*[3]uint32)(out)) + case 4: + deltapack_uint32_4(initoffset, (*[32]uint32)(in), (*[4]uint32)(out)) + case 5: + deltapack_uint32_5(initoffset, (*[32]uint32)(in), (*[5]uint32)(out)) + case 6: + deltapack_uint32_6(initoffset, (*[32]uint32)(in), (*[6]uint32)(out)) + case 7: + deltapack_uint32_7(initoffset, (*[32]uint32)(in), (*[7]uint32)(out)) + case 8: + deltapack_uint32_8(initoffset, (*[32]uint32)(in), (*[8]uint32)(out)) + case 9: + deltapack_uint32_9(initoffset, (*[32]uint32)(in), (*[9]uint32)(out)) + case 10: + deltapack_uint32_10(initoffset, (*[32]uint32)(in), (*[10]uint32)(out)) + case 11: + deltapack_uint32_11(initoffset, (*[32]uint32)(in), (*[11]uint32)(out)) + case 12: + deltapack_uint32_12(initoffset, (*[32]uint32)(in), (*[12]uint32)(out)) + case 13: + deltapack_uint32_13(initoffset, (*[32]uint32)(in), (*[13]uint32)(out)) + case 14: + deltapack_uint32_14(initoffset, (*[32]uint32)(in), (*[14]uint32)(out)) + case 15: + deltapack_uint32_15(initoffset, (*[32]uint32)(in), (*[15]uint32)(out)) + case 16: + deltapack_uint32_16(initoffset, (*[32]uint32)(in), (*[16]uint32)(out)) + case 17: + deltapack_uint32_17(initoffset, (*[32]uint32)(in), (*[17]uint32)(out)) + case 18: + deltapack_uint32_18(initoffset, (*[32]uint32)(in), (*[18]uint32)(out)) + case 19: + deltapack_uint32_19(initoffset, (*[32]uint32)(in), (*[19]uint32)(out)) + case 20: + deltapack_uint32_20(initoffset, (*[32]uint32)(in), (*[20]uint32)(out)) + case 21: + deltapack_uint32_21(initoffset, (*[32]uint32)(in), (*[21]uint32)(out)) + case 22: + deltapack_uint32_22(initoffset, (*[32]uint32)(in), (*[22]uint32)(out)) + case 23: + deltapack_uint32_23(initoffset, (*[32]uint32)(in), (*[23]uint32)(out)) + case 24: + deltapack_uint32_24(initoffset, (*[32]uint32)(in), (*[24]uint32)(out)) + case 25: + deltapack_uint32_25(initoffset, (*[32]uint32)(in), (*[25]uint32)(out)) + case 26: + deltapack_uint32_26(initoffset, (*[32]uint32)(in), (*[26]uint32)(out)) + case 27: + deltapack_uint32_27(initoffset, (*[32]uint32)(in), (*[27]uint32)(out)) + case 28: + deltapack_uint32_28(initoffset, (*[32]uint32)(in), (*[28]uint32)(out)) + case 29: + deltapack_uint32_29(initoffset, (*[32]uint32)(in), (*[29]uint32)(out)) + case 30: + deltapack_uint32_30(initoffset, (*[32]uint32)(in), (*[30]uint32)(out)) + case 31: + deltapack_uint32_31(initoffset, (*[32]uint32)(in), (*[31]uint32)(out)) + case 32: + *(*[32]uint32)(out) = *((*[32]uint32)(unsafe.Pointer((*[32]uint32)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpack_uint32 Decoding operation for DeltaPack_uint32 +func deltaUnpack_uint32(initoffset uint32, in []uint32, out []uint32, bitlen int) { + switch bitlen { + case 0: + deltaunpack_uint32_0(initoffset, (*[0]uint32)(in), (*[32]uint32)(out)) + case 1: + deltaunpack_uint32_1(initoffset, (*[1]uint32)(in), (*[32]uint32)(out)) + case 2: + deltaunpack_uint32_2(initoffset, (*[2]uint32)(in), (*[32]uint32)(out)) + case 3: + deltaunpack_uint32_3(initoffset, (*[3]uint32)(in), (*[32]uint32)(out)) + case 4: + deltaunpack_uint32_4(initoffset, (*[4]uint32)(in), (*[32]uint32)(out)) + case 5: + deltaunpack_uint32_5(initoffset, (*[5]uint32)(in), (*[32]uint32)(out)) + case 6: + deltaunpack_uint32_6(initoffset, (*[6]uint32)(in), (*[32]uint32)(out)) + case 7: + deltaunpack_uint32_7(initoffset, (*[7]uint32)(in), (*[32]uint32)(out)) + case 8: + deltaunpack_uint32_8(initoffset, (*[8]uint32)(in), (*[32]uint32)(out)) + case 9: + deltaunpack_uint32_9(initoffset, (*[9]uint32)(in), (*[32]uint32)(out)) + case 10: + deltaunpack_uint32_10(initoffset, (*[10]uint32)(in), (*[32]uint32)(out)) + case 11: + deltaunpack_uint32_11(initoffset, (*[11]uint32)(in), (*[32]uint32)(out)) + case 12: + deltaunpack_uint32_12(initoffset, (*[12]uint32)(in), (*[32]uint32)(out)) + case 13: + deltaunpack_uint32_13(initoffset, (*[13]uint32)(in), (*[32]uint32)(out)) + case 14: + deltaunpack_uint32_14(initoffset, (*[14]uint32)(in), (*[32]uint32)(out)) + case 15: + deltaunpack_uint32_15(initoffset, (*[15]uint32)(in), (*[32]uint32)(out)) + case 16: + deltaunpack_uint32_16(initoffset, (*[16]uint32)(in), (*[32]uint32)(out)) + case 17: + deltaunpack_uint32_17(initoffset, (*[17]uint32)(in), (*[32]uint32)(out)) + case 18: + deltaunpack_uint32_18(initoffset, (*[18]uint32)(in), (*[32]uint32)(out)) + case 19: + deltaunpack_uint32_19(initoffset, (*[19]uint32)(in), (*[32]uint32)(out)) + case 20: + deltaunpack_uint32_20(initoffset, (*[20]uint32)(in), (*[32]uint32)(out)) + case 21: + deltaunpack_uint32_21(initoffset, (*[21]uint32)(in), (*[32]uint32)(out)) + case 22: + deltaunpack_uint32_22(initoffset, (*[22]uint32)(in), (*[32]uint32)(out)) + case 23: + deltaunpack_uint32_23(initoffset, (*[23]uint32)(in), (*[32]uint32)(out)) + case 24: + deltaunpack_uint32_24(initoffset, (*[24]uint32)(in), (*[32]uint32)(out)) + case 25: + deltaunpack_uint32_25(initoffset, (*[25]uint32)(in), (*[32]uint32)(out)) + case 26: + deltaunpack_uint32_26(initoffset, (*[26]uint32)(in), (*[32]uint32)(out)) + case 27: + deltaunpack_uint32_27(initoffset, (*[27]uint32)(in), (*[32]uint32)(out)) + case 28: + deltaunpack_uint32_28(initoffset, (*[28]uint32)(in), (*[32]uint32)(out)) + case 29: + deltaunpack_uint32_29(initoffset, (*[29]uint32)(in), (*[32]uint32)(out)) + case 30: + deltaunpack_uint32_30(initoffset, (*[30]uint32)(in), (*[32]uint32)(out)) + case 31: + deltaunpack_uint32_31(initoffset, (*[31]uint32)(in), (*[32]uint32)(out)) + case 32: + *(*[32]uint32)(out) = *(*[32]uint32)(unsafe.Pointer((*[32]uint32)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapack_uint32_0(initoffset uint32, in *[32]uint32, out *[0]uint32) { +} + +func deltapack_uint32_1(initoffset uint32, in *[32]uint32, out *[1]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 1) | + ((in[2] - in[1]) << 2) | + ((in[3] - in[2]) << 3) | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 5) | + ((in[6] - in[5]) << 6) | + ((in[7] - in[6]) << 7) | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 9) | + ((in[10] - in[9]) << 10) | + ((in[11] - in[10]) << 11) | + ((in[12] - in[11]) << 12) | + ((in[13] - in[12]) << 13) | + ((in[14] - in[13]) << 14) | + ((in[15] - in[14]) << 15) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 17) | + ((in[18] - in[17]) << 18) | + ((in[19] - in[18]) << 19) | + ((in[20] - in[19]) << 20) | + ((in[21] - in[20]) << 21) | + ((in[22] - in[21]) << 22) | + ((in[23] - in[22]) << 23) | + ((in[24] - in[23]) << 24) | + ((in[25] - in[24]) << 25) | + ((in[26] - in[25]) << 26) | + ((in[27] - in[26]) << 27) | + ((in[28] - in[27]) << 28) | + ((in[29] - in[28]) << 29) | + ((in[30] - in[29]) << 30) | + ((in[31] - in[30]) << 31) +} + +func deltapack_uint32_2(initoffset uint32, in *[32]uint32, out *[2]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 2) | + ((in[2] - in[1]) << 4) | + ((in[3] - in[2]) << 6) | + ((in[4] - in[3]) << 8) | + ((in[5] - in[4]) << 10) | + ((in[6] - in[5]) << 12) | + ((in[7] - in[6]) << 14) | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 18) | + ((in[10] - in[9]) << 20) | + ((in[11] - in[10]) << 22) | + ((in[12] - in[11]) << 24) | + ((in[13] - in[12]) << 26) | + ((in[14] - in[13]) << 28) | + ((in[15] - in[14]) << 30) + out[1] = + in[16] - in[15] | + ((in[17] - in[16]) << 2) | + ((in[18] - in[17]) << 4) | + ((in[19] - in[18]) << 6) | + ((in[20] - in[19]) << 8) | + ((in[21] - in[20]) << 10) | + ((in[22] - in[21]) << 12) | + ((in[23] - in[22]) << 14) | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 18) | + ((in[26] - in[25]) << 20) | + ((in[27] - in[26]) << 22) | + ((in[28] - in[27]) << 24) | + ((in[29] - in[28]) << 26) | + ((in[30] - in[29]) << 28) | + ((in[31] - in[30]) << 30) +} + +func deltapack_uint32_3(initoffset uint32, in *[32]uint32, out *[3]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 3) | + ((in[2] - in[1]) << 6) | + ((in[3] - in[2]) << 9) | + ((in[4] - in[3]) << 12) | + ((in[5] - in[4]) << 15) | + ((in[6] - in[5]) << 18) | + ((in[7] - in[6]) << 21) | + ((in[8] - in[7]) << 24) | + ((in[9] - in[8]) << 27) | + ((in[10] - in[9]) << 30) + out[1] = + (in[10] - in[9]) >> 2 | + ((in[11] - in[10]) << 1) | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 7) | + ((in[14] - in[13]) << 10) | + ((in[15] - in[14]) << 13) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 19) | + ((in[18] - in[17]) << 22) | + ((in[19] - in[18]) << 25) | + ((in[20] - in[19]) << 28) | + ((in[21] - in[20]) << 31) + out[2] = + (in[21] - in[20]) >> 1 | + ((in[22] - in[21]) << 2) | + ((in[23] - in[22]) << 5) | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 11) | + ((in[26] - in[25]) << 14) | + ((in[27] - in[26]) << 17) | + ((in[28] - in[27]) << 20) | + ((in[29] - in[28]) << 23) | + ((in[30] - in[29]) << 26) | + ((in[31] - in[30]) << 29) +} + +func deltapack_uint32_4(initoffset uint32, in *[32]uint32, out *[4]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 4) | + ((in[2] - in[1]) << 8) | + ((in[3] - in[2]) << 12) | + ((in[4] - in[3]) << 16) | + ((in[5] - in[4]) << 20) | + ((in[6] - in[5]) << 24) | + ((in[7] - in[6]) << 28) + out[1] = + in[8] - in[7] | + ((in[9] - in[8]) << 4) | + ((in[10] - in[9]) << 8) | + ((in[11] - in[10]) << 12) | + ((in[12] - in[11]) << 16) | + ((in[13] - in[12]) << 20) | + ((in[14] - in[13]) << 24) | + ((in[15] - in[14]) << 28) + out[2] = + in[16] - in[15] | + ((in[17] - in[16]) << 4) | + ((in[18] - in[17]) << 8) | + ((in[19] - in[18]) << 12) | + ((in[20] - in[19]) << 16) | + ((in[21] - in[20]) << 20) | + ((in[22] - in[21]) << 24) | + ((in[23] - in[22]) << 28) + out[3] = + in[24] - in[23] | + ((in[25] - in[24]) << 4) | + ((in[26] - in[25]) << 8) | + ((in[27] - in[26]) << 12) | + ((in[28] - in[27]) << 16) | + ((in[29] - in[28]) << 20) | + ((in[30] - in[29]) << 24) | + ((in[31] - in[30]) << 28) +} + +func deltapack_uint32_5(initoffset uint32, in *[32]uint32, out *[5]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 5) | + ((in[2] - in[1]) << 10) | + ((in[3] - in[2]) << 15) | + ((in[4] - in[3]) << 20) | + ((in[5] - in[4]) << 25) | + ((in[6] - in[5]) << 30) + out[1] = + (in[6] - in[5]) >> 2 | + ((in[7] - in[6]) << 3) | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 13) | + ((in[10] - in[9]) << 18) | + ((in[11] - in[10]) << 23) | + ((in[12] - in[11]) << 28) + out[2] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 1) | + ((in[14] - in[13]) << 6) | + ((in[15] - in[14]) << 11) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 21) | + ((in[18] - in[17]) << 26) | + ((in[19] - in[18]) << 31) + out[3] = + (in[19] - in[18]) >> 1 | + ((in[20] - in[19]) << 4) | + ((in[21] - in[20]) << 9) | + ((in[22] - in[21]) << 14) | + ((in[23] - in[22]) << 19) | + ((in[24] - in[23]) << 24) | + ((in[25] - in[24]) << 29) + out[4] = + (in[25] - in[24]) >> 3 | + ((in[26] - in[25]) << 2) | + ((in[27] - in[26]) << 7) | + ((in[28] - in[27]) << 12) | + ((in[29] - in[28]) << 17) | + ((in[30] - in[29]) << 22) | + ((in[31] - in[30]) << 27) +} + +func deltapack_uint32_6(initoffset uint32, in *[32]uint32, out *[6]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 6) | + ((in[2] - in[1]) << 12) | + ((in[3] - in[2]) << 18) | + ((in[4] - in[3]) << 24) | + ((in[5] - in[4]) << 30) + out[1] = + (in[5] - in[4]) >> 2 | + ((in[6] - in[5]) << 4) | + ((in[7] - in[6]) << 10) | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 22) | + ((in[10] - in[9]) << 28) + out[2] = + (in[10] - in[9]) >> 4 | + ((in[11] - in[10]) << 2) | + ((in[12] - in[11]) << 8) | + ((in[13] - in[12]) << 14) | + ((in[14] - in[13]) << 20) | + ((in[15] - in[14]) << 26) + out[3] = + in[16] - in[15] | + ((in[17] - in[16]) << 6) | + ((in[18] - in[17]) << 12) | + ((in[19] - in[18]) << 18) | + ((in[20] - in[19]) << 24) | + ((in[21] - in[20]) << 30) + out[4] = + (in[21] - in[20]) >> 2 | + ((in[22] - in[21]) << 4) | + ((in[23] - in[22]) << 10) | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 22) | + ((in[26] - in[25]) << 28) + out[5] = + (in[26] - in[25]) >> 4 | + ((in[27] - in[26]) << 2) | + ((in[28] - in[27]) << 8) | + ((in[29] - in[28]) << 14) | + ((in[30] - in[29]) << 20) | + ((in[31] - in[30]) << 26) +} + +func deltapack_uint32_7(initoffset uint32, in *[32]uint32, out *[7]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 7) | + ((in[2] - in[1]) << 14) | + ((in[3] - in[2]) << 21) | + ((in[4] - in[3]) << 28) + out[1] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 3) | + ((in[6] - in[5]) << 10) | + ((in[7] - in[6]) << 17) | + ((in[8] - in[7]) << 24) | + ((in[9] - in[8]) << 31) + out[2] = + (in[9] - in[8]) >> 1 | + ((in[10] - in[9]) << 6) | + ((in[11] - in[10]) << 13) | + ((in[12] - in[11]) << 20) | + ((in[13] - in[12]) << 27) + out[3] = + (in[13] - in[12]) >> 5 | + ((in[14] - in[13]) << 2) | + ((in[15] - in[14]) << 9) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 23) | + ((in[18] - in[17]) << 30) + out[4] = + (in[18] - in[17]) >> 2 | + ((in[19] - in[18]) << 5) | + ((in[20] - in[19]) << 12) | + ((in[21] - in[20]) << 19) | + ((in[22] - in[21]) << 26) + out[5] = + (in[22] - in[21]) >> 6 | + ((in[23] - in[22]) << 1) | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 15) | + ((in[26] - in[25]) << 22) | + ((in[27] - in[26]) << 29) + out[6] = + (in[27] - in[26]) >> 3 | + ((in[28] - in[27]) << 4) | + ((in[29] - in[28]) << 11) | + ((in[30] - in[29]) << 18) | + ((in[31] - in[30]) << 25) +} + +func deltapack_uint32_8(initoffset uint32, in *[32]uint32, out *[8]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 8) | + ((in[2] - in[1]) << 16) | + ((in[3] - in[2]) << 24) + out[1] = + in[4] - in[3] | + ((in[5] - in[4]) << 8) | + ((in[6] - in[5]) << 16) | + ((in[7] - in[6]) << 24) + out[2] = + in[8] - in[7] | + ((in[9] - in[8]) << 8) | + ((in[10] - in[9]) << 16) | + ((in[11] - in[10]) << 24) + out[3] = + in[12] - in[11] | + ((in[13] - in[12]) << 8) | + ((in[14] - in[13]) << 16) | + ((in[15] - in[14]) << 24) + out[4] = + in[16] - in[15] | + ((in[17] - in[16]) << 8) | + ((in[18] - in[17]) << 16) | + ((in[19] - in[18]) << 24) + out[5] = + in[20] - in[19] | + ((in[21] - in[20]) << 8) | + ((in[22] - in[21]) << 16) | + ((in[23] - in[22]) << 24) + out[6] = + in[24] - in[23] | + ((in[25] - in[24]) << 8) | + ((in[26] - in[25]) << 16) | + ((in[27] - in[26]) << 24) + out[7] = + in[28] - in[27] | + ((in[29] - in[28]) << 8) | + ((in[30] - in[29]) << 16) | + ((in[31] - in[30]) << 24) +} + +func deltapack_uint32_9(initoffset uint32, in *[32]uint32, out *[9]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 9) | + ((in[2] - in[1]) << 18) | + ((in[3] - in[2]) << 27) + out[1] = + (in[3] - in[2]) >> 5 | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 13) | + ((in[6] - in[5]) << 22) | + ((in[7] - in[6]) << 31) + out[2] = + (in[7] - in[6]) >> 1 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 17) | + ((in[10] - in[9]) << 26) + out[3] = + (in[10] - in[9]) >> 6 | + ((in[11] - in[10]) << 3) | + ((in[12] - in[11]) << 12) | + ((in[13] - in[12]) << 21) | + ((in[14] - in[13]) << 30) + out[4] = + (in[14] - in[13]) >> 2 | + ((in[15] - in[14]) << 7) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 25) + out[5] = + (in[17] - in[16]) >> 7 | + ((in[18] - in[17]) << 2) | + ((in[19] - in[18]) << 11) | + ((in[20] - in[19]) << 20) | + ((in[21] - in[20]) << 29) + out[6] = + (in[21] - in[20]) >> 3 | + ((in[22] - in[21]) << 6) | + ((in[23] - in[22]) << 15) | + ((in[24] - in[23]) << 24) + out[7] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 1) | + ((in[26] - in[25]) << 10) | + ((in[27] - in[26]) << 19) | + ((in[28] - in[27]) << 28) + out[8] = + (in[28] - in[27]) >> 4 | + ((in[29] - in[28]) << 5) | + ((in[30] - in[29]) << 14) | + ((in[31] - in[30]) << 23) +} + +func deltapack_uint32_10(initoffset uint32, in *[32]uint32, out *[10]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 10) | + ((in[2] - in[1]) << 20) | + ((in[3] - in[2]) << 30) + out[1] = + (in[3] - in[2]) >> 2 | + ((in[4] - in[3]) << 8) | + ((in[5] - in[4]) << 18) | + ((in[6] - in[5]) << 28) + out[2] = + (in[6] - in[5]) >> 4 | + ((in[7] - in[6]) << 6) | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 26) + out[3] = + (in[9] - in[8]) >> 6 | + ((in[10] - in[9]) << 4) | + ((in[11] - in[10]) << 14) | + ((in[12] - in[11]) << 24) + out[4] = + (in[12] - in[11]) >> 8 | + ((in[13] - in[12]) << 2) | + ((in[14] - in[13]) << 12) | + ((in[15] - in[14]) << 22) + out[5] = + in[16] - in[15] | + ((in[17] - in[16]) << 10) | + ((in[18] - in[17]) << 20) | + ((in[19] - in[18]) << 30) + out[6] = + (in[19] - in[18]) >> 2 | + ((in[20] - in[19]) << 8) | + ((in[21] - in[20]) << 18) | + ((in[22] - in[21]) << 28) + out[7] = + (in[22] - in[21]) >> 4 | + ((in[23] - in[22]) << 6) | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 26) + out[8] = + (in[25] - in[24]) >> 6 | + ((in[26] - in[25]) << 4) | + ((in[27] - in[26]) << 14) | + ((in[28] - in[27]) << 24) + out[9] = + (in[28] - in[27]) >> 8 | + ((in[29] - in[28]) << 2) | + ((in[30] - in[29]) << 12) | + ((in[31] - in[30]) << 22) +} + +func deltapack_uint32_11(initoffset uint32, in *[32]uint32, out *[11]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 11) | + ((in[2] - in[1]) << 22) + out[1] = + (in[2] - in[1]) >> 10 | + ((in[3] - in[2]) << 1) | + ((in[4] - in[3]) << 12) | + ((in[5] - in[4]) << 23) + out[2] = + (in[5] - in[4]) >> 9 | + ((in[6] - in[5]) << 2) | + ((in[7] - in[6]) << 13) | + ((in[8] - in[7]) << 24) + out[3] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 3) | + ((in[10] - in[9]) << 14) | + ((in[11] - in[10]) << 25) + out[4] = + (in[11] - in[10]) >> 7 | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 15) | + ((in[14] - in[13]) << 26) + out[5] = + (in[14] - in[13]) >> 6 | + ((in[15] - in[14]) << 5) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 27) + out[6] = + (in[17] - in[16]) >> 5 | + ((in[18] - in[17]) << 6) | + ((in[19] - in[18]) << 17) | + ((in[20] - in[19]) << 28) + out[7] = + (in[20] - in[19]) >> 4 | + ((in[21] - in[20]) << 7) | + ((in[22] - in[21]) << 18) | + ((in[23] - in[22]) << 29) + out[8] = + (in[23] - in[22]) >> 3 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 19) | + ((in[26] - in[25]) << 30) + out[9] = + (in[26] - in[25]) >> 2 | + ((in[27] - in[26]) << 9) | + ((in[28] - in[27]) << 20) | + ((in[29] - in[28]) << 31) + out[10] = + (in[29] - in[28]) >> 1 | + ((in[30] - in[29]) << 10) | + ((in[31] - in[30]) << 21) +} + +func deltapack_uint32_12(initoffset uint32, in *[32]uint32, out *[12]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 12) | + ((in[2] - in[1]) << 24) + out[1] = + (in[2] - in[1]) >> 8 | + ((in[3] - in[2]) << 4) | + ((in[4] - in[3]) << 16) | + ((in[5] - in[4]) << 28) + out[2] = + (in[5] - in[4]) >> 4 | + ((in[6] - in[5]) << 8) | + ((in[7] - in[6]) << 20) + out[3] = + in[8] - in[7] | + ((in[9] - in[8]) << 12) | + ((in[10] - in[9]) << 24) + out[4] = + (in[10] - in[9]) >> 8 | + ((in[11] - in[10]) << 4) | + ((in[12] - in[11]) << 16) | + ((in[13] - in[12]) << 28) + out[5] = + (in[13] - in[12]) >> 4 | + ((in[14] - in[13]) << 8) | + ((in[15] - in[14]) << 20) + out[6] = + in[16] - in[15] | + ((in[17] - in[16]) << 12) | + ((in[18] - in[17]) << 24) + out[7] = + (in[18] - in[17]) >> 8 | + ((in[19] - in[18]) << 4) | + ((in[20] - in[19]) << 16) | + ((in[21] - in[20]) << 28) + out[8] = + (in[21] - in[20]) >> 4 | + ((in[22] - in[21]) << 8) | + ((in[23] - in[22]) << 20) + out[9] = + in[24] - in[23] | + ((in[25] - in[24]) << 12) | + ((in[26] - in[25]) << 24) + out[10] = + (in[26] - in[25]) >> 8 | + ((in[27] - in[26]) << 4) | + ((in[28] - in[27]) << 16) | + ((in[29] - in[28]) << 28) + out[11] = + (in[29] - in[28]) >> 4 | + ((in[30] - in[29]) << 8) | + ((in[31] - in[30]) << 20) +} + +func deltapack_uint32_13(initoffset uint32, in *[32]uint32, out *[13]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 13) | + ((in[2] - in[1]) << 26) + out[1] = + (in[2] - in[1]) >> 6 | + ((in[3] - in[2]) << 7) | + ((in[4] - in[3]) << 20) + out[2] = + (in[4] - in[3]) >> 12 | + ((in[5] - in[4]) << 1) | + ((in[6] - in[5]) << 14) | + ((in[7] - in[6]) << 27) + out[3] = + (in[7] - in[6]) >> 5 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 21) + out[4] = + (in[9] - in[8]) >> 11 | + ((in[10] - in[9]) << 2) | + ((in[11] - in[10]) << 15) | + ((in[12] - in[11]) << 28) + out[5] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 9) | + ((in[14] - in[13]) << 22) + out[6] = + (in[14] - in[13]) >> 10 | + ((in[15] - in[14]) << 3) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 29) + out[7] = + (in[17] - in[16]) >> 3 | + ((in[18] - in[17]) << 10) | + ((in[19] - in[18]) << 23) + out[8] = + (in[19] - in[18]) >> 9 | + ((in[20] - in[19]) << 4) | + ((in[21] - in[20]) << 17) | + ((in[22] - in[21]) << 30) + out[9] = + (in[22] - in[21]) >> 2 | + ((in[23] - in[22]) << 11) | + ((in[24] - in[23]) << 24) + out[10] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 5) | + ((in[26] - in[25]) << 18) | + ((in[27] - in[26]) << 31) + out[11] = + (in[27] - in[26]) >> 1 | + ((in[28] - in[27]) << 12) | + ((in[29] - in[28]) << 25) + out[12] = + (in[29] - in[28]) >> 7 | + ((in[30] - in[29]) << 6) | + ((in[31] - in[30]) << 19) +} + +func deltapack_uint32_14(initoffset uint32, in *[32]uint32, out *[14]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 14) | + ((in[2] - in[1]) << 28) + out[1] = + (in[2] - in[1]) >> 4 | + ((in[3] - in[2]) << 10) | + ((in[4] - in[3]) << 24) + out[2] = + (in[4] - in[3]) >> 8 | + ((in[5] - in[4]) << 6) | + ((in[6] - in[5]) << 20) + out[3] = + (in[6] - in[5]) >> 12 | + ((in[7] - in[6]) << 2) | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 30) + out[4] = + (in[9] - in[8]) >> 2 | + ((in[10] - in[9]) << 12) | + ((in[11] - in[10]) << 26) + out[5] = + (in[11] - in[10]) >> 6 | + ((in[12] - in[11]) << 8) | + ((in[13] - in[12]) << 22) + out[6] = + (in[13] - in[12]) >> 10 | + ((in[14] - in[13]) << 4) | + ((in[15] - in[14]) << 18) + out[7] = + in[16] - in[15] | + ((in[17] - in[16]) << 14) | + ((in[18] - in[17]) << 28) + out[8] = + (in[18] - in[17]) >> 4 | + ((in[19] - in[18]) << 10) | + ((in[20] - in[19]) << 24) + out[9] = + (in[20] - in[19]) >> 8 | + ((in[21] - in[20]) << 6) | + ((in[22] - in[21]) << 20) + out[10] = + (in[22] - in[21]) >> 12 | + ((in[23] - in[22]) << 2) | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 30) + out[11] = + (in[25] - in[24]) >> 2 | + ((in[26] - in[25]) << 12) | + ((in[27] - in[26]) << 26) + out[12] = + (in[27] - in[26]) >> 6 | + ((in[28] - in[27]) << 8) | + ((in[29] - in[28]) << 22) + out[13] = + (in[29] - in[28]) >> 10 | + ((in[30] - in[29]) << 4) | + ((in[31] - in[30]) << 18) +} + +func deltapack_uint32_15(initoffset uint32, in *[32]uint32, out *[15]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 15) | + ((in[2] - in[1]) << 30) + out[1] = + (in[2] - in[1]) >> 2 | + ((in[3] - in[2]) << 13) | + ((in[4] - in[3]) << 28) + out[2] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 11) | + ((in[6] - in[5]) << 26) + out[3] = + (in[6] - in[5]) >> 6 | + ((in[7] - in[6]) << 9) | + ((in[8] - in[7]) << 24) + out[4] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 7) | + ((in[10] - in[9]) << 22) + out[5] = + (in[10] - in[9]) >> 10 | + ((in[11] - in[10]) << 5) | + ((in[12] - in[11]) << 20) + out[6] = + (in[12] - in[11]) >> 12 | + ((in[13] - in[12]) << 3) | + ((in[14] - in[13]) << 18) + out[7] = + (in[14] - in[13]) >> 14 | + ((in[15] - in[14]) << 1) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 31) + out[8] = + (in[17] - in[16]) >> 1 | + ((in[18] - in[17]) << 14) | + ((in[19] - in[18]) << 29) + out[9] = + (in[19] - in[18]) >> 3 | + ((in[20] - in[19]) << 12) | + ((in[21] - in[20]) << 27) + out[10] = + (in[21] - in[20]) >> 5 | + ((in[22] - in[21]) << 10) | + ((in[23] - in[22]) << 25) + out[11] = + (in[23] - in[22]) >> 7 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 23) + out[12] = + (in[25] - in[24]) >> 9 | + ((in[26] - in[25]) << 6) | + ((in[27] - in[26]) << 21) + out[13] = + (in[27] - in[26]) >> 11 | + ((in[28] - in[27]) << 4) | + ((in[29] - in[28]) << 19) + out[14] = + (in[29] - in[28]) >> 13 | + ((in[30] - in[29]) << 2) | + ((in[31] - in[30]) << 17) +} + +func deltapack_uint32_16(initoffset uint32, in *[32]uint32, out *[16]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 16) + out[1] = + in[2] - in[1] | + ((in[3] - in[2]) << 16) + out[2] = + in[4] - in[3] | + ((in[5] - in[4]) << 16) + out[3] = + in[6] - in[5] | + ((in[7] - in[6]) << 16) + out[4] = + in[8] - in[7] | + ((in[9] - in[8]) << 16) + out[5] = + in[10] - in[9] | + ((in[11] - in[10]) << 16) + out[6] = + in[12] - in[11] | + ((in[13] - in[12]) << 16) + out[7] = + in[14] - in[13] | + ((in[15] - in[14]) << 16) + out[8] = + in[16] - in[15] | + ((in[17] - in[16]) << 16) + out[9] = + in[18] - in[17] | + ((in[19] - in[18]) << 16) + out[10] = + in[20] - in[19] | + ((in[21] - in[20]) << 16) + out[11] = + in[22] - in[21] | + ((in[23] - in[22]) << 16) + out[12] = + in[24] - in[23] | + ((in[25] - in[24]) << 16) + out[13] = + in[26] - in[25] | + ((in[27] - in[26]) << 16) + out[14] = + in[28] - in[27] | + ((in[29] - in[28]) << 16) + out[15] = + in[30] - in[29] | + ((in[31] - in[30]) << 16) +} + +func deltapack_uint32_17(initoffset uint32, in *[32]uint32, out *[17]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 17) + out[1] = + (in[1] - in[0]) >> 15 | + ((in[2] - in[1]) << 2) | + ((in[3] - in[2]) << 19) + out[2] = + (in[3] - in[2]) >> 13 | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 21) + out[3] = + (in[5] - in[4]) >> 11 | + ((in[6] - in[5]) << 6) | + ((in[7] - in[6]) << 23) + out[4] = + (in[7] - in[6]) >> 9 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 25) + out[5] = + (in[9] - in[8]) >> 7 | + ((in[10] - in[9]) << 10) | + ((in[11] - in[10]) << 27) + out[6] = + (in[11] - in[10]) >> 5 | + ((in[12] - in[11]) << 12) | + ((in[13] - in[12]) << 29) + out[7] = + (in[13] - in[12]) >> 3 | + ((in[14] - in[13]) << 14) | + ((in[15] - in[14]) << 31) + out[8] = + (in[15] - in[14]) >> 1 | + ((in[16] - in[15]) << 16) + out[9] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 1) | + ((in[18] - in[17]) << 18) + out[10] = + (in[18] - in[17]) >> 14 | + ((in[19] - in[18]) << 3) | + ((in[20] - in[19]) << 20) + out[11] = + (in[20] - in[19]) >> 12 | + ((in[21] - in[20]) << 5) | + ((in[22] - in[21]) << 22) + out[12] = + (in[22] - in[21]) >> 10 | + ((in[23] - in[22]) << 7) | + ((in[24] - in[23]) << 24) + out[13] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 9) | + ((in[26] - in[25]) << 26) + out[14] = + (in[26] - in[25]) >> 6 | + ((in[27] - in[26]) << 11) | + ((in[28] - in[27]) << 28) + out[15] = + (in[28] - in[27]) >> 4 | + ((in[29] - in[28]) << 13) | + ((in[30] - in[29]) << 30) + out[16] = + (in[30] - in[29]) >> 2 | + ((in[31] - in[30]) << 15) +} + +func deltapack_uint32_18(initoffset uint32, in *[32]uint32, out *[18]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 18) + out[1] = + (in[1] - in[0]) >> 14 | + ((in[2] - in[1]) << 4) | + ((in[3] - in[2]) << 22) + out[2] = + (in[3] - in[2]) >> 10 | + ((in[4] - in[3]) << 8) | + ((in[5] - in[4]) << 26) + out[3] = + (in[5] - in[4]) >> 6 | + ((in[6] - in[5]) << 12) | + ((in[7] - in[6]) << 30) + out[4] = + (in[7] - in[6]) >> 2 | + ((in[8] - in[7]) << 16) + out[5] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 2) | + ((in[10] - in[9]) << 20) + out[6] = + (in[10] - in[9]) >> 12 | + ((in[11] - in[10]) << 6) | + ((in[12] - in[11]) << 24) + out[7] = + (in[12] - in[11]) >> 8 | + ((in[13] - in[12]) << 10) | + ((in[14] - in[13]) << 28) + out[8] = + (in[14] - in[13]) >> 4 | + ((in[15] - in[14]) << 14) + out[9] = + in[16] - in[15] | + ((in[17] - in[16]) << 18) + out[10] = + (in[17] - in[16]) >> 14 | + ((in[18] - in[17]) << 4) | + ((in[19] - in[18]) << 22) + out[11] = + (in[19] - in[18]) >> 10 | + ((in[20] - in[19]) << 8) | + ((in[21] - in[20]) << 26) + out[12] = + (in[21] - in[20]) >> 6 | + ((in[22] - in[21]) << 12) | + ((in[23] - in[22]) << 30) + out[13] = + (in[23] - in[22]) >> 2 | + ((in[24] - in[23]) << 16) + out[14] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 2) | + ((in[26] - in[25]) << 20) + out[15] = + (in[26] - in[25]) >> 12 | + ((in[27] - in[26]) << 6) | + ((in[28] - in[27]) << 24) + out[16] = + (in[28] - in[27]) >> 8 | + ((in[29] - in[28]) << 10) | + ((in[30] - in[29]) << 28) + out[17] = + (in[30] - in[29]) >> 4 | + ((in[31] - in[30]) << 14) +} + +func deltapack_uint32_19(initoffset uint32, in *[32]uint32, out *[19]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 19) + out[1] = + (in[1] - in[0]) >> 13 | + ((in[2] - in[1]) << 6) | + ((in[3] - in[2]) << 25) + out[2] = + (in[3] - in[2]) >> 7 | + ((in[4] - in[3]) << 12) | + ((in[5] - in[4]) << 31) + out[3] = + (in[5] - in[4]) >> 1 | + ((in[6] - in[5]) << 18) + out[4] = + (in[6] - in[5]) >> 14 | + ((in[7] - in[6]) << 5) | + ((in[8] - in[7]) << 24) + out[5] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 11) | + ((in[10] - in[9]) << 30) + out[6] = + (in[10] - in[9]) >> 2 | + ((in[11] - in[10]) << 17) + out[7] = + (in[11] - in[10]) >> 15 | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 23) + out[8] = + (in[13] - in[12]) >> 9 | + ((in[14] - in[13]) << 10) | + ((in[15] - in[14]) << 29) + out[9] = + (in[15] - in[14]) >> 3 | + ((in[16] - in[15]) << 16) + out[10] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 3) | + ((in[18] - in[17]) << 22) + out[11] = + (in[18] - in[17]) >> 10 | + ((in[19] - in[18]) << 9) | + ((in[20] - in[19]) << 28) + out[12] = + (in[20] - in[19]) >> 4 | + ((in[21] - in[20]) << 15) + out[13] = + (in[21] - in[20]) >> 17 | + ((in[22] - in[21]) << 2) | + ((in[23] - in[22]) << 21) + out[14] = + (in[23] - in[22]) >> 11 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 27) + out[15] = + (in[25] - in[24]) >> 5 | + ((in[26] - in[25]) << 14) + out[16] = + (in[26] - in[25]) >> 18 | + ((in[27] - in[26]) << 1) | + ((in[28] - in[27]) << 20) + out[17] = + (in[28] - in[27]) >> 12 | + ((in[29] - in[28]) << 7) | + ((in[30] - in[29]) << 26) + out[18] = + (in[30] - in[29]) >> 6 | + ((in[31] - in[30]) << 13) +} + +func deltapack_uint32_20(initoffset uint32, in *[32]uint32, out *[20]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 20) + out[1] = + (in[1] - in[0]) >> 12 | + ((in[2] - in[1]) << 8) | + ((in[3] - in[2]) << 28) + out[2] = + (in[3] - in[2]) >> 4 | + ((in[4] - in[3]) << 16) + out[3] = + (in[4] - in[3]) >> 16 | + ((in[5] - in[4]) << 4) | + ((in[6] - in[5]) << 24) + out[4] = + (in[6] - in[5]) >> 8 | + ((in[7] - in[6]) << 12) + out[5] = + in[8] - in[7] | + ((in[9] - in[8]) << 20) + out[6] = + (in[9] - in[8]) >> 12 | + ((in[10] - in[9]) << 8) | + ((in[11] - in[10]) << 28) + out[7] = + (in[11] - in[10]) >> 4 | + ((in[12] - in[11]) << 16) + out[8] = + (in[12] - in[11]) >> 16 | + ((in[13] - in[12]) << 4) | + ((in[14] - in[13]) << 24) + out[9] = + (in[14] - in[13]) >> 8 | + ((in[15] - in[14]) << 12) + out[10] = + in[16] - in[15] | + ((in[17] - in[16]) << 20) + out[11] = + (in[17] - in[16]) >> 12 | + ((in[18] - in[17]) << 8) | + ((in[19] - in[18]) << 28) + out[12] = + (in[19] - in[18]) >> 4 | + ((in[20] - in[19]) << 16) + out[13] = + (in[20] - in[19]) >> 16 | + ((in[21] - in[20]) << 4) | + ((in[22] - in[21]) << 24) + out[14] = + (in[22] - in[21]) >> 8 | + ((in[23] - in[22]) << 12) + out[15] = + in[24] - in[23] | + ((in[25] - in[24]) << 20) + out[16] = + (in[25] - in[24]) >> 12 | + ((in[26] - in[25]) << 8) | + ((in[27] - in[26]) << 28) + out[17] = + (in[27] - in[26]) >> 4 | + ((in[28] - in[27]) << 16) + out[18] = + (in[28] - in[27]) >> 16 | + ((in[29] - in[28]) << 4) | + ((in[30] - in[29]) << 24) + out[19] = + (in[30] - in[29]) >> 8 | + ((in[31] - in[30]) << 12) +} + +func deltapack_uint32_21(initoffset uint32, in *[32]uint32, out *[21]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 21) + out[1] = + (in[1] - in[0]) >> 11 | + ((in[2] - in[1]) << 10) | + ((in[3] - in[2]) << 31) + out[2] = + (in[3] - in[2]) >> 1 | + ((in[4] - in[3]) << 20) + out[3] = + (in[4] - in[3]) >> 12 | + ((in[5] - in[4]) << 9) | + ((in[6] - in[5]) << 30) + out[4] = + (in[6] - in[5]) >> 2 | + ((in[7] - in[6]) << 19) + out[5] = + (in[7] - in[6]) >> 13 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 29) + out[6] = + (in[9] - in[8]) >> 3 | + ((in[10] - in[9]) << 18) + out[7] = + (in[10] - in[9]) >> 14 | + ((in[11] - in[10]) << 7) | + ((in[12] - in[11]) << 28) + out[8] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 17) + out[9] = + (in[13] - in[12]) >> 15 | + ((in[14] - in[13]) << 6) | + ((in[15] - in[14]) << 27) + out[10] = + (in[15] - in[14]) >> 5 | + ((in[16] - in[15]) << 16) + out[11] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 5) | + ((in[18] - in[17]) << 26) + out[12] = + (in[18] - in[17]) >> 6 | + ((in[19] - in[18]) << 15) + out[13] = + (in[19] - in[18]) >> 17 | + ((in[20] - in[19]) << 4) | + ((in[21] - in[20]) << 25) + out[14] = + (in[21] - in[20]) >> 7 | + ((in[22] - in[21]) << 14) + out[15] = + (in[22] - in[21]) >> 18 | + ((in[23] - in[22]) << 3) | + ((in[24] - in[23]) << 24) + out[16] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 13) + out[17] = + (in[25] - in[24]) >> 19 | + ((in[26] - in[25]) << 2) | + ((in[27] - in[26]) << 23) + out[18] = + (in[27] - in[26]) >> 9 | + ((in[28] - in[27]) << 12) + out[19] = + (in[28] - in[27]) >> 20 | + ((in[29] - in[28]) << 1) | + ((in[30] - in[29]) << 22) + out[20] = + (in[30] - in[29]) >> 10 | + ((in[31] - in[30]) << 11) +} + +func deltapack_uint32_22(initoffset uint32, in *[32]uint32, out *[22]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 22) + out[1] = + (in[1] - in[0]) >> 10 | + ((in[2] - in[1]) << 12) + out[2] = + (in[2] - in[1]) >> 20 | + ((in[3] - in[2]) << 2) | + ((in[4] - in[3]) << 24) + out[3] = + (in[4] - in[3]) >> 8 | + ((in[5] - in[4]) << 14) + out[4] = + (in[5] - in[4]) >> 18 | + ((in[6] - in[5]) << 4) | + ((in[7] - in[6]) << 26) + out[5] = + (in[7] - in[6]) >> 6 | + ((in[8] - in[7]) << 16) + out[6] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 6) | + ((in[10] - in[9]) << 28) + out[7] = + (in[10] - in[9]) >> 4 | + ((in[11] - in[10]) << 18) + out[8] = + (in[11] - in[10]) >> 14 | + ((in[12] - in[11]) << 8) | + ((in[13] - in[12]) << 30) + out[9] = + (in[13] - in[12]) >> 2 | + ((in[14] - in[13]) << 20) + out[10] = + (in[14] - in[13]) >> 12 | + ((in[15] - in[14]) << 10) + out[11] = + in[16] - in[15] | + ((in[17] - in[16]) << 22) + out[12] = + (in[17] - in[16]) >> 10 | + ((in[18] - in[17]) << 12) + out[13] = + (in[18] - in[17]) >> 20 | + ((in[19] - in[18]) << 2) | + ((in[20] - in[19]) << 24) + out[14] = + (in[20] - in[19]) >> 8 | + ((in[21] - in[20]) << 14) + out[15] = + (in[21] - in[20]) >> 18 | + ((in[22] - in[21]) << 4) | + ((in[23] - in[22]) << 26) + out[16] = + (in[23] - in[22]) >> 6 | + ((in[24] - in[23]) << 16) + out[17] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 6) | + ((in[26] - in[25]) << 28) + out[18] = + (in[26] - in[25]) >> 4 | + ((in[27] - in[26]) << 18) + out[19] = + (in[27] - in[26]) >> 14 | + ((in[28] - in[27]) << 8) | + ((in[29] - in[28]) << 30) + out[20] = + (in[29] - in[28]) >> 2 | + ((in[30] - in[29]) << 20) + out[21] = + (in[30] - in[29]) >> 12 | + ((in[31] - in[30]) << 10) +} + +func deltapack_uint32_23(initoffset uint32, in *[32]uint32, out *[23]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 23) + out[1] = + (in[1] - in[0]) >> 9 | + ((in[2] - in[1]) << 14) + out[2] = + (in[2] - in[1]) >> 18 | + ((in[3] - in[2]) << 5) | + ((in[4] - in[3]) << 28) + out[3] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 19) + out[4] = + (in[5] - in[4]) >> 13 | + ((in[6] - in[5]) << 10) + out[5] = + (in[6] - in[5]) >> 22 | + ((in[7] - in[6]) << 1) | + ((in[8] - in[7]) << 24) + out[6] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 15) + out[7] = + (in[9] - in[8]) >> 17 | + ((in[10] - in[9]) << 6) | + ((in[11] - in[10]) << 29) + out[8] = + (in[11] - in[10]) >> 3 | + ((in[12] - in[11]) << 20) + out[9] = + (in[12] - in[11]) >> 12 | + ((in[13] - in[12]) << 11) + out[10] = + (in[13] - in[12]) >> 21 | + ((in[14] - in[13]) << 2) | + ((in[15] - in[14]) << 25) + out[11] = + (in[15] - in[14]) >> 7 | + ((in[16] - in[15]) << 16) + out[12] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 7) | + ((in[18] - in[17]) << 30) + out[13] = + (in[18] - in[17]) >> 2 | + ((in[19] - in[18]) << 21) + out[14] = + (in[19] - in[18]) >> 11 | + ((in[20] - in[19]) << 12) + out[15] = + (in[20] - in[19]) >> 20 | + ((in[21] - in[20]) << 3) | + ((in[22] - in[21]) << 26) + out[16] = + (in[22] - in[21]) >> 6 | + ((in[23] - in[22]) << 17) + out[17] = + (in[23] - in[22]) >> 15 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 31) + out[18] = + (in[25] - in[24]) >> 1 | + ((in[26] - in[25]) << 22) + out[19] = + (in[26] - in[25]) >> 10 | + ((in[27] - in[26]) << 13) + out[20] = + (in[27] - in[26]) >> 19 | + ((in[28] - in[27]) << 4) | + ((in[29] - in[28]) << 27) + out[21] = + (in[29] - in[28]) >> 5 | + ((in[30] - in[29]) << 18) + out[22] = + (in[30] - in[29]) >> 14 | + ((in[31] - in[30]) << 9) +} + +func deltapack_uint32_24(initoffset uint32, in *[32]uint32, out *[24]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 24) + out[1] = + (in[1] - in[0]) >> 8 | + ((in[2] - in[1]) << 16) + out[2] = + (in[2] - in[1]) >> 16 | + ((in[3] - in[2]) << 8) + out[3] = + in[4] - in[3] | + ((in[5] - in[4]) << 24) + out[4] = + (in[5] - in[4]) >> 8 | + ((in[6] - in[5]) << 16) + out[5] = + (in[6] - in[5]) >> 16 | + ((in[7] - in[6]) << 8) + out[6] = + in[8] - in[7] | + ((in[9] - in[8]) << 24) + out[7] = + (in[9] - in[8]) >> 8 | + ((in[10] - in[9]) << 16) + out[8] = + (in[10] - in[9]) >> 16 | + ((in[11] - in[10]) << 8) + out[9] = + in[12] - in[11] | + ((in[13] - in[12]) << 24) + out[10] = + (in[13] - in[12]) >> 8 | + ((in[14] - in[13]) << 16) + out[11] = + (in[14] - in[13]) >> 16 | + ((in[15] - in[14]) << 8) + out[12] = + in[16] - in[15] | + ((in[17] - in[16]) << 24) + out[13] = + (in[17] - in[16]) >> 8 | + ((in[18] - in[17]) << 16) + out[14] = + (in[18] - in[17]) >> 16 | + ((in[19] - in[18]) << 8) + out[15] = + in[20] - in[19] | + ((in[21] - in[20]) << 24) + out[16] = + (in[21] - in[20]) >> 8 | + ((in[22] - in[21]) << 16) + out[17] = + (in[22] - in[21]) >> 16 | + ((in[23] - in[22]) << 8) + out[18] = + in[24] - in[23] | + ((in[25] - in[24]) << 24) + out[19] = + (in[25] - in[24]) >> 8 | + ((in[26] - in[25]) << 16) + out[20] = + (in[26] - in[25]) >> 16 | + ((in[27] - in[26]) << 8) + out[21] = + in[28] - in[27] | + ((in[29] - in[28]) << 24) + out[22] = + (in[29] - in[28]) >> 8 | + ((in[30] - in[29]) << 16) + out[23] = + (in[30] - in[29]) >> 16 | + ((in[31] - in[30]) << 8) +} + +func deltapack_uint32_25(initoffset uint32, in *[32]uint32, out *[25]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 25) + out[1] = + (in[1] - in[0]) >> 7 | + ((in[2] - in[1]) << 18) + out[2] = + (in[2] - in[1]) >> 14 | + ((in[3] - in[2]) << 11) + out[3] = + (in[3] - in[2]) >> 21 | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 29) + out[4] = + (in[5] - in[4]) >> 3 | + ((in[6] - in[5]) << 22) + out[5] = + (in[6] - in[5]) >> 10 | + ((in[7] - in[6]) << 15) + out[6] = + (in[7] - in[6]) >> 17 | + ((in[8] - in[7]) << 8) + out[7] = + (in[8] - in[7]) >> 24 | + ((in[9] - in[8]) << 1) | + ((in[10] - in[9]) << 26) + out[8] = + (in[10] - in[9]) >> 6 | + ((in[11] - in[10]) << 19) + out[9] = + (in[11] - in[10]) >> 13 | + ((in[12] - in[11]) << 12) + out[10] = + (in[12] - in[11]) >> 20 | + ((in[13] - in[12]) << 5) | + ((in[14] - in[13]) << 30) + out[11] = + (in[14] - in[13]) >> 2 | + ((in[15] - in[14]) << 23) + out[12] = + (in[15] - in[14]) >> 9 | + ((in[16] - in[15]) << 16) + out[13] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 9) + out[14] = + (in[17] - in[16]) >> 23 | + ((in[18] - in[17]) << 2) | + ((in[19] - in[18]) << 27) + out[15] = + (in[19] - in[18]) >> 5 | + ((in[20] - in[19]) << 20) + out[16] = + (in[20] - in[19]) >> 12 | + ((in[21] - in[20]) << 13) + out[17] = + (in[21] - in[20]) >> 19 | + ((in[22] - in[21]) << 6) | + ((in[23] - in[22]) << 31) + out[18] = + (in[23] - in[22]) >> 1 | + ((in[24] - in[23]) << 24) + out[19] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 17) + out[20] = + (in[25] - in[24]) >> 15 | + ((in[26] - in[25]) << 10) + out[21] = + (in[26] - in[25]) >> 22 | + ((in[27] - in[26]) << 3) | + ((in[28] - in[27]) << 28) + out[22] = + (in[28] - in[27]) >> 4 | + ((in[29] - in[28]) << 21) + out[23] = + (in[29] - in[28]) >> 11 | + ((in[30] - in[29]) << 14) + out[24] = + (in[30] - in[29]) >> 18 | + ((in[31] - in[30]) << 7) +} + +func deltapack_uint32_26(initoffset uint32, in *[32]uint32, out *[26]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 26) + out[1] = + (in[1] - in[0]) >> 6 | + ((in[2] - in[1]) << 20) + out[2] = + (in[2] - in[1]) >> 12 | + ((in[3] - in[2]) << 14) + out[3] = + (in[3] - in[2]) >> 18 | + ((in[4] - in[3]) << 8) + out[4] = + (in[4] - in[3]) >> 24 | + ((in[5] - in[4]) << 2) | + ((in[6] - in[5]) << 28) + out[5] = + (in[6] - in[5]) >> 4 | + ((in[7] - in[6]) << 22) + out[6] = + (in[7] - in[6]) >> 10 | + ((in[8] - in[7]) << 16) + out[7] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 10) + out[8] = + (in[9] - in[8]) >> 22 | + ((in[10] - in[9]) << 4) | + ((in[11] - in[10]) << 30) + out[9] = + (in[11] - in[10]) >> 2 | + ((in[12] - in[11]) << 24) + out[10] = + (in[12] - in[11]) >> 8 | + ((in[13] - in[12]) << 18) + out[11] = + (in[13] - in[12]) >> 14 | + ((in[14] - in[13]) << 12) + out[12] = + (in[14] - in[13]) >> 20 | + ((in[15] - in[14]) << 6) + out[13] = + in[16] - in[15] | + ((in[17] - in[16]) << 26) + out[14] = + (in[17] - in[16]) >> 6 | + ((in[18] - in[17]) << 20) + out[15] = + (in[18] - in[17]) >> 12 | + ((in[19] - in[18]) << 14) + out[16] = + (in[19] - in[18]) >> 18 | + ((in[20] - in[19]) << 8) + out[17] = + (in[20] - in[19]) >> 24 | + ((in[21] - in[20]) << 2) | + ((in[22] - in[21]) << 28) + out[18] = + (in[22] - in[21]) >> 4 | + ((in[23] - in[22]) << 22) + out[19] = + (in[23] - in[22]) >> 10 | + ((in[24] - in[23]) << 16) + out[20] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 10) + out[21] = + (in[25] - in[24]) >> 22 | + ((in[26] - in[25]) << 4) | + ((in[27] - in[26]) << 30) + out[22] = + (in[27] - in[26]) >> 2 | + ((in[28] - in[27]) << 24) + out[23] = + (in[28] - in[27]) >> 8 | + ((in[29] - in[28]) << 18) + out[24] = + (in[29] - in[28]) >> 14 | + ((in[30] - in[29]) << 12) + out[25] = + (in[30] - in[29]) >> 20 | + ((in[31] - in[30]) << 6) +} + +func deltapack_uint32_27(initoffset uint32, in *[32]uint32, out *[27]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 27) + out[1] = + (in[1] - in[0]) >> 5 | + ((in[2] - in[1]) << 22) + out[2] = + (in[2] - in[1]) >> 10 | + ((in[3] - in[2]) << 17) + out[3] = + (in[3] - in[2]) >> 15 | + ((in[4] - in[3]) << 12) + out[4] = + (in[4] - in[3]) >> 20 | + ((in[5] - in[4]) << 7) + out[5] = + (in[5] - in[4]) >> 25 | + ((in[6] - in[5]) << 2) | + ((in[7] - in[6]) << 29) + out[6] = + (in[7] - in[6]) >> 3 | + ((in[8] - in[7]) << 24) + out[7] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 19) + out[8] = + (in[9] - in[8]) >> 13 | + ((in[10] - in[9]) << 14) + out[9] = + (in[10] - in[9]) >> 18 | + ((in[11] - in[10]) << 9) + out[10] = + (in[11] - in[10]) >> 23 | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 31) + out[11] = + (in[13] - in[12]) >> 1 | + ((in[14] - in[13]) << 26) + out[12] = + (in[14] - in[13]) >> 6 | + ((in[15] - in[14]) << 21) + out[13] = + (in[15] - in[14]) >> 11 | + ((in[16] - in[15]) << 16) + out[14] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 11) + out[15] = + (in[17] - in[16]) >> 21 | + ((in[18] - in[17]) << 6) + out[16] = + (in[18] - in[17]) >> 26 | + ((in[19] - in[18]) << 1) | + ((in[20] - in[19]) << 28) + out[17] = + (in[20] - in[19]) >> 4 | + ((in[21] - in[20]) << 23) + out[18] = + (in[21] - in[20]) >> 9 | + ((in[22] - in[21]) << 18) + out[19] = + (in[22] - in[21]) >> 14 | + ((in[23] - in[22]) << 13) + out[20] = + (in[23] - in[22]) >> 19 | + ((in[24] - in[23]) << 8) + out[21] = + (in[24] - in[23]) >> 24 | + ((in[25] - in[24]) << 3) | + ((in[26] - in[25]) << 30) + out[22] = + (in[26] - in[25]) >> 2 | + ((in[27] - in[26]) << 25) + out[23] = + (in[27] - in[26]) >> 7 | + ((in[28] - in[27]) << 20) + out[24] = + (in[28] - in[27]) >> 12 | + ((in[29] - in[28]) << 15) + out[25] = + (in[29] - in[28]) >> 17 | + ((in[30] - in[29]) << 10) + out[26] = + (in[30] - in[29]) >> 22 | + ((in[31] - in[30]) << 5) +} + +func deltapack_uint32_28(initoffset uint32, in *[32]uint32, out *[28]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 28) + out[1] = + (in[1] - in[0]) >> 4 | + ((in[2] - in[1]) << 24) + out[2] = + (in[2] - in[1]) >> 8 | + ((in[3] - in[2]) << 20) + out[3] = + (in[3] - in[2]) >> 12 | + ((in[4] - in[3]) << 16) + out[4] = + (in[4] - in[3]) >> 16 | + ((in[5] - in[4]) << 12) + out[5] = + (in[5] - in[4]) >> 20 | + ((in[6] - in[5]) << 8) + out[6] = + (in[6] - in[5]) >> 24 | + ((in[7] - in[6]) << 4) + out[7] = + in[8] - in[7] | + ((in[9] - in[8]) << 28) + out[8] = + (in[9] - in[8]) >> 4 | + ((in[10] - in[9]) << 24) + out[9] = + (in[10] - in[9]) >> 8 | + ((in[11] - in[10]) << 20) + out[10] = + (in[11] - in[10]) >> 12 | + ((in[12] - in[11]) << 16) + out[11] = + (in[12] - in[11]) >> 16 | + ((in[13] - in[12]) << 12) + out[12] = + (in[13] - in[12]) >> 20 | + ((in[14] - in[13]) << 8) + out[13] = + (in[14] - in[13]) >> 24 | + ((in[15] - in[14]) << 4) + out[14] = + in[16] - in[15] | + ((in[17] - in[16]) << 28) + out[15] = + (in[17] - in[16]) >> 4 | + ((in[18] - in[17]) << 24) + out[16] = + (in[18] - in[17]) >> 8 | + ((in[19] - in[18]) << 20) + out[17] = + (in[19] - in[18]) >> 12 | + ((in[20] - in[19]) << 16) + out[18] = + (in[20] - in[19]) >> 16 | + ((in[21] - in[20]) << 12) + out[19] = + (in[21] - in[20]) >> 20 | + ((in[22] - in[21]) << 8) + out[20] = + (in[22] - in[21]) >> 24 | + ((in[23] - in[22]) << 4) + out[21] = + in[24] - in[23] | + ((in[25] - in[24]) << 28) + out[22] = + (in[25] - in[24]) >> 4 | + ((in[26] - in[25]) << 24) + out[23] = + (in[26] - in[25]) >> 8 | + ((in[27] - in[26]) << 20) + out[24] = + (in[27] - in[26]) >> 12 | + ((in[28] - in[27]) << 16) + out[25] = + (in[28] - in[27]) >> 16 | + ((in[29] - in[28]) << 12) + out[26] = + (in[29] - in[28]) >> 20 | + ((in[30] - in[29]) << 8) + out[27] = + (in[30] - in[29]) >> 24 | + ((in[31] - in[30]) << 4) +} + +func deltapack_uint32_29(initoffset uint32, in *[32]uint32, out *[29]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 29) + out[1] = + (in[1] - in[0]) >> 3 | + ((in[2] - in[1]) << 26) + out[2] = + (in[2] - in[1]) >> 6 | + ((in[3] - in[2]) << 23) + out[3] = + (in[3] - in[2]) >> 9 | + ((in[4] - in[3]) << 20) + out[4] = + (in[4] - in[3]) >> 12 | + ((in[5] - in[4]) << 17) + out[5] = + (in[5] - in[4]) >> 15 | + ((in[6] - in[5]) << 14) + out[6] = + (in[6] - in[5]) >> 18 | + ((in[7] - in[6]) << 11) + out[7] = + (in[7] - in[6]) >> 21 | + ((in[8] - in[7]) << 8) + out[8] = + (in[8] - in[7]) >> 24 | + ((in[9] - in[8]) << 5) + out[9] = + (in[9] - in[8]) >> 27 | + ((in[10] - in[9]) << 2) | + ((in[11] - in[10]) << 31) + out[10] = + (in[11] - in[10]) >> 1 | + ((in[12] - in[11]) << 28) + out[11] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 25) + out[12] = + (in[13] - in[12]) >> 7 | + ((in[14] - in[13]) << 22) + out[13] = + (in[14] - in[13]) >> 10 | + ((in[15] - in[14]) << 19) + out[14] = + (in[15] - in[14]) >> 13 | + ((in[16] - in[15]) << 16) + out[15] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 13) + out[16] = + (in[17] - in[16]) >> 19 | + ((in[18] - in[17]) << 10) + out[17] = + (in[18] - in[17]) >> 22 | + ((in[19] - in[18]) << 7) + out[18] = + (in[19] - in[18]) >> 25 | + ((in[20] - in[19]) << 4) + out[19] = + (in[20] - in[19]) >> 28 | + ((in[21] - in[20]) << 1) | + ((in[22] - in[21]) << 30) + out[20] = + (in[22] - in[21]) >> 2 | + ((in[23] - in[22]) << 27) + out[21] = + (in[23] - in[22]) >> 5 | + ((in[24] - in[23]) << 24) + out[22] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 21) + out[23] = + (in[25] - in[24]) >> 11 | + ((in[26] - in[25]) << 18) + out[24] = + (in[26] - in[25]) >> 14 | + ((in[27] - in[26]) << 15) + out[25] = + (in[27] - in[26]) >> 17 | + ((in[28] - in[27]) << 12) + out[26] = + (in[28] - in[27]) >> 20 | + ((in[29] - in[28]) << 9) + out[27] = + (in[29] - in[28]) >> 23 | + ((in[30] - in[29]) << 6) + out[28] = + (in[30] - in[29]) >> 26 | + ((in[31] - in[30]) << 3) +} + +func deltapack_uint32_30(initoffset uint32, in *[32]uint32, out *[30]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 30) + out[1] = + (in[1] - in[0]) >> 2 | + ((in[2] - in[1]) << 28) + out[2] = + (in[2] - in[1]) >> 4 | + ((in[3] - in[2]) << 26) + out[3] = + (in[3] - in[2]) >> 6 | + ((in[4] - in[3]) << 24) + out[4] = + (in[4] - in[3]) >> 8 | + ((in[5] - in[4]) << 22) + out[5] = + (in[5] - in[4]) >> 10 | + ((in[6] - in[5]) << 20) + out[6] = + (in[6] - in[5]) >> 12 | + ((in[7] - in[6]) << 18) + out[7] = + (in[7] - in[6]) >> 14 | + ((in[8] - in[7]) << 16) + out[8] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 14) + out[9] = + (in[9] - in[8]) >> 18 | + ((in[10] - in[9]) << 12) + out[10] = + (in[10] - in[9]) >> 20 | + ((in[11] - in[10]) << 10) + out[11] = + (in[11] - in[10]) >> 22 | + ((in[12] - in[11]) << 8) + out[12] = + (in[12] - in[11]) >> 24 | + ((in[13] - in[12]) << 6) + out[13] = + (in[13] - in[12]) >> 26 | + ((in[14] - in[13]) << 4) + out[14] = + (in[14] - in[13]) >> 28 | + ((in[15] - in[14]) << 2) + out[15] = + in[16] - in[15] | + ((in[17] - in[16]) << 30) + out[16] = + (in[17] - in[16]) >> 2 | + ((in[18] - in[17]) << 28) + out[17] = + (in[18] - in[17]) >> 4 | + ((in[19] - in[18]) << 26) + out[18] = + (in[19] - in[18]) >> 6 | + ((in[20] - in[19]) << 24) + out[19] = + (in[20] - in[19]) >> 8 | + ((in[21] - in[20]) << 22) + out[20] = + (in[21] - in[20]) >> 10 | + ((in[22] - in[21]) << 20) + out[21] = + (in[22] - in[21]) >> 12 | + ((in[23] - in[22]) << 18) + out[22] = + (in[23] - in[22]) >> 14 | + ((in[24] - in[23]) << 16) + out[23] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 14) + out[24] = + (in[25] - in[24]) >> 18 | + ((in[26] - in[25]) << 12) + out[25] = + (in[26] - in[25]) >> 20 | + ((in[27] - in[26]) << 10) + out[26] = + (in[27] - in[26]) >> 22 | + ((in[28] - in[27]) << 8) + out[27] = + (in[28] - in[27]) >> 24 | + ((in[29] - in[28]) << 6) + out[28] = + (in[29] - in[28]) >> 26 | + ((in[30] - in[29]) << 4) + out[29] = + (in[30] - in[29]) >> 28 | + ((in[31] - in[30]) << 2) +} + +func deltapack_uint32_31(initoffset uint32, in *[32]uint32, out *[31]uint32) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 31) + out[1] = + (in[1] - in[0]) >> 1 | + ((in[2] - in[1]) << 30) + out[2] = + (in[2] - in[1]) >> 2 | + ((in[3] - in[2]) << 29) + out[3] = + (in[3] - in[2]) >> 3 | + ((in[4] - in[3]) << 28) + out[4] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 27) + out[5] = + (in[5] - in[4]) >> 5 | + ((in[6] - in[5]) << 26) + out[6] = + (in[6] - in[5]) >> 6 | + ((in[7] - in[6]) << 25) + out[7] = + (in[7] - in[6]) >> 7 | + ((in[8] - in[7]) << 24) + out[8] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 23) + out[9] = + (in[9] - in[8]) >> 9 | + ((in[10] - in[9]) << 22) + out[10] = + (in[10] - in[9]) >> 10 | + ((in[11] - in[10]) << 21) + out[11] = + (in[11] - in[10]) >> 11 | + ((in[12] - in[11]) << 20) + out[12] = + (in[12] - in[11]) >> 12 | + ((in[13] - in[12]) << 19) + out[13] = + (in[13] - in[12]) >> 13 | + ((in[14] - in[13]) << 18) + out[14] = + (in[14] - in[13]) >> 14 | + ((in[15] - in[14]) << 17) + out[15] = + (in[15] - in[14]) >> 15 | + ((in[16] - in[15]) << 16) + out[16] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 15) + out[17] = + (in[17] - in[16]) >> 17 | + ((in[18] - in[17]) << 14) + out[18] = + (in[18] - in[17]) >> 18 | + ((in[19] - in[18]) << 13) + out[19] = + (in[19] - in[18]) >> 19 | + ((in[20] - in[19]) << 12) + out[20] = + (in[20] - in[19]) >> 20 | + ((in[21] - in[20]) << 11) + out[21] = + (in[21] - in[20]) >> 21 | + ((in[22] - in[21]) << 10) + out[22] = + (in[22] - in[21]) >> 22 | + ((in[23] - in[22]) << 9) + out[23] = + (in[23] - in[22]) >> 23 | + ((in[24] - in[23]) << 8) + out[24] = + (in[24] - in[23]) >> 24 | + ((in[25] - in[24]) << 7) + out[25] = + (in[25] - in[24]) >> 25 | + ((in[26] - in[25]) << 6) + out[26] = + (in[26] - in[25]) >> 26 | + ((in[27] - in[26]) << 5) + out[27] = + (in[27] - in[26]) >> 27 | + ((in[28] - in[27]) << 4) + out[28] = + (in[28] - in[27]) >> 28 | + ((in[29] - in[28]) << 3) + out[29] = + (in[29] - in[28]) >> 29 | + ((in[30] - in[29]) << 2) + out[30] = + (in[30] - in[29]) >> 30 | + ((in[31] - in[30]) << 1) +} + +func deltaunpack_uint32_0(initoffset uint32, in *[0]uint32, out *[32]uint32) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset +} + +func deltaunpack_uint32_1(initoffset uint32, in *[1]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1 + initoffset + out[1] = (in[0] >> 1) & 0x1 + out[0] + out[2] = (in[0] >> 2) & 0x1 + out[1] + out[3] = (in[0] >> 3) & 0x1 + out[2] + out[4] = (in[0] >> 4) & 0x1 + out[3] + out[5] = (in[0] >> 5) & 0x1 + out[4] + out[6] = (in[0] >> 6) & 0x1 + out[5] + out[7] = (in[0] >> 7) & 0x1 + out[6] + out[8] = (in[0] >> 8) & 0x1 + out[7] + out[9] = (in[0] >> 9) & 0x1 + out[8] + out[10] = (in[0] >> 10) & 0x1 + out[9] + out[11] = (in[0] >> 11) & 0x1 + out[10] + out[12] = (in[0] >> 12) & 0x1 + out[11] + out[13] = (in[0] >> 13) & 0x1 + out[12] + out[14] = (in[0] >> 14) & 0x1 + out[13] + out[15] = (in[0] >> 15) & 0x1 + out[14] + out[16] = (in[0] >> 16) & 0x1 + out[15] + out[17] = (in[0] >> 17) & 0x1 + out[16] + out[18] = (in[0] >> 18) & 0x1 + out[17] + out[19] = (in[0] >> 19) & 0x1 + out[18] + out[20] = (in[0] >> 20) & 0x1 + out[19] + out[21] = (in[0] >> 21) & 0x1 + out[20] + out[22] = (in[0] >> 22) & 0x1 + out[21] + out[23] = (in[0] >> 23) & 0x1 + out[22] + out[24] = (in[0] >> 24) & 0x1 + out[23] + out[25] = (in[0] >> 25) & 0x1 + out[24] + out[26] = (in[0] >> 26) & 0x1 + out[25] + out[27] = (in[0] >> 27) & 0x1 + out[26] + out[28] = (in[0] >> 28) & 0x1 + out[27] + out[29] = (in[0] >> 29) & 0x1 + out[28] + out[30] = (in[0] >> 30) & 0x1 + out[29] + out[31] = (in[0] >> 31) + out[30] +} + +func deltaunpack_uint32_2(initoffset uint32, in *[2]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3 + initoffset + out[1] = (in[0] >> 2) & 0x3 + out[0] + out[2] = (in[0] >> 4) & 0x3 + out[1] + out[3] = (in[0] >> 6) & 0x3 + out[2] + out[4] = (in[0] >> 8) & 0x3 + out[3] + out[5] = (in[0] >> 10) & 0x3 + out[4] + out[6] = (in[0] >> 12) & 0x3 + out[5] + out[7] = (in[0] >> 14) & 0x3 + out[6] + out[8] = (in[0] >> 16) & 0x3 + out[7] + out[9] = (in[0] >> 18) & 0x3 + out[8] + out[10] = (in[0] >> 20) & 0x3 + out[9] + out[11] = (in[0] >> 22) & 0x3 + out[10] + out[12] = (in[0] >> 24) & 0x3 + out[11] + out[13] = (in[0] >> 26) & 0x3 + out[12] + out[14] = (in[0] >> 28) & 0x3 + out[13] + out[15] = (in[0] >> 30) + out[14] + out[16] = (in[1] >> 0) & 0x3 + out[15] + out[17] = (in[1] >> 2) & 0x3 + out[16] + out[18] = (in[1] >> 4) & 0x3 + out[17] + out[19] = (in[1] >> 6) & 0x3 + out[18] + out[20] = (in[1] >> 8) & 0x3 + out[19] + out[21] = (in[1] >> 10) & 0x3 + out[20] + out[22] = (in[1] >> 12) & 0x3 + out[21] + out[23] = (in[1] >> 14) & 0x3 + out[22] + out[24] = (in[1] >> 16) & 0x3 + out[23] + out[25] = (in[1] >> 18) & 0x3 + out[24] + out[26] = (in[1] >> 20) & 0x3 + out[25] + out[27] = (in[1] >> 22) & 0x3 + out[26] + out[28] = (in[1] >> 24) & 0x3 + out[27] + out[29] = (in[1] >> 26) & 0x3 + out[28] + out[30] = (in[1] >> 28) & 0x3 + out[29] + out[31] = (in[1] >> 30) + out[30] +} + +func deltaunpack_uint32_3(initoffset uint32, in *[3]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7 + initoffset + out[1] = (in[0] >> 3) & 0x7 + out[0] + out[2] = (in[0] >> 6) & 0x7 + out[1] + out[3] = (in[0] >> 9) & 0x7 + out[2] + out[4] = (in[0] >> 12) & 0x7 + out[3] + out[5] = (in[0] >> 15) & 0x7 + out[4] + out[6] = (in[0] >> 18) & 0x7 + out[5] + out[7] = (in[0] >> 21) & 0x7 + out[6] + out[8] = (in[0] >> 24) & 0x7 + out[7] + out[9] = (in[0] >> 27) & 0x7 + out[8] + out[10] = ((in[0] >> 30) | ((in[1] & 0x1) << 2)) + out[9] + out[11] = (in[1] >> 1) & 0x7 + out[10] + out[12] = (in[1] >> 4) & 0x7 + out[11] + out[13] = (in[1] >> 7) & 0x7 + out[12] + out[14] = (in[1] >> 10) & 0x7 + out[13] + out[15] = (in[1] >> 13) & 0x7 + out[14] + out[16] = (in[1] >> 16) & 0x7 + out[15] + out[17] = (in[1] >> 19) & 0x7 + out[16] + out[18] = (in[1] >> 22) & 0x7 + out[17] + out[19] = (in[1] >> 25) & 0x7 + out[18] + out[20] = (in[1] >> 28) & 0x7 + out[19] + out[21] = ((in[1] >> 31) | ((in[2] & 0x3) << 1)) + out[20] + out[22] = (in[2] >> 2) & 0x7 + out[21] + out[23] = (in[2] >> 5) & 0x7 + out[22] + out[24] = (in[2] >> 8) & 0x7 + out[23] + out[25] = (in[2] >> 11) & 0x7 + out[24] + out[26] = (in[2] >> 14) & 0x7 + out[25] + out[27] = (in[2] >> 17) & 0x7 + out[26] + out[28] = (in[2] >> 20) & 0x7 + out[27] + out[29] = (in[2] >> 23) & 0x7 + out[28] + out[30] = (in[2] >> 26) & 0x7 + out[29] + out[31] = (in[2] >> 29) + out[30] +} + +func deltaunpack_uint32_4(initoffset uint32, in *[4]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0xF + initoffset + out[1] = (in[0] >> 4) & 0xF + out[0] + out[2] = (in[0] >> 8) & 0xF + out[1] + out[3] = (in[0] >> 12) & 0xF + out[2] + out[4] = (in[0] >> 16) & 0xF + out[3] + out[5] = (in[0] >> 20) & 0xF + out[4] + out[6] = (in[0] >> 24) & 0xF + out[5] + out[7] = (in[0] >> 28) + out[6] + out[8] = (in[1] >> 0) & 0xF + out[7] + out[9] = (in[1] >> 4) & 0xF + out[8] + out[10] = (in[1] >> 8) & 0xF + out[9] + out[11] = (in[1] >> 12) & 0xF + out[10] + out[12] = (in[1] >> 16) & 0xF + out[11] + out[13] = (in[1] >> 20) & 0xF + out[12] + out[14] = (in[1] >> 24) & 0xF + out[13] + out[15] = (in[1] >> 28) + out[14] + out[16] = (in[2] >> 0) & 0xF + out[15] + out[17] = (in[2] >> 4) & 0xF + out[16] + out[18] = (in[2] >> 8) & 0xF + out[17] + out[19] = (in[2] >> 12) & 0xF + out[18] + out[20] = (in[2] >> 16) & 0xF + out[19] + out[21] = (in[2] >> 20) & 0xF + out[20] + out[22] = (in[2] >> 24) & 0xF + out[21] + out[23] = (in[2] >> 28) + out[22] + out[24] = (in[3] >> 0) & 0xF + out[23] + out[25] = (in[3] >> 4) & 0xF + out[24] + out[26] = (in[3] >> 8) & 0xF + out[25] + out[27] = (in[3] >> 12) & 0xF + out[26] + out[28] = (in[3] >> 16) & 0xF + out[27] + out[29] = (in[3] >> 20) & 0xF + out[28] + out[30] = (in[3] >> 24) & 0xF + out[29] + out[31] = (in[3] >> 28) + out[30] +} + +func deltaunpack_uint32_5(initoffset uint32, in *[5]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1F + initoffset + out[1] = (in[0] >> 5) & 0x1F + out[0] + out[2] = (in[0] >> 10) & 0x1F + out[1] + out[3] = (in[0] >> 15) & 0x1F + out[2] + out[4] = (in[0] >> 20) & 0x1F + out[3] + out[5] = (in[0] >> 25) & 0x1F + out[4] + out[6] = ((in[0] >> 30) | ((in[1] & 0x7) << 2)) + out[5] + out[7] = (in[1] >> 3) & 0x1F + out[6] + out[8] = (in[1] >> 8) & 0x1F + out[7] + out[9] = (in[1] >> 13) & 0x1F + out[8] + out[10] = (in[1] >> 18) & 0x1F + out[9] + out[11] = (in[1] >> 23) & 0x1F + out[10] + out[12] = ((in[1] >> 28) | ((in[2] & 0x1) << 4)) + out[11] + out[13] = (in[2] >> 1) & 0x1F + out[12] + out[14] = (in[2] >> 6) & 0x1F + out[13] + out[15] = (in[2] >> 11) & 0x1F + out[14] + out[16] = (in[2] >> 16) & 0x1F + out[15] + out[17] = (in[2] >> 21) & 0x1F + out[16] + out[18] = (in[2] >> 26) & 0x1F + out[17] + out[19] = ((in[2] >> 31) | ((in[3] & 0xF) << 1)) + out[18] + out[20] = (in[3] >> 4) & 0x1F + out[19] + out[21] = (in[3] >> 9) & 0x1F + out[20] + out[22] = (in[3] >> 14) & 0x1F + out[21] + out[23] = (in[3] >> 19) & 0x1F + out[22] + out[24] = (in[3] >> 24) & 0x1F + out[23] + out[25] = ((in[3] >> 29) | ((in[4] & 0x3) << 3)) + out[24] + out[26] = (in[4] >> 2) & 0x1F + out[25] + out[27] = (in[4] >> 7) & 0x1F + out[26] + out[28] = (in[4] >> 12) & 0x1F + out[27] + out[29] = (in[4] >> 17) & 0x1F + out[28] + out[30] = (in[4] >> 22) & 0x1F + out[29] + out[31] = (in[4] >> 27) + out[30] +} + +func deltaunpack_uint32_6(initoffset uint32, in *[6]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3F + initoffset + out[1] = (in[0] >> 6) & 0x3F + out[0] + out[2] = (in[0] >> 12) & 0x3F + out[1] + out[3] = (in[0] >> 18) & 0x3F + out[2] + out[4] = (in[0] >> 24) & 0x3F + out[3] + out[5] = ((in[0] >> 30) | ((in[1] & 0xF) << 2)) + out[4] + out[6] = (in[1] >> 4) & 0x3F + out[5] + out[7] = (in[1] >> 10) & 0x3F + out[6] + out[8] = (in[1] >> 16) & 0x3F + out[7] + out[9] = (in[1] >> 22) & 0x3F + out[8] + out[10] = ((in[1] >> 28) | ((in[2] & 0x3) << 4)) + out[9] + out[11] = (in[2] >> 2) & 0x3F + out[10] + out[12] = (in[2] >> 8) & 0x3F + out[11] + out[13] = (in[2] >> 14) & 0x3F + out[12] + out[14] = (in[2] >> 20) & 0x3F + out[13] + out[15] = (in[2] >> 26) + out[14] + out[16] = (in[3] >> 0) & 0x3F + out[15] + out[17] = (in[3] >> 6) & 0x3F + out[16] + out[18] = (in[3] >> 12) & 0x3F + out[17] + out[19] = (in[3] >> 18) & 0x3F + out[18] + out[20] = (in[3] >> 24) & 0x3F + out[19] + out[21] = ((in[3] >> 30) | ((in[4] & 0xF) << 2)) + out[20] + out[22] = (in[4] >> 4) & 0x3F + out[21] + out[23] = (in[4] >> 10) & 0x3F + out[22] + out[24] = (in[4] >> 16) & 0x3F + out[23] + out[25] = (in[4] >> 22) & 0x3F + out[24] + out[26] = ((in[4] >> 28) | ((in[5] & 0x3) << 4)) + out[25] + out[27] = (in[5] >> 2) & 0x3F + out[26] + out[28] = (in[5] >> 8) & 0x3F + out[27] + out[29] = (in[5] >> 14) & 0x3F + out[28] + out[30] = (in[5] >> 20) & 0x3F + out[29] + out[31] = (in[5] >> 26) + out[30] +} + +func deltaunpack_uint32_7(initoffset uint32, in *[7]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7F + initoffset + out[1] = (in[0] >> 7) & 0x7F + out[0] + out[2] = (in[0] >> 14) & 0x7F + out[1] + out[3] = (in[0] >> 21) & 0x7F + out[2] + out[4] = ((in[0] >> 28) | ((in[1] & 0x7) << 4)) + out[3] + out[5] = (in[1] >> 3) & 0x7F + out[4] + out[6] = (in[1] >> 10) & 0x7F + out[5] + out[7] = (in[1] >> 17) & 0x7F + out[6] + out[8] = (in[1] >> 24) & 0x7F + out[7] + out[9] = ((in[1] >> 31) | ((in[2] & 0x3F) << 1)) + out[8] + out[10] = (in[2] >> 6) & 0x7F + out[9] + out[11] = (in[2] >> 13) & 0x7F + out[10] + out[12] = (in[2] >> 20) & 0x7F + out[11] + out[13] = ((in[2] >> 27) | ((in[3] & 0x3) << 5)) + out[12] + out[14] = (in[3] >> 2) & 0x7F + out[13] + out[15] = (in[3] >> 9) & 0x7F + out[14] + out[16] = (in[3] >> 16) & 0x7F + out[15] + out[17] = (in[3] >> 23) & 0x7F + out[16] + out[18] = ((in[3] >> 30) | ((in[4] & 0x1F) << 2)) + out[17] + out[19] = (in[4] >> 5) & 0x7F + out[18] + out[20] = (in[4] >> 12) & 0x7F + out[19] + out[21] = (in[4] >> 19) & 0x7F + out[20] + out[22] = ((in[4] >> 26) | ((in[5] & 0x1) << 6)) + out[21] + out[23] = (in[5] >> 1) & 0x7F + out[22] + out[24] = (in[5] >> 8) & 0x7F + out[23] + out[25] = (in[5] >> 15) & 0x7F + out[24] + out[26] = (in[5] >> 22) & 0x7F + out[25] + out[27] = ((in[5] >> 29) | ((in[6] & 0xF) << 3)) + out[26] + out[28] = (in[6] >> 4) & 0x7F + out[27] + out[29] = (in[6] >> 11) & 0x7F + out[28] + out[30] = (in[6] >> 18) & 0x7F + out[29] + out[31] = (in[6] >> 25) + out[30] +} + +func deltaunpack_uint32_8(initoffset uint32, in *[8]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0xFF + initoffset + out[1] = (in[0] >> 8) & 0xFF + out[0] + out[2] = (in[0] >> 16) & 0xFF + out[1] + out[3] = (in[0] >> 24) + out[2] + out[4] = (in[1] >> 0) & 0xFF + out[3] + out[5] = (in[1] >> 8) & 0xFF + out[4] + out[6] = (in[1] >> 16) & 0xFF + out[5] + out[7] = (in[1] >> 24) + out[6] + out[8] = (in[2] >> 0) & 0xFF + out[7] + out[9] = (in[2] >> 8) & 0xFF + out[8] + out[10] = (in[2] >> 16) & 0xFF + out[9] + out[11] = (in[2] >> 24) + out[10] + out[12] = (in[3] >> 0) & 0xFF + out[11] + out[13] = (in[3] >> 8) & 0xFF + out[12] + out[14] = (in[3] >> 16) & 0xFF + out[13] + out[15] = (in[3] >> 24) + out[14] + out[16] = (in[4] >> 0) & 0xFF + out[15] + out[17] = (in[4] >> 8) & 0xFF + out[16] + out[18] = (in[4] >> 16) & 0xFF + out[17] + out[19] = (in[4] >> 24) + out[18] + out[20] = (in[5] >> 0) & 0xFF + out[19] + out[21] = (in[5] >> 8) & 0xFF + out[20] + out[22] = (in[5] >> 16) & 0xFF + out[21] + out[23] = (in[5] >> 24) + out[22] + out[24] = (in[6] >> 0) & 0xFF + out[23] + out[25] = (in[6] >> 8) & 0xFF + out[24] + out[26] = (in[6] >> 16) & 0xFF + out[25] + out[27] = (in[6] >> 24) + out[26] + out[28] = (in[7] >> 0) & 0xFF + out[27] + out[29] = (in[7] >> 8) & 0xFF + out[28] + out[30] = (in[7] >> 16) & 0xFF + out[29] + out[31] = (in[7] >> 24) + out[30] +} + +func deltaunpack_uint32_9(initoffset uint32, in *[9]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1FF + initoffset + out[1] = (in[0] >> 9) & 0x1FF + out[0] + out[2] = (in[0] >> 18) & 0x1FF + out[1] + out[3] = ((in[0] >> 27) | ((in[1] & 0xF) << 5)) + out[2] + out[4] = (in[1] >> 4) & 0x1FF + out[3] + out[5] = (in[1] >> 13) & 0x1FF + out[4] + out[6] = (in[1] >> 22) & 0x1FF + out[5] + out[7] = ((in[1] >> 31) | ((in[2] & 0xFF) << 1)) + out[6] + out[8] = (in[2] >> 8) & 0x1FF + out[7] + out[9] = (in[2] >> 17) & 0x1FF + out[8] + out[10] = ((in[2] >> 26) | ((in[3] & 0x7) << 6)) + out[9] + out[11] = (in[3] >> 3) & 0x1FF + out[10] + out[12] = (in[3] >> 12) & 0x1FF + out[11] + out[13] = (in[3] >> 21) & 0x1FF + out[12] + out[14] = ((in[3] >> 30) | ((in[4] & 0x7F) << 2)) + out[13] + out[15] = (in[4] >> 7) & 0x1FF + out[14] + out[16] = (in[4] >> 16) & 0x1FF + out[15] + out[17] = ((in[4] >> 25) | ((in[5] & 0x3) << 7)) + out[16] + out[18] = (in[5] >> 2) & 0x1FF + out[17] + out[19] = (in[5] >> 11) & 0x1FF + out[18] + out[20] = (in[5] >> 20) & 0x1FF + out[19] + out[21] = ((in[5] >> 29) | ((in[6] & 0x3F) << 3)) + out[20] + out[22] = (in[6] >> 6) & 0x1FF + out[21] + out[23] = (in[6] >> 15) & 0x1FF + out[22] + out[24] = ((in[6] >> 24) | ((in[7] & 0x1) << 8)) + out[23] + out[25] = (in[7] >> 1) & 0x1FF + out[24] + out[26] = (in[7] >> 10) & 0x1FF + out[25] + out[27] = (in[7] >> 19) & 0x1FF + out[26] + out[28] = ((in[7] >> 28) | ((in[8] & 0x1F) << 4)) + out[27] + out[29] = (in[8] >> 5) & 0x1FF + out[28] + out[30] = (in[8] >> 14) & 0x1FF + out[29] + out[31] = (in[8] >> 23) + out[30] +} + +func deltaunpack_uint32_10(initoffset uint32, in *[10]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3FF + initoffset + out[1] = (in[0] >> 10) & 0x3FF + out[0] + out[2] = (in[0] >> 20) & 0x3FF + out[1] + out[3] = ((in[0] >> 30) | ((in[1] & 0xFF) << 2)) + out[2] + out[4] = (in[1] >> 8) & 0x3FF + out[3] + out[5] = (in[1] >> 18) & 0x3FF + out[4] + out[6] = ((in[1] >> 28) | ((in[2] & 0x3F) << 4)) + out[5] + out[7] = (in[2] >> 6) & 0x3FF + out[6] + out[8] = (in[2] >> 16) & 0x3FF + out[7] + out[9] = ((in[2] >> 26) | ((in[3] & 0xF) << 6)) + out[8] + out[10] = (in[3] >> 4) & 0x3FF + out[9] + out[11] = (in[3] >> 14) & 0x3FF + out[10] + out[12] = ((in[3] >> 24) | ((in[4] & 0x3) << 8)) + out[11] + out[13] = (in[4] >> 2) & 0x3FF + out[12] + out[14] = (in[4] >> 12) & 0x3FF + out[13] + out[15] = (in[4] >> 22) + out[14] + out[16] = (in[5] >> 0) & 0x3FF + out[15] + out[17] = (in[5] >> 10) & 0x3FF + out[16] + out[18] = (in[5] >> 20) & 0x3FF + out[17] + out[19] = ((in[5] >> 30) | ((in[6] & 0xFF) << 2)) + out[18] + out[20] = (in[6] >> 8) & 0x3FF + out[19] + out[21] = (in[6] >> 18) & 0x3FF + out[20] + out[22] = ((in[6] >> 28) | ((in[7] & 0x3F) << 4)) + out[21] + out[23] = (in[7] >> 6) & 0x3FF + out[22] + out[24] = (in[7] >> 16) & 0x3FF + out[23] + out[25] = ((in[7] >> 26) | ((in[8] & 0xF) << 6)) + out[24] + out[26] = (in[8] >> 4) & 0x3FF + out[25] + out[27] = (in[8] >> 14) & 0x3FF + out[26] + out[28] = ((in[8] >> 24) | ((in[9] & 0x3) << 8)) + out[27] + out[29] = (in[9] >> 2) & 0x3FF + out[28] + out[30] = (in[9] >> 12) & 0x3FF + out[29] + out[31] = (in[9] >> 22) + out[30] +} + +func deltaunpack_uint32_11(initoffset uint32, in *[11]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7FF + initoffset + out[1] = (in[0] >> 11) & 0x7FF + out[0] + out[2] = ((in[0] >> 22) | ((in[1] & 0x1) << 10)) + out[1] + out[3] = (in[1] >> 1) & 0x7FF + out[2] + out[4] = (in[1] >> 12) & 0x7FF + out[3] + out[5] = ((in[1] >> 23) | ((in[2] & 0x3) << 9)) + out[4] + out[6] = (in[2] >> 2) & 0x7FF + out[5] + out[7] = (in[2] >> 13) & 0x7FF + out[6] + out[8] = ((in[2] >> 24) | ((in[3] & 0x7) << 8)) + out[7] + out[9] = (in[3] >> 3) & 0x7FF + out[8] + out[10] = (in[3] >> 14) & 0x7FF + out[9] + out[11] = ((in[3] >> 25) | ((in[4] & 0xF) << 7)) + out[10] + out[12] = (in[4] >> 4) & 0x7FF + out[11] + out[13] = (in[4] >> 15) & 0x7FF + out[12] + out[14] = ((in[4] >> 26) | ((in[5] & 0x1F) << 6)) + out[13] + out[15] = (in[5] >> 5) & 0x7FF + out[14] + out[16] = (in[5] >> 16) & 0x7FF + out[15] + out[17] = ((in[5] >> 27) | ((in[6] & 0x3F) << 5)) + out[16] + out[18] = (in[6] >> 6) & 0x7FF + out[17] + out[19] = (in[6] >> 17) & 0x7FF + out[18] + out[20] = ((in[6] >> 28) | ((in[7] & 0x7F) << 4)) + out[19] + out[21] = (in[7] >> 7) & 0x7FF + out[20] + out[22] = (in[7] >> 18) & 0x7FF + out[21] + out[23] = ((in[7] >> 29) | ((in[8] & 0xFF) << 3)) + out[22] + out[24] = (in[8] >> 8) & 0x7FF + out[23] + out[25] = (in[8] >> 19) & 0x7FF + out[24] + out[26] = ((in[8] >> 30) | ((in[9] & 0x1FF) << 2)) + out[25] + out[27] = (in[9] >> 9) & 0x7FF + out[26] + out[28] = (in[9] >> 20) & 0x7FF + out[27] + out[29] = ((in[9] >> 31) | ((in[10] & 0x3FF) << 1)) + out[28] + out[30] = (in[10] >> 10) & 0x7FF + out[29] + out[31] = (in[10] >> 21) + out[30] +} + +func deltaunpack_uint32_12(initoffset uint32, in *[12]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0xFFF + initoffset + out[1] = (in[0] >> 12) & 0xFFF + out[0] + out[2] = ((in[0] >> 24) | ((in[1] & 0xF) << 8)) + out[1] + out[3] = (in[1] >> 4) & 0xFFF + out[2] + out[4] = (in[1] >> 16) & 0xFFF + out[3] + out[5] = ((in[1] >> 28) | ((in[2] & 0xFF) << 4)) + out[4] + out[6] = (in[2] >> 8) & 0xFFF + out[5] + out[7] = (in[2] >> 20) + out[6] + out[8] = (in[3] >> 0) & 0xFFF + out[7] + out[9] = (in[3] >> 12) & 0xFFF + out[8] + out[10] = ((in[3] >> 24) | ((in[4] & 0xF) << 8)) + out[9] + out[11] = (in[4] >> 4) & 0xFFF + out[10] + out[12] = (in[4] >> 16) & 0xFFF + out[11] + out[13] = ((in[4] >> 28) | ((in[5] & 0xFF) << 4)) + out[12] + out[14] = (in[5] >> 8) & 0xFFF + out[13] + out[15] = (in[5] >> 20) + out[14] + out[16] = (in[6] >> 0) & 0xFFF + out[15] + out[17] = (in[6] >> 12) & 0xFFF + out[16] + out[18] = ((in[6] >> 24) | ((in[7] & 0xF) << 8)) + out[17] + out[19] = (in[7] >> 4) & 0xFFF + out[18] + out[20] = (in[7] >> 16) & 0xFFF + out[19] + out[21] = ((in[7] >> 28) | ((in[8] & 0xFF) << 4)) + out[20] + out[22] = (in[8] >> 8) & 0xFFF + out[21] + out[23] = (in[8] >> 20) + out[22] + out[24] = (in[9] >> 0) & 0xFFF + out[23] + out[25] = (in[9] >> 12) & 0xFFF + out[24] + out[26] = ((in[9] >> 24) | ((in[10] & 0xF) << 8)) + out[25] + out[27] = (in[10] >> 4) & 0xFFF + out[26] + out[28] = (in[10] >> 16) & 0xFFF + out[27] + out[29] = ((in[10] >> 28) | ((in[11] & 0xFF) << 4)) + out[28] + out[30] = (in[11] >> 8) & 0xFFF + out[29] + out[31] = (in[11] >> 20) + out[30] +} + +func deltaunpack_uint32_13(initoffset uint32, in *[13]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1FFF + initoffset + out[1] = (in[0] >> 13) & 0x1FFF + out[0] + out[2] = ((in[0] >> 26) | ((in[1] & 0x7F) << 6)) + out[1] + out[3] = (in[1] >> 7) & 0x1FFF + out[2] + out[4] = ((in[1] >> 20) | ((in[2] & 0x1) << 12)) + out[3] + out[5] = (in[2] >> 1) & 0x1FFF + out[4] + out[6] = (in[2] >> 14) & 0x1FFF + out[5] + out[7] = ((in[2] >> 27) | ((in[3] & 0xFF) << 5)) + out[6] + out[8] = (in[3] >> 8) & 0x1FFF + out[7] + out[9] = ((in[3] >> 21) | ((in[4] & 0x3) << 11)) + out[8] + out[10] = (in[4] >> 2) & 0x1FFF + out[9] + out[11] = (in[4] >> 15) & 0x1FFF + out[10] + out[12] = ((in[4] >> 28) | ((in[5] & 0x1FF) << 4)) + out[11] + out[13] = (in[5] >> 9) & 0x1FFF + out[12] + out[14] = ((in[5] >> 22) | ((in[6] & 0x7) << 10)) + out[13] + out[15] = (in[6] >> 3) & 0x1FFF + out[14] + out[16] = (in[6] >> 16) & 0x1FFF + out[15] + out[17] = ((in[6] >> 29) | ((in[7] & 0x3FF) << 3)) + out[16] + out[18] = (in[7] >> 10) & 0x1FFF + out[17] + out[19] = ((in[7] >> 23) | ((in[8] & 0xF) << 9)) + out[18] + out[20] = (in[8] >> 4) & 0x1FFF + out[19] + out[21] = (in[8] >> 17) & 0x1FFF + out[20] + out[22] = ((in[8] >> 30) | ((in[9] & 0x7FF) << 2)) + out[21] + out[23] = (in[9] >> 11) & 0x1FFF + out[22] + out[24] = ((in[9] >> 24) | ((in[10] & 0x1F) << 8)) + out[23] + out[25] = (in[10] >> 5) & 0x1FFF + out[24] + out[26] = (in[10] >> 18) & 0x1FFF + out[25] + out[27] = ((in[10] >> 31) | ((in[11] & 0xFFF) << 1)) + out[26] + out[28] = (in[11] >> 12) & 0x1FFF + out[27] + out[29] = ((in[11] >> 25) | ((in[12] & 0x3F) << 7)) + out[28] + out[30] = (in[12] >> 6) & 0x1FFF + out[29] + out[31] = (in[12] >> 19) + out[30] +} + +func deltaunpack_uint32_14(initoffset uint32, in *[14]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3FFF + initoffset + out[1] = (in[0] >> 14) & 0x3FFF + out[0] + out[2] = ((in[0] >> 28) | ((in[1] & 0x3FF) << 4)) + out[1] + out[3] = (in[1] >> 10) & 0x3FFF + out[2] + out[4] = ((in[1] >> 24) | ((in[2] & 0x3F) << 8)) + out[3] + out[5] = (in[2] >> 6) & 0x3FFF + out[4] + out[6] = ((in[2] >> 20) | ((in[3] & 0x3) << 12)) + out[5] + out[7] = (in[3] >> 2) & 0x3FFF + out[6] + out[8] = (in[3] >> 16) & 0x3FFF + out[7] + out[9] = ((in[3] >> 30) | ((in[4] & 0xFFF) << 2)) + out[8] + out[10] = (in[4] >> 12) & 0x3FFF + out[9] + out[11] = ((in[4] >> 26) | ((in[5] & 0xFF) << 6)) + out[10] + out[12] = (in[5] >> 8) & 0x3FFF + out[11] + out[13] = ((in[5] >> 22) | ((in[6] & 0xF) << 10)) + out[12] + out[14] = (in[6] >> 4) & 0x3FFF + out[13] + out[15] = (in[6] >> 18) + out[14] + out[16] = (in[7] >> 0) & 0x3FFF + out[15] + out[17] = (in[7] >> 14) & 0x3FFF + out[16] + out[18] = ((in[7] >> 28) | ((in[8] & 0x3FF) << 4)) + out[17] + out[19] = (in[8] >> 10) & 0x3FFF + out[18] + out[20] = ((in[8] >> 24) | ((in[9] & 0x3F) << 8)) + out[19] + out[21] = (in[9] >> 6) & 0x3FFF + out[20] + out[22] = ((in[9] >> 20) | ((in[10] & 0x3) << 12)) + out[21] + out[23] = (in[10] >> 2) & 0x3FFF + out[22] + out[24] = (in[10] >> 16) & 0x3FFF + out[23] + out[25] = ((in[10] >> 30) | ((in[11] & 0xFFF) << 2)) + out[24] + out[26] = (in[11] >> 12) & 0x3FFF + out[25] + out[27] = ((in[11] >> 26) | ((in[12] & 0xFF) << 6)) + out[26] + out[28] = (in[12] >> 8) & 0x3FFF + out[27] + out[29] = ((in[12] >> 22) | ((in[13] & 0xF) << 10)) + out[28] + out[30] = (in[13] >> 4) & 0x3FFF + out[29] + out[31] = (in[13] >> 18) + out[30] +} + +func deltaunpack_uint32_15(initoffset uint32, in *[15]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7FFF + initoffset + out[1] = (in[0] >> 15) & 0x7FFF + out[0] + out[2] = ((in[0] >> 30) | ((in[1] & 0x1FFF) << 2)) + out[1] + out[3] = (in[1] >> 13) & 0x7FFF + out[2] + out[4] = ((in[1] >> 28) | ((in[2] & 0x7FF) << 4)) + out[3] + out[5] = (in[2] >> 11) & 0x7FFF + out[4] + out[6] = ((in[2] >> 26) | ((in[3] & 0x1FF) << 6)) + out[5] + out[7] = (in[3] >> 9) & 0x7FFF + out[6] + out[8] = ((in[3] >> 24) | ((in[4] & 0x7F) << 8)) + out[7] + out[9] = (in[4] >> 7) & 0x7FFF + out[8] + out[10] = ((in[4] >> 22) | ((in[5] & 0x1F) << 10)) + out[9] + out[11] = (in[5] >> 5) & 0x7FFF + out[10] + out[12] = ((in[5] >> 20) | ((in[6] & 0x7) << 12)) + out[11] + out[13] = (in[6] >> 3) & 0x7FFF + out[12] + out[14] = ((in[6] >> 18) | ((in[7] & 0x1) << 14)) + out[13] + out[15] = (in[7] >> 1) & 0x7FFF + out[14] + out[16] = (in[7] >> 16) & 0x7FFF + out[15] + out[17] = ((in[7] >> 31) | ((in[8] & 0x3FFF) << 1)) + out[16] + out[18] = (in[8] >> 14) & 0x7FFF + out[17] + out[19] = ((in[8] >> 29) | ((in[9] & 0xFFF) << 3)) + out[18] + out[20] = (in[9] >> 12) & 0x7FFF + out[19] + out[21] = ((in[9] >> 27) | ((in[10] & 0x3FF) << 5)) + out[20] + out[22] = (in[10] >> 10) & 0x7FFF + out[21] + out[23] = ((in[10] >> 25) | ((in[11] & 0xFF) << 7)) + out[22] + out[24] = (in[11] >> 8) & 0x7FFF + out[23] + out[25] = ((in[11] >> 23) | ((in[12] & 0x3F) << 9)) + out[24] + out[26] = (in[12] >> 6) & 0x7FFF + out[25] + out[27] = ((in[12] >> 21) | ((in[13] & 0xF) << 11)) + out[26] + out[28] = (in[13] >> 4) & 0x7FFF + out[27] + out[29] = ((in[13] >> 19) | ((in[14] & 0x3) << 13)) + out[28] + out[30] = (in[14] >> 2) & 0x7FFF + out[29] + out[31] = (in[14] >> 17) + out[30] +} + +func deltaunpack_uint32_16(initoffset uint32, in *[16]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0xFFFF + initoffset + out[1] = (in[0] >> 16) + out[0] + out[2] = (in[1] >> 0) & 0xFFFF + out[1] + out[3] = (in[1] >> 16) + out[2] + out[4] = (in[2] >> 0) & 0xFFFF + out[3] + out[5] = (in[2] >> 16) + out[4] + out[6] = (in[3] >> 0) & 0xFFFF + out[5] + out[7] = (in[3] >> 16) + out[6] + out[8] = (in[4] >> 0) & 0xFFFF + out[7] + out[9] = (in[4] >> 16) + out[8] + out[10] = (in[5] >> 0) & 0xFFFF + out[9] + out[11] = (in[5] >> 16) + out[10] + out[12] = (in[6] >> 0) & 0xFFFF + out[11] + out[13] = (in[6] >> 16) + out[12] + out[14] = (in[7] >> 0) & 0xFFFF + out[13] + out[15] = (in[7] >> 16) + out[14] + out[16] = (in[8] >> 0) & 0xFFFF + out[15] + out[17] = (in[8] >> 16) + out[16] + out[18] = (in[9] >> 0) & 0xFFFF + out[17] + out[19] = (in[9] >> 16) + out[18] + out[20] = (in[10] >> 0) & 0xFFFF + out[19] + out[21] = (in[10] >> 16) + out[20] + out[22] = (in[11] >> 0) & 0xFFFF + out[21] + out[23] = (in[11] >> 16) + out[22] + out[24] = (in[12] >> 0) & 0xFFFF + out[23] + out[25] = (in[12] >> 16) + out[24] + out[26] = (in[13] >> 0) & 0xFFFF + out[25] + out[27] = (in[13] >> 16) + out[26] + out[28] = (in[14] >> 0) & 0xFFFF + out[27] + out[29] = (in[14] >> 16) + out[28] + out[30] = (in[15] >> 0) & 0xFFFF + out[29] + out[31] = (in[15] >> 16) + out[30] +} + +func deltaunpack_uint32_17(initoffset uint32, in *[17]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1FFFF + initoffset + out[1] = ((in[0] >> 17) | ((in[1] & 0x3) << 15)) + out[0] + out[2] = (in[1] >> 2) & 0x1FFFF + out[1] + out[3] = ((in[1] >> 19) | ((in[2] & 0xF) << 13)) + out[2] + out[4] = (in[2] >> 4) & 0x1FFFF + out[3] + out[5] = ((in[2] >> 21) | ((in[3] & 0x3F) << 11)) + out[4] + out[6] = (in[3] >> 6) & 0x1FFFF + out[5] + out[7] = ((in[3] >> 23) | ((in[4] & 0xFF) << 9)) + out[6] + out[8] = (in[4] >> 8) & 0x1FFFF + out[7] + out[9] = ((in[4] >> 25) | ((in[5] & 0x3FF) << 7)) + out[8] + out[10] = (in[5] >> 10) & 0x1FFFF + out[9] + out[11] = ((in[5] >> 27) | ((in[6] & 0xFFF) << 5)) + out[10] + out[12] = (in[6] >> 12) & 0x1FFFF + out[11] + out[13] = ((in[6] >> 29) | ((in[7] & 0x3FFF) << 3)) + out[12] + out[14] = (in[7] >> 14) & 0x1FFFF + out[13] + out[15] = ((in[7] >> 31) | ((in[8] & 0xFFFF) << 1)) + out[14] + out[16] = ((in[8] >> 16) | ((in[9] & 0x1) << 16)) + out[15] + out[17] = (in[9] >> 1) & 0x1FFFF + out[16] + out[18] = ((in[9] >> 18) | ((in[10] & 0x7) << 14)) + out[17] + out[19] = (in[10] >> 3) & 0x1FFFF + out[18] + out[20] = ((in[10] >> 20) | ((in[11] & 0x1F) << 12)) + out[19] + out[21] = (in[11] >> 5) & 0x1FFFF + out[20] + out[22] = ((in[11] >> 22) | ((in[12] & 0x7F) << 10)) + out[21] + out[23] = (in[12] >> 7) & 0x1FFFF + out[22] + out[24] = ((in[12] >> 24) | ((in[13] & 0x1FF) << 8)) + out[23] + out[25] = (in[13] >> 9) & 0x1FFFF + out[24] + out[26] = ((in[13] >> 26) | ((in[14] & 0x7FF) << 6)) + out[25] + out[27] = (in[14] >> 11) & 0x1FFFF + out[26] + out[28] = ((in[14] >> 28) | ((in[15] & 0x1FFF) << 4)) + out[27] + out[29] = (in[15] >> 13) & 0x1FFFF + out[28] + out[30] = ((in[15] >> 30) | ((in[16] & 0x7FFF) << 2)) + out[29] + out[31] = (in[16] >> 15) + out[30] +} + +func deltaunpack_uint32_18(initoffset uint32, in *[18]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3FFFF + initoffset + out[1] = ((in[0] >> 18) | ((in[1] & 0xF) << 14)) + out[0] + out[2] = (in[1] >> 4) & 0x3FFFF + out[1] + out[3] = ((in[1] >> 22) | ((in[2] & 0xFF) << 10)) + out[2] + out[4] = (in[2] >> 8) & 0x3FFFF + out[3] + out[5] = ((in[2] >> 26) | ((in[3] & 0xFFF) << 6)) + out[4] + out[6] = (in[3] >> 12) & 0x3FFFF + out[5] + out[7] = ((in[3] >> 30) | ((in[4] & 0xFFFF) << 2)) + out[6] + out[8] = ((in[4] >> 16) | ((in[5] & 0x3) << 16)) + out[7] + out[9] = (in[5] >> 2) & 0x3FFFF + out[8] + out[10] = ((in[5] >> 20) | ((in[6] & 0x3F) << 12)) + out[9] + out[11] = (in[6] >> 6) & 0x3FFFF + out[10] + out[12] = ((in[6] >> 24) | ((in[7] & 0x3FF) << 8)) + out[11] + out[13] = (in[7] >> 10) & 0x3FFFF + out[12] + out[14] = ((in[7] >> 28) | ((in[8] & 0x3FFF) << 4)) + out[13] + out[15] = (in[8] >> 14) + out[14] + out[16] = (in[9] >> 0) & 0x3FFFF + out[15] + out[17] = ((in[9] >> 18) | ((in[10] & 0xF) << 14)) + out[16] + out[18] = (in[10] >> 4) & 0x3FFFF + out[17] + out[19] = ((in[10] >> 22) | ((in[11] & 0xFF) << 10)) + out[18] + out[20] = (in[11] >> 8) & 0x3FFFF + out[19] + out[21] = ((in[11] >> 26) | ((in[12] & 0xFFF) << 6)) + out[20] + out[22] = (in[12] >> 12) & 0x3FFFF + out[21] + out[23] = ((in[12] >> 30) | ((in[13] & 0xFFFF) << 2)) + out[22] + out[24] = ((in[13] >> 16) | ((in[14] & 0x3) << 16)) + out[23] + out[25] = (in[14] >> 2) & 0x3FFFF + out[24] + out[26] = ((in[14] >> 20) | ((in[15] & 0x3F) << 12)) + out[25] + out[27] = (in[15] >> 6) & 0x3FFFF + out[26] + out[28] = ((in[15] >> 24) | ((in[16] & 0x3FF) << 8)) + out[27] + out[29] = (in[16] >> 10) & 0x3FFFF + out[28] + out[30] = ((in[16] >> 28) | ((in[17] & 0x3FFF) << 4)) + out[29] + out[31] = (in[17] >> 14) + out[30] +} + +func deltaunpack_uint32_19(initoffset uint32, in *[19]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7FFFF + initoffset + out[1] = ((in[0] >> 19) | ((in[1] & 0x3F) << 13)) + out[0] + out[2] = (in[1] >> 6) & 0x7FFFF + out[1] + out[3] = ((in[1] >> 25) | ((in[2] & 0xFFF) << 7)) + out[2] + out[4] = (in[2] >> 12) & 0x7FFFF + out[3] + out[5] = ((in[2] >> 31) | ((in[3] & 0x3FFFF) << 1)) + out[4] + out[6] = ((in[3] >> 18) | ((in[4] & 0x1F) << 14)) + out[5] + out[7] = (in[4] >> 5) & 0x7FFFF + out[6] + out[8] = ((in[4] >> 24) | ((in[5] & 0x7FF) << 8)) + out[7] + out[9] = (in[5] >> 11) & 0x7FFFF + out[8] + out[10] = ((in[5] >> 30) | ((in[6] & 0x1FFFF) << 2)) + out[9] + out[11] = ((in[6] >> 17) | ((in[7] & 0xF) << 15)) + out[10] + out[12] = (in[7] >> 4) & 0x7FFFF + out[11] + out[13] = ((in[7] >> 23) | ((in[8] & 0x3FF) << 9)) + out[12] + out[14] = (in[8] >> 10) & 0x7FFFF + out[13] + out[15] = ((in[8] >> 29) | ((in[9] & 0xFFFF) << 3)) + out[14] + out[16] = ((in[9] >> 16) | ((in[10] & 0x7) << 16)) + out[15] + out[17] = (in[10] >> 3) & 0x7FFFF + out[16] + out[18] = ((in[10] >> 22) | ((in[11] & 0x1FF) << 10)) + out[17] + out[19] = (in[11] >> 9) & 0x7FFFF + out[18] + out[20] = ((in[11] >> 28) | ((in[12] & 0x7FFF) << 4)) + out[19] + out[21] = ((in[12] >> 15) | ((in[13] & 0x3) << 17)) + out[20] + out[22] = (in[13] >> 2) & 0x7FFFF + out[21] + out[23] = ((in[13] >> 21) | ((in[14] & 0xFF) << 11)) + out[22] + out[24] = (in[14] >> 8) & 0x7FFFF + out[23] + out[25] = ((in[14] >> 27) | ((in[15] & 0x3FFF) << 5)) + out[24] + out[26] = ((in[15] >> 14) | ((in[16] & 0x1) << 18)) + out[25] + out[27] = (in[16] >> 1) & 0x7FFFF + out[26] + out[28] = ((in[16] >> 20) | ((in[17] & 0x7F) << 12)) + out[27] + out[29] = (in[17] >> 7) & 0x7FFFF + out[28] + out[30] = ((in[17] >> 26) | ((in[18] & 0x1FFF) << 6)) + out[29] + out[31] = (in[18] >> 13) + out[30] +} + +func deltaunpack_uint32_20(initoffset uint32, in *[20]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0xFFFFF + initoffset + out[1] = ((in[0] >> 20) | ((in[1] & 0xFF) << 12)) + out[0] + out[2] = (in[1] >> 8) & 0xFFFFF + out[1] + out[3] = ((in[1] >> 28) | ((in[2] & 0xFFFF) << 4)) + out[2] + out[4] = ((in[2] >> 16) | ((in[3] & 0xF) << 16)) + out[3] + out[5] = (in[3] >> 4) & 0xFFFFF + out[4] + out[6] = ((in[3] >> 24) | ((in[4] & 0xFFF) << 8)) + out[5] + out[7] = (in[4] >> 12) + out[6] + out[8] = (in[5] >> 0) & 0xFFFFF + out[7] + out[9] = ((in[5] >> 20) | ((in[6] & 0xFF) << 12)) + out[8] + out[10] = (in[6] >> 8) & 0xFFFFF + out[9] + out[11] = ((in[6] >> 28) | ((in[7] & 0xFFFF) << 4)) + out[10] + out[12] = ((in[7] >> 16) | ((in[8] & 0xF) << 16)) + out[11] + out[13] = (in[8] >> 4) & 0xFFFFF + out[12] + out[14] = ((in[8] >> 24) | ((in[9] & 0xFFF) << 8)) + out[13] + out[15] = (in[9] >> 12) + out[14] + out[16] = (in[10] >> 0) & 0xFFFFF + out[15] + out[17] = ((in[10] >> 20) | ((in[11] & 0xFF) << 12)) + out[16] + out[18] = (in[11] >> 8) & 0xFFFFF + out[17] + out[19] = ((in[11] >> 28) | ((in[12] & 0xFFFF) << 4)) + out[18] + out[20] = ((in[12] >> 16) | ((in[13] & 0xF) << 16)) + out[19] + out[21] = (in[13] >> 4) & 0xFFFFF + out[20] + out[22] = ((in[13] >> 24) | ((in[14] & 0xFFF) << 8)) + out[21] + out[23] = (in[14] >> 12) + out[22] + out[24] = (in[15] >> 0) & 0xFFFFF + out[23] + out[25] = ((in[15] >> 20) | ((in[16] & 0xFF) << 12)) + out[24] + out[26] = (in[16] >> 8) & 0xFFFFF + out[25] + out[27] = ((in[16] >> 28) | ((in[17] & 0xFFFF) << 4)) + out[26] + out[28] = ((in[17] >> 16) | ((in[18] & 0xF) << 16)) + out[27] + out[29] = (in[18] >> 4) & 0xFFFFF + out[28] + out[30] = ((in[18] >> 24) | ((in[19] & 0xFFF) << 8)) + out[29] + out[31] = (in[19] >> 12) + out[30] +} + +func deltaunpack_uint32_21(initoffset uint32, in *[21]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1FFFFF + initoffset + out[1] = ((in[0] >> 21) | ((in[1] & 0x3FF) << 11)) + out[0] + out[2] = (in[1] >> 10) & 0x1FFFFF + out[1] + out[3] = ((in[1] >> 31) | ((in[2] & 0xFFFFF) << 1)) + out[2] + out[4] = ((in[2] >> 20) | ((in[3] & 0x1FF) << 12)) + out[3] + out[5] = (in[3] >> 9) & 0x1FFFFF + out[4] + out[6] = ((in[3] >> 30) | ((in[4] & 0x7FFFF) << 2)) + out[5] + out[7] = ((in[4] >> 19) | ((in[5] & 0xFF) << 13)) + out[6] + out[8] = (in[5] >> 8) & 0x1FFFFF + out[7] + out[9] = ((in[5] >> 29) | ((in[6] & 0x3FFFF) << 3)) + out[8] + out[10] = ((in[6] >> 18) | ((in[7] & 0x7F) << 14)) + out[9] + out[11] = (in[7] >> 7) & 0x1FFFFF + out[10] + out[12] = ((in[7] >> 28) | ((in[8] & 0x1FFFF) << 4)) + out[11] + out[13] = ((in[8] >> 17) | ((in[9] & 0x3F) << 15)) + out[12] + out[14] = (in[9] >> 6) & 0x1FFFFF + out[13] + out[15] = ((in[9] >> 27) | ((in[10] & 0xFFFF) << 5)) + out[14] + out[16] = ((in[10] >> 16) | ((in[11] & 0x1F) << 16)) + out[15] + out[17] = (in[11] >> 5) & 0x1FFFFF + out[16] + out[18] = ((in[11] >> 26) | ((in[12] & 0x7FFF) << 6)) + out[17] + out[19] = ((in[12] >> 15) | ((in[13] & 0xF) << 17)) + out[18] + out[20] = (in[13] >> 4) & 0x1FFFFF + out[19] + out[21] = ((in[13] >> 25) | ((in[14] & 0x3FFF) << 7)) + out[20] + out[22] = ((in[14] >> 14) | ((in[15] & 0x7) << 18)) + out[21] + out[23] = (in[15] >> 3) & 0x1FFFFF + out[22] + out[24] = ((in[15] >> 24) | ((in[16] & 0x1FFF) << 8)) + out[23] + out[25] = ((in[16] >> 13) | ((in[17] & 0x3) << 19)) + out[24] + out[26] = (in[17] >> 2) & 0x1FFFFF + out[25] + out[27] = ((in[17] >> 23) | ((in[18] & 0xFFF) << 9)) + out[26] + out[28] = ((in[18] >> 12) | ((in[19] & 0x1) << 20)) + out[27] + out[29] = (in[19] >> 1) & 0x1FFFFF + out[28] + out[30] = ((in[19] >> 22) | ((in[20] & 0x7FF) << 10)) + out[29] + out[31] = (in[20] >> 11) + out[30] +} + +func deltaunpack_uint32_22(initoffset uint32, in *[22]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3FFFFF + initoffset + out[1] = ((in[0] >> 22) | ((in[1] & 0xFFF) << 10)) + out[0] + out[2] = ((in[1] >> 12) | ((in[2] & 0x3) << 20)) + out[1] + out[3] = (in[2] >> 2) & 0x3FFFFF + out[2] + out[4] = ((in[2] >> 24) | ((in[3] & 0x3FFF) << 8)) + out[3] + out[5] = ((in[3] >> 14) | ((in[4] & 0xF) << 18)) + out[4] + out[6] = (in[4] >> 4) & 0x3FFFFF + out[5] + out[7] = ((in[4] >> 26) | ((in[5] & 0xFFFF) << 6)) + out[6] + out[8] = ((in[5] >> 16) | ((in[6] & 0x3F) << 16)) + out[7] + out[9] = (in[6] >> 6) & 0x3FFFFF + out[8] + out[10] = ((in[6] >> 28) | ((in[7] & 0x3FFFF) << 4)) + out[9] + out[11] = ((in[7] >> 18) | ((in[8] & 0xFF) << 14)) + out[10] + out[12] = (in[8] >> 8) & 0x3FFFFF + out[11] + out[13] = ((in[8] >> 30) | ((in[9] & 0xFFFFF) << 2)) + out[12] + out[14] = ((in[9] >> 20) | ((in[10] & 0x3FF) << 12)) + out[13] + out[15] = (in[10] >> 10) + out[14] + out[16] = (in[11] >> 0) & 0x3FFFFF + out[15] + out[17] = ((in[11] >> 22) | ((in[12] & 0xFFF) << 10)) + out[16] + out[18] = ((in[12] >> 12) | ((in[13] & 0x3) << 20)) + out[17] + out[19] = (in[13] >> 2) & 0x3FFFFF + out[18] + out[20] = ((in[13] >> 24) | ((in[14] & 0x3FFF) << 8)) + out[19] + out[21] = ((in[14] >> 14) | ((in[15] & 0xF) << 18)) + out[20] + out[22] = (in[15] >> 4) & 0x3FFFFF + out[21] + out[23] = ((in[15] >> 26) | ((in[16] & 0xFFFF) << 6)) + out[22] + out[24] = ((in[16] >> 16) | ((in[17] & 0x3F) << 16)) + out[23] + out[25] = (in[17] >> 6) & 0x3FFFFF + out[24] + out[26] = ((in[17] >> 28) | ((in[18] & 0x3FFFF) << 4)) + out[25] + out[27] = ((in[18] >> 18) | ((in[19] & 0xFF) << 14)) + out[26] + out[28] = (in[19] >> 8) & 0x3FFFFF + out[27] + out[29] = ((in[19] >> 30) | ((in[20] & 0xFFFFF) << 2)) + out[28] + out[30] = ((in[20] >> 20) | ((in[21] & 0x3FF) << 12)) + out[29] + out[31] = (in[21] >> 10) + out[30] +} + +func deltaunpack_uint32_23(initoffset uint32, in *[23]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7FFFFF + initoffset + out[1] = ((in[0] >> 23) | ((in[1] & 0x3FFF) << 9)) + out[0] + out[2] = ((in[1] >> 14) | ((in[2] & 0x1F) << 18)) + out[1] + out[3] = (in[2] >> 5) & 0x7FFFFF + out[2] + out[4] = ((in[2] >> 28) | ((in[3] & 0x7FFFF) << 4)) + out[3] + out[5] = ((in[3] >> 19) | ((in[4] & 0x3FF) << 13)) + out[4] + out[6] = ((in[4] >> 10) | ((in[5] & 0x1) << 22)) + out[5] + out[7] = (in[5] >> 1) & 0x7FFFFF + out[6] + out[8] = ((in[5] >> 24) | ((in[6] & 0x7FFF) << 8)) + out[7] + out[9] = ((in[6] >> 15) | ((in[7] & 0x3F) << 17)) + out[8] + out[10] = (in[7] >> 6) & 0x7FFFFF + out[9] + out[11] = ((in[7] >> 29) | ((in[8] & 0xFFFFF) << 3)) + out[10] + out[12] = ((in[8] >> 20) | ((in[9] & 0x7FF) << 12)) + out[11] + out[13] = ((in[9] >> 11) | ((in[10] & 0x3) << 21)) + out[12] + out[14] = (in[10] >> 2) & 0x7FFFFF + out[13] + out[15] = ((in[10] >> 25) | ((in[11] & 0xFFFF) << 7)) + out[14] + out[16] = ((in[11] >> 16) | ((in[12] & 0x7F) << 16)) + out[15] + out[17] = (in[12] >> 7) & 0x7FFFFF + out[16] + out[18] = ((in[12] >> 30) | ((in[13] & 0x1FFFFF) << 2)) + out[17] + out[19] = ((in[13] >> 21) | ((in[14] & 0xFFF) << 11)) + out[18] + out[20] = ((in[14] >> 12) | ((in[15] & 0x7) << 20)) + out[19] + out[21] = (in[15] >> 3) & 0x7FFFFF + out[20] + out[22] = ((in[15] >> 26) | ((in[16] & 0x1FFFF) << 6)) + out[21] + out[23] = ((in[16] >> 17) | ((in[17] & 0xFF) << 15)) + out[22] + out[24] = (in[17] >> 8) & 0x7FFFFF + out[23] + out[25] = ((in[17] >> 31) | ((in[18] & 0x3FFFFF) << 1)) + out[24] + out[26] = ((in[18] >> 22) | ((in[19] & 0x1FFF) << 10)) + out[25] + out[27] = ((in[19] >> 13) | ((in[20] & 0xF) << 19)) + out[26] + out[28] = (in[20] >> 4) & 0x7FFFFF + out[27] + out[29] = ((in[20] >> 27) | ((in[21] & 0x3FFFF) << 5)) + out[28] + out[30] = ((in[21] >> 18) | ((in[22] & 0x1FF) << 14)) + out[29] + out[31] = (in[22] >> 9) + out[30] +} + +func deltaunpack_uint32_24(initoffset uint32, in *[24]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0xFFFFFF + initoffset + out[1] = ((in[0] >> 24) | ((in[1] & 0xFFFF) << 8)) + out[0] + out[2] = ((in[1] >> 16) | ((in[2] & 0xFF) << 16)) + out[1] + out[3] = (in[2] >> 8) + out[2] + out[4] = (in[3] >> 0) & 0xFFFFFF + out[3] + out[5] = ((in[3] >> 24) | ((in[4] & 0xFFFF) << 8)) + out[4] + out[6] = ((in[4] >> 16) | ((in[5] & 0xFF) << 16)) + out[5] + out[7] = (in[5] >> 8) + out[6] + out[8] = (in[6] >> 0) & 0xFFFFFF + out[7] + out[9] = ((in[6] >> 24) | ((in[7] & 0xFFFF) << 8)) + out[8] + out[10] = ((in[7] >> 16) | ((in[8] & 0xFF) << 16)) + out[9] + out[11] = (in[8] >> 8) + out[10] + out[12] = (in[9] >> 0) & 0xFFFFFF + out[11] + out[13] = ((in[9] >> 24) | ((in[10] & 0xFFFF) << 8)) + out[12] + out[14] = ((in[10] >> 16) | ((in[11] & 0xFF) << 16)) + out[13] + out[15] = (in[11] >> 8) + out[14] + out[16] = (in[12] >> 0) & 0xFFFFFF + out[15] + out[17] = ((in[12] >> 24) | ((in[13] & 0xFFFF) << 8)) + out[16] + out[18] = ((in[13] >> 16) | ((in[14] & 0xFF) << 16)) + out[17] + out[19] = (in[14] >> 8) + out[18] + out[20] = (in[15] >> 0) & 0xFFFFFF + out[19] + out[21] = ((in[15] >> 24) | ((in[16] & 0xFFFF) << 8)) + out[20] + out[22] = ((in[16] >> 16) | ((in[17] & 0xFF) << 16)) + out[21] + out[23] = (in[17] >> 8) + out[22] + out[24] = (in[18] >> 0) & 0xFFFFFF + out[23] + out[25] = ((in[18] >> 24) | ((in[19] & 0xFFFF) << 8)) + out[24] + out[26] = ((in[19] >> 16) | ((in[20] & 0xFF) << 16)) + out[25] + out[27] = (in[20] >> 8) + out[26] + out[28] = (in[21] >> 0) & 0xFFFFFF + out[27] + out[29] = ((in[21] >> 24) | ((in[22] & 0xFFFF) << 8)) + out[28] + out[30] = ((in[22] >> 16) | ((in[23] & 0xFF) << 16)) + out[29] + out[31] = (in[23] >> 8) + out[30] +} + +func deltaunpack_uint32_25(initoffset uint32, in *[25]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1FFFFFF + initoffset + out[1] = ((in[0] >> 25) | ((in[1] & 0x3FFFF) << 7)) + out[0] + out[2] = ((in[1] >> 18) | ((in[2] & 0x7FF) << 14)) + out[1] + out[3] = ((in[2] >> 11) | ((in[3] & 0xF) << 21)) + out[2] + out[4] = (in[3] >> 4) & 0x1FFFFFF + out[3] + out[5] = ((in[3] >> 29) | ((in[4] & 0x3FFFFF) << 3)) + out[4] + out[6] = ((in[4] >> 22) | ((in[5] & 0x7FFF) << 10)) + out[5] + out[7] = ((in[5] >> 15) | ((in[6] & 0xFF) << 17)) + out[6] + out[8] = ((in[6] >> 8) | ((in[7] & 0x1) << 24)) + out[7] + out[9] = (in[7] >> 1) & 0x1FFFFFF + out[8] + out[10] = ((in[7] >> 26) | ((in[8] & 0x7FFFF) << 6)) + out[9] + out[11] = ((in[8] >> 19) | ((in[9] & 0xFFF) << 13)) + out[10] + out[12] = ((in[9] >> 12) | ((in[10] & 0x1F) << 20)) + out[11] + out[13] = (in[10] >> 5) & 0x1FFFFFF + out[12] + out[14] = ((in[10] >> 30) | ((in[11] & 0x7FFFFF) << 2)) + out[13] + out[15] = ((in[11] >> 23) | ((in[12] & 0xFFFF) << 9)) + out[14] + out[16] = ((in[12] >> 16) | ((in[13] & 0x1FF) << 16)) + out[15] + out[17] = ((in[13] >> 9) | ((in[14] & 0x3) << 23)) + out[16] + out[18] = (in[14] >> 2) & 0x1FFFFFF + out[17] + out[19] = ((in[14] >> 27) | ((in[15] & 0xFFFFF) << 5)) + out[18] + out[20] = ((in[15] >> 20) | ((in[16] & 0x1FFF) << 12)) + out[19] + out[21] = ((in[16] >> 13) | ((in[17] & 0x3F) << 19)) + out[20] + out[22] = (in[17] >> 6) & 0x1FFFFFF + out[21] + out[23] = ((in[17] >> 31) | ((in[18] & 0xFFFFFF) << 1)) + out[22] + out[24] = ((in[18] >> 24) | ((in[19] & 0x1FFFF) << 8)) + out[23] + out[25] = ((in[19] >> 17) | ((in[20] & 0x3FF) << 15)) + out[24] + out[26] = ((in[20] >> 10) | ((in[21] & 0x7) << 22)) + out[25] + out[27] = (in[21] >> 3) & 0x1FFFFFF + out[26] + out[28] = ((in[21] >> 28) | ((in[22] & 0x1FFFFF) << 4)) + out[27] + out[29] = ((in[22] >> 21) | ((in[23] & 0x3FFF) << 11)) + out[28] + out[30] = ((in[23] >> 14) | ((in[24] & 0x7F) << 18)) + out[29] + out[31] = (in[24] >> 7) + out[30] +} + +func deltaunpack_uint32_26(initoffset uint32, in *[26]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3FFFFFF + initoffset + out[1] = ((in[0] >> 26) | ((in[1] & 0xFFFFF) << 6)) + out[0] + out[2] = ((in[1] >> 20) | ((in[2] & 0x3FFF) << 12)) + out[1] + out[3] = ((in[2] >> 14) | ((in[3] & 0xFF) << 18)) + out[2] + out[4] = ((in[3] >> 8) | ((in[4] & 0x3) << 24)) + out[3] + out[5] = (in[4] >> 2) & 0x3FFFFFF + out[4] + out[6] = ((in[4] >> 28) | ((in[5] & 0x3FFFFF) << 4)) + out[5] + out[7] = ((in[5] >> 22) | ((in[6] & 0xFFFF) << 10)) + out[6] + out[8] = ((in[6] >> 16) | ((in[7] & 0x3FF) << 16)) + out[7] + out[9] = ((in[7] >> 10) | ((in[8] & 0xF) << 22)) + out[8] + out[10] = (in[8] >> 4) & 0x3FFFFFF + out[9] + out[11] = ((in[8] >> 30) | ((in[9] & 0xFFFFFF) << 2)) + out[10] + out[12] = ((in[9] >> 24) | ((in[10] & 0x3FFFF) << 8)) + out[11] + out[13] = ((in[10] >> 18) | ((in[11] & 0xFFF) << 14)) + out[12] + out[14] = ((in[11] >> 12) | ((in[12] & 0x3F) << 20)) + out[13] + out[15] = (in[12] >> 6) + out[14] + out[16] = (in[13] >> 0) & 0x3FFFFFF + out[15] + out[17] = ((in[13] >> 26) | ((in[14] & 0xFFFFF) << 6)) + out[16] + out[18] = ((in[14] >> 20) | ((in[15] & 0x3FFF) << 12)) + out[17] + out[19] = ((in[15] >> 14) | ((in[16] & 0xFF) << 18)) + out[18] + out[20] = ((in[16] >> 8) | ((in[17] & 0x3) << 24)) + out[19] + out[21] = (in[17] >> 2) & 0x3FFFFFF + out[20] + out[22] = ((in[17] >> 28) | ((in[18] & 0x3FFFFF) << 4)) + out[21] + out[23] = ((in[18] >> 22) | ((in[19] & 0xFFFF) << 10)) + out[22] + out[24] = ((in[19] >> 16) | ((in[20] & 0x3FF) << 16)) + out[23] + out[25] = ((in[20] >> 10) | ((in[21] & 0xF) << 22)) + out[24] + out[26] = (in[21] >> 4) & 0x3FFFFFF + out[25] + out[27] = ((in[21] >> 30) | ((in[22] & 0xFFFFFF) << 2)) + out[26] + out[28] = ((in[22] >> 24) | ((in[23] & 0x3FFFF) << 8)) + out[27] + out[29] = ((in[23] >> 18) | ((in[24] & 0xFFF) << 14)) + out[28] + out[30] = ((in[24] >> 12) | ((in[25] & 0x3F) << 20)) + out[29] + out[31] = (in[25] >> 6) + out[30] +} + +func deltaunpack_uint32_27(initoffset uint32, in *[27]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7FFFFFF + initoffset + out[1] = ((in[0] >> 27) | ((in[1] & 0x3FFFFF) << 5)) + out[0] + out[2] = ((in[1] >> 22) | ((in[2] & 0x1FFFF) << 10)) + out[1] + out[3] = ((in[2] >> 17) | ((in[3] & 0xFFF) << 15)) + out[2] + out[4] = ((in[3] >> 12) | ((in[4] & 0x7F) << 20)) + out[3] + out[5] = ((in[4] >> 7) | ((in[5] & 0x3) << 25)) + out[4] + out[6] = (in[5] >> 2) & 0x7FFFFFF + out[5] + out[7] = ((in[5] >> 29) | ((in[6] & 0xFFFFFF) << 3)) + out[6] + out[8] = ((in[6] >> 24) | ((in[7] & 0x7FFFF) << 8)) + out[7] + out[9] = ((in[7] >> 19) | ((in[8] & 0x3FFF) << 13)) + out[8] + out[10] = ((in[8] >> 14) | ((in[9] & 0x1FF) << 18)) + out[9] + out[11] = ((in[9] >> 9) | ((in[10] & 0xF) << 23)) + out[10] + out[12] = (in[10] >> 4) & 0x7FFFFFF + out[11] + out[13] = ((in[10] >> 31) | ((in[11] & 0x3FFFFFF) << 1)) + out[12] + out[14] = ((in[11] >> 26) | ((in[12] & 0x1FFFFF) << 6)) + out[13] + out[15] = ((in[12] >> 21) | ((in[13] & 0xFFFF) << 11)) + out[14] + out[16] = ((in[13] >> 16) | ((in[14] & 0x7FF) << 16)) + out[15] + out[17] = ((in[14] >> 11) | ((in[15] & 0x3F) << 21)) + out[16] + out[18] = ((in[15] >> 6) | ((in[16] & 0x1) << 26)) + out[17] + out[19] = (in[16] >> 1) & 0x7FFFFFF + out[18] + out[20] = ((in[16] >> 28) | ((in[17] & 0x7FFFFF) << 4)) + out[19] + out[21] = ((in[17] >> 23) | ((in[18] & 0x3FFFF) << 9)) + out[20] + out[22] = ((in[18] >> 18) | ((in[19] & 0x1FFF) << 14)) + out[21] + out[23] = ((in[19] >> 13) | ((in[20] & 0xFF) << 19)) + out[22] + out[24] = ((in[20] >> 8) | ((in[21] & 0x7) << 24)) + out[23] + out[25] = (in[21] >> 3) & 0x7FFFFFF + out[24] + out[26] = ((in[21] >> 30) | ((in[22] & 0x1FFFFFF) << 2)) + out[25] + out[27] = ((in[22] >> 25) | ((in[23] & 0xFFFFF) << 7)) + out[26] + out[28] = ((in[23] >> 20) | ((in[24] & 0x7FFF) << 12)) + out[27] + out[29] = ((in[24] >> 15) | ((in[25] & 0x3FF) << 17)) + out[28] + out[30] = ((in[25] >> 10) | ((in[26] & 0x1F) << 22)) + out[29] + out[31] = (in[26] >> 5) + out[30] +} + +func deltaunpack_uint32_28(initoffset uint32, in *[28]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0xFFFFFFF + initoffset + out[1] = ((in[0] >> 28) | ((in[1] & 0xFFFFFF) << 4)) + out[0] + out[2] = ((in[1] >> 24) | ((in[2] & 0xFFFFF) << 8)) + out[1] + out[3] = ((in[2] >> 20) | ((in[3] & 0xFFFF) << 12)) + out[2] + out[4] = ((in[3] >> 16) | ((in[4] & 0xFFF) << 16)) + out[3] + out[5] = ((in[4] >> 12) | ((in[5] & 0xFF) << 20)) + out[4] + out[6] = ((in[5] >> 8) | ((in[6] & 0xF) << 24)) + out[5] + out[7] = (in[6] >> 4) + out[6] + out[8] = (in[7] >> 0) & 0xFFFFFFF + out[7] + out[9] = ((in[7] >> 28) | ((in[8] & 0xFFFFFF) << 4)) + out[8] + out[10] = ((in[8] >> 24) | ((in[9] & 0xFFFFF) << 8)) + out[9] + out[11] = ((in[9] >> 20) | ((in[10] & 0xFFFF) << 12)) + out[10] + out[12] = ((in[10] >> 16) | ((in[11] & 0xFFF) << 16)) + out[11] + out[13] = ((in[11] >> 12) | ((in[12] & 0xFF) << 20)) + out[12] + out[14] = ((in[12] >> 8) | ((in[13] & 0xF) << 24)) + out[13] + out[15] = (in[13] >> 4) + out[14] + out[16] = (in[14] >> 0) & 0xFFFFFFF + out[15] + out[17] = ((in[14] >> 28) | ((in[15] & 0xFFFFFF) << 4)) + out[16] + out[18] = ((in[15] >> 24) | ((in[16] & 0xFFFFF) << 8)) + out[17] + out[19] = ((in[16] >> 20) | ((in[17] & 0xFFFF) << 12)) + out[18] + out[20] = ((in[17] >> 16) | ((in[18] & 0xFFF) << 16)) + out[19] + out[21] = ((in[18] >> 12) | ((in[19] & 0xFF) << 20)) + out[20] + out[22] = ((in[19] >> 8) | ((in[20] & 0xF) << 24)) + out[21] + out[23] = (in[20] >> 4) + out[22] + out[24] = (in[21] >> 0) & 0xFFFFFFF + out[23] + out[25] = ((in[21] >> 28) | ((in[22] & 0xFFFFFF) << 4)) + out[24] + out[26] = ((in[22] >> 24) | ((in[23] & 0xFFFFF) << 8)) + out[25] + out[27] = ((in[23] >> 20) | ((in[24] & 0xFFFF) << 12)) + out[26] + out[28] = ((in[24] >> 16) | ((in[25] & 0xFFF) << 16)) + out[27] + out[29] = ((in[25] >> 12) | ((in[26] & 0xFF) << 20)) + out[28] + out[30] = ((in[26] >> 8) | ((in[27] & 0xF) << 24)) + out[29] + out[31] = (in[27] >> 4) + out[30] +} + +func deltaunpack_uint32_29(initoffset uint32, in *[29]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x1FFFFFFF + initoffset + out[1] = ((in[0] >> 29) | ((in[1] & 0x3FFFFFF) << 3)) + out[0] + out[2] = ((in[1] >> 26) | ((in[2] & 0x7FFFFF) << 6)) + out[1] + out[3] = ((in[2] >> 23) | ((in[3] & 0xFFFFF) << 9)) + out[2] + out[4] = ((in[3] >> 20) | ((in[4] & 0x1FFFF) << 12)) + out[3] + out[5] = ((in[4] >> 17) | ((in[5] & 0x3FFF) << 15)) + out[4] + out[6] = ((in[5] >> 14) | ((in[6] & 0x7FF) << 18)) + out[5] + out[7] = ((in[6] >> 11) | ((in[7] & 0xFF) << 21)) + out[6] + out[8] = ((in[7] >> 8) | ((in[8] & 0x1F) << 24)) + out[7] + out[9] = ((in[8] >> 5) | ((in[9] & 0x3) << 27)) + out[8] + out[10] = (in[9] >> 2) & 0x1FFFFFFF + out[9] + out[11] = ((in[9] >> 31) | ((in[10] & 0xFFFFFFF) << 1)) + out[10] + out[12] = ((in[10] >> 28) | ((in[11] & 0x1FFFFFF) << 4)) + out[11] + out[13] = ((in[11] >> 25) | ((in[12] & 0x3FFFFF) << 7)) + out[12] + out[14] = ((in[12] >> 22) | ((in[13] & 0x7FFFF) << 10)) + out[13] + out[15] = ((in[13] >> 19) | ((in[14] & 0xFFFF) << 13)) + out[14] + out[16] = ((in[14] >> 16) | ((in[15] & 0x1FFF) << 16)) + out[15] + out[17] = ((in[15] >> 13) | ((in[16] & 0x3FF) << 19)) + out[16] + out[18] = ((in[16] >> 10) | ((in[17] & 0x7F) << 22)) + out[17] + out[19] = ((in[17] >> 7) | ((in[18] & 0xF) << 25)) + out[18] + out[20] = ((in[18] >> 4) | ((in[19] & 0x1) << 28)) + out[19] + out[21] = (in[19] >> 1) & 0x1FFFFFFF + out[20] + out[22] = ((in[19] >> 30) | ((in[20] & 0x7FFFFFF) << 2)) + out[21] + out[23] = ((in[20] >> 27) | ((in[21] & 0xFFFFFF) << 5)) + out[22] + out[24] = ((in[21] >> 24) | ((in[22] & 0x1FFFFF) << 8)) + out[23] + out[25] = ((in[22] >> 21) | ((in[23] & 0x3FFFF) << 11)) + out[24] + out[26] = ((in[23] >> 18) | ((in[24] & 0x7FFF) << 14)) + out[25] + out[27] = ((in[24] >> 15) | ((in[25] & 0xFFF) << 17)) + out[26] + out[28] = ((in[25] >> 12) | ((in[26] & 0x1FF) << 20)) + out[27] + out[29] = ((in[26] >> 9) | ((in[27] & 0x3F) << 23)) + out[28] + out[30] = ((in[27] >> 6) | ((in[28] & 0x7) << 26)) + out[29] + out[31] = (in[28] >> 3) + out[30] +} + +func deltaunpack_uint32_30(initoffset uint32, in *[30]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x3FFFFFFF + initoffset + out[1] = ((in[0] >> 30) | ((in[1] & 0xFFFFFFF) << 2)) + out[0] + out[2] = ((in[1] >> 28) | ((in[2] & 0x3FFFFFF) << 4)) + out[1] + out[3] = ((in[2] >> 26) | ((in[3] & 0xFFFFFF) << 6)) + out[2] + out[4] = ((in[3] >> 24) | ((in[4] & 0x3FFFFF) << 8)) + out[3] + out[5] = ((in[4] >> 22) | ((in[5] & 0xFFFFF) << 10)) + out[4] + out[6] = ((in[5] >> 20) | ((in[6] & 0x3FFFF) << 12)) + out[5] + out[7] = ((in[6] >> 18) | ((in[7] & 0xFFFF) << 14)) + out[6] + out[8] = ((in[7] >> 16) | ((in[8] & 0x3FFF) << 16)) + out[7] + out[9] = ((in[8] >> 14) | ((in[9] & 0xFFF) << 18)) + out[8] + out[10] = ((in[9] >> 12) | ((in[10] & 0x3FF) << 20)) + out[9] + out[11] = ((in[10] >> 10) | ((in[11] & 0xFF) << 22)) + out[10] + out[12] = ((in[11] >> 8) | ((in[12] & 0x3F) << 24)) + out[11] + out[13] = ((in[12] >> 6) | ((in[13] & 0xF) << 26)) + out[12] + out[14] = ((in[13] >> 4) | ((in[14] & 0x3) << 28)) + out[13] + out[15] = (in[14] >> 2) + out[14] + out[16] = (in[15] >> 0) & 0x3FFFFFFF + out[15] + out[17] = ((in[15] >> 30) | ((in[16] & 0xFFFFFFF) << 2)) + out[16] + out[18] = ((in[16] >> 28) | ((in[17] & 0x3FFFFFF) << 4)) + out[17] + out[19] = ((in[17] >> 26) | ((in[18] & 0xFFFFFF) << 6)) + out[18] + out[20] = ((in[18] >> 24) | ((in[19] & 0x3FFFFF) << 8)) + out[19] + out[21] = ((in[19] >> 22) | ((in[20] & 0xFFFFF) << 10)) + out[20] + out[22] = ((in[20] >> 20) | ((in[21] & 0x3FFFF) << 12)) + out[21] + out[23] = ((in[21] >> 18) | ((in[22] & 0xFFFF) << 14)) + out[22] + out[24] = ((in[22] >> 16) | ((in[23] & 0x3FFF) << 16)) + out[23] + out[25] = ((in[23] >> 14) | ((in[24] & 0xFFF) << 18)) + out[24] + out[26] = ((in[24] >> 12) | ((in[25] & 0x3FF) << 20)) + out[25] + out[27] = ((in[25] >> 10) | ((in[26] & 0xFF) << 22)) + out[26] + out[28] = ((in[26] >> 8) | ((in[27] & 0x3F) << 24)) + out[27] + out[29] = ((in[27] >> 6) | ((in[28] & 0xF) << 26)) + out[28] + out[30] = ((in[28] >> 4) | ((in[29] & 0x3) << 28)) + out[29] + out[31] = (in[29] >> 2) + out[30] +} + +func deltaunpack_uint32_31(initoffset uint32, in *[31]uint32, out *[32]uint32) { + out[0] = (in[0] >> 0) & 0x7FFFFFFF + initoffset + out[1] = ((in[0] >> 31) | ((in[1] & 0x3FFFFFFF) << 1)) + out[0] + out[2] = ((in[1] >> 30) | ((in[2] & 0x1FFFFFFF) << 2)) + out[1] + out[3] = ((in[2] >> 29) | ((in[3] & 0xFFFFFFF) << 3)) + out[2] + out[4] = ((in[3] >> 28) | ((in[4] & 0x7FFFFFF) << 4)) + out[3] + out[5] = ((in[4] >> 27) | ((in[5] & 0x3FFFFFF) << 5)) + out[4] + out[6] = ((in[5] >> 26) | ((in[6] & 0x1FFFFFF) << 6)) + out[5] + out[7] = ((in[6] >> 25) | ((in[7] & 0xFFFFFF) << 7)) + out[6] + out[8] = ((in[7] >> 24) | ((in[8] & 0x7FFFFF) << 8)) + out[7] + out[9] = ((in[8] >> 23) | ((in[9] & 0x3FFFFF) << 9)) + out[8] + out[10] = ((in[9] >> 22) | ((in[10] & 0x1FFFFF) << 10)) + out[9] + out[11] = ((in[10] >> 21) | ((in[11] & 0xFFFFF) << 11)) + out[10] + out[12] = ((in[11] >> 20) | ((in[12] & 0x7FFFF) << 12)) + out[11] + out[13] = ((in[12] >> 19) | ((in[13] & 0x3FFFF) << 13)) + out[12] + out[14] = ((in[13] >> 18) | ((in[14] & 0x1FFFF) << 14)) + out[13] + out[15] = ((in[14] >> 17) | ((in[15] & 0xFFFF) << 15)) + out[14] + out[16] = ((in[15] >> 16) | ((in[16] & 0x7FFF) << 16)) + out[15] + out[17] = ((in[16] >> 15) | ((in[17] & 0x3FFF) << 17)) + out[16] + out[18] = ((in[17] >> 14) | ((in[18] & 0x1FFF) << 18)) + out[17] + out[19] = ((in[18] >> 13) | ((in[19] & 0xFFF) << 19)) + out[18] + out[20] = ((in[19] >> 12) | ((in[20] & 0x7FF) << 20)) + out[19] + out[21] = ((in[20] >> 11) | ((in[21] & 0x3FF) << 21)) + out[20] + out[22] = ((in[21] >> 10) | ((in[22] & 0x1FF) << 22)) + out[21] + out[23] = ((in[22] >> 9) | ((in[23] & 0xFF) << 23)) + out[22] + out[24] = ((in[23] >> 8) | ((in[24] & 0x7F) << 24)) + out[23] + out[25] = ((in[24] >> 7) | ((in[25] & 0x3F) << 25)) + out[24] + out[26] = ((in[25] >> 6) | ((in[26] & 0x1F) << 26)) + out[25] + out[27] = ((in[26] >> 5) | ((in[27] & 0xF) << 27)) + out[26] + out[28] = ((in[27] >> 4) | ((in[28] & 0x7) << 28)) + out[27] + out[29] = ((in[28] >> 3) | ((in[29] & 0x3) << 29)) + out[28] + out[30] = ((in[29] >> 2) | ((in[30] & 0x1) << 30)) + out[29] + out[31] = (in[30] >> 1) + out[30] +} + +// --- zigzag + +// deltaPackZigzag_uint32 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first, the difference is zigzag encoded. +// Caller must give the proper `bitlen` of the block +func deltaPackZigzag_uint32(initoffset uint32, in []uint32, out []uint32, bitlen int) { + switch bitlen { + case 0: + deltapackzigzag_uint32_0(initoffset, (*[32]uint32)(in), (*[0]uint32)(out)) + case 1: + deltapackzigzag_uint32_1(initoffset, (*[32]uint32)(in), (*[1]uint32)(out)) + case 2: + deltapackzigzag_uint32_2(initoffset, (*[32]uint32)(in), (*[2]uint32)(out)) + case 3: + deltapackzigzag_uint32_3(initoffset, (*[32]uint32)(in), (*[3]uint32)(out)) + case 4: + deltapackzigzag_uint32_4(initoffset, (*[32]uint32)(in), (*[4]uint32)(out)) + case 5: + deltapackzigzag_uint32_5(initoffset, (*[32]uint32)(in), (*[5]uint32)(out)) + case 6: + deltapackzigzag_uint32_6(initoffset, (*[32]uint32)(in), (*[6]uint32)(out)) + case 7: + deltapackzigzag_uint32_7(initoffset, (*[32]uint32)(in), (*[7]uint32)(out)) + case 8: + deltapackzigzag_uint32_8(initoffset, (*[32]uint32)(in), (*[8]uint32)(out)) + case 9: + deltapackzigzag_uint32_9(initoffset, (*[32]uint32)(in), (*[9]uint32)(out)) + case 10: + deltapackzigzag_uint32_10(initoffset, (*[32]uint32)(in), (*[10]uint32)(out)) + case 11: + deltapackzigzag_uint32_11(initoffset, (*[32]uint32)(in), (*[11]uint32)(out)) + case 12: + deltapackzigzag_uint32_12(initoffset, (*[32]uint32)(in), (*[12]uint32)(out)) + case 13: + deltapackzigzag_uint32_13(initoffset, (*[32]uint32)(in), (*[13]uint32)(out)) + case 14: + deltapackzigzag_uint32_14(initoffset, (*[32]uint32)(in), (*[14]uint32)(out)) + case 15: + deltapackzigzag_uint32_15(initoffset, (*[32]uint32)(in), (*[15]uint32)(out)) + case 16: + deltapackzigzag_uint32_16(initoffset, (*[32]uint32)(in), (*[16]uint32)(out)) + case 17: + deltapackzigzag_uint32_17(initoffset, (*[32]uint32)(in), (*[17]uint32)(out)) + case 18: + deltapackzigzag_uint32_18(initoffset, (*[32]uint32)(in), (*[18]uint32)(out)) + case 19: + deltapackzigzag_uint32_19(initoffset, (*[32]uint32)(in), (*[19]uint32)(out)) + case 20: + deltapackzigzag_uint32_20(initoffset, (*[32]uint32)(in), (*[20]uint32)(out)) + case 21: + deltapackzigzag_uint32_21(initoffset, (*[32]uint32)(in), (*[21]uint32)(out)) + case 22: + deltapackzigzag_uint32_22(initoffset, (*[32]uint32)(in), (*[22]uint32)(out)) + case 23: + deltapackzigzag_uint32_23(initoffset, (*[32]uint32)(in), (*[23]uint32)(out)) + case 24: + deltapackzigzag_uint32_24(initoffset, (*[32]uint32)(in), (*[24]uint32)(out)) + case 25: + deltapackzigzag_uint32_25(initoffset, (*[32]uint32)(in), (*[25]uint32)(out)) + case 26: + deltapackzigzag_uint32_26(initoffset, (*[32]uint32)(in), (*[26]uint32)(out)) + case 27: + deltapackzigzag_uint32_27(initoffset, (*[32]uint32)(in), (*[27]uint32)(out)) + case 28: + deltapackzigzag_uint32_28(initoffset, (*[32]uint32)(in), (*[28]uint32)(out)) + case 29: + deltapackzigzag_uint32_29(initoffset, (*[32]uint32)(in), (*[29]uint32)(out)) + case 30: + deltapackzigzag_uint32_30(initoffset, (*[32]uint32)(in), (*[30]uint32)(out)) + case 31: + deltapackzigzag_uint32_31(initoffset, (*[32]uint32)(in), (*[31]uint32)(out)) + case 32: + *(*[32]uint32)(out) = *((*[32]uint32)(unsafe.Pointer((*[32]uint32)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpackZigzag_uint32 Decoding operation for DeltaPackZigzag_uint32 +func deltaUnpackZigzag_uint32(initoffset uint32, in []uint32, out []uint32, bitlen int) { + switch bitlen { + case 0: + deltaunpackzigzag_uint32_0(initoffset, (*[0]uint32)(in), (*[32]uint32)(out)) + case 1: + deltaunpackzigzag_uint32_1(initoffset, (*[1]uint32)(in), (*[32]uint32)(out)) + case 2: + deltaunpackzigzag_uint32_2(initoffset, (*[2]uint32)(in), (*[32]uint32)(out)) + case 3: + deltaunpackzigzag_uint32_3(initoffset, (*[3]uint32)(in), (*[32]uint32)(out)) + case 4: + deltaunpackzigzag_uint32_4(initoffset, (*[4]uint32)(in), (*[32]uint32)(out)) + case 5: + deltaunpackzigzag_uint32_5(initoffset, (*[5]uint32)(in), (*[32]uint32)(out)) + case 6: + deltaunpackzigzag_uint32_6(initoffset, (*[6]uint32)(in), (*[32]uint32)(out)) + case 7: + deltaunpackzigzag_uint32_7(initoffset, (*[7]uint32)(in), (*[32]uint32)(out)) + case 8: + deltaunpackzigzag_uint32_8(initoffset, (*[8]uint32)(in), (*[32]uint32)(out)) + case 9: + deltaunpackzigzag_uint32_9(initoffset, (*[9]uint32)(in), (*[32]uint32)(out)) + case 10: + deltaunpackzigzag_uint32_10(initoffset, (*[10]uint32)(in), (*[32]uint32)(out)) + case 11: + deltaunpackzigzag_uint32_11(initoffset, (*[11]uint32)(in), (*[32]uint32)(out)) + case 12: + deltaunpackzigzag_uint32_12(initoffset, (*[12]uint32)(in), (*[32]uint32)(out)) + case 13: + deltaunpackzigzag_uint32_13(initoffset, (*[13]uint32)(in), (*[32]uint32)(out)) + case 14: + deltaunpackzigzag_uint32_14(initoffset, (*[14]uint32)(in), (*[32]uint32)(out)) + case 15: + deltaunpackzigzag_uint32_15(initoffset, (*[15]uint32)(in), (*[32]uint32)(out)) + case 16: + deltaunpackzigzag_uint32_16(initoffset, (*[16]uint32)(in), (*[32]uint32)(out)) + case 17: + deltaunpackzigzag_uint32_17(initoffset, (*[17]uint32)(in), (*[32]uint32)(out)) + case 18: + deltaunpackzigzag_uint32_18(initoffset, (*[18]uint32)(in), (*[32]uint32)(out)) + case 19: + deltaunpackzigzag_uint32_19(initoffset, (*[19]uint32)(in), (*[32]uint32)(out)) + case 20: + deltaunpackzigzag_uint32_20(initoffset, (*[20]uint32)(in), (*[32]uint32)(out)) + case 21: + deltaunpackzigzag_uint32_21(initoffset, (*[21]uint32)(in), (*[32]uint32)(out)) + case 22: + deltaunpackzigzag_uint32_22(initoffset, (*[22]uint32)(in), (*[32]uint32)(out)) + case 23: + deltaunpackzigzag_uint32_23(initoffset, (*[23]uint32)(in), (*[32]uint32)(out)) + case 24: + deltaunpackzigzag_uint32_24(initoffset, (*[24]uint32)(in), (*[32]uint32)(out)) + case 25: + deltaunpackzigzag_uint32_25(initoffset, (*[25]uint32)(in), (*[32]uint32)(out)) + case 26: + deltaunpackzigzag_uint32_26(initoffset, (*[26]uint32)(in), (*[32]uint32)(out)) + case 27: + deltaunpackzigzag_uint32_27(initoffset, (*[27]uint32)(in), (*[32]uint32)(out)) + case 28: + deltaunpackzigzag_uint32_28(initoffset, (*[28]uint32)(in), (*[32]uint32)(out)) + case 29: + deltaunpackzigzag_uint32_29(initoffset, (*[29]uint32)(in), (*[32]uint32)(out)) + case 30: + deltaunpackzigzag_uint32_30(initoffset, (*[30]uint32)(in), (*[32]uint32)(out)) + case 31: + deltaunpackzigzag_uint32_31(initoffset, (*[31]uint32)(in), (*[32]uint32)(out)) + case 32: + *(*[32]uint32)(out) = *(*[32]uint32)(unsafe.Pointer((*[32]uint32)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapackzigzag_uint32_0(initoffset uint32, in *[32]uint32, out *[0]uint32) { +} + +func deltapackzigzag_uint32_1(initoffset uint32, in *[32]uint32, out *[1]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 1) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 2) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 3) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 4) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 5) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 6) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 7) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 9) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 10) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 11) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 12) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 13) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 14) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 15) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 17) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 18) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 19) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 20) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 21) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 22) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 23) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 25) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 26) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 27) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 28) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 29) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 30) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 31) +} + +func deltapackzigzag_uint32_2(initoffset uint32, in *[32]uint32, out *[2]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 2) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 4) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 6) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 8) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 10) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 12) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 14) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 18) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 20) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 22) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 24) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 26) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 28) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 30) + out[1] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 2) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 4) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 6) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 8) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 10) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 12) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 14) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 18) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 20) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 22) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 24) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 26) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 28) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 30) +} + +func deltapackzigzag_uint32_3(initoffset uint32, in *[32]uint32, out *[3]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 3) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 6) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 9) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 12) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 15) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 18) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 21) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 27) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 30) + out[1] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 2 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 1) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 4) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 7) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 10) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 13) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 19) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 22) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 25) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 28) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 31) + out[2] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 1 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 2) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 5) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 11) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 14) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 17) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 20) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 23) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 26) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 29) +} + +func deltapackzigzag_uint32_4(initoffset uint32, in *[32]uint32, out *[4]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 4) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 8) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 12) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 16) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 20) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 24) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 28) + out[1] = + uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31)) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 4) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 8) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 12) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 16) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 20) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 24) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 28) + out[2] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 4) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 8) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 12) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 16) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 20) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 24) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 28) + out[3] = + uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31)) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 4) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 8) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 12) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 16) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 20) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 24) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 28) +} + +func deltapackzigzag_uint32_5(initoffset uint32, in *[32]uint32, out *[5]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 5) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 10) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 15) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 20) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 25) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 30) + out[1] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 2 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 3) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 13) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 18) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 23) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 28) + out[2] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 4 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 1) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 6) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 11) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 21) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 26) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 31) + out[3] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 1 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 4) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 9) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 14) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 19) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 29) + out[4] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 3 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 2) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 7) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 12) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 17) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 22) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 27) +} + +func deltapackzigzag_uint32_6(initoffset uint32, in *[32]uint32, out *[6]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 6) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 12) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 18) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 24) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 30) + out[1] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 2 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 4) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 10) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 22) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 28) + out[2] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 4 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 2) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 8) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 14) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 20) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 26) + out[3] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 6) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 12) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 18) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 24) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 30) + out[4] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 2 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 4) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 10) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 22) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 28) + out[5] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 4 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 2) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 8) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 14) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 20) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 26) +} + +func deltapackzigzag_uint32_7(initoffset uint32, in *[32]uint32, out *[7]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 7) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 14) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 21) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 28) + out[1] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 4 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 3) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 10) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 17) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 31) + out[2] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 1 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 6) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 13) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 20) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 27) + out[3] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 5 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 2) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 9) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 23) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 30) + out[4] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 2 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 5) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 12) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 19) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 26) + out[5] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 6 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 1) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 15) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 22) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 29) + out[6] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 3 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 4) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 11) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 18) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 25) +} + +func deltapackzigzag_uint32_8(initoffset uint32, in *[32]uint32, out *[8]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 8) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 16) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 24) + out[1] = + uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31)) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 8) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 16) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 24) + out[2] = + uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31)) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 8) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 16) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 24) + out[3] = + uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31)) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 8) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 16) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 24) + out[4] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 8) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 16) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 24) + out[5] = + uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31)) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 8) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 16) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 24) + out[6] = + uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31)) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 8) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 16) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 24) + out[7] = + uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31)) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 8) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 16) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 24) +} + +func deltapackzigzag_uint32_9(initoffset uint32, in *[32]uint32, out *[9]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 9) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 18) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 27) + out[1] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 5 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 4) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 13) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 22) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 31) + out[2] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 1 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 17) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 26) + out[3] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 6 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 3) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 12) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 21) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 30) + out[4] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 2 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 7) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 25) + out[5] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 7 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 2) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 11) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 20) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 29) + out[6] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 3 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 6) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 15) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) + out[7] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 8 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 1) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 10) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 19) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 28) + out[8] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 4 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 5) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 14) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 23) +} + +func deltapackzigzag_uint32_10(initoffset uint32, in *[32]uint32, out *[10]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 10) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 20) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 30) + out[1] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 2 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 8) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 18) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 28) + out[2] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 4 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 6) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 26) + out[3] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 6 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 4) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 14) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 24) + out[4] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 8 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 2) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 12) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 22) + out[5] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 10) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 20) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 30) + out[6] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 2 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 8) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 18) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 28) + out[7] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 4 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 6) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 26) + out[8] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 6 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 4) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 14) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 24) + out[9] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 8 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 2) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 12) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 22) +} + +func deltapackzigzag_uint32_11(initoffset uint32, in *[32]uint32, out *[11]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 11) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 22) + out[1] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 10 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 1) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 12) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 23) + out[2] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 9 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 2) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 13) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) + out[3] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 8 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 3) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 14) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 25) + out[4] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 7 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 4) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 15) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 26) + out[5] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 6 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 5) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 27) + out[6] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 5 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 6) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 17) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 28) + out[7] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 4 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 7) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 18) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 29) + out[8] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 3 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 19) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 30) + out[9] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 2 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 9) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 20) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 31) + out[10] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 1 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 10) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 21) +} + +func deltapackzigzag_uint32_12(initoffset uint32, in *[32]uint32, out *[12]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 12) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 24) + out[1] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 8 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 4) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 16) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 28) + out[2] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 4 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 8) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 20) + out[3] = + uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31)) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 12) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 24) + out[4] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 8 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 4) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 16) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 28) + out[5] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 4 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 8) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 20) + out[6] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 12) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 24) + out[7] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 8 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 4) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 16) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 28) + out[8] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 4 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 8) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 20) + out[9] = + uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31)) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 12) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 24) + out[10] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 8 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 4) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 16) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 28) + out[11] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 4 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 8) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 20) +} + +func deltapackzigzag_uint32_13(initoffset uint32, in *[32]uint32, out *[13]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 13) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 26) + out[1] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 6 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 7) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 20) + out[2] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 12 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 1) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 14) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 27) + out[3] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 5 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 21) + out[4] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 11 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 2) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 15) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 28) + out[5] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 4 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 9) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 22) + out[6] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 10 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 3) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 29) + out[7] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 3 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 10) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 23) + out[8] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 9 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 4) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 17) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 30) + out[9] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 2 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 11) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) + out[10] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 8 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 5) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 18) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 31) + out[11] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 1 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 12) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 25) + out[12] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 7 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 6) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 19) +} + +func deltapackzigzag_uint32_14(initoffset uint32, in *[32]uint32, out *[14]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 14) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 28) + out[1] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 4 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 10) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 24) + out[2] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 8 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 6) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 20) + out[3] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 12 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 2) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 30) + out[4] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 2 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 12) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 26) + out[5] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 6 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 8) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 22) + out[6] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 10 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 4) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 18) + out[7] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 14) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 28) + out[8] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 4 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 10) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 24) + out[9] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 8 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 6) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 20) + out[10] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 12 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 2) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 30) + out[11] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 2 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 12) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 26) + out[12] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 6 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 8) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 22) + out[13] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 10 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 4) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 18) +} + +func deltapackzigzag_uint32_15(initoffset uint32, in *[32]uint32, out *[15]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 15) | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 30) + out[1] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 2 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 13) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 28) + out[2] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 4 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 11) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 26) + out[3] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 6 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 9) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) + out[4] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 8 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 7) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 22) + out[5] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 10 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 5) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 20) + out[6] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 12 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 3) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 18) + out[7] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 14 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 1) | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 31) + out[8] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 1 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 14) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 29) + out[9] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 3 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 12) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 27) + out[10] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 5 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 10) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 25) + out[11] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 7 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 23) + out[12] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 9 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 6) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 21) + out[13] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 11 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 4) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 19) + out[14] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 13 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 2) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 17) +} + +func deltapackzigzag_uint32_16(initoffset uint32, in *[32]uint32, out *[16]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 16) + out[1] = + uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31)) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 16) + out[2] = + uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31)) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 16) + out[3] = + uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31)) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 16) + out[4] = + uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31)) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 16) + out[5] = + uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31)) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 16) + out[6] = + uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31)) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 16) + out[7] = + uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31)) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 16) + out[8] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 16) + out[9] = + uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31)) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 16) + out[10] = + uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31)) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 16) + out[11] = + uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31)) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 16) + out[12] = + uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31)) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 16) + out[13] = + uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31)) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 16) + out[14] = + uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31)) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 16) + out[15] = + uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31)) | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 16) +} + +func deltapackzigzag_uint32_17(initoffset uint32, in *[32]uint32, out *[17]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 17) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 15 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 2) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 19) + out[2] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 13 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 4) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 21) + out[3] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 11 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 6) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 23) + out[4] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 9 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 25) + out[5] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 7 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 10) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 27) + out[6] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 5 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 12) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 29) + out[7] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 3 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 14) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 31) + out[8] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 1 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[9] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 1) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 18) + out[10] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 14 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 3) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 20) + out[11] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 12 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 5) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 22) + out[12] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 10 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 7) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) + out[13] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 8 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 9) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 26) + out[14] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 6 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 11) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 28) + out[15] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 4 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 13) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 30) + out[16] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 2 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 15) +} + +func deltapackzigzag_uint32_18(initoffset uint32, in *[32]uint32, out *[18]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 18) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 14 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 4) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 22) + out[2] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 10 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 8) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 26) + out[3] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 6 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 12) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 30) + out[4] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 2 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) + out[5] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 16 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 2) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 20) + out[6] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 12 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 6) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 24) + out[7] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 8 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 10) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 28) + out[8] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 4 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 14) + out[9] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 18) + out[10] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 14 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 4) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 22) + out[11] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 10 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 8) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 26) + out[12] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 6 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 12) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 30) + out[13] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 2 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) + out[14] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 16 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 2) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 20) + out[15] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 12 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 6) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 24) + out[16] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 8 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 10) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 28) + out[17] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 4 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 14) +} + +func deltapackzigzag_uint32_19(initoffset uint32, in *[32]uint32, out *[19]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 19) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 13 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 6) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 25) + out[2] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 7 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 12) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 31) + out[3] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 1 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 18) + out[4] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 14 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 5) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) + out[5] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 8 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 11) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 30) + out[6] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 2 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 17) + out[7] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 15 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 4) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 23) + out[8] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 9 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 10) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 29) + out[9] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 3 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[10] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 3) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 22) + out[11] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 10 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 9) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 28) + out[12] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 4 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 15) + out[13] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 17 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 2) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 21) + out[14] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 11 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 27) + out[15] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 5 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 14) + out[16] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 18 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 1) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 20) + out[17] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 12 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 7) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 26) + out[18] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 6 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 13) +} + +func deltapackzigzag_uint32_20(initoffset uint32, in *[32]uint32, out *[20]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 20) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 12 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 8) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 28) + out[2] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 4 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 16) + out[3] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 16 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 4) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 24) + out[4] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 8 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 12) + out[5] = + uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31)) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 20) + out[6] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 12 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 8) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 28) + out[7] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 4 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 16) + out[8] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 16 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 4) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 24) + out[9] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 8 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 12) + out[10] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 20) + out[11] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 12 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 8) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 28) + out[12] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 4 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 16) + out[13] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 16 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 4) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 24) + out[14] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 8 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 12) + out[15] = + uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31)) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 20) + out[16] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 12 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 8) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 28) + out[17] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 4 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 16) + out[18] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 16 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 4) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 24) + out[19] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 8 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 12) +} + +func deltapackzigzag_uint32_21(initoffset uint32, in *[32]uint32, out *[21]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 21) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 11 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 10) | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 31) + out[2] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 1 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 20) + out[3] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 12 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 9) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 30) + out[4] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 2 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 19) + out[5] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 13 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 29) + out[6] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 3 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 18) + out[7] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 14 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 7) | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 28) + out[8] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 4 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 17) + out[9] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 15 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 6) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 27) + out[10] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 5 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[11] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 5) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 26) + out[12] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 6 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 15) + out[13] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 17 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 4) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 25) + out[14] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 7 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 14) + out[15] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 18 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 3) | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) + out[16] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 8 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 13) + out[17] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 19 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 2) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 23) + out[18] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 9 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 12) + out[19] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 20 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 1) | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 22) + out[20] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 10 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 11) +} + +func deltapackzigzag_uint32_22(initoffset uint32, in *[32]uint32, out *[22]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 22) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 10 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 12) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 20 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 2) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 24) + out[3] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 8 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 14) + out[4] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 18 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 4) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 26) + out[5] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 6 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) + out[6] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 16 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 6) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 28) + out[7] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 4 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 18) + out[8] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 14 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 8) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 30) + out[9] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 2 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 20) + out[10] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 12 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 10) + out[11] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 22) + out[12] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 10 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 12) + out[13] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 20 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 2) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 24) + out[14] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 8 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 14) + out[15] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 18 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 4) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 26) + out[16] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 6 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) + out[17] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 16 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 6) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 28) + out[18] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 4 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 18) + out[19] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 14 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 8) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 30) + out[20] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 2 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 20) + out[21] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 12 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 10) +} + +func deltapackzigzag_uint32_23(initoffset uint32, in *[32]uint32, out *[23]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 23) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 9 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 14) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 18 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 5) | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 28) + out[3] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 4 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 19) + out[4] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 13 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 10) + out[5] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 22 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 1) | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) + out[6] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 8 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 15) + out[7] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 17 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 6) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 29) + out[8] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 3 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 20) + out[9] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 12 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 11) + out[10] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 21 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 2) | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 25) + out[11] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 7 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[12] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 7) | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 30) + out[13] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 2 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 21) + out[14] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 11 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 12) + out[15] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 20 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 3) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 26) + out[16] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 6 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 17) + out[17] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 15 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 31) + out[18] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 1 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 22) + out[19] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 10 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 13) + out[20] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 19 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 4) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 27) + out[21] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 5 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 18) + out[22] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 14 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 9) +} + +func deltapackzigzag_uint32_24(initoffset uint32, in *[32]uint32, out *[24]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 24) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 8 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 16) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 16 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 8) + out[3] = + uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31)) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 24) + out[4] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 8 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 16) + out[5] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 16 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 8) + out[6] = + uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31)) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 24) + out[7] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 8 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 16) + out[8] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 16 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 8) + out[9] = + uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31)) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 24) + out[10] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 8 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 16) + out[11] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 16 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 8) + out[12] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 24) + out[13] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 8 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 16) + out[14] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 16 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 8) + out[15] = + uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31)) | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 24) + out[16] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 8 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 16) + out[17] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 16 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 8) + out[18] = + uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31)) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 24) + out[19] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 8 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 16) + out[20] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 16 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 8) + out[21] = + uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31)) | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 24) + out[22] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 8 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 16) + out[23] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 16 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 8) +} + +func deltapackzigzag_uint32_25(initoffset uint32, in *[32]uint32, out *[25]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 25) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 7 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 18) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 14 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 11) + out[3] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 21 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 4) | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 29) + out[4] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 3 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 22) + out[5] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 10 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 15) + out[6] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 17 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) + out[7] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 24 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 1) | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 26) + out[8] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 6 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 19) + out[9] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 13 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 12) + out[10] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 20 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 5) | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 30) + out[11] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 2 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 23) + out[12] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 9 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[13] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 9) + out[14] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 23 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 2) | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 27) + out[15] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 5 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 20) + out[16] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 12 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 13) + out[17] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 19 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 6) | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 31) + out[18] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 1 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) + out[19] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 8 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 17) + out[20] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 15 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 10) + out[21] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 22 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 3) | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 28) + out[22] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 4 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 21) + out[23] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 11 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 14) + out[24] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 18 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 7) +} + +func deltapackzigzag_uint32_26(initoffset uint32, in *[32]uint32, out *[26]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 26) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 6 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 20) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 12 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 14) + out[3] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 18 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 8) + out[4] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 24 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 2) | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 28) + out[5] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 4 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 22) + out[6] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 10 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) + out[7] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 16 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 10) + out[8] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 22 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 4) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 30) + out[9] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 2 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 24) + out[10] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 8 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 18) + out[11] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 14 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 12) + out[12] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 20 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 6) + out[13] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 26) + out[14] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 6 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 20) + out[15] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 12 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 14) + out[16] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 18 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 8) + out[17] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 24 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 2) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 28) + out[18] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 4 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 22) + out[19] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 10 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) + out[20] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 16 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 10) + out[21] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 22 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 4) | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 30) + out[22] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 2 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 24) + out[23] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 8 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 18) + out[24] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 14 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 12) + out[25] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 20 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 6) +} + +func deltapackzigzag_uint32_27(initoffset uint32, in *[32]uint32, out *[27]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 27) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 5 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 22) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 10 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 17) + out[3] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 15 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 12) + out[4] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 20 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 7) + out[5] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 25 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 2) | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 29) + out[6] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 3 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) + out[7] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 8 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 19) + out[8] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 13 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 14) + out[9] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 18 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 9) + out[10] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 23 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 4) | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 31) + out[11] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 1 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 26) + out[12] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 6 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 21) + out[13] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 11 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[14] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 11) + out[15] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 21 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 6) + out[16] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 26 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 1) | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 28) + out[17] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 4 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 23) + out[18] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 9 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 18) + out[19] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 14 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 13) + out[20] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 19 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) + out[21] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 24 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 3) | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 30) + out[22] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 2 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 25) + out[23] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 7 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 20) + out[24] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 12 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 15) + out[25] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 17 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 10) + out[26] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 22 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 5) +} + +func deltapackzigzag_uint32_28(initoffset uint32, in *[32]uint32, out *[28]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 28) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 4 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 24) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 8 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 20) + out[3] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 12 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 16) + out[4] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 16 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 12) + out[5] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 20 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 8) + out[6] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 24 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 4) + out[7] = + uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31)) | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 28) + out[8] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 4 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 24) + out[9] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 8 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 20) + out[10] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 12 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 16) + out[11] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 16 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 12) + out[12] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 20 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 8) + out[13] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 24 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 4) + out[14] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 28) + out[15] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 4 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 24) + out[16] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 8 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 20) + out[17] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 12 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 16) + out[18] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 16 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 12) + out[19] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 20 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 8) + out[20] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 24 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 4) + out[21] = + uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31)) | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 28) + out[22] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 4 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 24) + out[23] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 8 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 20) + out[24] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 12 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 16) + out[25] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 16 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 12) + out[26] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 20 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 8) + out[27] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 24 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 4) +} + +func deltapackzigzag_uint32_29(initoffset uint32, in *[32]uint32, out *[29]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 29) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 3 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 26) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 6 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 23) + out[3] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 9 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 20) + out[4] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 12 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 17) + out[5] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 15 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 14) + out[6] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 18 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 11) + out[7] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 21 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 8) + out[8] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 24 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 5) + out[9] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 27 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 2) | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 31) + out[10] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 1 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 28) + out[11] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 4 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 25) + out[12] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 7 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 22) + out[13] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 10 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 19) + out[14] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 13 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[15] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 13) + out[16] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 19 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 10) + out[17] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 22 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 7) + out[18] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 25 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 4) + out[19] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 28 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 1) | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 30) + out[20] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 2 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 27) + out[21] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 5 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 24) + out[22] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 8 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 21) + out[23] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 11 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 18) + out[24] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 14 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 15) + out[25] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 17 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 12) + out[26] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 20 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 9) + out[27] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 23 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 6) + out[28] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 26 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 3) +} + +func deltapackzigzag_uint32_30(initoffset uint32, in *[32]uint32, out *[30]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 30) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 2 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 28) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 4 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 26) + out[3] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 6 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 24) + out[4] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 8 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 22) + out[5] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 10 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 20) + out[6] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 12 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 18) + out[7] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 14 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 16) + out[8] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 16 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 14) + out[9] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 18 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 12) + out[10] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 20 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 10) + out[11] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 22 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 8) + out[12] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 24 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 6) + out[13] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 26 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 4) + out[14] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 28 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 2) + out[15] = + uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31)) | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 30) + out[16] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 2 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 28) + out[17] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 4 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 26) + out[18] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 6 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 24) + out[19] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 8 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 22) + out[20] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 10 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 20) + out[21] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 12 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 18) + out[22] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 14 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 16) + out[23] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 16 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 14) + out[24] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 18 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 12) + out[25] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 20 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 10) + out[26] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 22 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 8) + out[27] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 24 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 6) + out[28] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 26 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 4) + out[29] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 28 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 2) +} + +func deltapackzigzag_uint32_31(initoffset uint32, in *[32]uint32, out *[31]uint32) { + out[0] = + uint32(((int32(in[0] - initoffset)) << 1) ^ ((int32(in[0] - initoffset)) >> 31)) | + ((uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) << 31) + out[1] = + (uint32(((int32(in[1] - in[0])) << 1) ^ ((int32(in[1] - in[0])) >> 31))) >> 1 | + ((uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) << 30) + out[2] = + (uint32(((int32(in[2] - in[1])) << 1) ^ ((int32(in[2] - in[1])) >> 31))) >> 2 | + ((uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) << 29) + out[3] = + (uint32(((int32(in[3] - in[2])) << 1) ^ ((int32(in[3] - in[2])) >> 31))) >> 3 | + ((uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) << 28) + out[4] = + (uint32(((int32(in[4] - in[3])) << 1) ^ ((int32(in[4] - in[3])) >> 31))) >> 4 | + ((uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) << 27) + out[5] = + (uint32(((int32(in[5] - in[4])) << 1) ^ ((int32(in[5] - in[4])) >> 31))) >> 5 | + ((uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) << 26) + out[6] = + (uint32(((int32(in[6] - in[5])) << 1) ^ ((int32(in[6] - in[5])) >> 31))) >> 6 | + ((uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) << 25) + out[7] = + (uint32(((int32(in[7] - in[6])) << 1) ^ ((int32(in[7] - in[6])) >> 31))) >> 7 | + ((uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) << 24) + out[8] = + (uint32(((int32(in[8] - in[7])) << 1) ^ ((int32(in[8] - in[7])) >> 31))) >> 8 | + ((uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) << 23) + out[9] = + (uint32(((int32(in[9] - in[8])) << 1) ^ ((int32(in[9] - in[8])) >> 31))) >> 9 | + ((uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) << 22) + out[10] = + (uint32(((int32(in[10] - in[9])) << 1) ^ ((int32(in[10] - in[9])) >> 31))) >> 10 | + ((uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) << 21) + out[11] = + (uint32(((int32(in[11] - in[10])) << 1) ^ ((int32(in[11] - in[10])) >> 31))) >> 11 | + ((uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) << 20) + out[12] = + (uint32(((int32(in[12] - in[11])) << 1) ^ ((int32(in[12] - in[11])) >> 31))) >> 12 | + ((uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) << 19) + out[13] = + (uint32(((int32(in[13] - in[12])) << 1) ^ ((int32(in[13] - in[12])) >> 31))) >> 13 | + ((uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) << 18) + out[14] = + (uint32(((int32(in[14] - in[13])) << 1) ^ ((int32(in[14] - in[13])) >> 31))) >> 14 | + ((uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) << 17) + out[15] = + (uint32(((int32(in[15] - in[14])) << 1) ^ ((int32(in[15] - in[14])) >> 31))) >> 15 | + ((uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) << 16) + out[16] = + (uint32(((int32(in[16] - in[15])) << 1) ^ ((int32(in[16] - in[15])) >> 31))) >> 16 | + ((uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) << 15) + out[17] = + (uint32(((int32(in[17] - in[16])) << 1) ^ ((int32(in[17] - in[16])) >> 31))) >> 17 | + ((uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) << 14) + out[18] = + (uint32(((int32(in[18] - in[17])) << 1) ^ ((int32(in[18] - in[17])) >> 31))) >> 18 | + ((uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) << 13) + out[19] = + (uint32(((int32(in[19] - in[18])) << 1) ^ ((int32(in[19] - in[18])) >> 31))) >> 19 | + ((uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) << 12) + out[20] = + (uint32(((int32(in[20] - in[19])) << 1) ^ ((int32(in[20] - in[19])) >> 31))) >> 20 | + ((uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) << 11) + out[21] = + (uint32(((int32(in[21] - in[20])) << 1) ^ ((int32(in[21] - in[20])) >> 31))) >> 21 | + ((uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) << 10) + out[22] = + (uint32(((int32(in[22] - in[21])) << 1) ^ ((int32(in[22] - in[21])) >> 31))) >> 22 | + ((uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) << 9) + out[23] = + (uint32(((int32(in[23] - in[22])) << 1) ^ ((int32(in[23] - in[22])) >> 31))) >> 23 | + ((uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) << 8) + out[24] = + (uint32(((int32(in[24] - in[23])) << 1) ^ ((int32(in[24] - in[23])) >> 31))) >> 24 | + ((uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) << 7) + out[25] = + (uint32(((int32(in[25] - in[24])) << 1) ^ ((int32(in[25] - in[24])) >> 31))) >> 25 | + ((uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) << 6) + out[26] = + (uint32(((int32(in[26] - in[25])) << 1) ^ ((int32(in[26] - in[25])) >> 31))) >> 26 | + ((uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) << 5) + out[27] = + (uint32(((int32(in[27] - in[26])) << 1) ^ ((int32(in[27] - in[26])) >> 31))) >> 27 | + ((uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) << 4) + out[28] = + (uint32(((int32(in[28] - in[27])) << 1) ^ ((int32(in[28] - in[27])) >> 31))) >> 28 | + ((uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) << 3) + out[29] = + (uint32(((int32(in[29] - in[28])) << 1) ^ ((int32(in[29] - in[28])) >> 31))) >> 29 | + ((uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) << 2) + out[30] = + (uint32(((int32(in[30] - in[29])) << 1) ^ ((int32(in[30] - in[29])) >> 31))) >> 30 | + ((uint32(((int32(in[31] - in[30])) << 1) ^ ((int32(in[31] - in[30])) >> 31))) << 1) +} + +func deltaunpackzigzag_uint32_0(initoffset uint32, in *[0]uint32, out *[32]uint32) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset +} + +func deltaunpackzigzag_uint32_1(initoffset uint32, in *[1]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1)) & 1))^((int32((in[0] >> 0) & 0x1))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 1) & 0x1)) & 1))^((int32((in[0] >> 1) & 0x1))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 2) & 0x1)) & 1))^((int32((in[0] >> 2) & 0x1))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 3) & 0x1)) & 1))^((int32((in[0] >> 3) & 0x1))>>1))) + out[2] + out[4] = uint32(((-((int32((in[0] >> 4) & 0x1)) & 1))^((int32((in[0] >> 4) & 0x1))>>1))) + out[3] + out[5] = uint32(((-((int32((in[0] >> 5) & 0x1)) & 1))^((int32((in[0] >> 5) & 0x1))>>1))) + out[4] + out[6] = uint32(((-((int32((in[0] >> 6) & 0x1)) & 1))^((int32((in[0] >> 6) & 0x1))>>1))) + out[5] + out[7] = uint32(((-((int32((in[0] >> 7) & 0x1)) & 1))^((int32((in[0] >> 7) & 0x1))>>1))) + out[6] + out[8] = uint32(((-((int32((in[0] >> 8) & 0x1)) & 1))^((int32((in[0] >> 8) & 0x1))>>1))) + out[7] + out[9] = uint32(((-((int32((in[0] >> 9) & 0x1)) & 1))^((int32((in[0] >> 9) & 0x1))>>1))) + out[8] + out[10] = uint32(((-((int32((in[0] >> 10) & 0x1)) & 1))^((int32((in[0] >> 10) & 0x1))>>1))) + out[9] + out[11] = uint32(((-((int32((in[0] >> 11) & 0x1)) & 1))^((int32((in[0] >> 11) & 0x1))>>1))) + out[10] + out[12] = uint32(((-((int32((in[0] >> 12) & 0x1)) & 1))^((int32((in[0] >> 12) & 0x1))>>1))) + out[11] + out[13] = uint32(((-((int32((in[0] >> 13) & 0x1)) & 1))^((int32((in[0] >> 13) & 0x1))>>1))) + out[12] + out[14] = uint32(((-((int32((in[0] >> 14) & 0x1)) & 1))^((int32((in[0] >> 14) & 0x1))>>1))) + out[13] + out[15] = uint32(((-((int32((in[0] >> 15) & 0x1)) & 1))^((int32((in[0] >> 15) & 0x1))>>1))) + out[14] + out[16] = uint32(((-((int32((in[0] >> 16) & 0x1)) & 1))^((int32((in[0] >> 16) & 0x1))>>1))) + out[15] + out[17] = uint32(((-((int32((in[0] >> 17) & 0x1)) & 1))^((int32((in[0] >> 17) & 0x1))>>1))) + out[16] + out[18] = uint32(((-((int32((in[0] >> 18) & 0x1)) & 1))^((int32((in[0] >> 18) & 0x1))>>1))) + out[17] + out[19] = uint32(((-((int32((in[0] >> 19) & 0x1)) & 1))^((int32((in[0] >> 19) & 0x1))>>1))) + out[18] + out[20] = uint32(((-((int32((in[0] >> 20) & 0x1)) & 1))^((int32((in[0] >> 20) & 0x1))>>1))) + out[19] + out[21] = uint32(((-((int32((in[0] >> 21) & 0x1)) & 1))^((int32((in[0] >> 21) & 0x1))>>1))) + out[20] + out[22] = uint32(((-((int32((in[0] >> 22) & 0x1)) & 1))^((int32((in[0] >> 22) & 0x1))>>1))) + out[21] + out[23] = uint32(((-((int32((in[0] >> 23) & 0x1)) & 1))^((int32((in[0] >> 23) & 0x1))>>1))) + out[22] + out[24] = uint32(((-((int32((in[0] >> 24) & 0x1)) & 1))^((int32((in[0] >> 24) & 0x1))>>1))) + out[23] + out[25] = uint32(((-((int32((in[0] >> 25) & 0x1)) & 1))^((int32((in[0] >> 25) & 0x1))>>1))) + out[24] + out[26] = uint32(((-((int32((in[0] >> 26) & 0x1)) & 1))^((int32((in[0] >> 26) & 0x1))>>1))) + out[25] + out[27] = uint32(((-((int32((in[0] >> 27) & 0x1)) & 1))^((int32((in[0] >> 27) & 0x1))>>1))) + out[26] + out[28] = uint32(((-((int32((in[0] >> 28) & 0x1)) & 1))^((int32((in[0] >> 28) & 0x1))>>1))) + out[27] + out[29] = uint32(((-((int32((in[0] >> 29) & 0x1)) & 1))^((int32((in[0] >> 29) & 0x1))>>1))) + out[28] + out[30] = uint32(((-((int32((in[0] >> 30) & 0x1)) & 1))^((int32((in[0] >> 30) & 0x1))>>1))) + out[29] + out[31] = uint32(((-((int32((in[0] >> 31))) & 1))^((int32((in[0] >> 31)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_2(initoffset uint32, in *[2]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3)) & 1))^((int32((in[0] >> 0) & 0x3))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 2) & 0x3)) & 1))^((int32((in[0] >> 2) & 0x3))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 4) & 0x3)) & 1))^((int32((in[0] >> 4) & 0x3))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 6) & 0x3)) & 1))^((int32((in[0] >> 6) & 0x3))>>1))) + out[2] + out[4] = uint32(((-((int32((in[0] >> 8) & 0x3)) & 1))^((int32((in[0] >> 8) & 0x3))>>1))) + out[3] + out[5] = uint32(((-((int32((in[0] >> 10) & 0x3)) & 1))^((int32((in[0] >> 10) & 0x3))>>1))) + out[4] + out[6] = uint32(((-((int32((in[0] >> 12) & 0x3)) & 1))^((int32((in[0] >> 12) & 0x3))>>1))) + out[5] + out[7] = uint32(((-((int32((in[0] >> 14) & 0x3)) & 1))^((int32((in[0] >> 14) & 0x3))>>1))) + out[6] + out[8] = uint32(((-((int32((in[0] >> 16) & 0x3)) & 1))^((int32((in[0] >> 16) & 0x3))>>1))) + out[7] + out[9] = uint32(((-((int32((in[0] >> 18) & 0x3)) & 1))^((int32((in[0] >> 18) & 0x3))>>1))) + out[8] + out[10] = uint32(((-((int32((in[0] >> 20) & 0x3)) & 1))^((int32((in[0] >> 20) & 0x3))>>1))) + out[9] + out[11] = uint32(((-((int32((in[0] >> 22) & 0x3)) & 1))^((int32((in[0] >> 22) & 0x3))>>1))) + out[10] + out[12] = uint32(((-((int32((in[0] >> 24) & 0x3)) & 1))^((int32((in[0] >> 24) & 0x3))>>1))) + out[11] + out[13] = uint32(((-((int32((in[0] >> 26) & 0x3)) & 1))^((int32((in[0] >> 26) & 0x3))>>1))) + out[12] + out[14] = uint32(((-((int32((in[0] >> 28) & 0x3)) & 1))^((int32((in[0] >> 28) & 0x3))>>1))) + out[13] + out[15] = uint32(((-((int32((in[0] >> 30))) & 1))^((int32((in[0] >> 30)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[1] >> 0) & 0x3)) & 1))^((int32((in[1] >> 0) & 0x3))>>1))) + out[15] + out[17] = uint32(((-((int32((in[1] >> 2) & 0x3)) & 1))^((int32((in[1] >> 2) & 0x3))>>1))) + out[16] + out[18] = uint32(((-((int32((in[1] >> 4) & 0x3)) & 1))^((int32((in[1] >> 4) & 0x3))>>1))) + out[17] + out[19] = uint32(((-((int32((in[1] >> 6) & 0x3)) & 1))^((int32((in[1] >> 6) & 0x3))>>1))) + out[18] + out[20] = uint32(((-((int32((in[1] >> 8) & 0x3)) & 1))^((int32((in[1] >> 8) & 0x3))>>1))) + out[19] + out[21] = uint32(((-((int32((in[1] >> 10) & 0x3)) & 1))^((int32((in[1] >> 10) & 0x3))>>1))) + out[20] + out[22] = uint32(((-((int32((in[1] >> 12) & 0x3)) & 1))^((int32((in[1] >> 12) & 0x3))>>1))) + out[21] + out[23] = uint32(((-((int32((in[1] >> 14) & 0x3)) & 1))^((int32((in[1] >> 14) & 0x3))>>1))) + out[22] + out[24] = uint32(((-((int32((in[1] >> 16) & 0x3)) & 1))^((int32((in[1] >> 16) & 0x3))>>1))) + out[23] + out[25] = uint32(((-((int32((in[1] >> 18) & 0x3)) & 1))^((int32((in[1] >> 18) & 0x3))>>1))) + out[24] + out[26] = uint32(((-((int32((in[1] >> 20) & 0x3)) & 1))^((int32((in[1] >> 20) & 0x3))>>1))) + out[25] + out[27] = uint32(((-((int32((in[1] >> 22) & 0x3)) & 1))^((int32((in[1] >> 22) & 0x3))>>1))) + out[26] + out[28] = uint32(((-((int32((in[1] >> 24) & 0x3)) & 1))^((int32((in[1] >> 24) & 0x3))>>1))) + out[27] + out[29] = uint32(((-((int32((in[1] >> 26) & 0x3)) & 1))^((int32((in[1] >> 26) & 0x3))>>1))) + out[28] + out[30] = uint32(((-((int32((in[1] >> 28) & 0x3)) & 1))^((int32((in[1] >> 28) & 0x3))>>1))) + out[29] + out[31] = uint32(((-((int32((in[1] >> 30))) & 1))^((int32((in[1] >> 30)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_3(initoffset uint32, in *[3]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7)) & 1))^((int32((in[0] >> 0) & 0x7))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 3) & 0x7)) & 1))^((int32((in[0] >> 3) & 0x7))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 6) & 0x7)) & 1))^((int32((in[0] >> 6) & 0x7))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 9) & 0x7)) & 1))^((int32((in[0] >> 9) & 0x7))>>1))) + out[2] + out[4] = uint32(((-((int32((in[0] >> 12) & 0x7)) & 1))^((int32((in[0] >> 12) & 0x7))>>1))) + out[3] + out[5] = uint32(((-((int32((in[0] >> 15) & 0x7)) & 1))^((int32((in[0] >> 15) & 0x7))>>1))) + out[4] + out[6] = uint32(((-((int32((in[0] >> 18) & 0x7)) & 1))^((int32((in[0] >> 18) & 0x7))>>1))) + out[5] + out[7] = uint32(((-((int32((in[0] >> 21) & 0x7)) & 1))^((int32((in[0] >> 21) & 0x7))>>1))) + out[6] + out[8] = uint32(((-((int32((in[0] >> 24) & 0x7)) & 1))^((int32((in[0] >> 24) & 0x7))>>1))) + out[7] + out[9] = uint32(((-((int32((in[0] >> 27) & 0x7)) & 1))^((int32((in[0] >> 27) & 0x7))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[0] >> 30) | ((in[1] & 0x1) << 2)))) & 1))^((int32(((in[0] >> 30) | ((in[1] & 0x1) << 2))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[1] >> 1) & 0x7)) & 1))^((int32((in[1] >> 1) & 0x7))>>1))) + out[10] + out[12] = uint32(((-((int32((in[1] >> 4) & 0x7)) & 1))^((int32((in[1] >> 4) & 0x7))>>1))) + out[11] + out[13] = uint32(((-((int32((in[1] >> 7) & 0x7)) & 1))^((int32((in[1] >> 7) & 0x7))>>1))) + out[12] + out[14] = uint32(((-((int32((in[1] >> 10) & 0x7)) & 1))^((int32((in[1] >> 10) & 0x7))>>1))) + out[13] + out[15] = uint32(((-((int32((in[1] >> 13) & 0x7)) & 1))^((int32((in[1] >> 13) & 0x7))>>1))) + out[14] + out[16] = uint32(((-((int32((in[1] >> 16) & 0x7)) & 1))^((int32((in[1] >> 16) & 0x7))>>1))) + out[15] + out[17] = uint32(((-((int32((in[1] >> 19) & 0x7)) & 1))^((int32((in[1] >> 19) & 0x7))>>1))) + out[16] + out[18] = uint32(((-((int32((in[1] >> 22) & 0x7)) & 1))^((int32((in[1] >> 22) & 0x7))>>1))) + out[17] + out[19] = uint32(((-((int32((in[1] >> 25) & 0x7)) & 1))^((int32((in[1] >> 25) & 0x7))>>1))) + out[18] + out[20] = uint32(((-((int32((in[1] >> 28) & 0x7)) & 1))^((int32((in[1] >> 28) & 0x7))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[1] >> 31) | ((in[2] & 0x3) << 1)))) & 1))^((int32(((in[1] >> 31) | ((in[2] & 0x3) << 1))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[2] >> 2) & 0x7)) & 1))^((int32((in[2] >> 2) & 0x7))>>1))) + out[21] + out[23] = uint32(((-((int32((in[2] >> 5) & 0x7)) & 1))^((int32((in[2] >> 5) & 0x7))>>1))) + out[22] + out[24] = uint32(((-((int32((in[2] >> 8) & 0x7)) & 1))^((int32((in[2] >> 8) & 0x7))>>1))) + out[23] + out[25] = uint32(((-((int32((in[2] >> 11) & 0x7)) & 1))^((int32((in[2] >> 11) & 0x7))>>1))) + out[24] + out[26] = uint32(((-((int32((in[2] >> 14) & 0x7)) & 1))^((int32((in[2] >> 14) & 0x7))>>1))) + out[25] + out[27] = uint32(((-((int32((in[2] >> 17) & 0x7)) & 1))^((int32((in[2] >> 17) & 0x7))>>1))) + out[26] + out[28] = uint32(((-((int32((in[2] >> 20) & 0x7)) & 1))^((int32((in[2] >> 20) & 0x7))>>1))) + out[27] + out[29] = uint32(((-((int32((in[2] >> 23) & 0x7)) & 1))^((int32((in[2] >> 23) & 0x7))>>1))) + out[28] + out[30] = uint32(((-((int32((in[2] >> 26) & 0x7)) & 1))^((int32((in[2] >> 26) & 0x7))>>1))) + out[29] + out[31] = uint32(((-((int32((in[2] >> 29))) & 1))^((int32((in[2] >> 29)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_4(initoffset uint32, in *[4]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0xF)) & 1))^((int32((in[0] >> 0) & 0xF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 4) & 0xF)) & 1))^((int32((in[0] >> 4) & 0xF))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 8) & 0xF)) & 1))^((int32((in[0] >> 8) & 0xF))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 12) & 0xF)) & 1))^((int32((in[0] >> 12) & 0xF))>>1))) + out[2] + out[4] = uint32(((-((int32((in[0] >> 16) & 0xF)) & 1))^((int32((in[0] >> 16) & 0xF))>>1))) + out[3] + out[5] = uint32(((-((int32((in[0] >> 20) & 0xF)) & 1))^((int32((in[0] >> 20) & 0xF))>>1))) + out[4] + out[6] = uint32(((-((int32((in[0] >> 24) & 0xF)) & 1))^((int32((in[0] >> 24) & 0xF))>>1))) + out[5] + out[7] = uint32(((-((int32((in[0] >> 28))) & 1))^((int32((in[0] >> 28)))>>1))) + out[6] + out[8] = uint32(((-((int32((in[1] >> 0) & 0xF)) & 1))^((int32((in[1] >> 0) & 0xF))>>1))) + out[7] + out[9] = uint32(((-((int32((in[1] >> 4) & 0xF)) & 1))^((int32((in[1] >> 4) & 0xF))>>1))) + out[8] + out[10] = uint32(((-((int32((in[1] >> 8) & 0xF)) & 1))^((int32((in[1] >> 8) & 0xF))>>1))) + out[9] + out[11] = uint32(((-((int32((in[1] >> 12) & 0xF)) & 1))^((int32((in[1] >> 12) & 0xF))>>1))) + out[10] + out[12] = uint32(((-((int32((in[1] >> 16) & 0xF)) & 1))^((int32((in[1] >> 16) & 0xF))>>1))) + out[11] + out[13] = uint32(((-((int32((in[1] >> 20) & 0xF)) & 1))^((int32((in[1] >> 20) & 0xF))>>1))) + out[12] + out[14] = uint32(((-((int32((in[1] >> 24) & 0xF)) & 1))^((int32((in[1] >> 24) & 0xF))>>1))) + out[13] + out[15] = uint32(((-((int32((in[1] >> 28))) & 1))^((int32((in[1] >> 28)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[2] >> 0) & 0xF)) & 1))^((int32((in[2] >> 0) & 0xF))>>1))) + out[15] + out[17] = uint32(((-((int32((in[2] >> 4) & 0xF)) & 1))^((int32((in[2] >> 4) & 0xF))>>1))) + out[16] + out[18] = uint32(((-((int32((in[2] >> 8) & 0xF)) & 1))^((int32((in[2] >> 8) & 0xF))>>1))) + out[17] + out[19] = uint32(((-((int32((in[2] >> 12) & 0xF)) & 1))^((int32((in[2] >> 12) & 0xF))>>1))) + out[18] + out[20] = uint32(((-((int32((in[2] >> 16) & 0xF)) & 1))^((int32((in[2] >> 16) & 0xF))>>1))) + out[19] + out[21] = uint32(((-((int32((in[2] >> 20) & 0xF)) & 1))^((int32((in[2] >> 20) & 0xF))>>1))) + out[20] + out[22] = uint32(((-((int32((in[2] >> 24) & 0xF)) & 1))^((int32((in[2] >> 24) & 0xF))>>1))) + out[21] + out[23] = uint32(((-((int32((in[2] >> 28))) & 1))^((int32((in[2] >> 28)))>>1))) + out[22] + out[24] = uint32(((-((int32((in[3] >> 0) & 0xF)) & 1))^((int32((in[3] >> 0) & 0xF))>>1))) + out[23] + out[25] = uint32(((-((int32((in[3] >> 4) & 0xF)) & 1))^((int32((in[3] >> 4) & 0xF))>>1))) + out[24] + out[26] = uint32(((-((int32((in[3] >> 8) & 0xF)) & 1))^((int32((in[3] >> 8) & 0xF))>>1))) + out[25] + out[27] = uint32(((-((int32((in[3] >> 12) & 0xF)) & 1))^((int32((in[3] >> 12) & 0xF))>>1))) + out[26] + out[28] = uint32(((-((int32((in[3] >> 16) & 0xF)) & 1))^((int32((in[3] >> 16) & 0xF))>>1))) + out[27] + out[29] = uint32(((-((int32((in[3] >> 20) & 0xF)) & 1))^((int32((in[3] >> 20) & 0xF))>>1))) + out[28] + out[30] = uint32(((-((int32((in[3] >> 24) & 0xF)) & 1))^((int32((in[3] >> 24) & 0xF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[3] >> 28))) & 1))^((int32((in[3] >> 28)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_5(initoffset uint32, in *[5]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1F)) & 1))^((int32((in[0] >> 0) & 0x1F))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 5) & 0x1F)) & 1))^((int32((in[0] >> 5) & 0x1F))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 10) & 0x1F)) & 1))^((int32((in[0] >> 10) & 0x1F))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 15) & 0x1F)) & 1))^((int32((in[0] >> 15) & 0x1F))>>1))) + out[2] + out[4] = uint32(((-((int32((in[0] >> 20) & 0x1F)) & 1))^((int32((in[0] >> 20) & 0x1F))>>1))) + out[3] + out[5] = uint32(((-((int32((in[0] >> 25) & 0x1F)) & 1))^((int32((in[0] >> 25) & 0x1F))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[0] >> 30) | ((in[1] & 0x7) << 2)))) & 1))^((int32(((in[0] >> 30) | ((in[1] & 0x7) << 2))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[1] >> 3) & 0x1F)) & 1))^((int32((in[1] >> 3) & 0x1F))>>1))) + out[6] + out[8] = uint32(((-((int32((in[1] >> 8) & 0x1F)) & 1))^((int32((in[1] >> 8) & 0x1F))>>1))) + out[7] + out[9] = uint32(((-((int32((in[1] >> 13) & 0x1F)) & 1))^((int32((in[1] >> 13) & 0x1F))>>1))) + out[8] + out[10] = uint32(((-((int32((in[1] >> 18) & 0x1F)) & 1))^((int32((in[1] >> 18) & 0x1F))>>1))) + out[9] + out[11] = uint32(((-((int32((in[1] >> 23) & 0x1F)) & 1))^((int32((in[1] >> 23) & 0x1F))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[1] >> 28) | ((in[2] & 0x1) << 4)))) & 1))^((int32(((in[1] >> 28) | ((in[2] & 0x1) << 4))))>>1))) + out[11] + out[13] = uint32(((-((int32((in[2] >> 1) & 0x1F)) & 1))^((int32((in[2] >> 1) & 0x1F))>>1))) + out[12] + out[14] = uint32(((-((int32((in[2] >> 6) & 0x1F)) & 1))^((int32((in[2] >> 6) & 0x1F))>>1))) + out[13] + out[15] = uint32(((-((int32((in[2] >> 11) & 0x1F)) & 1))^((int32((in[2] >> 11) & 0x1F))>>1))) + out[14] + out[16] = uint32(((-((int32((in[2] >> 16) & 0x1F)) & 1))^((int32((in[2] >> 16) & 0x1F))>>1))) + out[15] + out[17] = uint32(((-((int32((in[2] >> 21) & 0x1F)) & 1))^((int32((in[2] >> 21) & 0x1F))>>1))) + out[16] + out[18] = uint32(((-((int32((in[2] >> 26) & 0x1F)) & 1))^((int32((in[2] >> 26) & 0x1F))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[2] >> 31) | ((in[3] & 0xF) << 1)))) & 1))^((int32(((in[2] >> 31) | ((in[3] & 0xF) << 1))))>>1))) + out[18] + out[20] = uint32(((-((int32((in[3] >> 4) & 0x1F)) & 1))^((int32((in[3] >> 4) & 0x1F))>>1))) + out[19] + out[21] = uint32(((-((int32((in[3] >> 9) & 0x1F)) & 1))^((int32((in[3] >> 9) & 0x1F))>>1))) + out[20] + out[22] = uint32(((-((int32((in[3] >> 14) & 0x1F)) & 1))^((int32((in[3] >> 14) & 0x1F))>>1))) + out[21] + out[23] = uint32(((-((int32((in[3] >> 19) & 0x1F)) & 1))^((int32((in[3] >> 19) & 0x1F))>>1))) + out[22] + out[24] = uint32(((-((int32((in[3] >> 24) & 0x1F)) & 1))^((int32((in[3] >> 24) & 0x1F))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[3] >> 29) | ((in[4] & 0x3) << 3)))) & 1))^((int32(((in[3] >> 29) | ((in[4] & 0x3) << 3))))>>1))) + out[24] + out[26] = uint32(((-((int32((in[4] >> 2) & 0x1F)) & 1))^((int32((in[4] >> 2) & 0x1F))>>1))) + out[25] + out[27] = uint32(((-((int32((in[4] >> 7) & 0x1F)) & 1))^((int32((in[4] >> 7) & 0x1F))>>1))) + out[26] + out[28] = uint32(((-((int32((in[4] >> 12) & 0x1F)) & 1))^((int32((in[4] >> 12) & 0x1F))>>1))) + out[27] + out[29] = uint32(((-((int32((in[4] >> 17) & 0x1F)) & 1))^((int32((in[4] >> 17) & 0x1F))>>1))) + out[28] + out[30] = uint32(((-((int32((in[4] >> 22) & 0x1F)) & 1))^((int32((in[4] >> 22) & 0x1F))>>1))) + out[29] + out[31] = uint32(((-((int32((in[4] >> 27))) & 1))^((int32((in[4] >> 27)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_6(initoffset uint32, in *[6]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3F)) & 1))^((int32((in[0] >> 0) & 0x3F))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 6) & 0x3F)) & 1))^((int32((in[0] >> 6) & 0x3F))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 12) & 0x3F)) & 1))^((int32((in[0] >> 12) & 0x3F))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 18) & 0x3F)) & 1))^((int32((in[0] >> 18) & 0x3F))>>1))) + out[2] + out[4] = uint32(((-((int32((in[0] >> 24) & 0x3F)) & 1))^((int32((in[0] >> 24) & 0x3F))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[0] >> 30) | ((in[1] & 0xF) << 2)))) & 1))^((int32(((in[0] >> 30) | ((in[1] & 0xF) << 2))))>>1))) + out[4] + out[6] = uint32(((-((int32((in[1] >> 4) & 0x3F)) & 1))^((int32((in[1] >> 4) & 0x3F))>>1))) + out[5] + out[7] = uint32(((-((int32((in[1] >> 10) & 0x3F)) & 1))^((int32((in[1] >> 10) & 0x3F))>>1))) + out[6] + out[8] = uint32(((-((int32((in[1] >> 16) & 0x3F)) & 1))^((int32((in[1] >> 16) & 0x3F))>>1))) + out[7] + out[9] = uint32(((-((int32((in[1] >> 22) & 0x3F)) & 1))^((int32((in[1] >> 22) & 0x3F))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[1] >> 28) | ((in[2] & 0x3) << 4)))) & 1))^((int32(((in[1] >> 28) | ((in[2] & 0x3) << 4))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[2] >> 2) & 0x3F)) & 1))^((int32((in[2] >> 2) & 0x3F))>>1))) + out[10] + out[12] = uint32(((-((int32((in[2] >> 8) & 0x3F)) & 1))^((int32((in[2] >> 8) & 0x3F))>>1))) + out[11] + out[13] = uint32(((-((int32((in[2] >> 14) & 0x3F)) & 1))^((int32((in[2] >> 14) & 0x3F))>>1))) + out[12] + out[14] = uint32(((-((int32((in[2] >> 20) & 0x3F)) & 1))^((int32((in[2] >> 20) & 0x3F))>>1))) + out[13] + out[15] = uint32(((-((int32((in[2] >> 26))) & 1))^((int32((in[2] >> 26)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[3] >> 0) & 0x3F)) & 1))^((int32((in[3] >> 0) & 0x3F))>>1))) + out[15] + out[17] = uint32(((-((int32((in[3] >> 6) & 0x3F)) & 1))^((int32((in[3] >> 6) & 0x3F))>>1))) + out[16] + out[18] = uint32(((-((int32((in[3] >> 12) & 0x3F)) & 1))^((int32((in[3] >> 12) & 0x3F))>>1))) + out[17] + out[19] = uint32(((-((int32((in[3] >> 18) & 0x3F)) & 1))^((int32((in[3] >> 18) & 0x3F))>>1))) + out[18] + out[20] = uint32(((-((int32((in[3] >> 24) & 0x3F)) & 1))^((int32((in[3] >> 24) & 0x3F))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[3] >> 30) | ((in[4] & 0xF) << 2)))) & 1))^((int32(((in[3] >> 30) | ((in[4] & 0xF) << 2))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[4] >> 4) & 0x3F)) & 1))^((int32((in[4] >> 4) & 0x3F))>>1))) + out[21] + out[23] = uint32(((-((int32((in[4] >> 10) & 0x3F)) & 1))^((int32((in[4] >> 10) & 0x3F))>>1))) + out[22] + out[24] = uint32(((-((int32((in[4] >> 16) & 0x3F)) & 1))^((int32((in[4] >> 16) & 0x3F))>>1))) + out[23] + out[25] = uint32(((-((int32((in[4] >> 22) & 0x3F)) & 1))^((int32((in[4] >> 22) & 0x3F))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[4] >> 28) | ((in[5] & 0x3) << 4)))) & 1))^((int32(((in[4] >> 28) | ((in[5] & 0x3) << 4))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[5] >> 2) & 0x3F)) & 1))^((int32((in[5] >> 2) & 0x3F))>>1))) + out[26] + out[28] = uint32(((-((int32((in[5] >> 8) & 0x3F)) & 1))^((int32((in[5] >> 8) & 0x3F))>>1))) + out[27] + out[29] = uint32(((-((int32((in[5] >> 14) & 0x3F)) & 1))^((int32((in[5] >> 14) & 0x3F))>>1))) + out[28] + out[30] = uint32(((-((int32((in[5] >> 20) & 0x3F)) & 1))^((int32((in[5] >> 20) & 0x3F))>>1))) + out[29] + out[31] = uint32(((-((int32((in[5] >> 26))) & 1))^((int32((in[5] >> 26)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_7(initoffset uint32, in *[7]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7F)) & 1))^((int32((in[0] >> 0) & 0x7F))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 7) & 0x7F)) & 1))^((int32((in[0] >> 7) & 0x7F))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 14) & 0x7F)) & 1))^((int32((in[0] >> 14) & 0x7F))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 21) & 0x7F)) & 1))^((int32((in[0] >> 21) & 0x7F))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[0] >> 28) | ((in[1] & 0x7) << 4)))) & 1))^((int32(((in[0] >> 28) | ((in[1] & 0x7) << 4))))>>1))) + out[3] + out[5] = uint32(((-((int32((in[1] >> 3) & 0x7F)) & 1))^((int32((in[1] >> 3) & 0x7F))>>1))) + out[4] + out[6] = uint32(((-((int32((in[1] >> 10) & 0x7F)) & 1))^((int32((in[1] >> 10) & 0x7F))>>1))) + out[5] + out[7] = uint32(((-((int32((in[1] >> 17) & 0x7F)) & 1))^((int32((in[1] >> 17) & 0x7F))>>1))) + out[6] + out[8] = uint32(((-((int32((in[1] >> 24) & 0x7F)) & 1))^((int32((in[1] >> 24) & 0x7F))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[1] >> 31) | ((in[2] & 0x3F) << 1)))) & 1))^((int32(((in[1] >> 31) | ((in[2] & 0x3F) << 1))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[2] >> 6) & 0x7F)) & 1))^((int32((in[2] >> 6) & 0x7F))>>1))) + out[9] + out[11] = uint32(((-((int32((in[2] >> 13) & 0x7F)) & 1))^((int32((in[2] >> 13) & 0x7F))>>1))) + out[10] + out[12] = uint32(((-((int32((in[2] >> 20) & 0x7F)) & 1))^((int32((in[2] >> 20) & 0x7F))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[2] >> 27) | ((in[3] & 0x3) << 5)))) & 1))^((int32(((in[2] >> 27) | ((in[3] & 0x3) << 5))))>>1))) + out[12] + out[14] = uint32(((-((int32((in[3] >> 2) & 0x7F)) & 1))^((int32((in[3] >> 2) & 0x7F))>>1))) + out[13] + out[15] = uint32(((-((int32((in[3] >> 9) & 0x7F)) & 1))^((int32((in[3] >> 9) & 0x7F))>>1))) + out[14] + out[16] = uint32(((-((int32((in[3] >> 16) & 0x7F)) & 1))^((int32((in[3] >> 16) & 0x7F))>>1))) + out[15] + out[17] = uint32(((-((int32((in[3] >> 23) & 0x7F)) & 1))^((int32((in[3] >> 23) & 0x7F))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[3] >> 30) | ((in[4] & 0x1F) << 2)))) & 1))^((int32(((in[3] >> 30) | ((in[4] & 0x1F) << 2))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[4] >> 5) & 0x7F)) & 1))^((int32((in[4] >> 5) & 0x7F))>>1))) + out[18] + out[20] = uint32(((-((int32((in[4] >> 12) & 0x7F)) & 1))^((int32((in[4] >> 12) & 0x7F))>>1))) + out[19] + out[21] = uint32(((-((int32((in[4] >> 19) & 0x7F)) & 1))^((int32((in[4] >> 19) & 0x7F))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[4] >> 26) | ((in[5] & 0x1) << 6)))) & 1))^((int32(((in[4] >> 26) | ((in[5] & 0x1) << 6))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[5] >> 1) & 0x7F)) & 1))^((int32((in[5] >> 1) & 0x7F))>>1))) + out[22] + out[24] = uint32(((-((int32((in[5] >> 8) & 0x7F)) & 1))^((int32((in[5] >> 8) & 0x7F))>>1))) + out[23] + out[25] = uint32(((-((int32((in[5] >> 15) & 0x7F)) & 1))^((int32((in[5] >> 15) & 0x7F))>>1))) + out[24] + out[26] = uint32(((-((int32((in[5] >> 22) & 0x7F)) & 1))^((int32((in[5] >> 22) & 0x7F))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[5] >> 29) | ((in[6] & 0xF) << 3)))) & 1))^((int32(((in[5] >> 29) | ((in[6] & 0xF) << 3))))>>1))) + out[26] + out[28] = uint32(((-((int32((in[6] >> 4) & 0x7F)) & 1))^((int32((in[6] >> 4) & 0x7F))>>1))) + out[27] + out[29] = uint32(((-((int32((in[6] >> 11) & 0x7F)) & 1))^((int32((in[6] >> 11) & 0x7F))>>1))) + out[28] + out[30] = uint32(((-((int32((in[6] >> 18) & 0x7F)) & 1))^((int32((in[6] >> 18) & 0x7F))>>1))) + out[29] + out[31] = uint32(((-((int32((in[6] >> 25))) & 1))^((int32((in[6] >> 25)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_8(initoffset uint32, in *[8]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0xFF)) & 1))^((int32((in[0] >> 0) & 0xFF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 8) & 0xFF)) & 1))^((int32((in[0] >> 8) & 0xFF))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 16) & 0xFF)) & 1))^((int32((in[0] >> 16) & 0xFF))>>1))) + out[1] + out[3] = uint32(((-((int32((in[0] >> 24))) & 1))^((int32((in[0] >> 24)))>>1))) + out[2] + out[4] = uint32(((-((int32((in[1] >> 0) & 0xFF)) & 1))^((int32((in[1] >> 0) & 0xFF))>>1))) + out[3] + out[5] = uint32(((-((int32((in[1] >> 8) & 0xFF)) & 1))^((int32((in[1] >> 8) & 0xFF))>>1))) + out[4] + out[6] = uint32(((-((int32((in[1] >> 16) & 0xFF)) & 1))^((int32((in[1] >> 16) & 0xFF))>>1))) + out[5] + out[7] = uint32(((-((int32((in[1] >> 24))) & 1))^((int32((in[1] >> 24)))>>1))) + out[6] + out[8] = uint32(((-((int32((in[2] >> 0) & 0xFF)) & 1))^((int32((in[2] >> 0) & 0xFF))>>1))) + out[7] + out[9] = uint32(((-((int32((in[2] >> 8) & 0xFF)) & 1))^((int32((in[2] >> 8) & 0xFF))>>1))) + out[8] + out[10] = uint32(((-((int32((in[2] >> 16) & 0xFF)) & 1))^((int32((in[2] >> 16) & 0xFF))>>1))) + out[9] + out[11] = uint32(((-((int32((in[2] >> 24))) & 1))^((int32((in[2] >> 24)))>>1))) + out[10] + out[12] = uint32(((-((int32((in[3] >> 0) & 0xFF)) & 1))^((int32((in[3] >> 0) & 0xFF))>>1))) + out[11] + out[13] = uint32(((-((int32((in[3] >> 8) & 0xFF)) & 1))^((int32((in[3] >> 8) & 0xFF))>>1))) + out[12] + out[14] = uint32(((-((int32((in[3] >> 16) & 0xFF)) & 1))^((int32((in[3] >> 16) & 0xFF))>>1))) + out[13] + out[15] = uint32(((-((int32((in[3] >> 24))) & 1))^((int32((in[3] >> 24)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[4] >> 0) & 0xFF)) & 1))^((int32((in[4] >> 0) & 0xFF))>>1))) + out[15] + out[17] = uint32(((-((int32((in[4] >> 8) & 0xFF)) & 1))^((int32((in[4] >> 8) & 0xFF))>>1))) + out[16] + out[18] = uint32(((-((int32((in[4] >> 16) & 0xFF)) & 1))^((int32((in[4] >> 16) & 0xFF))>>1))) + out[17] + out[19] = uint32(((-((int32((in[4] >> 24))) & 1))^((int32((in[4] >> 24)))>>1))) + out[18] + out[20] = uint32(((-((int32((in[5] >> 0) & 0xFF)) & 1))^((int32((in[5] >> 0) & 0xFF))>>1))) + out[19] + out[21] = uint32(((-((int32((in[5] >> 8) & 0xFF)) & 1))^((int32((in[5] >> 8) & 0xFF))>>1))) + out[20] + out[22] = uint32(((-((int32((in[5] >> 16) & 0xFF)) & 1))^((int32((in[5] >> 16) & 0xFF))>>1))) + out[21] + out[23] = uint32(((-((int32((in[5] >> 24))) & 1))^((int32((in[5] >> 24)))>>1))) + out[22] + out[24] = uint32(((-((int32((in[6] >> 0) & 0xFF)) & 1))^((int32((in[6] >> 0) & 0xFF))>>1))) + out[23] + out[25] = uint32(((-((int32((in[6] >> 8) & 0xFF)) & 1))^((int32((in[6] >> 8) & 0xFF))>>1))) + out[24] + out[26] = uint32(((-((int32((in[6] >> 16) & 0xFF)) & 1))^((int32((in[6] >> 16) & 0xFF))>>1))) + out[25] + out[27] = uint32(((-((int32((in[6] >> 24))) & 1))^((int32((in[6] >> 24)))>>1))) + out[26] + out[28] = uint32(((-((int32((in[7] >> 0) & 0xFF)) & 1))^((int32((in[7] >> 0) & 0xFF))>>1))) + out[27] + out[29] = uint32(((-((int32((in[7] >> 8) & 0xFF)) & 1))^((int32((in[7] >> 8) & 0xFF))>>1))) + out[28] + out[30] = uint32(((-((int32((in[7] >> 16) & 0xFF)) & 1))^((int32((in[7] >> 16) & 0xFF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[7] >> 24))) & 1))^((int32((in[7] >> 24)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_9(initoffset uint32, in *[9]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1FF)) & 1))^((int32((in[0] >> 0) & 0x1FF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 9) & 0x1FF)) & 1))^((int32((in[0] >> 9) & 0x1FF))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 18) & 0x1FF)) & 1))^((int32((in[0] >> 18) & 0x1FF))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[0] >> 27) | ((in[1] & 0xF) << 5)))) & 1))^((int32(((in[0] >> 27) | ((in[1] & 0xF) << 5))))>>1))) + out[2] + out[4] = uint32(((-((int32((in[1] >> 4) & 0x1FF)) & 1))^((int32((in[1] >> 4) & 0x1FF))>>1))) + out[3] + out[5] = uint32(((-((int32((in[1] >> 13) & 0x1FF)) & 1))^((int32((in[1] >> 13) & 0x1FF))>>1))) + out[4] + out[6] = uint32(((-((int32((in[1] >> 22) & 0x1FF)) & 1))^((int32((in[1] >> 22) & 0x1FF))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[1] >> 31) | ((in[2] & 0xFF) << 1)))) & 1))^((int32(((in[1] >> 31) | ((in[2] & 0xFF) << 1))))>>1))) + out[6] + out[8] = uint32(((-((int32((in[2] >> 8) & 0x1FF)) & 1))^((int32((in[2] >> 8) & 0x1FF))>>1))) + out[7] + out[9] = uint32(((-((int32((in[2] >> 17) & 0x1FF)) & 1))^((int32((in[2] >> 17) & 0x1FF))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[2] >> 26) | ((in[3] & 0x7) << 6)))) & 1))^((int32(((in[2] >> 26) | ((in[3] & 0x7) << 6))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[3] >> 3) & 0x1FF)) & 1))^((int32((in[3] >> 3) & 0x1FF))>>1))) + out[10] + out[12] = uint32(((-((int32((in[3] >> 12) & 0x1FF)) & 1))^((int32((in[3] >> 12) & 0x1FF))>>1))) + out[11] + out[13] = uint32(((-((int32((in[3] >> 21) & 0x1FF)) & 1))^((int32((in[3] >> 21) & 0x1FF))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[3] >> 30) | ((in[4] & 0x7F) << 2)))) & 1))^((int32(((in[3] >> 30) | ((in[4] & 0x7F) << 2))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[4] >> 7) & 0x1FF)) & 1))^((int32((in[4] >> 7) & 0x1FF))>>1))) + out[14] + out[16] = uint32(((-((int32((in[4] >> 16) & 0x1FF)) & 1))^((int32((in[4] >> 16) & 0x1FF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[4] >> 25) | ((in[5] & 0x3) << 7)))) & 1))^((int32(((in[4] >> 25) | ((in[5] & 0x3) << 7))))>>1))) + out[16] + out[18] = uint32(((-((int32((in[5] >> 2) & 0x1FF)) & 1))^((int32((in[5] >> 2) & 0x1FF))>>1))) + out[17] + out[19] = uint32(((-((int32((in[5] >> 11) & 0x1FF)) & 1))^((int32((in[5] >> 11) & 0x1FF))>>1))) + out[18] + out[20] = uint32(((-((int32((in[5] >> 20) & 0x1FF)) & 1))^((int32((in[5] >> 20) & 0x1FF))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[5] >> 29) | ((in[6] & 0x3F) << 3)))) & 1))^((int32(((in[5] >> 29) | ((in[6] & 0x3F) << 3))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[6] >> 6) & 0x1FF)) & 1))^((int32((in[6] >> 6) & 0x1FF))>>1))) + out[21] + out[23] = uint32(((-((int32((in[6] >> 15) & 0x1FF)) & 1))^((int32((in[6] >> 15) & 0x1FF))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[6] >> 24) | ((in[7] & 0x1) << 8)))) & 1))^((int32(((in[6] >> 24) | ((in[7] & 0x1) << 8))))>>1))) + out[23] + out[25] = uint32(((-((int32((in[7] >> 1) & 0x1FF)) & 1))^((int32((in[7] >> 1) & 0x1FF))>>1))) + out[24] + out[26] = uint32(((-((int32((in[7] >> 10) & 0x1FF)) & 1))^((int32((in[7] >> 10) & 0x1FF))>>1))) + out[25] + out[27] = uint32(((-((int32((in[7] >> 19) & 0x1FF)) & 1))^((int32((in[7] >> 19) & 0x1FF))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[7] >> 28) | ((in[8] & 0x1F) << 4)))) & 1))^((int32(((in[7] >> 28) | ((in[8] & 0x1F) << 4))))>>1))) + out[27] + out[29] = uint32(((-((int32((in[8] >> 5) & 0x1FF)) & 1))^((int32((in[8] >> 5) & 0x1FF))>>1))) + out[28] + out[30] = uint32(((-((int32((in[8] >> 14) & 0x1FF)) & 1))^((int32((in[8] >> 14) & 0x1FF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[8] >> 23))) & 1))^((int32((in[8] >> 23)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_10(initoffset uint32, in *[10]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3FF)) & 1))^((int32((in[0] >> 0) & 0x3FF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 10) & 0x3FF)) & 1))^((int32((in[0] >> 10) & 0x3FF))>>1))) + out[0] + out[2] = uint32(((-((int32((in[0] >> 20) & 0x3FF)) & 1))^((int32((in[0] >> 20) & 0x3FF))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[0] >> 30) | ((in[1] & 0xFF) << 2)))) & 1))^((int32(((in[0] >> 30) | ((in[1] & 0xFF) << 2))))>>1))) + out[2] + out[4] = uint32(((-((int32((in[1] >> 8) & 0x3FF)) & 1))^((int32((in[1] >> 8) & 0x3FF))>>1))) + out[3] + out[5] = uint32(((-((int32((in[1] >> 18) & 0x3FF)) & 1))^((int32((in[1] >> 18) & 0x3FF))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[1] >> 28) | ((in[2] & 0x3F) << 4)))) & 1))^((int32(((in[1] >> 28) | ((in[2] & 0x3F) << 4))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[2] >> 6) & 0x3FF)) & 1))^((int32((in[2] >> 6) & 0x3FF))>>1))) + out[6] + out[8] = uint32(((-((int32((in[2] >> 16) & 0x3FF)) & 1))^((int32((in[2] >> 16) & 0x3FF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[2] >> 26) | ((in[3] & 0xF) << 6)))) & 1))^((int32(((in[2] >> 26) | ((in[3] & 0xF) << 6))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[3] >> 4) & 0x3FF)) & 1))^((int32((in[3] >> 4) & 0x3FF))>>1))) + out[9] + out[11] = uint32(((-((int32((in[3] >> 14) & 0x3FF)) & 1))^((int32((in[3] >> 14) & 0x3FF))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[3] >> 24) | ((in[4] & 0x3) << 8)))) & 1))^((int32(((in[3] >> 24) | ((in[4] & 0x3) << 8))))>>1))) + out[11] + out[13] = uint32(((-((int32((in[4] >> 2) & 0x3FF)) & 1))^((int32((in[4] >> 2) & 0x3FF))>>1))) + out[12] + out[14] = uint32(((-((int32((in[4] >> 12) & 0x3FF)) & 1))^((int32((in[4] >> 12) & 0x3FF))>>1))) + out[13] + out[15] = uint32(((-((int32((in[4] >> 22))) & 1))^((int32((in[4] >> 22)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[5] >> 0) & 0x3FF)) & 1))^((int32((in[5] >> 0) & 0x3FF))>>1))) + out[15] + out[17] = uint32(((-((int32((in[5] >> 10) & 0x3FF)) & 1))^((int32((in[5] >> 10) & 0x3FF))>>1))) + out[16] + out[18] = uint32(((-((int32((in[5] >> 20) & 0x3FF)) & 1))^((int32((in[5] >> 20) & 0x3FF))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[5] >> 30) | ((in[6] & 0xFF) << 2)))) & 1))^((int32(((in[5] >> 30) | ((in[6] & 0xFF) << 2))))>>1))) + out[18] + out[20] = uint32(((-((int32((in[6] >> 8) & 0x3FF)) & 1))^((int32((in[6] >> 8) & 0x3FF))>>1))) + out[19] + out[21] = uint32(((-((int32((in[6] >> 18) & 0x3FF)) & 1))^((int32((in[6] >> 18) & 0x3FF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[6] >> 28) | ((in[7] & 0x3F) << 4)))) & 1))^((int32(((in[6] >> 28) | ((in[7] & 0x3F) << 4))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[7] >> 6) & 0x3FF)) & 1))^((int32((in[7] >> 6) & 0x3FF))>>1))) + out[22] + out[24] = uint32(((-((int32((in[7] >> 16) & 0x3FF)) & 1))^((int32((in[7] >> 16) & 0x3FF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[7] >> 26) | ((in[8] & 0xF) << 6)))) & 1))^((int32(((in[7] >> 26) | ((in[8] & 0xF) << 6))))>>1))) + out[24] + out[26] = uint32(((-((int32((in[8] >> 4) & 0x3FF)) & 1))^((int32((in[8] >> 4) & 0x3FF))>>1))) + out[25] + out[27] = uint32(((-((int32((in[8] >> 14) & 0x3FF)) & 1))^((int32((in[8] >> 14) & 0x3FF))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[8] >> 24) | ((in[9] & 0x3) << 8)))) & 1))^((int32(((in[8] >> 24) | ((in[9] & 0x3) << 8))))>>1))) + out[27] + out[29] = uint32(((-((int32((in[9] >> 2) & 0x3FF)) & 1))^((int32((in[9] >> 2) & 0x3FF))>>1))) + out[28] + out[30] = uint32(((-((int32((in[9] >> 12) & 0x3FF)) & 1))^((int32((in[9] >> 12) & 0x3FF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[9] >> 22))) & 1))^((int32((in[9] >> 22)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_11(initoffset uint32, in *[11]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7FF)) & 1))^((int32((in[0] >> 0) & 0x7FF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 11) & 0x7FF)) & 1))^((int32((in[0] >> 11) & 0x7FF))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[0] >> 22) | ((in[1] & 0x1) << 10)))) & 1))^((int32(((in[0] >> 22) | ((in[1] & 0x1) << 10))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[1] >> 1) & 0x7FF)) & 1))^((int32((in[1] >> 1) & 0x7FF))>>1))) + out[2] + out[4] = uint32(((-((int32((in[1] >> 12) & 0x7FF)) & 1))^((int32((in[1] >> 12) & 0x7FF))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[1] >> 23) | ((in[2] & 0x3) << 9)))) & 1))^((int32(((in[1] >> 23) | ((in[2] & 0x3) << 9))))>>1))) + out[4] + out[6] = uint32(((-((int32((in[2] >> 2) & 0x7FF)) & 1))^((int32((in[2] >> 2) & 0x7FF))>>1))) + out[5] + out[7] = uint32(((-((int32((in[2] >> 13) & 0x7FF)) & 1))^((int32((in[2] >> 13) & 0x7FF))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[2] >> 24) | ((in[3] & 0x7) << 8)))) & 1))^((int32(((in[2] >> 24) | ((in[3] & 0x7) << 8))))>>1))) + out[7] + out[9] = uint32(((-((int32((in[3] >> 3) & 0x7FF)) & 1))^((int32((in[3] >> 3) & 0x7FF))>>1))) + out[8] + out[10] = uint32(((-((int32((in[3] >> 14) & 0x7FF)) & 1))^((int32((in[3] >> 14) & 0x7FF))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[3] >> 25) | ((in[4] & 0xF) << 7)))) & 1))^((int32(((in[3] >> 25) | ((in[4] & 0xF) << 7))))>>1))) + out[10] + out[12] = uint32(((-((int32((in[4] >> 4) & 0x7FF)) & 1))^((int32((in[4] >> 4) & 0x7FF))>>1))) + out[11] + out[13] = uint32(((-((int32((in[4] >> 15) & 0x7FF)) & 1))^((int32((in[4] >> 15) & 0x7FF))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[4] >> 26) | ((in[5] & 0x1F) << 6)))) & 1))^((int32(((in[4] >> 26) | ((in[5] & 0x1F) << 6))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[5] >> 5) & 0x7FF)) & 1))^((int32((in[5] >> 5) & 0x7FF))>>1))) + out[14] + out[16] = uint32(((-((int32((in[5] >> 16) & 0x7FF)) & 1))^((int32((in[5] >> 16) & 0x7FF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[5] >> 27) | ((in[6] & 0x3F) << 5)))) & 1))^((int32(((in[5] >> 27) | ((in[6] & 0x3F) << 5))))>>1))) + out[16] + out[18] = uint32(((-((int32((in[6] >> 6) & 0x7FF)) & 1))^((int32((in[6] >> 6) & 0x7FF))>>1))) + out[17] + out[19] = uint32(((-((int32((in[6] >> 17) & 0x7FF)) & 1))^((int32((in[6] >> 17) & 0x7FF))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[6] >> 28) | ((in[7] & 0x7F) << 4)))) & 1))^((int32(((in[6] >> 28) | ((in[7] & 0x7F) << 4))))>>1))) + out[19] + out[21] = uint32(((-((int32((in[7] >> 7) & 0x7FF)) & 1))^((int32((in[7] >> 7) & 0x7FF))>>1))) + out[20] + out[22] = uint32(((-((int32((in[7] >> 18) & 0x7FF)) & 1))^((int32((in[7] >> 18) & 0x7FF))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[7] >> 29) | ((in[8] & 0xFF) << 3)))) & 1))^((int32(((in[7] >> 29) | ((in[8] & 0xFF) << 3))))>>1))) + out[22] + out[24] = uint32(((-((int32((in[8] >> 8) & 0x7FF)) & 1))^((int32((in[8] >> 8) & 0x7FF))>>1))) + out[23] + out[25] = uint32(((-((int32((in[8] >> 19) & 0x7FF)) & 1))^((int32((in[8] >> 19) & 0x7FF))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[8] >> 30) | ((in[9] & 0x1FF) << 2)))) & 1))^((int32(((in[8] >> 30) | ((in[9] & 0x1FF) << 2))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[9] >> 9) & 0x7FF)) & 1))^((int32((in[9] >> 9) & 0x7FF))>>1))) + out[26] + out[28] = uint32(((-((int32((in[9] >> 20) & 0x7FF)) & 1))^((int32((in[9] >> 20) & 0x7FF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[9] >> 31) | ((in[10] & 0x3FF) << 1)))) & 1))^((int32(((in[9] >> 31) | ((in[10] & 0x3FF) << 1))))>>1))) + out[28] + out[30] = uint32(((-((int32((in[10] >> 10) & 0x7FF)) & 1))^((int32((in[10] >> 10) & 0x7FF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[10] >> 21))) & 1))^((int32((in[10] >> 21)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_12(initoffset uint32, in *[12]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0xFFF)) & 1))^((int32((in[0] >> 0) & 0xFFF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 12) & 0xFFF)) & 1))^((int32((in[0] >> 12) & 0xFFF))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[0] >> 24) | ((in[1] & 0xF) << 8)))) & 1))^((int32(((in[0] >> 24) | ((in[1] & 0xF) << 8))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[1] >> 4) & 0xFFF)) & 1))^((int32((in[1] >> 4) & 0xFFF))>>1))) + out[2] + out[4] = uint32(((-((int32((in[1] >> 16) & 0xFFF)) & 1))^((int32((in[1] >> 16) & 0xFFF))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[1] >> 28) | ((in[2] & 0xFF) << 4)))) & 1))^((int32(((in[1] >> 28) | ((in[2] & 0xFF) << 4))))>>1))) + out[4] + out[6] = uint32(((-((int32((in[2] >> 8) & 0xFFF)) & 1))^((int32((in[2] >> 8) & 0xFFF))>>1))) + out[5] + out[7] = uint32(((-((int32((in[2] >> 20))) & 1))^((int32((in[2] >> 20)))>>1))) + out[6] + out[8] = uint32(((-((int32((in[3] >> 0) & 0xFFF)) & 1))^((int32((in[3] >> 0) & 0xFFF))>>1))) + out[7] + out[9] = uint32(((-((int32((in[3] >> 12) & 0xFFF)) & 1))^((int32((in[3] >> 12) & 0xFFF))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[3] >> 24) | ((in[4] & 0xF) << 8)))) & 1))^((int32(((in[3] >> 24) | ((in[4] & 0xF) << 8))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[4] >> 4) & 0xFFF)) & 1))^((int32((in[4] >> 4) & 0xFFF))>>1))) + out[10] + out[12] = uint32(((-((int32((in[4] >> 16) & 0xFFF)) & 1))^((int32((in[4] >> 16) & 0xFFF))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[4] >> 28) | ((in[5] & 0xFF) << 4)))) & 1))^((int32(((in[4] >> 28) | ((in[5] & 0xFF) << 4))))>>1))) + out[12] + out[14] = uint32(((-((int32((in[5] >> 8) & 0xFFF)) & 1))^((int32((in[5] >> 8) & 0xFFF))>>1))) + out[13] + out[15] = uint32(((-((int32((in[5] >> 20))) & 1))^((int32((in[5] >> 20)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[6] >> 0) & 0xFFF)) & 1))^((int32((in[6] >> 0) & 0xFFF))>>1))) + out[15] + out[17] = uint32(((-((int32((in[6] >> 12) & 0xFFF)) & 1))^((int32((in[6] >> 12) & 0xFFF))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[6] >> 24) | ((in[7] & 0xF) << 8)))) & 1))^((int32(((in[6] >> 24) | ((in[7] & 0xF) << 8))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[7] >> 4) & 0xFFF)) & 1))^((int32((in[7] >> 4) & 0xFFF))>>1))) + out[18] + out[20] = uint32(((-((int32((in[7] >> 16) & 0xFFF)) & 1))^((int32((in[7] >> 16) & 0xFFF))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[7] >> 28) | ((in[8] & 0xFF) << 4)))) & 1))^((int32(((in[7] >> 28) | ((in[8] & 0xFF) << 4))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[8] >> 8) & 0xFFF)) & 1))^((int32((in[8] >> 8) & 0xFFF))>>1))) + out[21] + out[23] = uint32(((-((int32((in[8] >> 20))) & 1))^((int32((in[8] >> 20)))>>1))) + out[22] + out[24] = uint32(((-((int32((in[9] >> 0) & 0xFFF)) & 1))^((int32((in[9] >> 0) & 0xFFF))>>1))) + out[23] + out[25] = uint32(((-((int32((in[9] >> 12) & 0xFFF)) & 1))^((int32((in[9] >> 12) & 0xFFF))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[9] >> 24) | ((in[10] & 0xF) << 8)))) & 1))^((int32(((in[9] >> 24) | ((in[10] & 0xF) << 8))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[10] >> 4) & 0xFFF)) & 1))^((int32((in[10] >> 4) & 0xFFF))>>1))) + out[26] + out[28] = uint32(((-((int32((in[10] >> 16) & 0xFFF)) & 1))^((int32((in[10] >> 16) & 0xFFF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[10] >> 28) | ((in[11] & 0xFF) << 4)))) & 1))^((int32(((in[10] >> 28) | ((in[11] & 0xFF) << 4))))>>1))) + out[28] + out[30] = uint32(((-((int32((in[11] >> 8) & 0xFFF)) & 1))^((int32((in[11] >> 8) & 0xFFF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[11] >> 20))) & 1))^((int32((in[11] >> 20)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_13(initoffset uint32, in *[13]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1FFF)) & 1))^((int32((in[0] >> 0) & 0x1FFF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 13) & 0x1FFF)) & 1))^((int32((in[0] >> 13) & 0x1FFF))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[0] >> 26) | ((in[1] & 0x7F) << 6)))) & 1))^((int32(((in[0] >> 26) | ((in[1] & 0x7F) << 6))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[1] >> 7) & 0x1FFF)) & 1))^((int32((in[1] >> 7) & 0x1FFF))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[1] >> 20) | ((in[2] & 0x1) << 12)))) & 1))^((int32(((in[1] >> 20) | ((in[2] & 0x1) << 12))))>>1))) + out[3] + out[5] = uint32(((-((int32((in[2] >> 1) & 0x1FFF)) & 1))^((int32((in[2] >> 1) & 0x1FFF))>>1))) + out[4] + out[6] = uint32(((-((int32((in[2] >> 14) & 0x1FFF)) & 1))^((int32((in[2] >> 14) & 0x1FFF))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[2] >> 27) | ((in[3] & 0xFF) << 5)))) & 1))^((int32(((in[2] >> 27) | ((in[3] & 0xFF) << 5))))>>1))) + out[6] + out[8] = uint32(((-((int32((in[3] >> 8) & 0x1FFF)) & 1))^((int32((in[3] >> 8) & 0x1FFF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[3] >> 21) | ((in[4] & 0x3) << 11)))) & 1))^((int32(((in[3] >> 21) | ((in[4] & 0x3) << 11))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[4] >> 2) & 0x1FFF)) & 1))^((int32((in[4] >> 2) & 0x1FFF))>>1))) + out[9] + out[11] = uint32(((-((int32((in[4] >> 15) & 0x1FFF)) & 1))^((int32((in[4] >> 15) & 0x1FFF))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[4] >> 28) | ((in[5] & 0x1FF) << 4)))) & 1))^((int32(((in[4] >> 28) | ((in[5] & 0x1FF) << 4))))>>1))) + out[11] + out[13] = uint32(((-((int32((in[5] >> 9) & 0x1FFF)) & 1))^((int32((in[5] >> 9) & 0x1FFF))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[5] >> 22) | ((in[6] & 0x7) << 10)))) & 1))^((int32(((in[5] >> 22) | ((in[6] & 0x7) << 10))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[6] >> 3) & 0x1FFF)) & 1))^((int32((in[6] >> 3) & 0x1FFF))>>1))) + out[14] + out[16] = uint32(((-((int32((in[6] >> 16) & 0x1FFF)) & 1))^((int32((in[6] >> 16) & 0x1FFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[6] >> 29) | ((in[7] & 0x3FF) << 3)))) & 1))^((int32(((in[6] >> 29) | ((in[7] & 0x3FF) << 3))))>>1))) + out[16] + out[18] = uint32(((-((int32((in[7] >> 10) & 0x1FFF)) & 1))^((int32((in[7] >> 10) & 0x1FFF))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[7] >> 23) | ((in[8] & 0xF) << 9)))) & 1))^((int32(((in[7] >> 23) | ((in[8] & 0xF) << 9))))>>1))) + out[18] + out[20] = uint32(((-((int32((in[8] >> 4) & 0x1FFF)) & 1))^((int32((in[8] >> 4) & 0x1FFF))>>1))) + out[19] + out[21] = uint32(((-((int32((in[8] >> 17) & 0x1FFF)) & 1))^((int32((in[8] >> 17) & 0x1FFF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[8] >> 30) | ((in[9] & 0x7FF) << 2)))) & 1))^((int32(((in[8] >> 30) | ((in[9] & 0x7FF) << 2))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[9] >> 11) & 0x1FFF)) & 1))^((int32((in[9] >> 11) & 0x1FFF))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[9] >> 24) | ((in[10] & 0x1F) << 8)))) & 1))^((int32(((in[9] >> 24) | ((in[10] & 0x1F) << 8))))>>1))) + out[23] + out[25] = uint32(((-((int32((in[10] >> 5) & 0x1FFF)) & 1))^((int32((in[10] >> 5) & 0x1FFF))>>1))) + out[24] + out[26] = uint32(((-((int32((in[10] >> 18) & 0x1FFF)) & 1))^((int32((in[10] >> 18) & 0x1FFF))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[10] >> 31) | ((in[11] & 0xFFF) << 1)))) & 1))^((int32(((in[10] >> 31) | ((in[11] & 0xFFF) << 1))))>>1))) + out[26] + out[28] = uint32(((-((int32((in[11] >> 12) & 0x1FFF)) & 1))^((int32((in[11] >> 12) & 0x1FFF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[11] >> 25) | ((in[12] & 0x3F) << 7)))) & 1))^((int32(((in[11] >> 25) | ((in[12] & 0x3F) << 7))))>>1))) + out[28] + out[30] = uint32(((-((int32((in[12] >> 6) & 0x1FFF)) & 1))^((int32((in[12] >> 6) & 0x1FFF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[12] >> 19))) & 1))^((int32((in[12] >> 19)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_14(initoffset uint32, in *[14]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3FFF)) & 1))^((int32((in[0] >> 0) & 0x3FFF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 14) & 0x3FFF)) & 1))^((int32((in[0] >> 14) & 0x3FFF))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[0] >> 28) | ((in[1] & 0x3FF) << 4)))) & 1))^((int32(((in[0] >> 28) | ((in[1] & 0x3FF) << 4))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[1] >> 10) & 0x3FFF)) & 1))^((int32((in[1] >> 10) & 0x3FFF))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[1] >> 24) | ((in[2] & 0x3F) << 8)))) & 1))^((int32(((in[1] >> 24) | ((in[2] & 0x3F) << 8))))>>1))) + out[3] + out[5] = uint32(((-((int32((in[2] >> 6) & 0x3FFF)) & 1))^((int32((in[2] >> 6) & 0x3FFF))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[2] >> 20) | ((in[3] & 0x3) << 12)))) & 1))^((int32(((in[2] >> 20) | ((in[3] & 0x3) << 12))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[3] >> 2) & 0x3FFF)) & 1))^((int32((in[3] >> 2) & 0x3FFF))>>1))) + out[6] + out[8] = uint32(((-((int32((in[3] >> 16) & 0x3FFF)) & 1))^((int32((in[3] >> 16) & 0x3FFF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[3] >> 30) | ((in[4] & 0xFFF) << 2)))) & 1))^((int32(((in[3] >> 30) | ((in[4] & 0xFFF) << 2))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[4] >> 12) & 0x3FFF)) & 1))^((int32((in[4] >> 12) & 0x3FFF))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[4] >> 26) | ((in[5] & 0xFF) << 6)))) & 1))^((int32(((in[4] >> 26) | ((in[5] & 0xFF) << 6))))>>1))) + out[10] + out[12] = uint32(((-((int32((in[5] >> 8) & 0x3FFF)) & 1))^((int32((in[5] >> 8) & 0x3FFF))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[5] >> 22) | ((in[6] & 0xF) << 10)))) & 1))^((int32(((in[5] >> 22) | ((in[6] & 0xF) << 10))))>>1))) + out[12] + out[14] = uint32(((-((int32((in[6] >> 4) & 0x3FFF)) & 1))^((int32((in[6] >> 4) & 0x3FFF))>>1))) + out[13] + out[15] = uint32(((-((int32((in[6] >> 18))) & 1))^((int32((in[6] >> 18)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[7] >> 0) & 0x3FFF)) & 1))^((int32((in[7] >> 0) & 0x3FFF))>>1))) + out[15] + out[17] = uint32(((-((int32((in[7] >> 14) & 0x3FFF)) & 1))^((int32((in[7] >> 14) & 0x3FFF))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[7] >> 28) | ((in[8] & 0x3FF) << 4)))) & 1))^((int32(((in[7] >> 28) | ((in[8] & 0x3FF) << 4))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[8] >> 10) & 0x3FFF)) & 1))^((int32((in[8] >> 10) & 0x3FFF))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[8] >> 24) | ((in[9] & 0x3F) << 8)))) & 1))^((int32(((in[8] >> 24) | ((in[9] & 0x3F) << 8))))>>1))) + out[19] + out[21] = uint32(((-((int32((in[9] >> 6) & 0x3FFF)) & 1))^((int32((in[9] >> 6) & 0x3FFF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[9] >> 20) | ((in[10] & 0x3) << 12)))) & 1))^((int32(((in[9] >> 20) | ((in[10] & 0x3) << 12))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[10] >> 2) & 0x3FFF)) & 1))^((int32((in[10] >> 2) & 0x3FFF))>>1))) + out[22] + out[24] = uint32(((-((int32((in[10] >> 16) & 0x3FFF)) & 1))^((int32((in[10] >> 16) & 0x3FFF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[10] >> 30) | ((in[11] & 0xFFF) << 2)))) & 1))^((int32(((in[10] >> 30) | ((in[11] & 0xFFF) << 2))))>>1))) + out[24] + out[26] = uint32(((-((int32((in[11] >> 12) & 0x3FFF)) & 1))^((int32((in[11] >> 12) & 0x3FFF))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[11] >> 26) | ((in[12] & 0xFF) << 6)))) & 1))^((int32(((in[11] >> 26) | ((in[12] & 0xFF) << 6))))>>1))) + out[26] + out[28] = uint32(((-((int32((in[12] >> 8) & 0x3FFF)) & 1))^((int32((in[12] >> 8) & 0x3FFF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[12] >> 22) | ((in[13] & 0xF) << 10)))) & 1))^((int32(((in[12] >> 22) | ((in[13] & 0xF) << 10))))>>1))) + out[28] + out[30] = uint32(((-((int32((in[13] >> 4) & 0x3FFF)) & 1))^((int32((in[13] >> 4) & 0x3FFF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[13] >> 18))) & 1))^((int32((in[13] >> 18)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_15(initoffset uint32, in *[15]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7FFF)) & 1))^((int32((in[0] >> 0) & 0x7FFF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 15) & 0x7FFF)) & 1))^((int32((in[0] >> 15) & 0x7FFF))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[0] >> 30) | ((in[1] & 0x1FFF) << 2)))) & 1))^((int32(((in[0] >> 30) | ((in[1] & 0x1FFF) << 2))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[1] >> 13) & 0x7FFF)) & 1))^((int32((in[1] >> 13) & 0x7FFF))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[1] >> 28) | ((in[2] & 0x7FF) << 4)))) & 1))^((int32(((in[1] >> 28) | ((in[2] & 0x7FF) << 4))))>>1))) + out[3] + out[5] = uint32(((-((int32((in[2] >> 11) & 0x7FFF)) & 1))^((int32((in[2] >> 11) & 0x7FFF))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[2] >> 26) | ((in[3] & 0x1FF) << 6)))) & 1))^((int32(((in[2] >> 26) | ((in[3] & 0x1FF) << 6))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[3] >> 9) & 0x7FFF)) & 1))^((int32((in[3] >> 9) & 0x7FFF))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[3] >> 24) | ((in[4] & 0x7F) << 8)))) & 1))^((int32(((in[3] >> 24) | ((in[4] & 0x7F) << 8))))>>1))) + out[7] + out[9] = uint32(((-((int32((in[4] >> 7) & 0x7FFF)) & 1))^((int32((in[4] >> 7) & 0x7FFF))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[4] >> 22) | ((in[5] & 0x1F) << 10)))) & 1))^((int32(((in[4] >> 22) | ((in[5] & 0x1F) << 10))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[5] >> 5) & 0x7FFF)) & 1))^((int32((in[5] >> 5) & 0x7FFF))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[5] >> 20) | ((in[6] & 0x7) << 12)))) & 1))^((int32(((in[5] >> 20) | ((in[6] & 0x7) << 12))))>>1))) + out[11] + out[13] = uint32(((-((int32((in[6] >> 3) & 0x7FFF)) & 1))^((int32((in[6] >> 3) & 0x7FFF))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[6] >> 18) | ((in[7] & 0x1) << 14)))) & 1))^((int32(((in[6] >> 18) | ((in[7] & 0x1) << 14))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[7] >> 1) & 0x7FFF)) & 1))^((int32((in[7] >> 1) & 0x7FFF))>>1))) + out[14] + out[16] = uint32(((-((int32((in[7] >> 16) & 0x7FFF)) & 1))^((int32((in[7] >> 16) & 0x7FFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[7] >> 31) | ((in[8] & 0x3FFF) << 1)))) & 1))^((int32(((in[7] >> 31) | ((in[8] & 0x3FFF) << 1))))>>1))) + out[16] + out[18] = uint32(((-((int32((in[8] >> 14) & 0x7FFF)) & 1))^((int32((in[8] >> 14) & 0x7FFF))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[8] >> 29) | ((in[9] & 0xFFF) << 3)))) & 1))^((int32(((in[8] >> 29) | ((in[9] & 0xFFF) << 3))))>>1))) + out[18] + out[20] = uint32(((-((int32((in[9] >> 12) & 0x7FFF)) & 1))^((int32((in[9] >> 12) & 0x7FFF))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[9] >> 27) | ((in[10] & 0x3FF) << 5)))) & 1))^((int32(((in[9] >> 27) | ((in[10] & 0x3FF) << 5))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[10] >> 10) & 0x7FFF)) & 1))^((int32((in[10] >> 10) & 0x7FFF))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[10] >> 25) | ((in[11] & 0xFF) << 7)))) & 1))^((int32(((in[10] >> 25) | ((in[11] & 0xFF) << 7))))>>1))) + out[22] + out[24] = uint32(((-((int32((in[11] >> 8) & 0x7FFF)) & 1))^((int32((in[11] >> 8) & 0x7FFF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[11] >> 23) | ((in[12] & 0x3F) << 9)))) & 1))^((int32(((in[11] >> 23) | ((in[12] & 0x3F) << 9))))>>1))) + out[24] + out[26] = uint32(((-((int32((in[12] >> 6) & 0x7FFF)) & 1))^((int32((in[12] >> 6) & 0x7FFF))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[12] >> 21) | ((in[13] & 0xF) << 11)))) & 1))^((int32(((in[12] >> 21) | ((in[13] & 0xF) << 11))))>>1))) + out[26] + out[28] = uint32(((-((int32((in[13] >> 4) & 0x7FFF)) & 1))^((int32((in[13] >> 4) & 0x7FFF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[13] >> 19) | ((in[14] & 0x3) << 13)))) & 1))^((int32(((in[13] >> 19) | ((in[14] & 0x3) << 13))))>>1))) + out[28] + out[30] = uint32(((-((int32((in[14] >> 2) & 0x7FFF)) & 1))^((int32((in[14] >> 2) & 0x7FFF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[14] >> 17))) & 1))^((int32((in[14] >> 17)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_16(initoffset uint32, in *[16]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0xFFFF)) & 1))^((int32((in[0] >> 0) & 0xFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32((in[0] >> 16))) & 1))^((int32((in[0] >> 16)))>>1))) + out[0] + out[2] = uint32(((-((int32((in[1] >> 0) & 0xFFFF)) & 1))^((int32((in[1] >> 0) & 0xFFFF))>>1))) + out[1] + out[3] = uint32(((-((int32((in[1] >> 16))) & 1))^((int32((in[1] >> 16)))>>1))) + out[2] + out[4] = uint32(((-((int32((in[2] >> 0) & 0xFFFF)) & 1))^((int32((in[2] >> 0) & 0xFFFF))>>1))) + out[3] + out[5] = uint32(((-((int32((in[2] >> 16))) & 1))^((int32((in[2] >> 16)))>>1))) + out[4] + out[6] = uint32(((-((int32((in[3] >> 0) & 0xFFFF)) & 1))^((int32((in[3] >> 0) & 0xFFFF))>>1))) + out[5] + out[7] = uint32(((-((int32((in[3] >> 16))) & 1))^((int32((in[3] >> 16)))>>1))) + out[6] + out[8] = uint32(((-((int32((in[4] >> 0) & 0xFFFF)) & 1))^((int32((in[4] >> 0) & 0xFFFF))>>1))) + out[7] + out[9] = uint32(((-((int32((in[4] >> 16))) & 1))^((int32((in[4] >> 16)))>>1))) + out[8] + out[10] = uint32(((-((int32((in[5] >> 0) & 0xFFFF)) & 1))^((int32((in[5] >> 0) & 0xFFFF))>>1))) + out[9] + out[11] = uint32(((-((int32((in[5] >> 16))) & 1))^((int32((in[5] >> 16)))>>1))) + out[10] + out[12] = uint32(((-((int32((in[6] >> 0) & 0xFFFF)) & 1))^((int32((in[6] >> 0) & 0xFFFF))>>1))) + out[11] + out[13] = uint32(((-((int32((in[6] >> 16))) & 1))^((int32((in[6] >> 16)))>>1))) + out[12] + out[14] = uint32(((-((int32((in[7] >> 0) & 0xFFFF)) & 1))^((int32((in[7] >> 0) & 0xFFFF))>>1))) + out[13] + out[15] = uint32(((-((int32((in[7] >> 16))) & 1))^((int32((in[7] >> 16)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[8] >> 0) & 0xFFFF)) & 1))^((int32((in[8] >> 0) & 0xFFFF))>>1))) + out[15] + out[17] = uint32(((-((int32((in[8] >> 16))) & 1))^((int32((in[8] >> 16)))>>1))) + out[16] + out[18] = uint32(((-((int32((in[9] >> 0) & 0xFFFF)) & 1))^((int32((in[9] >> 0) & 0xFFFF))>>1))) + out[17] + out[19] = uint32(((-((int32((in[9] >> 16))) & 1))^((int32((in[9] >> 16)))>>1))) + out[18] + out[20] = uint32(((-((int32((in[10] >> 0) & 0xFFFF)) & 1))^((int32((in[10] >> 0) & 0xFFFF))>>1))) + out[19] + out[21] = uint32(((-((int32((in[10] >> 16))) & 1))^((int32((in[10] >> 16)))>>1))) + out[20] + out[22] = uint32(((-((int32((in[11] >> 0) & 0xFFFF)) & 1))^((int32((in[11] >> 0) & 0xFFFF))>>1))) + out[21] + out[23] = uint32(((-((int32((in[11] >> 16))) & 1))^((int32((in[11] >> 16)))>>1))) + out[22] + out[24] = uint32(((-((int32((in[12] >> 0) & 0xFFFF)) & 1))^((int32((in[12] >> 0) & 0xFFFF))>>1))) + out[23] + out[25] = uint32(((-((int32((in[12] >> 16))) & 1))^((int32((in[12] >> 16)))>>1))) + out[24] + out[26] = uint32(((-((int32((in[13] >> 0) & 0xFFFF)) & 1))^((int32((in[13] >> 0) & 0xFFFF))>>1))) + out[25] + out[27] = uint32(((-((int32((in[13] >> 16))) & 1))^((int32((in[13] >> 16)))>>1))) + out[26] + out[28] = uint32(((-((int32((in[14] >> 0) & 0xFFFF)) & 1))^((int32((in[14] >> 0) & 0xFFFF))>>1))) + out[27] + out[29] = uint32(((-((int32((in[14] >> 16))) & 1))^((int32((in[14] >> 16)))>>1))) + out[28] + out[30] = uint32(((-((int32((in[15] >> 0) & 0xFFFF)) & 1))^((int32((in[15] >> 0) & 0xFFFF))>>1))) + out[29] + out[31] = uint32(((-((int32((in[15] >> 16))) & 1))^((int32((in[15] >> 16)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_17(initoffset uint32, in *[17]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1FFFF)) & 1))^((int32((in[0] >> 0) & 0x1FFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 17) | ((in[1] & 0x3) << 15)))) & 1))^((int32(((in[0] >> 17) | ((in[1] & 0x3) << 15))))>>1))) + out[0] + out[2] = uint32(((-((int32((in[1] >> 2) & 0x1FFFF)) & 1))^((int32((in[1] >> 2) & 0x1FFFF))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[1] >> 19) | ((in[2] & 0xF) << 13)))) & 1))^((int32(((in[1] >> 19) | ((in[2] & 0xF) << 13))))>>1))) + out[2] + out[4] = uint32(((-((int32((in[2] >> 4) & 0x1FFFF)) & 1))^((int32((in[2] >> 4) & 0x1FFFF))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[2] >> 21) | ((in[3] & 0x3F) << 11)))) & 1))^((int32(((in[2] >> 21) | ((in[3] & 0x3F) << 11))))>>1))) + out[4] + out[6] = uint32(((-((int32((in[3] >> 6) & 0x1FFFF)) & 1))^((int32((in[3] >> 6) & 0x1FFFF))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[3] >> 23) | ((in[4] & 0xFF) << 9)))) & 1))^((int32(((in[3] >> 23) | ((in[4] & 0xFF) << 9))))>>1))) + out[6] + out[8] = uint32(((-((int32((in[4] >> 8) & 0x1FFFF)) & 1))^((int32((in[4] >> 8) & 0x1FFFF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[4] >> 25) | ((in[5] & 0x3FF) << 7)))) & 1))^((int32(((in[4] >> 25) | ((in[5] & 0x3FF) << 7))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[5] >> 10) & 0x1FFFF)) & 1))^((int32((in[5] >> 10) & 0x1FFFF))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[5] >> 27) | ((in[6] & 0xFFF) << 5)))) & 1))^((int32(((in[5] >> 27) | ((in[6] & 0xFFF) << 5))))>>1))) + out[10] + out[12] = uint32(((-((int32((in[6] >> 12) & 0x1FFFF)) & 1))^((int32((in[6] >> 12) & 0x1FFFF))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[6] >> 29) | ((in[7] & 0x3FFF) << 3)))) & 1))^((int32(((in[6] >> 29) | ((in[7] & 0x3FFF) << 3))))>>1))) + out[12] + out[14] = uint32(((-((int32((in[7] >> 14) & 0x1FFFF)) & 1))^((int32((in[7] >> 14) & 0x1FFFF))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[7] >> 31) | ((in[8] & 0xFFFF) << 1)))) & 1))^((int32(((in[7] >> 31) | ((in[8] & 0xFFFF) << 1))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[8] >> 16) | ((in[9] & 0x1) << 16)))) & 1))^((int32(((in[8] >> 16) | ((in[9] & 0x1) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32((in[9] >> 1) & 0x1FFFF)) & 1))^((int32((in[9] >> 1) & 0x1FFFF))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[9] >> 18) | ((in[10] & 0x7) << 14)))) & 1))^((int32(((in[9] >> 18) | ((in[10] & 0x7) << 14))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[10] >> 3) & 0x1FFFF)) & 1))^((int32((in[10] >> 3) & 0x1FFFF))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[10] >> 20) | ((in[11] & 0x1F) << 12)))) & 1))^((int32(((in[10] >> 20) | ((in[11] & 0x1F) << 12))))>>1))) + out[19] + out[21] = uint32(((-((int32((in[11] >> 5) & 0x1FFFF)) & 1))^((int32((in[11] >> 5) & 0x1FFFF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[11] >> 22) | ((in[12] & 0x7F) << 10)))) & 1))^((int32(((in[11] >> 22) | ((in[12] & 0x7F) << 10))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[12] >> 7) & 0x1FFFF)) & 1))^((int32((in[12] >> 7) & 0x1FFFF))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[12] >> 24) | ((in[13] & 0x1FF) << 8)))) & 1))^((int32(((in[12] >> 24) | ((in[13] & 0x1FF) << 8))))>>1))) + out[23] + out[25] = uint32(((-((int32((in[13] >> 9) & 0x1FFFF)) & 1))^((int32((in[13] >> 9) & 0x1FFFF))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[13] >> 26) | ((in[14] & 0x7FF) << 6)))) & 1))^((int32(((in[13] >> 26) | ((in[14] & 0x7FF) << 6))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[14] >> 11) & 0x1FFFF)) & 1))^((int32((in[14] >> 11) & 0x1FFFF))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[14] >> 28) | ((in[15] & 0x1FFF) << 4)))) & 1))^((int32(((in[14] >> 28) | ((in[15] & 0x1FFF) << 4))))>>1))) + out[27] + out[29] = uint32(((-((int32((in[15] >> 13) & 0x1FFFF)) & 1))^((int32((in[15] >> 13) & 0x1FFFF))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[15] >> 30) | ((in[16] & 0x7FFF) << 2)))) & 1))^((int32(((in[15] >> 30) | ((in[16] & 0x7FFF) << 2))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[16] >> 15))) & 1))^((int32((in[16] >> 15)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_18(initoffset uint32, in *[18]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3FFFF)) & 1))^((int32((in[0] >> 0) & 0x3FFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 18) | ((in[1] & 0xF) << 14)))) & 1))^((int32(((in[0] >> 18) | ((in[1] & 0xF) << 14))))>>1))) + out[0] + out[2] = uint32(((-((int32((in[1] >> 4) & 0x3FFFF)) & 1))^((int32((in[1] >> 4) & 0x3FFFF))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[1] >> 22) | ((in[2] & 0xFF) << 10)))) & 1))^((int32(((in[1] >> 22) | ((in[2] & 0xFF) << 10))))>>1))) + out[2] + out[4] = uint32(((-((int32((in[2] >> 8) & 0x3FFFF)) & 1))^((int32((in[2] >> 8) & 0x3FFFF))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[2] >> 26) | ((in[3] & 0xFFF) << 6)))) & 1))^((int32(((in[2] >> 26) | ((in[3] & 0xFFF) << 6))))>>1))) + out[4] + out[6] = uint32(((-((int32((in[3] >> 12) & 0x3FFFF)) & 1))^((int32((in[3] >> 12) & 0x3FFFF))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[3] >> 30) | ((in[4] & 0xFFFF) << 2)))) & 1))^((int32(((in[3] >> 30) | ((in[4] & 0xFFFF) << 2))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[4] >> 16) | ((in[5] & 0x3) << 16)))) & 1))^((int32(((in[4] >> 16) | ((in[5] & 0x3) << 16))))>>1))) + out[7] + out[9] = uint32(((-((int32((in[5] >> 2) & 0x3FFFF)) & 1))^((int32((in[5] >> 2) & 0x3FFFF))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[5] >> 20) | ((in[6] & 0x3F) << 12)))) & 1))^((int32(((in[5] >> 20) | ((in[6] & 0x3F) << 12))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[6] >> 6) & 0x3FFFF)) & 1))^((int32((in[6] >> 6) & 0x3FFFF))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[6] >> 24) | ((in[7] & 0x3FF) << 8)))) & 1))^((int32(((in[6] >> 24) | ((in[7] & 0x3FF) << 8))))>>1))) + out[11] + out[13] = uint32(((-((int32((in[7] >> 10) & 0x3FFFF)) & 1))^((int32((in[7] >> 10) & 0x3FFFF))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[7] >> 28) | ((in[8] & 0x3FFF) << 4)))) & 1))^((int32(((in[7] >> 28) | ((in[8] & 0x3FFF) << 4))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[8] >> 14))) & 1))^((int32((in[8] >> 14)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[9] >> 0) & 0x3FFFF)) & 1))^((int32((in[9] >> 0) & 0x3FFFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[9] >> 18) | ((in[10] & 0xF) << 14)))) & 1))^((int32(((in[9] >> 18) | ((in[10] & 0xF) << 14))))>>1))) + out[16] + out[18] = uint32(((-((int32((in[10] >> 4) & 0x3FFFF)) & 1))^((int32((in[10] >> 4) & 0x3FFFF))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[10] >> 22) | ((in[11] & 0xFF) << 10)))) & 1))^((int32(((in[10] >> 22) | ((in[11] & 0xFF) << 10))))>>1))) + out[18] + out[20] = uint32(((-((int32((in[11] >> 8) & 0x3FFFF)) & 1))^((int32((in[11] >> 8) & 0x3FFFF))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[11] >> 26) | ((in[12] & 0xFFF) << 6)))) & 1))^((int32(((in[11] >> 26) | ((in[12] & 0xFFF) << 6))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[12] >> 12) & 0x3FFFF)) & 1))^((int32((in[12] >> 12) & 0x3FFFF))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[12] >> 30) | ((in[13] & 0xFFFF) << 2)))) & 1))^((int32(((in[12] >> 30) | ((in[13] & 0xFFFF) << 2))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[13] >> 16) | ((in[14] & 0x3) << 16)))) & 1))^((int32(((in[13] >> 16) | ((in[14] & 0x3) << 16))))>>1))) + out[23] + out[25] = uint32(((-((int32((in[14] >> 2) & 0x3FFFF)) & 1))^((int32((in[14] >> 2) & 0x3FFFF))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[14] >> 20) | ((in[15] & 0x3F) << 12)))) & 1))^((int32(((in[14] >> 20) | ((in[15] & 0x3F) << 12))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[15] >> 6) & 0x3FFFF)) & 1))^((int32((in[15] >> 6) & 0x3FFFF))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[15] >> 24) | ((in[16] & 0x3FF) << 8)))) & 1))^((int32(((in[15] >> 24) | ((in[16] & 0x3FF) << 8))))>>1))) + out[27] + out[29] = uint32(((-((int32((in[16] >> 10) & 0x3FFFF)) & 1))^((int32((in[16] >> 10) & 0x3FFFF))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[16] >> 28) | ((in[17] & 0x3FFF) << 4)))) & 1))^((int32(((in[16] >> 28) | ((in[17] & 0x3FFF) << 4))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[17] >> 14))) & 1))^((int32((in[17] >> 14)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_19(initoffset uint32, in *[19]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7FFFF)) & 1))^((int32((in[0] >> 0) & 0x7FFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 19) | ((in[1] & 0x3F) << 13)))) & 1))^((int32(((in[0] >> 19) | ((in[1] & 0x3F) << 13))))>>1))) + out[0] + out[2] = uint32(((-((int32((in[1] >> 6) & 0x7FFFF)) & 1))^((int32((in[1] >> 6) & 0x7FFFF))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[1] >> 25) | ((in[2] & 0xFFF) << 7)))) & 1))^((int32(((in[1] >> 25) | ((in[2] & 0xFFF) << 7))))>>1))) + out[2] + out[4] = uint32(((-((int32((in[2] >> 12) & 0x7FFFF)) & 1))^((int32((in[2] >> 12) & 0x7FFFF))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[2] >> 31) | ((in[3] & 0x3FFFF) << 1)))) & 1))^((int32(((in[2] >> 31) | ((in[3] & 0x3FFFF) << 1))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[3] >> 18) | ((in[4] & 0x1F) << 14)))) & 1))^((int32(((in[3] >> 18) | ((in[4] & 0x1F) << 14))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[4] >> 5) & 0x7FFFF)) & 1))^((int32((in[4] >> 5) & 0x7FFFF))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[4] >> 24) | ((in[5] & 0x7FF) << 8)))) & 1))^((int32(((in[4] >> 24) | ((in[5] & 0x7FF) << 8))))>>1))) + out[7] + out[9] = uint32(((-((int32((in[5] >> 11) & 0x7FFFF)) & 1))^((int32((in[5] >> 11) & 0x7FFFF))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[5] >> 30) | ((in[6] & 0x1FFFF) << 2)))) & 1))^((int32(((in[5] >> 30) | ((in[6] & 0x1FFFF) << 2))))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[6] >> 17) | ((in[7] & 0xF) << 15)))) & 1))^((int32(((in[6] >> 17) | ((in[7] & 0xF) << 15))))>>1))) + out[10] + out[12] = uint32(((-((int32((in[7] >> 4) & 0x7FFFF)) & 1))^((int32((in[7] >> 4) & 0x7FFFF))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[7] >> 23) | ((in[8] & 0x3FF) << 9)))) & 1))^((int32(((in[7] >> 23) | ((in[8] & 0x3FF) << 9))))>>1))) + out[12] + out[14] = uint32(((-((int32((in[8] >> 10) & 0x7FFFF)) & 1))^((int32((in[8] >> 10) & 0x7FFFF))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[8] >> 29) | ((in[9] & 0xFFFF) << 3)))) & 1))^((int32(((in[8] >> 29) | ((in[9] & 0xFFFF) << 3))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[9] >> 16) | ((in[10] & 0x7) << 16)))) & 1))^((int32(((in[9] >> 16) | ((in[10] & 0x7) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32((in[10] >> 3) & 0x7FFFF)) & 1))^((int32((in[10] >> 3) & 0x7FFFF))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[10] >> 22) | ((in[11] & 0x1FF) << 10)))) & 1))^((int32(((in[10] >> 22) | ((in[11] & 0x1FF) << 10))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[11] >> 9) & 0x7FFFF)) & 1))^((int32((in[11] >> 9) & 0x7FFFF))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[11] >> 28) | ((in[12] & 0x7FFF) << 4)))) & 1))^((int32(((in[11] >> 28) | ((in[12] & 0x7FFF) << 4))))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[12] >> 15) | ((in[13] & 0x3) << 17)))) & 1))^((int32(((in[12] >> 15) | ((in[13] & 0x3) << 17))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[13] >> 2) & 0x7FFFF)) & 1))^((int32((in[13] >> 2) & 0x7FFFF))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[13] >> 21) | ((in[14] & 0xFF) << 11)))) & 1))^((int32(((in[13] >> 21) | ((in[14] & 0xFF) << 11))))>>1))) + out[22] + out[24] = uint32(((-((int32((in[14] >> 8) & 0x7FFFF)) & 1))^((int32((in[14] >> 8) & 0x7FFFF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[14] >> 27) | ((in[15] & 0x3FFF) << 5)))) & 1))^((int32(((in[14] >> 27) | ((in[15] & 0x3FFF) << 5))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[15] >> 14) | ((in[16] & 0x1) << 18)))) & 1))^((int32(((in[15] >> 14) | ((in[16] & 0x1) << 18))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[16] >> 1) & 0x7FFFF)) & 1))^((int32((in[16] >> 1) & 0x7FFFF))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[16] >> 20) | ((in[17] & 0x7F) << 12)))) & 1))^((int32(((in[16] >> 20) | ((in[17] & 0x7F) << 12))))>>1))) + out[27] + out[29] = uint32(((-((int32((in[17] >> 7) & 0x7FFFF)) & 1))^((int32((in[17] >> 7) & 0x7FFFF))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[17] >> 26) | ((in[18] & 0x1FFF) << 6)))) & 1))^((int32(((in[17] >> 26) | ((in[18] & 0x1FFF) << 6))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[18] >> 13))) & 1))^((int32((in[18] >> 13)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_20(initoffset uint32, in *[20]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0xFFFFF)) & 1))^((int32((in[0] >> 0) & 0xFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 20) | ((in[1] & 0xFF) << 12)))) & 1))^((int32(((in[0] >> 20) | ((in[1] & 0xFF) << 12))))>>1))) + out[0] + out[2] = uint32(((-((int32((in[1] >> 8) & 0xFFFFF)) & 1))^((int32((in[1] >> 8) & 0xFFFFF))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[1] >> 28) | ((in[2] & 0xFFFF) << 4)))) & 1))^((int32(((in[1] >> 28) | ((in[2] & 0xFFFF) << 4))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[2] >> 16) | ((in[3] & 0xF) << 16)))) & 1))^((int32(((in[2] >> 16) | ((in[3] & 0xF) << 16))))>>1))) + out[3] + out[5] = uint32(((-((int32((in[3] >> 4) & 0xFFFFF)) & 1))^((int32((in[3] >> 4) & 0xFFFFF))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[3] >> 24) | ((in[4] & 0xFFF) << 8)))) & 1))^((int32(((in[3] >> 24) | ((in[4] & 0xFFF) << 8))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[4] >> 12))) & 1))^((int32((in[4] >> 12)))>>1))) + out[6] + out[8] = uint32(((-((int32((in[5] >> 0) & 0xFFFFF)) & 1))^((int32((in[5] >> 0) & 0xFFFFF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[5] >> 20) | ((in[6] & 0xFF) << 12)))) & 1))^((int32(((in[5] >> 20) | ((in[6] & 0xFF) << 12))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[6] >> 8) & 0xFFFFF)) & 1))^((int32((in[6] >> 8) & 0xFFFFF))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[6] >> 28) | ((in[7] & 0xFFFF) << 4)))) & 1))^((int32(((in[6] >> 28) | ((in[7] & 0xFFFF) << 4))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[7] >> 16) | ((in[8] & 0xF) << 16)))) & 1))^((int32(((in[7] >> 16) | ((in[8] & 0xF) << 16))))>>1))) + out[11] + out[13] = uint32(((-((int32((in[8] >> 4) & 0xFFFFF)) & 1))^((int32((in[8] >> 4) & 0xFFFFF))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[8] >> 24) | ((in[9] & 0xFFF) << 8)))) & 1))^((int32(((in[8] >> 24) | ((in[9] & 0xFFF) << 8))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[9] >> 12))) & 1))^((int32((in[9] >> 12)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[10] >> 0) & 0xFFFFF)) & 1))^((int32((in[10] >> 0) & 0xFFFFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[10] >> 20) | ((in[11] & 0xFF) << 12)))) & 1))^((int32(((in[10] >> 20) | ((in[11] & 0xFF) << 12))))>>1))) + out[16] + out[18] = uint32(((-((int32((in[11] >> 8) & 0xFFFFF)) & 1))^((int32((in[11] >> 8) & 0xFFFFF))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[11] >> 28) | ((in[12] & 0xFFFF) << 4)))) & 1))^((int32(((in[11] >> 28) | ((in[12] & 0xFFFF) << 4))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[12] >> 16) | ((in[13] & 0xF) << 16)))) & 1))^((int32(((in[12] >> 16) | ((in[13] & 0xF) << 16))))>>1))) + out[19] + out[21] = uint32(((-((int32((in[13] >> 4) & 0xFFFFF)) & 1))^((int32((in[13] >> 4) & 0xFFFFF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[13] >> 24) | ((in[14] & 0xFFF) << 8)))) & 1))^((int32(((in[13] >> 24) | ((in[14] & 0xFFF) << 8))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[14] >> 12))) & 1))^((int32((in[14] >> 12)))>>1))) + out[22] + out[24] = uint32(((-((int32((in[15] >> 0) & 0xFFFFF)) & 1))^((int32((in[15] >> 0) & 0xFFFFF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[15] >> 20) | ((in[16] & 0xFF) << 12)))) & 1))^((int32(((in[15] >> 20) | ((in[16] & 0xFF) << 12))))>>1))) + out[24] + out[26] = uint32(((-((int32((in[16] >> 8) & 0xFFFFF)) & 1))^((int32((in[16] >> 8) & 0xFFFFF))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[16] >> 28) | ((in[17] & 0xFFFF) << 4)))) & 1))^((int32(((in[16] >> 28) | ((in[17] & 0xFFFF) << 4))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[17] >> 16) | ((in[18] & 0xF) << 16)))) & 1))^((int32(((in[17] >> 16) | ((in[18] & 0xF) << 16))))>>1))) + out[27] + out[29] = uint32(((-((int32((in[18] >> 4) & 0xFFFFF)) & 1))^((int32((in[18] >> 4) & 0xFFFFF))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[18] >> 24) | ((in[19] & 0xFFF) << 8)))) & 1))^((int32(((in[18] >> 24) | ((in[19] & 0xFFF) << 8))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[19] >> 12))) & 1))^((int32((in[19] >> 12)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_21(initoffset uint32, in *[21]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1FFFFF)) & 1))^((int32((in[0] >> 0) & 0x1FFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 21) | ((in[1] & 0x3FF) << 11)))) & 1))^((int32(((in[0] >> 21) | ((in[1] & 0x3FF) << 11))))>>1))) + out[0] + out[2] = uint32(((-((int32((in[1] >> 10) & 0x1FFFFF)) & 1))^((int32((in[1] >> 10) & 0x1FFFFF))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[1] >> 31) | ((in[2] & 0xFFFFF) << 1)))) & 1))^((int32(((in[1] >> 31) | ((in[2] & 0xFFFFF) << 1))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[2] >> 20) | ((in[3] & 0x1FF) << 12)))) & 1))^((int32(((in[2] >> 20) | ((in[3] & 0x1FF) << 12))))>>1))) + out[3] + out[5] = uint32(((-((int32((in[3] >> 9) & 0x1FFFFF)) & 1))^((int32((in[3] >> 9) & 0x1FFFFF))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[3] >> 30) | ((in[4] & 0x7FFFF) << 2)))) & 1))^((int32(((in[3] >> 30) | ((in[4] & 0x7FFFF) << 2))))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[4] >> 19) | ((in[5] & 0xFF) << 13)))) & 1))^((int32(((in[4] >> 19) | ((in[5] & 0xFF) << 13))))>>1))) + out[6] + out[8] = uint32(((-((int32((in[5] >> 8) & 0x1FFFFF)) & 1))^((int32((in[5] >> 8) & 0x1FFFFF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[5] >> 29) | ((in[6] & 0x3FFFF) << 3)))) & 1))^((int32(((in[5] >> 29) | ((in[6] & 0x3FFFF) << 3))))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[6] >> 18) | ((in[7] & 0x7F) << 14)))) & 1))^((int32(((in[6] >> 18) | ((in[7] & 0x7F) << 14))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[7] >> 7) & 0x1FFFFF)) & 1))^((int32((in[7] >> 7) & 0x1FFFFF))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[7] >> 28) | ((in[8] & 0x1FFFF) << 4)))) & 1))^((int32(((in[7] >> 28) | ((in[8] & 0x1FFFF) << 4))))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[8] >> 17) | ((in[9] & 0x3F) << 15)))) & 1))^((int32(((in[8] >> 17) | ((in[9] & 0x3F) << 15))))>>1))) + out[12] + out[14] = uint32(((-((int32((in[9] >> 6) & 0x1FFFFF)) & 1))^((int32((in[9] >> 6) & 0x1FFFFF))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[9] >> 27) | ((in[10] & 0xFFFF) << 5)))) & 1))^((int32(((in[9] >> 27) | ((in[10] & 0xFFFF) << 5))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[10] >> 16) | ((in[11] & 0x1F) << 16)))) & 1))^((int32(((in[10] >> 16) | ((in[11] & 0x1F) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32((in[11] >> 5) & 0x1FFFFF)) & 1))^((int32((in[11] >> 5) & 0x1FFFFF))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[11] >> 26) | ((in[12] & 0x7FFF) << 6)))) & 1))^((int32(((in[11] >> 26) | ((in[12] & 0x7FFF) << 6))))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[12] >> 15) | ((in[13] & 0xF) << 17)))) & 1))^((int32(((in[12] >> 15) | ((in[13] & 0xF) << 17))))>>1))) + out[18] + out[20] = uint32(((-((int32((in[13] >> 4) & 0x1FFFFF)) & 1))^((int32((in[13] >> 4) & 0x1FFFFF))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[13] >> 25) | ((in[14] & 0x3FFF) << 7)))) & 1))^((int32(((in[13] >> 25) | ((in[14] & 0x3FFF) << 7))))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[14] >> 14) | ((in[15] & 0x7) << 18)))) & 1))^((int32(((in[14] >> 14) | ((in[15] & 0x7) << 18))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[15] >> 3) & 0x1FFFFF)) & 1))^((int32((in[15] >> 3) & 0x1FFFFF))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[15] >> 24) | ((in[16] & 0x1FFF) << 8)))) & 1))^((int32(((in[15] >> 24) | ((in[16] & 0x1FFF) << 8))))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[16] >> 13) | ((in[17] & 0x3) << 19)))) & 1))^((int32(((in[16] >> 13) | ((in[17] & 0x3) << 19))))>>1))) + out[24] + out[26] = uint32(((-((int32((in[17] >> 2) & 0x1FFFFF)) & 1))^((int32((in[17] >> 2) & 0x1FFFFF))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[17] >> 23) | ((in[18] & 0xFFF) << 9)))) & 1))^((int32(((in[17] >> 23) | ((in[18] & 0xFFF) << 9))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[18] >> 12) | ((in[19] & 0x1) << 20)))) & 1))^((int32(((in[18] >> 12) | ((in[19] & 0x1) << 20))))>>1))) + out[27] + out[29] = uint32(((-((int32((in[19] >> 1) & 0x1FFFFF)) & 1))^((int32((in[19] >> 1) & 0x1FFFFF))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[19] >> 22) | ((in[20] & 0x7FF) << 10)))) & 1))^((int32(((in[19] >> 22) | ((in[20] & 0x7FF) << 10))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[20] >> 11))) & 1))^((int32((in[20] >> 11)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_22(initoffset uint32, in *[22]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3FFFFF)) & 1))^((int32((in[0] >> 0) & 0x3FFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 22) | ((in[1] & 0xFFF) << 10)))) & 1))^((int32(((in[0] >> 22) | ((in[1] & 0xFFF) << 10))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 12) | ((in[2] & 0x3) << 20)))) & 1))^((int32(((in[1] >> 12) | ((in[2] & 0x3) << 20))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[2] >> 2) & 0x3FFFFF)) & 1))^((int32((in[2] >> 2) & 0x3FFFFF))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[2] >> 24) | ((in[3] & 0x3FFF) << 8)))) & 1))^((int32(((in[2] >> 24) | ((in[3] & 0x3FFF) << 8))))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[3] >> 14) | ((in[4] & 0xF) << 18)))) & 1))^((int32(((in[3] >> 14) | ((in[4] & 0xF) << 18))))>>1))) + out[4] + out[6] = uint32(((-((int32((in[4] >> 4) & 0x3FFFFF)) & 1))^((int32((in[4] >> 4) & 0x3FFFFF))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[4] >> 26) | ((in[5] & 0xFFFF) << 6)))) & 1))^((int32(((in[4] >> 26) | ((in[5] & 0xFFFF) << 6))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[5] >> 16) | ((in[6] & 0x3F) << 16)))) & 1))^((int32(((in[5] >> 16) | ((in[6] & 0x3F) << 16))))>>1))) + out[7] + out[9] = uint32(((-((int32((in[6] >> 6) & 0x3FFFFF)) & 1))^((int32((in[6] >> 6) & 0x3FFFFF))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[6] >> 28) | ((in[7] & 0x3FFFF) << 4)))) & 1))^((int32(((in[6] >> 28) | ((in[7] & 0x3FFFF) << 4))))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[7] >> 18) | ((in[8] & 0xFF) << 14)))) & 1))^((int32(((in[7] >> 18) | ((in[8] & 0xFF) << 14))))>>1))) + out[10] + out[12] = uint32(((-((int32((in[8] >> 8) & 0x3FFFFF)) & 1))^((int32((in[8] >> 8) & 0x3FFFFF))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[8] >> 30) | ((in[9] & 0xFFFFF) << 2)))) & 1))^((int32(((in[8] >> 30) | ((in[9] & 0xFFFFF) << 2))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[9] >> 20) | ((in[10] & 0x3FF) << 12)))) & 1))^((int32(((in[9] >> 20) | ((in[10] & 0x3FF) << 12))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[10] >> 10))) & 1))^((int32((in[10] >> 10)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[11] >> 0) & 0x3FFFFF)) & 1))^((int32((in[11] >> 0) & 0x3FFFFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[11] >> 22) | ((in[12] & 0xFFF) << 10)))) & 1))^((int32(((in[11] >> 22) | ((in[12] & 0xFFF) << 10))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[12] >> 12) | ((in[13] & 0x3) << 20)))) & 1))^((int32(((in[12] >> 12) | ((in[13] & 0x3) << 20))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[13] >> 2) & 0x3FFFFF)) & 1))^((int32((in[13] >> 2) & 0x3FFFFF))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[13] >> 24) | ((in[14] & 0x3FFF) << 8)))) & 1))^((int32(((in[13] >> 24) | ((in[14] & 0x3FFF) << 8))))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[14] >> 14) | ((in[15] & 0xF) << 18)))) & 1))^((int32(((in[14] >> 14) | ((in[15] & 0xF) << 18))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[15] >> 4) & 0x3FFFFF)) & 1))^((int32((in[15] >> 4) & 0x3FFFFF))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[15] >> 26) | ((in[16] & 0xFFFF) << 6)))) & 1))^((int32(((in[15] >> 26) | ((in[16] & 0xFFFF) << 6))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[16] >> 16) | ((in[17] & 0x3F) << 16)))) & 1))^((int32(((in[16] >> 16) | ((in[17] & 0x3F) << 16))))>>1))) + out[23] + out[25] = uint32(((-((int32((in[17] >> 6) & 0x3FFFFF)) & 1))^((int32((in[17] >> 6) & 0x3FFFFF))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[17] >> 28) | ((in[18] & 0x3FFFF) << 4)))) & 1))^((int32(((in[17] >> 28) | ((in[18] & 0x3FFFF) << 4))))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[18] >> 18) | ((in[19] & 0xFF) << 14)))) & 1))^((int32(((in[18] >> 18) | ((in[19] & 0xFF) << 14))))>>1))) + out[26] + out[28] = uint32(((-((int32((in[19] >> 8) & 0x3FFFFF)) & 1))^((int32((in[19] >> 8) & 0x3FFFFF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[19] >> 30) | ((in[20] & 0xFFFFF) << 2)))) & 1))^((int32(((in[19] >> 30) | ((in[20] & 0xFFFFF) << 2))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[20] >> 20) | ((in[21] & 0x3FF) << 12)))) & 1))^((int32(((in[20] >> 20) | ((in[21] & 0x3FF) << 12))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[21] >> 10))) & 1))^((int32((in[21] >> 10)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_23(initoffset uint32, in *[23]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7FFFFF)) & 1))^((int32((in[0] >> 0) & 0x7FFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 23) | ((in[1] & 0x3FFF) << 9)))) & 1))^((int32(((in[0] >> 23) | ((in[1] & 0x3FFF) << 9))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 14) | ((in[2] & 0x1F) << 18)))) & 1))^((int32(((in[1] >> 14) | ((in[2] & 0x1F) << 18))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[2] >> 5) & 0x7FFFFF)) & 1))^((int32((in[2] >> 5) & 0x7FFFFF))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[2] >> 28) | ((in[3] & 0x7FFFF) << 4)))) & 1))^((int32(((in[2] >> 28) | ((in[3] & 0x7FFFF) << 4))))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[3] >> 19) | ((in[4] & 0x3FF) << 13)))) & 1))^((int32(((in[3] >> 19) | ((in[4] & 0x3FF) << 13))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[4] >> 10) | ((in[5] & 0x1) << 22)))) & 1))^((int32(((in[4] >> 10) | ((in[5] & 0x1) << 22))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[5] >> 1) & 0x7FFFFF)) & 1))^((int32((in[5] >> 1) & 0x7FFFFF))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[5] >> 24) | ((in[6] & 0x7FFF) << 8)))) & 1))^((int32(((in[5] >> 24) | ((in[6] & 0x7FFF) << 8))))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[6] >> 15) | ((in[7] & 0x3F) << 17)))) & 1))^((int32(((in[6] >> 15) | ((in[7] & 0x3F) << 17))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[7] >> 6) & 0x7FFFFF)) & 1))^((int32((in[7] >> 6) & 0x7FFFFF))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[7] >> 29) | ((in[8] & 0xFFFFF) << 3)))) & 1))^((int32(((in[7] >> 29) | ((in[8] & 0xFFFFF) << 3))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[8] >> 20) | ((in[9] & 0x7FF) << 12)))) & 1))^((int32(((in[8] >> 20) | ((in[9] & 0x7FF) << 12))))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[9] >> 11) | ((in[10] & 0x3) << 21)))) & 1))^((int32(((in[9] >> 11) | ((in[10] & 0x3) << 21))))>>1))) + out[12] + out[14] = uint32(((-((int32((in[10] >> 2) & 0x7FFFFF)) & 1))^((int32((in[10] >> 2) & 0x7FFFFF))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[10] >> 25) | ((in[11] & 0xFFFF) << 7)))) & 1))^((int32(((in[10] >> 25) | ((in[11] & 0xFFFF) << 7))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[11] >> 16) | ((in[12] & 0x7F) << 16)))) & 1))^((int32(((in[11] >> 16) | ((in[12] & 0x7F) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32((in[12] >> 7) & 0x7FFFFF)) & 1))^((int32((in[12] >> 7) & 0x7FFFFF))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[12] >> 30) | ((in[13] & 0x1FFFFF) << 2)))) & 1))^((int32(((in[12] >> 30) | ((in[13] & 0x1FFFFF) << 2))))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[13] >> 21) | ((in[14] & 0xFFF) << 11)))) & 1))^((int32(((in[13] >> 21) | ((in[14] & 0xFFF) << 11))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[14] >> 12) | ((in[15] & 0x7) << 20)))) & 1))^((int32(((in[14] >> 12) | ((in[15] & 0x7) << 20))))>>1))) + out[19] + out[21] = uint32(((-((int32((in[15] >> 3) & 0x7FFFFF)) & 1))^((int32((in[15] >> 3) & 0x7FFFFF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[15] >> 26) | ((in[16] & 0x1FFFF) << 6)))) & 1))^((int32(((in[15] >> 26) | ((in[16] & 0x1FFFF) << 6))))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[16] >> 17) | ((in[17] & 0xFF) << 15)))) & 1))^((int32(((in[16] >> 17) | ((in[17] & 0xFF) << 15))))>>1))) + out[22] + out[24] = uint32(((-((int32((in[17] >> 8) & 0x7FFFFF)) & 1))^((int32((in[17] >> 8) & 0x7FFFFF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[17] >> 31) | ((in[18] & 0x3FFFFF) << 1)))) & 1))^((int32(((in[17] >> 31) | ((in[18] & 0x3FFFFF) << 1))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[18] >> 22) | ((in[19] & 0x1FFF) << 10)))) & 1))^((int32(((in[18] >> 22) | ((in[19] & 0x1FFF) << 10))))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[19] >> 13) | ((in[20] & 0xF) << 19)))) & 1))^((int32(((in[19] >> 13) | ((in[20] & 0xF) << 19))))>>1))) + out[26] + out[28] = uint32(((-((int32((in[20] >> 4) & 0x7FFFFF)) & 1))^((int32((in[20] >> 4) & 0x7FFFFF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[20] >> 27) | ((in[21] & 0x3FFFF) << 5)))) & 1))^((int32(((in[20] >> 27) | ((in[21] & 0x3FFFF) << 5))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[21] >> 18) | ((in[22] & 0x1FF) << 14)))) & 1))^((int32(((in[21] >> 18) | ((in[22] & 0x1FF) << 14))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[22] >> 9))) & 1))^((int32((in[22] >> 9)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_24(initoffset uint32, in *[24]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0xFFFFFF)) & 1))^((int32((in[0] >> 0) & 0xFFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 24) | ((in[1] & 0xFFFF) << 8)))) & 1))^((int32(((in[0] >> 24) | ((in[1] & 0xFFFF) << 8))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 16) | ((in[2] & 0xFF) << 16)))) & 1))^((int32(((in[1] >> 16) | ((in[2] & 0xFF) << 16))))>>1))) + out[1] + out[3] = uint32(((-((int32((in[2] >> 8))) & 1))^((int32((in[2] >> 8)))>>1))) + out[2] + out[4] = uint32(((-((int32((in[3] >> 0) & 0xFFFFFF)) & 1))^((int32((in[3] >> 0) & 0xFFFFFF))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[3] >> 24) | ((in[4] & 0xFFFF) << 8)))) & 1))^((int32(((in[3] >> 24) | ((in[4] & 0xFFFF) << 8))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[4] >> 16) | ((in[5] & 0xFF) << 16)))) & 1))^((int32(((in[4] >> 16) | ((in[5] & 0xFF) << 16))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[5] >> 8))) & 1))^((int32((in[5] >> 8)))>>1))) + out[6] + out[8] = uint32(((-((int32((in[6] >> 0) & 0xFFFFFF)) & 1))^((int32((in[6] >> 0) & 0xFFFFFF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[6] >> 24) | ((in[7] & 0xFFFF) << 8)))) & 1))^((int32(((in[6] >> 24) | ((in[7] & 0xFFFF) << 8))))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[7] >> 16) | ((in[8] & 0xFF) << 16)))) & 1))^((int32(((in[7] >> 16) | ((in[8] & 0xFF) << 16))))>>1))) + out[9] + out[11] = uint32(((-((int32((in[8] >> 8))) & 1))^((int32((in[8] >> 8)))>>1))) + out[10] + out[12] = uint32(((-((int32((in[9] >> 0) & 0xFFFFFF)) & 1))^((int32((in[9] >> 0) & 0xFFFFFF))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[9] >> 24) | ((in[10] & 0xFFFF) << 8)))) & 1))^((int32(((in[9] >> 24) | ((in[10] & 0xFFFF) << 8))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[10] >> 16) | ((in[11] & 0xFF) << 16)))) & 1))^((int32(((in[10] >> 16) | ((in[11] & 0xFF) << 16))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[11] >> 8))) & 1))^((int32((in[11] >> 8)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[12] >> 0) & 0xFFFFFF)) & 1))^((int32((in[12] >> 0) & 0xFFFFFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[12] >> 24) | ((in[13] & 0xFFFF) << 8)))) & 1))^((int32(((in[12] >> 24) | ((in[13] & 0xFFFF) << 8))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[13] >> 16) | ((in[14] & 0xFF) << 16)))) & 1))^((int32(((in[13] >> 16) | ((in[14] & 0xFF) << 16))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[14] >> 8))) & 1))^((int32((in[14] >> 8)))>>1))) + out[18] + out[20] = uint32(((-((int32((in[15] >> 0) & 0xFFFFFF)) & 1))^((int32((in[15] >> 0) & 0xFFFFFF))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[15] >> 24) | ((in[16] & 0xFFFF) << 8)))) & 1))^((int32(((in[15] >> 24) | ((in[16] & 0xFFFF) << 8))))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[16] >> 16) | ((in[17] & 0xFF) << 16)))) & 1))^((int32(((in[16] >> 16) | ((in[17] & 0xFF) << 16))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[17] >> 8))) & 1))^((int32((in[17] >> 8)))>>1))) + out[22] + out[24] = uint32(((-((int32((in[18] >> 0) & 0xFFFFFF)) & 1))^((int32((in[18] >> 0) & 0xFFFFFF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[18] >> 24) | ((in[19] & 0xFFFF) << 8)))) & 1))^((int32(((in[18] >> 24) | ((in[19] & 0xFFFF) << 8))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[19] >> 16) | ((in[20] & 0xFF) << 16)))) & 1))^((int32(((in[19] >> 16) | ((in[20] & 0xFF) << 16))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[20] >> 8))) & 1))^((int32((in[20] >> 8)))>>1))) + out[26] + out[28] = uint32(((-((int32((in[21] >> 0) & 0xFFFFFF)) & 1))^((int32((in[21] >> 0) & 0xFFFFFF))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[21] >> 24) | ((in[22] & 0xFFFF) << 8)))) & 1))^((int32(((in[21] >> 24) | ((in[22] & 0xFFFF) << 8))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[22] >> 16) | ((in[23] & 0xFF) << 16)))) & 1))^((int32(((in[22] >> 16) | ((in[23] & 0xFF) << 16))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[23] >> 8))) & 1))^((int32((in[23] >> 8)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_25(initoffset uint32, in *[25]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1FFFFFF)) & 1))^((int32((in[0] >> 0) & 0x1FFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 25) | ((in[1] & 0x3FFFF) << 7)))) & 1))^((int32(((in[0] >> 25) | ((in[1] & 0x3FFFF) << 7))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 18) | ((in[2] & 0x7FF) << 14)))) & 1))^((int32(((in[1] >> 18) | ((in[2] & 0x7FF) << 14))))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[2] >> 11) | ((in[3] & 0xF) << 21)))) & 1))^((int32(((in[2] >> 11) | ((in[3] & 0xF) << 21))))>>1))) + out[2] + out[4] = uint32(((-((int32((in[3] >> 4) & 0x1FFFFFF)) & 1))^((int32((in[3] >> 4) & 0x1FFFFFF))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[3] >> 29) | ((in[4] & 0x3FFFFF) << 3)))) & 1))^((int32(((in[3] >> 29) | ((in[4] & 0x3FFFFF) << 3))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[4] >> 22) | ((in[5] & 0x7FFF) << 10)))) & 1))^((int32(((in[4] >> 22) | ((in[5] & 0x7FFF) << 10))))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[5] >> 15) | ((in[6] & 0xFF) << 17)))) & 1))^((int32(((in[5] >> 15) | ((in[6] & 0xFF) << 17))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[6] >> 8) | ((in[7] & 0x1) << 24)))) & 1))^((int32(((in[6] >> 8) | ((in[7] & 0x1) << 24))))>>1))) + out[7] + out[9] = uint32(((-((int32((in[7] >> 1) & 0x1FFFFFF)) & 1))^((int32((in[7] >> 1) & 0x1FFFFFF))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[7] >> 26) | ((in[8] & 0x7FFFF) << 6)))) & 1))^((int32(((in[7] >> 26) | ((in[8] & 0x7FFFF) << 6))))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[8] >> 19) | ((in[9] & 0xFFF) << 13)))) & 1))^((int32(((in[8] >> 19) | ((in[9] & 0xFFF) << 13))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[9] >> 12) | ((in[10] & 0x1F) << 20)))) & 1))^((int32(((in[9] >> 12) | ((in[10] & 0x1F) << 20))))>>1))) + out[11] + out[13] = uint32(((-((int32((in[10] >> 5) & 0x1FFFFFF)) & 1))^((int32((in[10] >> 5) & 0x1FFFFFF))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[10] >> 30) | ((in[11] & 0x7FFFFF) << 2)))) & 1))^((int32(((in[10] >> 30) | ((in[11] & 0x7FFFFF) << 2))))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[11] >> 23) | ((in[12] & 0xFFFF) << 9)))) & 1))^((int32(((in[11] >> 23) | ((in[12] & 0xFFFF) << 9))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[12] >> 16) | ((in[13] & 0x1FF) << 16)))) & 1))^((int32(((in[12] >> 16) | ((in[13] & 0x1FF) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[13] >> 9) | ((in[14] & 0x3) << 23)))) & 1))^((int32(((in[13] >> 9) | ((in[14] & 0x3) << 23))))>>1))) + out[16] + out[18] = uint32(((-((int32((in[14] >> 2) & 0x1FFFFFF)) & 1))^((int32((in[14] >> 2) & 0x1FFFFFF))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[14] >> 27) | ((in[15] & 0xFFFFF) << 5)))) & 1))^((int32(((in[14] >> 27) | ((in[15] & 0xFFFFF) << 5))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[15] >> 20) | ((in[16] & 0x1FFF) << 12)))) & 1))^((int32(((in[15] >> 20) | ((in[16] & 0x1FFF) << 12))))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[16] >> 13) | ((in[17] & 0x3F) << 19)))) & 1))^((int32(((in[16] >> 13) | ((in[17] & 0x3F) << 19))))>>1))) + out[20] + out[22] = uint32(((-((int32((in[17] >> 6) & 0x1FFFFFF)) & 1))^((int32((in[17] >> 6) & 0x1FFFFFF))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[17] >> 31) | ((in[18] & 0xFFFFFF) << 1)))) & 1))^((int32(((in[17] >> 31) | ((in[18] & 0xFFFFFF) << 1))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[18] >> 24) | ((in[19] & 0x1FFFF) << 8)))) & 1))^((int32(((in[18] >> 24) | ((in[19] & 0x1FFFF) << 8))))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[19] >> 17) | ((in[20] & 0x3FF) << 15)))) & 1))^((int32(((in[19] >> 17) | ((in[20] & 0x3FF) << 15))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[20] >> 10) | ((in[21] & 0x7) << 22)))) & 1))^((int32(((in[20] >> 10) | ((in[21] & 0x7) << 22))))>>1))) + out[25] + out[27] = uint32(((-((int32((in[21] >> 3) & 0x1FFFFFF)) & 1))^((int32((in[21] >> 3) & 0x1FFFFFF))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[21] >> 28) | ((in[22] & 0x1FFFFF) << 4)))) & 1))^((int32(((in[21] >> 28) | ((in[22] & 0x1FFFFF) << 4))))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[22] >> 21) | ((in[23] & 0x3FFF) << 11)))) & 1))^((int32(((in[22] >> 21) | ((in[23] & 0x3FFF) << 11))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[23] >> 14) | ((in[24] & 0x7F) << 18)))) & 1))^((int32(((in[23] >> 14) | ((in[24] & 0x7F) << 18))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[24] >> 7))) & 1))^((int32((in[24] >> 7)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_26(initoffset uint32, in *[26]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3FFFFFF)) & 1))^((int32((in[0] >> 0) & 0x3FFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 26) | ((in[1] & 0xFFFFF) << 6)))) & 1))^((int32(((in[0] >> 26) | ((in[1] & 0xFFFFF) << 6))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 20) | ((in[2] & 0x3FFF) << 12)))) & 1))^((int32(((in[1] >> 20) | ((in[2] & 0x3FFF) << 12))))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[2] >> 14) | ((in[3] & 0xFF) << 18)))) & 1))^((int32(((in[2] >> 14) | ((in[3] & 0xFF) << 18))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[3] >> 8) | ((in[4] & 0x3) << 24)))) & 1))^((int32(((in[3] >> 8) | ((in[4] & 0x3) << 24))))>>1))) + out[3] + out[5] = uint32(((-((int32((in[4] >> 2) & 0x3FFFFFF)) & 1))^((int32((in[4] >> 2) & 0x3FFFFFF))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[4] >> 28) | ((in[5] & 0x3FFFFF) << 4)))) & 1))^((int32(((in[4] >> 28) | ((in[5] & 0x3FFFFF) << 4))))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[5] >> 22) | ((in[6] & 0xFFFF) << 10)))) & 1))^((int32(((in[5] >> 22) | ((in[6] & 0xFFFF) << 10))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[6] >> 16) | ((in[7] & 0x3FF) << 16)))) & 1))^((int32(((in[6] >> 16) | ((in[7] & 0x3FF) << 16))))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[7] >> 10) | ((in[8] & 0xF) << 22)))) & 1))^((int32(((in[7] >> 10) | ((in[8] & 0xF) << 22))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[8] >> 4) & 0x3FFFFFF)) & 1))^((int32((in[8] >> 4) & 0x3FFFFFF))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[8] >> 30) | ((in[9] & 0xFFFFFF) << 2)))) & 1))^((int32(((in[8] >> 30) | ((in[9] & 0xFFFFFF) << 2))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[9] >> 24) | ((in[10] & 0x3FFFF) << 8)))) & 1))^((int32(((in[9] >> 24) | ((in[10] & 0x3FFFF) << 8))))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[10] >> 18) | ((in[11] & 0xFFF) << 14)))) & 1))^((int32(((in[10] >> 18) | ((in[11] & 0xFFF) << 14))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[11] >> 12) | ((in[12] & 0x3F) << 20)))) & 1))^((int32(((in[11] >> 12) | ((in[12] & 0x3F) << 20))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[12] >> 6))) & 1))^((int32((in[12] >> 6)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[13] >> 0) & 0x3FFFFFF)) & 1))^((int32((in[13] >> 0) & 0x3FFFFFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[13] >> 26) | ((in[14] & 0xFFFFF) << 6)))) & 1))^((int32(((in[13] >> 26) | ((in[14] & 0xFFFFF) << 6))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[14] >> 20) | ((in[15] & 0x3FFF) << 12)))) & 1))^((int32(((in[14] >> 20) | ((in[15] & 0x3FFF) << 12))))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[15] >> 14) | ((in[16] & 0xFF) << 18)))) & 1))^((int32(((in[15] >> 14) | ((in[16] & 0xFF) << 18))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[16] >> 8) | ((in[17] & 0x3) << 24)))) & 1))^((int32(((in[16] >> 8) | ((in[17] & 0x3) << 24))))>>1))) + out[19] + out[21] = uint32(((-((int32((in[17] >> 2) & 0x3FFFFFF)) & 1))^((int32((in[17] >> 2) & 0x3FFFFFF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[17] >> 28) | ((in[18] & 0x3FFFFF) << 4)))) & 1))^((int32(((in[17] >> 28) | ((in[18] & 0x3FFFFF) << 4))))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[18] >> 22) | ((in[19] & 0xFFFF) << 10)))) & 1))^((int32(((in[18] >> 22) | ((in[19] & 0xFFFF) << 10))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[19] >> 16) | ((in[20] & 0x3FF) << 16)))) & 1))^((int32(((in[19] >> 16) | ((in[20] & 0x3FF) << 16))))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[20] >> 10) | ((in[21] & 0xF) << 22)))) & 1))^((int32(((in[20] >> 10) | ((in[21] & 0xF) << 22))))>>1))) + out[24] + out[26] = uint32(((-((int32((in[21] >> 4) & 0x3FFFFFF)) & 1))^((int32((in[21] >> 4) & 0x3FFFFFF))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[21] >> 30) | ((in[22] & 0xFFFFFF) << 2)))) & 1))^((int32(((in[21] >> 30) | ((in[22] & 0xFFFFFF) << 2))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[22] >> 24) | ((in[23] & 0x3FFFF) << 8)))) & 1))^((int32(((in[22] >> 24) | ((in[23] & 0x3FFFF) << 8))))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[23] >> 18) | ((in[24] & 0xFFF) << 14)))) & 1))^((int32(((in[23] >> 18) | ((in[24] & 0xFFF) << 14))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[24] >> 12) | ((in[25] & 0x3F) << 20)))) & 1))^((int32(((in[24] >> 12) | ((in[25] & 0x3F) << 20))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[25] >> 6))) & 1))^((int32((in[25] >> 6)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_27(initoffset uint32, in *[27]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7FFFFFF)) & 1))^((int32((in[0] >> 0) & 0x7FFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 27) | ((in[1] & 0x3FFFFF) << 5)))) & 1))^((int32(((in[0] >> 27) | ((in[1] & 0x3FFFFF) << 5))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 22) | ((in[2] & 0x1FFFF) << 10)))) & 1))^((int32(((in[1] >> 22) | ((in[2] & 0x1FFFF) << 10))))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[2] >> 17) | ((in[3] & 0xFFF) << 15)))) & 1))^((int32(((in[2] >> 17) | ((in[3] & 0xFFF) << 15))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[3] >> 12) | ((in[4] & 0x7F) << 20)))) & 1))^((int32(((in[3] >> 12) | ((in[4] & 0x7F) << 20))))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[4] >> 7) | ((in[5] & 0x3) << 25)))) & 1))^((int32(((in[4] >> 7) | ((in[5] & 0x3) << 25))))>>1))) + out[4] + out[6] = uint32(((-((int32((in[5] >> 2) & 0x7FFFFFF)) & 1))^((int32((in[5] >> 2) & 0x7FFFFFF))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[5] >> 29) | ((in[6] & 0xFFFFFF) << 3)))) & 1))^((int32(((in[5] >> 29) | ((in[6] & 0xFFFFFF) << 3))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[6] >> 24) | ((in[7] & 0x7FFFF) << 8)))) & 1))^((int32(((in[6] >> 24) | ((in[7] & 0x7FFFF) << 8))))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[7] >> 19) | ((in[8] & 0x3FFF) << 13)))) & 1))^((int32(((in[7] >> 19) | ((in[8] & 0x3FFF) << 13))))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[8] >> 14) | ((in[9] & 0x1FF) << 18)))) & 1))^((int32(((in[8] >> 14) | ((in[9] & 0x1FF) << 18))))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[9] >> 9) | ((in[10] & 0xF) << 23)))) & 1))^((int32(((in[9] >> 9) | ((in[10] & 0xF) << 23))))>>1))) + out[10] + out[12] = uint32(((-((int32((in[10] >> 4) & 0x7FFFFFF)) & 1))^((int32((in[10] >> 4) & 0x7FFFFFF))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[10] >> 31) | ((in[11] & 0x3FFFFFF) << 1)))) & 1))^((int32(((in[10] >> 31) | ((in[11] & 0x3FFFFFF) << 1))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[11] >> 26) | ((in[12] & 0x1FFFFF) << 6)))) & 1))^((int32(((in[11] >> 26) | ((in[12] & 0x1FFFFF) << 6))))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[12] >> 21) | ((in[13] & 0xFFFF) << 11)))) & 1))^((int32(((in[12] >> 21) | ((in[13] & 0xFFFF) << 11))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[13] >> 16) | ((in[14] & 0x7FF) << 16)))) & 1))^((int32(((in[13] >> 16) | ((in[14] & 0x7FF) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[14] >> 11) | ((in[15] & 0x3F) << 21)))) & 1))^((int32(((in[14] >> 11) | ((in[15] & 0x3F) << 21))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[15] >> 6) | ((in[16] & 0x1) << 26)))) & 1))^((int32(((in[15] >> 6) | ((in[16] & 0x1) << 26))))>>1))) + out[17] + out[19] = uint32(((-((int32((in[16] >> 1) & 0x7FFFFFF)) & 1))^((int32((in[16] >> 1) & 0x7FFFFFF))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[16] >> 28) | ((in[17] & 0x7FFFFF) << 4)))) & 1))^((int32(((in[16] >> 28) | ((in[17] & 0x7FFFFF) << 4))))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[17] >> 23) | ((in[18] & 0x3FFFF) << 9)))) & 1))^((int32(((in[17] >> 23) | ((in[18] & 0x3FFFF) << 9))))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[18] >> 18) | ((in[19] & 0x1FFF) << 14)))) & 1))^((int32(((in[18] >> 18) | ((in[19] & 0x1FFF) << 14))))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[19] >> 13) | ((in[20] & 0xFF) << 19)))) & 1))^((int32(((in[19] >> 13) | ((in[20] & 0xFF) << 19))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[20] >> 8) | ((in[21] & 0x7) << 24)))) & 1))^((int32(((in[20] >> 8) | ((in[21] & 0x7) << 24))))>>1))) + out[23] + out[25] = uint32(((-((int32((in[21] >> 3) & 0x7FFFFFF)) & 1))^((int32((in[21] >> 3) & 0x7FFFFFF))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[21] >> 30) | ((in[22] & 0x1FFFFFF) << 2)))) & 1))^((int32(((in[21] >> 30) | ((in[22] & 0x1FFFFFF) << 2))))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[22] >> 25) | ((in[23] & 0xFFFFF) << 7)))) & 1))^((int32(((in[22] >> 25) | ((in[23] & 0xFFFFF) << 7))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[23] >> 20) | ((in[24] & 0x7FFF) << 12)))) & 1))^((int32(((in[23] >> 20) | ((in[24] & 0x7FFF) << 12))))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[24] >> 15) | ((in[25] & 0x3FF) << 17)))) & 1))^((int32(((in[24] >> 15) | ((in[25] & 0x3FF) << 17))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[25] >> 10) | ((in[26] & 0x1F) << 22)))) & 1))^((int32(((in[25] >> 10) | ((in[26] & 0x1F) << 22))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[26] >> 5))) & 1))^((int32((in[26] >> 5)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_28(initoffset uint32, in *[28]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0xFFFFFFF)) & 1))^((int32((in[0] >> 0) & 0xFFFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 28) | ((in[1] & 0xFFFFFF) << 4)))) & 1))^((int32(((in[0] >> 28) | ((in[1] & 0xFFFFFF) << 4))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 24) | ((in[2] & 0xFFFFF) << 8)))) & 1))^((int32(((in[1] >> 24) | ((in[2] & 0xFFFFF) << 8))))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[2] >> 20) | ((in[3] & 0xFFFF) << 12)))) & 1))^((int32(((in[2] >> 20) | ((in[3] & 0xFFFF) << 12))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[3] >> 16) | ((in[4] & 0xFFF) << 16)))) & 1))^((int32(((in[3] >> 16) | ((in[4] & 0xFFF) << 16))))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[4] >> 12) | ((in[5] & 0xFF) << 20)))) & 1))^((int32(((in[4] >> 12) | ((in[5] & 0xFF) << 20))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[5] >> 8) | ((in[6] & 0xF) << 24)))) & 1))^((int32(((in[5] >> 8) | ((in[6] & 0xF) << 24))))>>1))) + out[5] + out[7] = uint32(((-((int32((in[6] >> 4))) & 1))^((int32((in[6] >> 4)))>>1))) + out[6] + out[8] = uint32(((-((int32((in[7] >> 0) & 0xFFFFFFF)) & 1))^((int32((in[7] >> 0) & 0xFFFFFFF))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[7] >> 28) | ((in[8] & 0xFFFFFF) << 4)))) & 1))^((int32(((in[7] >> 28) | ((in[8] & 0xFFFFFF) << 4))))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[8] >> 24) | ((in[9] & 0xFFFFF) << 8)))) & 1))^((int32(((in[8] >> 24) | ((in[9] & 0xFFFFF) << 8))))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[9] >> 20) | ((in[10] & 0xFFFF) << 12)))) & 1))^((int32(((in[9] >> 20) | ((in[10] & 0xFFFF) << 12))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[10] >> 16) | ((in[11] & 0xFFF) << 16)))) & 1))^((int32(((in[10] >> 16) | ((in[11] & 0xFFF) << 16))))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[11] >> 12) | ((in[12] & 0xFF) << 20)))) & 1))^((int32(((in[11] >> 12) | ((in[12] & 0xFF) << 20))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[12] >> 8) | ((in[13] & 0xF) << 24)))) & 1))^((int32(((in[12] >> 8) | ((in[13] & 0xF) << 24))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[13] >> 4))) & 1))^((int32((in[13] >> 4)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[14] >> 0) & 0xFFFFFFF)) & 1))^((int32((in[14] >> 0) & 0xFFFFFFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[14] >> 28) | ((in[15] & 0xFFFFFF) << 4)))) & 1))^((int32(((in[14] >> 28) | ((in[15] & 0xFFFFFF) << 4))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[15] >> 24) | ((in[16] & 0xFFFFF) << 8)))) & 1))^((int32(((in[15] >> 24) | ((in[16] & 0xFFFFF) << 8))))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[16] >> 20) | ((in[17] & 0xFFFF) << 12)))) & 1))^((int32(((in[16] >> 20) | ((in[17] & 0xFFFF) << 12))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[17] >> 16) | ((in[18] & 0xFFF) << 16)))) & 1))^((int32(((in[17] >> 16) | ((in[18] & 0xFFF) << 16))))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[18] >> 12) | ((in[19] & 0xFF) << 20)))) & 1))^((int32(((in[18] >> 12) | ((in[19] & 0xFF) << 20))))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[19] >> 8) | ((in[20] & 0xF) << 24)))) & 1))^((int32(((in[19] >> 8) | ((in[20] & 0xF) << 24))))>>1))) + out[21] + out[23] = uint32(((-((int32((in[20] >> 4))) & 1))^((int32((in[20] >> 4)))>>1))) + out[22] + out[24] = uint32(((-((int32((in[21] >> 0) & 0xFFFFFFF)) & 1))^((int32((in[21] >> 0) & 0xFFFFFFF))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[21] >> 28) | ((in[22] & 0xFFFFFF) << 4)))) & 1))^((int32(((in[21] >> 28) | ((in[22] & 0xFFFFFF) << 4))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[22] >> 24) | ((in[23] & 0xFFFFF) << 8)))) & 1))^((int32(((in[22] >> 24) | ((in[23] & 0xFFFFF) << 8))))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[23] >> 20) | ((in[24] & 0xFFFF) << 12)))) & 1))^((int32(((in[23] >> 20) | ((in[24] & 0xFFFF) << 12))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[24] >> 16) | ((in[25] & 0xFFF) << 16)))) & 1))^((int32(((in[24] >> 16) | ((in[25] & 0xFFF) << 16))))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[25] >> 12) | ((in[26] & 0xFF) << 20)))) & 1))^((int32(((in[25] >> 12) | ((in[26] & 0xFF) << 20))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[26] >> 8) | ((in[27] & 0xF) << 24)))) & 1))^((int32(((in[26] >> 8) | ((in[27] & 0xF) << 24))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[27] >> 4))) & 1))^((int32((in[27] >> 4)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_29(initoffset uint32, in *[29]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x1FFFFFFF)) & 1))^((int32((in[0] >> 0) & 0x1FFFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 29) | ((in[1] & 0x3FFFFFF) << 3)))) & 1))^((int32(((in[0] >> 29) | ((in[1] & 0x3FFFFFF) << 3))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 26) | ((in[2] & 0x7FFFFF) << 6)))) & 1))^((int32(((in[1] >> 26) | ((in[2] & 0x7FFFFF) << 6))))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[2] >> 23) | ((in[3] & 0xFFFFF) << 9)))) & 1))^((int32(((in[2] >> 23) | ((in[3] & 0xFFFFF) << 9))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[3] >> 20) | ((in[4] & 0x1FFFF) << 12)))) & 1))^((int32(((in[3] >> 20) | ((in[4] & 0x1FFFF) << 12))))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[4] >> 17) | ((in[5] & 0x3FFF) << 15)))) & 1))^((int32(((in[4] >> 17) | ((in[5] & 0x3FFF) << 15))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[5] >> 14) | ((in[6] & 0x7FF) << 18)))) & 1))^((int32(((in[5] >> 14) | ((in[6] & 0x7FF) << 18))))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[6] >> 11) | ((in[7] & 0xFF) << 21)))) & 1))^((int32(((in[6] >> 11) | ((in[7] & 0xFF) << 21))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[7] >> 8) | ((in[8] & 0x1F) << 24)))) & 1))^((int32(((in[7] >> 8) | ((in[8] & 0x1F) << 24))))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[8] >> 5) | ((in[9] & 0x3) << 27)))) & 1))^((int32(((in[8] >> 5) | ((in[9] & 0x3) << 27))))>>1))) + out[8] + out[10] = uint32(((-((int32((in[9] >> 2) & 0x1FFFFFFF)) & 1))^((int32((in[9] >> 2) & 0x1FFFFFFF))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[9] >> 31) | ((in[10] & 0xFFFFFFF) << 1)))) & 1))^((int32(((in[9] >> 31) | ((in[10] & 0xFFFFFFF) << 1))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[10] >> 28) | ((in[11] & 0x1FFFFFF) << 4)))) & 1))^((int32(((in[10] >> 28) | ((in[11] & 0x1FFFFFF) << 4))))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[11] >> 25) | ((in[12] & 0x3FFFFF) << 7)))) & 1))^((int32(((in[11] >> 25) | ((in[12] & 0x3FFFFF) << 7))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[12] >> 22) | ((in[13] & 0x7FFFF) << 10)))) & 1))^((int32(((in[12] >> 22) | ((in[13] & 0x7FFFF) << 10))))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[13] >> 19) | ((in[14] & 0xFFFF) << 13)))) & 1))^((int32(((in[13] >> 19) | ((in[14] & 0xFFFF) << 13))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[14] >> 16) | ((in[15] & 0x1FFF) << 16)))) & 1))^((int32(((in[14] >> 16) | ((in[15] & 0x1FFF) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[15] >> 13) | ((in[16] & 0x3FF) << 19)))) & 1))^((int32(((in[15] >> 13) | ((in[16] & 0x3FF) << 19))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[16] >> 10) | ((in[17] & 0x7F) << 22)))) & 1))^((int32(((in[16] >> 10) | ((in[17] & 0x7F) << 22))))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[17] >> 7) | ((in[18] & 0xF) << 25)))) & 1))^((int32(((in[17] >> 7) | ((in[18] & 0xF) << 25))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[18] >> 4) | ((in[19] & 0x1) << 28)))) & 1))^((int32(((in[18] >> 4) | ((in[19] & 0x1) << 28))))>>1))) + out[19] + out[21] = uint32(((-((int32((in[19] >> 1) & 0x1FFFFFFF)) & 1))^((int32((in[19] >> 1) & 0x1FFFFFFF))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[19] >> 30) | ((in[20] & 0x7FFFFFF) << 2)))) & 1))^((int32(((in[19] >> 30) | ((in[20] & 0x7FFFFFF) << 2))))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[20] >> 27) | ((in[21] & 0xFFFFFF) << 5)))) & 1))^((int32(((in[20] >> 27) | ((in[21] & 0xFFFFFF) << 5))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[21] >> 24) | ((in[22] & 0x1FFFFF) << 8)))) & 1))^((int32(((in[21] >> 24) | ((in[22] & 0x1FFFFF) << 8))))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[22] >> 21) | ((in[23] & 0x3FFFF) << 11)))) & 1))^((int32(((in[22] >> 21) | ((in[23] & 0x3FFFF) << 11))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[23] >> 18) | ((in[24] & 0x7FFF) << 14)))) & 1))^((int32(((in[23] >> 18) | ((in[24] & 0x7FFF) << 14))))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[24] >> 15) | ((in[25] & 0xFFF) << 17)))) & 1))^((int32(((in[24] >> 15) | ((in[25] & 0xFFF) << 17))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[25] >> 12) | ((in[26] & 0x1FF) << 20)))) & 1))^((int32(((in[25] >> 12) | ((in[26] & 0x1FF) << 20))))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[26] >> 9) | ((in[27] & 0x3F) << 23)))) & 1))^((int32(((in[26] >> 9) | ((in[27] & 0x3F) << 23))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[27] >> 6) | ((in[28] & 0x7) << 26)))) & 1))^((int32(((in[27] >> 6) | ((in[28] & 0x7) << 26))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[28] >> 3))) & 1))^((int32((in[28] >> 3)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_30(initoffset uint32, in *[30]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x3FFFFFFF)) & 1))^((int32((in[0] >> 0) & 0x3FFFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 30) | ((in[1] & 0xFFFFFFF) << 2)))) & 1))^((int32(((in[0] >> 30) | ((in[1] & 0xFFFFFFF) << 2))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 28) | ((in[2] & 0x3FFFFFF) << 4)))) & 1))^((int32(((in[1] >> 28) | ((in[2] & 0x3FFFFFF) << 4))))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[2] >> 26) | ((in[3] & 0xFFFFFF) << 6)))) & 1))^((int32(((in[2] >> 26) | ((in[3] & 0xFFFFFF) << 6))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[3] >> 24) | ((in[4] & 0x3FFFFF) << 8)))) & 1))^((int32(((in[3] >> 24) | ((in[4] & 0x3FFFFF) << 8))))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[4] >> 22) | ((in[5] & 0xFFFFF) << 10)))) & 1))^((int32(((in[4] >> 22) | ((in[5] & 0xFFFFF) << 10))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[5] >> 20) | ((in[6] & 0x3FFFF) << 12)))) & 1))^((int32(((in[5] >> 20) | ((in[6] & 0x3FFFF) << 12))))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[6] >> 18) | ((in[7] & 0xFFFF) << 14)))) & 1))^((int32(((in[6] >> 18) | ((in[7] & 0xFFFF) << 14))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[7] >> 16) | ((in[8] & 0x3FFF) << 16)))) & 1))^((int32(((in[7] >> 16) | ((in[8] & 0x3FFF) << 16))))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[8] >> 14) | ((in[9] & 0xFFF) << 18)))) & 1))^((int32(((in[8] >> 14) | ((in[9] & 0xFFF) << 18))))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[9] >> 12) | ((in[10] & 0x3FF) << 20)))) & 1))^((int32(((in[9] >> 12) | ((in[10] & 0x3FF) << 20))))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[10] >> 10) | ((in[11] & 0xFF) << 22)))) & 1))^((int32(((in[10] >> 10) | ((in[11] & 0xFF) << 22))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[11] >> 8) | ((in[12] & 0x3F) << 24)))) & 1))^((int32(((in[11] >> 8) | ((in[12] & 0x3F) << 24))))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[12] >> 6) | ((in[13] & 0xF) << 26)))) & 1))^((int32(((in[12] >> 6) | ((in[13] & 0xF) << 26))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[13] >> 4) | ((in[14] & 0x3) << 28)))) & 1))^((int32(((in[13] >> 4) | ((in[14] & 0x3) << 28))))>>1))) + out[13] + out[15] = uint32(((-((int32((in[14] >> 2))) & 1))^((int32((in[14] >> 2)))>>1))) + out[14] + out[16] = uint32(((-((int32((in[15] >> 0) & 0x3FFFFFFF)) & 1))^((int32((in[15] >> 0) & 0x3FFFFFFF))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[15] >> 30) | ((in[16] & 0xFFFFFFF) << 2)))) & 1))^((int32(((in[15] >> 30) | ((in[16] & 0xFFFFFFF) << 2))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[16] >> 28) | ((in[17] & 0x3FFFFFF) << 4)))) & 1))^((int32(((in[16] >> 28) | ((in[17] & 0x3FFFFFF) << 4))))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[17] >> 26) | ((in[18] & 0xFFFFFF) << 6)))) & 1))^((int32(((in[17] >> 26) | ((in[18] & 0xFFFFFF) << 6))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[18] >> 24) | ((in[19] & 0x3FFFFF) << 8)))) & 1))^((int32(((in[18] >> 24) | ((in[19] & 0x3FFFFF) << 8))))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[19] >> 22) | ((in[20] & 0xFFFFF) << 10)))) & 1))^((int32(((in[19] >> 22) | ((in[20] & 0xFFFFF) << 10))))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[20] >> 20) | ((in[21] & 0x3FFFF) << 12)))) & 1))^((int32(((in[20] >> 20) | ((in[21] & 0x3FFFF) << 12))))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[21] >> 18) | ((in[22] & 0xFFFF) << 14)))) & 1))^((int32(((in[21] >> 18) | ((in[22] & 0xFFFF) << 14))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[22] >> 16) | ((in[23] & 0x3FFF) << 16)))) & 1))^((int32(((in[22] >> 16) | ((in[23] & 0x3FFF) << 16))))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[23] >> 14) | ((in[24] & 0xFFF) << 18)))) & 1))^((int32(((in[23] >> 14) | ((in[24] & 0xFFF) << 18))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[24] >> 12) | ((in[25] & 0x3FF) << 20)))) & 1))^((int32(((in[24] >> 12) | ((in[25] & 0x3FF) << 20))))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[25] >> 10) | ((in[26] & 0xFF) << 22)))) & 1))^((int32(((in[25] >> 10) | ((in[26] & 0xFF) << 22))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[26] >> 8) | ((in[27] & 0x3F) << 24)))) & 1))^((int32(((in[26] >> 8) | ((in[27] & 0x3F) << 24))))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[27] >> 6) | ((in[28] & 0xF) << 26)))) & 1))^((int32(((in[27] >> 6) | ((in[28] & 0xF) << 26))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[28] >> 4) | ((in[29] & 0x3) << 28)))) & 1))^((int32(((in[28] >> 4) | ((in[29] & 0x3) << 28))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[29] >> 2))) & 1))^((int32((in[29] >> 2)))>>1))) + out[30] +} + +func deltaunpackzigzag_uint32_31(initoffset uint32, in *[31]uint32, out *[32]uint32) { + out[0] = uint32(((-((int32((in[0] >> 0) & 0x7FFFFFFF)) & 1))^((int32((in[0] >> 0) & 0x7FFFFFFF))>>1))) + initoffset + out[1] = uint32(((-((int32(((in[0] >> 31) | ((in[1] & 0x3FFFFFFF) << 1)))) & 1))^((int32(((in[0] >> 31) | ((in[1] & 0x3FFFFFFF) << 1))))>>1))) + out[0] + out[2] = uint32(((-((int32(((in[1] >> 30) | ((in[2] & 0x1FFFFFFF) << 2)))) & 1))^((int32(((in[1] >> 30) | ((in[2] & 0x1FFFFFFF) << 2))))>>1))) + out[1] + out[3] = uint32(((-((int32(((in[2] >> 29) | ((in[3] & 0xFFFFFFF) << 3)))) & 1))^((int32(((in[2] >> 29) | ((in[3] & 0xFFFFFFF) << 3))))>>1))) + out[2] + out[4] = uint32(((-((int32(((in[3] >> 28) | ((in[4] & 0x7FFFFFF) << 4)))) & 1))^((int32(((in[3] >> 28) | ((in[4] & 0x7FFFFFF) << 4))))>>1))) + out[3] + out[5] = uint32(((-((int32(((in[4] >> 27) | ((in[5] & 0x3FFFFFF) << 5)))) & 1))^((int32(((in[4] >> 27) | ((in[5] & 0x3FFFFFF) << 5))))>>1))) + out[4] + out[6] = uint32(((-((int32(((in[5] >> 26) | ((in[6] & 0x1FFFFFF) << 6)))) & 1))^((int32(((in[5] >> 26) | ((in[6] & 0x1FFFFFF) << 6))))>>1))) + out[5] + out[7] = uint32(((-((int32(((in[6] >> 25) | ((in[7] & 0xFFFFFF) << 7)))) & 1))^((int32(((in[6] >> 25) | ((in[7] & 0xFFFFFF) << 7))))>>1))) + out[6] + out[8] = uint32(((-((int32(((in[7] >> 24) | ((in[8] & 0x7FFFFF) << 8)))) & 1))^((int32(((in[7] >> 24) | ((in[8] & 0x7FFFFF) << 8))))>>1))) + out[7] + out[9] = uint32(((-((int32(((in[8] >> 23) | ((in[9] & 0x3FFFFF) << 9)))) & 1))^((int32(((in[8] >> 23) | ((in[9] & 0x3FFFFF) << 9))))>>1))) + out[8] + out[10] = uint32(((-((int32(((in[9] >> 22) | ((in[10] & 0x1FFFFF) << 10)))) & 1))^((int32(((in[9] >> 22) | ((in[10] & 0x1FFFFF) << 10))))>>1))) + out[9] + out[11] = uint32(((-((int32(((in[10] >> 21) | ((in[11] & 0xFFFFF) << 11)))) & 1))^((int32(((in[10] >> 21) | ((in[11] & 0xFFFFF) << 11))))>>1))) + out[10] + out[12] = uint32(((-((int32(((in[11] >> 20) | ((in[12] & 0x7FFFF) << 12)))) & 1))^((int32(((in[11] >> 20) | ((in[12] & 0x7FFFF) << 12))))>>1))) + out[11] + out[13] = uint32(((-((int32(((in[12] >> 19) | ((in[13] & 0x3FFFF) << 13)))) & 1))^((int32(((in[12] >> 19) | ((in[13] & 0x3FFFF) << 13))))>>1))) + out[12] + out[14] = uint32(((-((int32(((in[13] >> 18) | ((in[14] & 0x1FFFF) << 14)))) & 1))^((int32(((in[13] >> 18) | ((in[14] & 0x1FFFF) << 14))))>>1))) + out[13] + out[15] = uint32(((-((int32(((in[14] >> 17) | ((in[15] & 0xFFFF) << 15)))) & 1))^((int32(((in[14] >> 17) | ((in[15] & 0xFFFF) << 15))))>>1))) + out[14] + out[16] = uint32(((-((int32(((in[15] >> 16) | ((in[16] & 0x7FFF) << 16)))) & 1))^((int32(((in[15] >> 16) | ((in[16] & 0x7FFF) << 16))))>>1))) + out[15] + out[17] = uint32(((-((int32(((in[16] >> 15) | ((in[17] & 0x3FFF) << 17)))) & 1))^((int32(((in[16] >> 15) | ((in[17] & 0x3FFF) << 17))))>>1))) + out[16] + out[18] = uint32(((-((int32(((in[17] >> 14) | ((in[18] & 0x1FFF) << 18)))) & 1))^((int32(((in[17] >> 14) | ((in[18] & 0x1FFF) << 18))))>>1))) + out[17] + out[19] = uint32(((-((int32(((in[18] >> 13) | ((in[19] & 0xFFF) << 19)))) & 1))^((int32(((in[18] >> 13) | ((in[19] & 0xFFF) << 19))))>>1))) + out[18] + out[20] = uint32(((-((int32(((in[19] >> 12) | ((in[20] & 0x7FF) << 20)))) & 1))^((int32(((in[19] >> 12) | ((in[20] & 0x7FF) << 20))))>>1))) + out[19] + out[21] = uint32(((-((int32(((in[20] >> 11) | ((in[21] & 0x3FF) << 21)))) & 1))^((int32(((in[20] >> 11) | ((in[21] & 0x3FF) << 21))))>>1))) + out[20] + out[22] = uint32(((-((int32(((in[21] >> 10) | ((in[22] & 0x1FF) << 22)))) & 1))^((int32(((in[21] >> 10) | ((in[22] & 0x1FF) << 22))))>>1))) + out[21] + out[23] = uint32(((-((int32(((in[22] >> 9) | ((in[23] & 0xFF) << 23)))) & 1))^((int32(((in[22] >> 9) | ((in[23] & 0xFF) << 23))))>>1))) + out[22] + out[24] = uint32(((-((int32(((in[23] >> 8) | ((in[24] & 0x7F) << 24)))) & 1))^((int32(((in[23] >> 8) | ((in[24] & 0x7F) << 24))))>>1))) + out[23] + out[25] = uint32(((-((int32(((in[24] >> 7) | ((in[25] & 0x3F) << 25)))) & 1))^((int32(((in[24] >> 7) | ((in[25] & 0x3F) << 25))))>>1))) + out[24] + out[26] = uint32(((-((int32(((in[25] >> 6) | ((in[26] & 0x1F) << 26)))) & 1))^((int32(((in[25] >> 6) | ((in[26] & 0x1F) << 26))))>>1))) + out[25] + out[27] = uint32(((-((int32(((in[26] >> 5) | ((in[27] & 0xF) << 27)))) & 1))^((int32(((in[26] >> 5) | ((in[27] & 0xF) << 27))))>>1))) + out[26] + out[28] = uint32(((-((int32(((in[27] >> 4) | ((in[28] & 0x7) << 28)))) & 1))^((int32(((in[27] >> 4) | ((in[28] & 0x7) << 28))))>>1))) + out[27] + out[29] = uint32(((-((int32(((in[28] >> 3) | ((in[29] & 0x3) << 29)))) & 1))^((int32(((in[28] >> 3) | ((in[29] & 0x3) << 29))))>>1))) + out[28] + out[30] = uint32(((-((int32(((in[29] >> 2) | ((in[30] & 0x1) << 30)))) & 1))^((int32(((in[29] >> 2) | ((in[30] & 0x1) << 30))))>>1))) + out[29] + out[31] = uint32(((-((int32((in[30] >> 1))) & 1))^((int32((in[30] >> 1)))>>1))) + out[30] +} + +// deltaPack_int64 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first. +// Caller must give the proper `bitlen` of the block +func deltaPack_int64(initoffset int64, in []int64, out []uint64, ntz, bitlen int) { + switch bitlen - ntz { + case 0: + deltapack_int64_0(initoffset, (*[64]int64)(in), (*[0]uint64)(out), ntz) + case 1: + deltapack_int64_1(initoffset, (*[64]int64)(in), (*[1]uint64)(out), ntz) + case 2: + deltapack_int64_2(initoffset, (*[64]int64)(in), (*[2]uint64)(out), ntz) + case 3: + deltapack_int64_3(initoffset, (*[64]int64)(in), (*[3]uint64)(out), ntz) + case 4: + deltapack_int64_4(initoffset, (*[64]int64)(in), (*[4]uint64)(out), ntz) + case 5: + deltapack_int64_5(initoffset, (*[64]int64)(in), (*[5]uint64)(out), ntz) + case 6: + deltapack_int64_6(initoffset, (*[64]int64)(in), (*[6]uint64)(out), ntz) + case 7: + deltapack_int64_7(initoffset, (*[64]int64)(in), (*[7]uint64)(out), ntz) + case 8: + deltapack_int64_8(initoffset, (*[64]int64)(in), (*[8]uint64)(out), ntz) + case 9: + deltapack_int64_9(initoffset, (*[64]int64)(in), (*[9]uint64)(out), ntz) + case 10: + deltapack_int64_10(initoffset, (*[64]int64)(in), (*[10]uint64)(out), ntz) + case 11: + deltapack_int64_11(initoffset, (*[64]int64)(in), (*[11]uint64)(out), ntz) + case 12: + deltapack_int64_12(initoffset, (*[64]int64)(in), (*[12]uint64)(out), ntz) + case 13: + deltapack_int64_13(initoffset, (*[64]int64)(in), (*[13]uint64)(out), ntz) + case 14: + deltapack_int64_14(initoffset, (*[64]int64)(in), (*[14]uint64)(out), ntz) + case 15: + deltapack_int64_15(initoffset, (*[64]int64)(in), (*[15]uint64)(out), ntz) + case 16: + deltapack_int64_16(initoffset, (*[64]int64)(in), (*[16]uint64)(out), ntz) + case 17: + deltapack_int64_17(initoffset, (*[64]int64)(in), (*[17]uint64)(out), ntz) + case 18: + deltapack_int64_18(initoffset, (*[64]int64)(in), (*[18]uint64)(out), ntz) + case 19: + deltapack_int64_19(initoffset, (*[64]int64)(in), (*[19]uint64)(out), ntz) + case 20: + deltapack_int64_20(initoffset, (*[64]int64)(in), (*[20]uint64)(out), ntz) + case 21: + deltapack_int64_21(initoffset, (*[64]int64)(in), (*[21]uint64)(out), ntz) + case 22: + deltapack_int64_22(initoffset, (*[64]int64)(in), (*[22]uint64)(out), ntz) + case 23: + deltapack_int64_23(initoffset, (*[64]int64)(in), (*[23]uint64)(out), ntz) + case 24: + deltapack_int64_24(initoffset, (*[64]int64)(in), (*[24]uint64)(out), ntz) + case 25: + deltapack_int64_25(initoffset, (*[64]int64)(in), (*[25]uint64)(out), ntz) + case 26: + deltapack_int64_26(initoffset, (*[64]int64)(in), (*[26]uint64)(out), ntz) + case 27: + deltapack_int64_27(initoffset, (*[64]int64)(in), (*[27]uint64)(out), ntz) + case 28: + deltapack_int64_28(initoffset, (*[64]int64)(in), (*[28]uint64)(out), ntz) + case 29: + deltapack_int64_29(initoffset, (*[64]int64)(in), (*[29]uint64)(out), ntz) + case 30: + deltapack_int64_30(initoffset, (*[64]int64)(in), (*[30]uint64)(out), ntz) + case 31: + deltapack_int64_31(initoffset, (*[64]int64)(in), (*[31]uint64)(out), ntz) + case 32: + deltapack_int64_32(initoffset, (*[64]int64)(in), (*[32]uint64)(out), ntz) + case 33: + deltapack_int64_33(initoffset, (*[64]int64)(in), (*[33]uint64)(out), ntz) + case 34: + deltapack_int64_34(initoffset, (*[64]int64)(in), (*[34]uint64)(out), ntz) + case 35: + deltapack_int64_35(initoffset, (*[64]int64)(in), (*[35]uint64)(out), ntz) + case 36: + deltapack_int64_36(initoffset, (*[64]int64)(in), (*[36]uint64)(out), ntz) + case 37: + deltapack_int64_37(initoffset, (*[64]int64)(in), (*[37]uint64)(out), ntz) + case 38: + deltapack_int64_38(initoffset, (*[64]int64)(in), (*[38]uint64)(out), ntz) + case 39: + deltapack_int64_39(initoffset, (*[64]int64)(in), (*[39]uint64)(out), ntz) + case 40: + deltapack_int64_40(initoffset, (*[64]int64)(in), (*[40]uint64)(out), ntz) + case 41: + deltapack_int64_41(initoffset, (*[64]int64)(in), (*[41]uint64)(out), ntz) + case 42: + deltapack_int64_42(initoffset, (*[64]int64)(in), (*[42]uint64)(out), ntz) + case 43: + deltapack_int64_43(initoffset, (*[64]int64)(in), (*[43]uint64)(out), ntz) + case 44: + deltapack_int64_44(initoffset, (*[64]int64)(in), (*[44]uint64)(out), ntz) + case 45: + deltapack_int64_45(initoffset, (*[64]int64)(in), (*[45]uint64)(out), ntz) + case 46: + deltapack_int64_46(initoffset, (*[64]int64)(in), (*[46]uint64)(out), ntz) + case 47: + deltapack_int64_47(initoffset, (*[64]int64)(in), (*[47]uint64)(out), ntz) + case 48: + deltapack_int64_48(initoffset, (*[64]int64)(in), (*[48]uint64)(out), ntz) + case 49: + deltapack_int64_49(initoffset, (*[64]int64)(in), (*[49]uint64)(out), ntz) + case 50: + deltapack_int64_50(initoffset, (*[64]int64)(in), (*[50]uint64)(out), ntz) + case 51: + deltapack_int64_51(initoffset, (*[64]int64)(in), (*[51]uint64)(out), ntz) + case 52: + deltapack_int64_52(initoffset, (*[64]int64)(in), (*[52]uint64)(out), ntz) + case 53: + deltapack_int64_53(initoffset, (*[64]int64)(in), (*[53]uint64)(out), ntz) + case 54: + deltapack_int64_54(initoffset, (*[64]int64)(in), (*[54]uint64)(out), ntz) + case 55: + deltapack_int64_55(initoffset, (*[64]int64)(in), (*[55]uint64)(out), ntz) + case 56: + deltapack_int64_56(initoffset, (*[64]int64)(in), (*[56]uint64)(out), ntz) + case 57: + deltapack_int64_57(initoffset, (*[64]int64)(in), (*[57]uint64)(out), ntz) + case 58: + deltapack_int64_58(initoffset, (*[64]int64)(in), (*[58]uint64)(out), ntz) + case 59: + deltapack_int64_59(initoffset, (*[64]int64)(in), (*[59]uint64)(out), ntz) + case 60: + deltapack_int64_60(initoffset, (*[64]int64)(in), (*[60]uint64)(out), ntz) + case 61: + deltapack_int64_61(initoffset, (*[64]int64)(in), (*[61]uint64)(out), ntz) + case 62: + deltapack_int64_62(initoffset, (*[64]int64)(in), (*[62]uint64)(out), ntz) + case 63: + deltapack_int64_63(initoffset, (*[64]int64)(in), (*[63]uint64)(out), ntz) + case 64: + *(*[64]uint64)(out) = *((*[64]uint64)(unsafe.Pointer((*[64]int64)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpack_int64 Decoding operation for DeltaPack_int64 +func deltaUnpack_int64(initoffset int64, in []uint64, out []int64, ntz, bitlen int) { + switch bitlen - ntz { + case 0: + deltaunpack_int64_0(initoffset, (*[0]uint64)(in), (*[64]int64)(out), ntz) + case 1: + deltaunpack_int64_1(initoffset, (*[1]uint64)(in), (*[64]int64)(out), ntz) + case 2: + deltaunpack_int64_2(initoffset, (*[2]uint64)(in), (*[64]int64)(out), ntz) + case 3: + deltaunpack_int64_3(initoffset, (*[3]uint64)(in), (*[64]int64)(out), ntz) + case 4: + deltaunpack_int64_4(initoffset, (*[4]uint64)(in), (*[64]int64)(out), ntz) + case 5: + deltaunpack_int64_5(initoffset, (*[5]uint64)(in), (*[64]int64)(out), ntz) + case 6: + deltaunpack_int64_6(initoffset, (*[6]uint64)(in), (*[64]int64)(out), ntz) + case 7: + deltaunpack_int64_7(initoffset, (*[7]uint64)(in), (*[64]int64)(out), ntz) + case 8: + deltaunpack_int64_8(initoffset, (*[8]uint64)(in), (*[64]int64)(out), ntz) + case 9: + deltaunpack_int64_9(initoffset, (*[9]uint64)(in), (*[64]int64)(out), ntz) + case 10: + deltaunpack_int64_10(initoffset, (*[10]uint64)(in), (*[64]int64)(out), ntz) + case 11: + deltaunpack_int64_11(initoffset, (*[11]uint64)(in), (*[64]int64)(out), ntz) + case 12: + deltaunpack_int64_12(initoffset, (*[12]uint64)(in), (*[64]int64)(out), ntz) + case 13: + deltaunpack_int64_13(initoffset, (*[13]uint64)(in), (*[64]int64)(out), ntz) + case 14: + deltaunpack_int64_14(initoffset, (*[14]uint64)(in), (*[64]int64)(out), ntz) + case 15: + deltaunpack_int64_15(initoffset, (*[15]uint64)(in), (*[64]int64)(out), ntz) + case 16: + deltaunpack_int64_16(initoffset, (*[16]uint64)(in), (*[64]int64)(out), ntz) + case 17: + deltaunpack_int64_17(initoffset, (*[17]uint64)(in), (*[64]int64)(out), ntz) + case 18: + deltaunpack_int64_18(initoffset, (*[18]uint64)(in), (*[64]int64)(out), ntz) + case 19: + deltaunpack_int64_19(initoffset, (*[19]uint64)(in), (*[64]int64)(out), ntz) + case 20: + deltaunpack_int64_20(initoffset, (*[20]uint64)(in), (*[64]int64)(out), ntz) + case 21: + deltaunpack_int64_21(initoffset, (*[21]uint64)(in), (*[64]int64)(out), ntz) + case 22: + deltaunpack_int64_22(initoffset, (*[22]uint64)(in), (*[64]int64)(out), ntz) + case 23: + deltaunpack_int64_23(initoffset, (*[23]uint64)(in), (*[64]int64)(out), ntz) + case 24: + deltaunpack_int64_24(initoffset, (*[24]uint64)(in), (*[64]int64)(out), ntz) + case 25: + deltaunpack_int64_25(initoffset, (*[25]uint64)(in), (*[64]int64)(out), ntz) + case 26: + deltaunpack_int64_26(initoffset, (*[26]uint64)(in), (*[64]int64)(out), ntz) + case 27: + deltaunpack_int64_27(initoffset, (*[27]uint64)(in), (*[64]int64)(out), ntz) + case 28: + deltaunpack_int64_28(initoffset, (*[28]uint64)(in), (*[64]int64)(out), ntz) + case 29: + deltaunpack_int64_29(initoffset, (*[29]uint64)(in), (*[64]int64)(out), ntz) + case 30: + deltaunpack_int64_30(initoffset, (*[30]uint64)(in), (*[64]int64)(out), ntz) + case 31: + deltaunpack_int64_31(initoffset, (*[31]uint64)(in), (*[64]int64)(out), ntz) + case 32: + deltaunpack_int64_32(initoffset, (*[32]uint64)(in), (*[64]int64)(out), ntz) + case 33: + deltaunpack_int64_33(initoffset, (*[33]uint64)(in), (*[64]int64)(out), ntz) + case 34: + deltaunpack_int64_34(initoffset, (*[34]uint64)(in), (*[64]int64)(out), ntz) + case 35: + deltaunpack_int64_35(initoffset, (*[35]uint64)(in), (*[64]int64)(out), ntz) + case 36: + deltaunpack_int64_36(initoffset, (*[36]uint64)(in), (*[64]int64)(out), ntz) + case 37: + deltaunpack_int64_37(initoffset, (*[37]uint64)(in), (*[64]int64)(out), ntz) + case 38: + deltaunpack_int64_38(initoffset, (*[38]uint64)(in), (*[64]int64)(out), ntz) + case 39: + deltaunpack_int64_39(initoffset, (*[39]uint64)(in), (*[64]int64)(out), ntz) + case 40: + deltaunpack_int64_40(initoffset, (*[40]uint64)(in), (*[64]int64)(out), ntz) + case 41: + deltaunpack_int64_41(initoffset, (*[41]uint64)(in), (*[64]int64)(out), ntz) + case 42: + deltaunpack_int64_42(initoffset, (*[42]uint64)(in), (*[64]int64)(out), ntz) + case 43: + deltaunpack_int64_43(initoffset, (*[43]uint64)(in), (*[64]int64)(out), ntz) + case 44: + deltaunpack_int64_44(initoffset, (*[44]uint64)(in), (*[64]int64)(out), ntz) + case 45: + deltaunpack_int64_45(initoffset, (*[45]uint64)(in), (*[64]int64)(out), ntz) + case 46: + deltaunpack_int64_46(initoffset, (*[46]uint64)(in), (*[64]int64)(out), ntz) + case 47: + deltaunpack_int64_47(initoffset, (*[47]uint64)(in), (*[64]int64)(out), ntz) + case 48: + deltaunpack_int64_48(initoffset, (*[48]uint64)(in), (*[64]int64)(out), ntz) + case 49: + deltaunpack_int64_49(initoffset, (*[49]uint64)(in), (*[64]int64)(out), ntz) + case 50: + deltaunpack_int64_50(initoffset, (*[50]uint64)(in), (*[64]int64)(out), ntz) + case 51: + deltaunpack_int64_51(initoffset, (*[51]uint64)(in), (*[64]int64)(out), ntz) + case 52: + deltaunpack_int64_52(initoffset, (*[52]uint64)(in), (*[64]int64)(out), ntz) + case 53: + deltaunpack_int64_53(initoffset, (*[53]uint64)(in), (*[64]int64)(out), ntz) + case 54: + deltaunpack_int64_54(initoffset, (*[54]uint64)(in), (*[64]int64)(out), ntz) + case 55: + deltaunpack_int64_55(initoffset, (*[55]uint64)(in), (*[64]int64)(out), ntz) + case 56: + deltaunpack_int64_56(initoffset, (*[56]uint64)(in), (*[64]int64)(out), ntz) + case 57: + deltaunpack_int64_57(initoffset, (*[57]uint64)(in), (*[64]int64)(out), ntz) + case 58: + deltaunpack_int64_58(initoffset, (*[58]uint64)(in), (*[64]int64)(out), ntz) + case 59: + deltaunpack_int64_59(initoffset, (*[59]uint64)(in), (*[64]int64)(out), ntz) + case 60: + deltaunpack_int64_60(initoffset, (*[60]uint64)(in), (*[64]int64)(out), ntz) + case 61: + deltaunpack_int64_61(initoffset, (*[61]uint64)(in), (*[64]int64)(out), ntz) + case 62: + deltaunpack_int64_62(initoffset, (*[62]uint64)(in), (*[64]int64)(out), ntz) + case 63: + deltaunpack_int64_63(initoffset, (*[63]uint64)(in), (*[64]int64)(out), ntz) + case 64: + *(*[64]int64)(out) = *(*[64]int64)(unsafe.Pointer((*[64]uint64)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapack_int64_0(initoffset int64, in *[64]int64, out *[0]uint64, ntz int) { +} + +func deltapack_int64_1(initoffset int64, in *[64]int64, out *[1]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 1) | + ((uint64(in[2] - in[1])) >> ntz << 2) | + ((uint64(in[3] - in[2])) >> ntz << 3) | + ((uint64(in[4] - in[3])) >> ntz << 4) | + ((uint64(in[5] - in[4])) >> ntz << 5) | + ((uint64(in[6] - in[5])) >> ntz << 6) | + ((uint64(in[7] - in[6])) >> ntz << 7) | + ((uint64(in[8] - in[7])) >> ntz << 8) | + ((uint64(in[9] - in[8])) >> ntz << 9) | + ((uint64(in[10] - in[9])) >> ntz << 10) | + ((uint64(in[11] - in[10])) >> ntz << 11) | + ((uint64(in[12] - in[11])) >> ntz << 12) | + ((uint64(in[13] - in[12])) >> ntz << 13) | + ((uint64(in[14] - in[13])) >> ntz << 14) | + ((uint64(in[15] - in[14])) >> ntz << 15) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 17) | + ((uint64(in[18] - in[17])) >> ntz << 18) | + ((uint64(in[19] - in[18])) >> ntz << 19) | + ((uint64(in[20] - in[19])) >> ntz << 20) | + ((uint64(in[21] - in[20])) >> ntz << 21) | + ((uint64(in[22] - in[21])) >> ntz << 22) | + ((uint64(in[23] - in[22])) >> ntz << 23) | + ((uint64(in[24] - in[23])) >> ntz << 24) | + ((uint64(in[25] - in[24])) >> ntz << 25) | + ((uint64(in[26] - in[25])) >> ntz << 26) | + ((uint64(in[27] - in[26])) >> ntz << 27) | + ((uint64(in[28] - in[27])) >> ntz << 28) | + ((uint64(in[29] - in[28])) >> ntz << 29) | + ((uint64(in[30] - in[29])) >> ntz << 30) | + ((uint64(in[31] - in[30])) >> ntz << 31) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 33) | + ((uint64(in[34] - in[33])) >> ntz << 34) | + ((uint64(in[35] - in[34])) >> ntz << 35) | + ((uint64(in[36] - in[35])) >> ntz << 36) | + ((uint64(in[37] - in[36])) >> ntz << 37) | + ((uint64(in[38] - in[37])) >> ntz << 38) | + ((uint64(in[39] - in[38])) >> ntz << 39) | + ((uint64(in[40] - in[39])) >> ntz << 40) | + ((uint64(in[41] - in[40])) >> ntz << 41) | + ((uint64(in[42] - in[41])) >> ntz << 42) | + ((uint64(in[43] - in[42])) >> ntz << 43) | + ((uint64(in[44] - in[43])) >> ntz << 44) | + ((uint64(in[45] - in[44])) >> ntz << 45) | + ((uint64(in[46] - in[45])) >> ntz << 46) | + ((uint64(in[47] - in[46])) >> ntz << 47) | + ((uint64(in[48] - in[47])) >> ntz << 48) | + ((uint64(in[49] - in[48])) >> ntz << 49) | + ((uint64(in[50] - in[49])) >> ntz << 50) | + ((uint64(in[51] - in[50])) >> ntz << 51) | + ((uint64(in[52] - in[51])) >> ntz << 52) | + ((uint64(in[53] - in[52])) >> ntz << 53) | + ((uint64(in[54] - in[53])) >> ntz << 54) | + ((uint64(in[55] - in[54])) >> ntz << 55) | + ((uint64(in[56] - in[55])) >> ntz << 56) | + ((uint64(in[57] - in[56])) >> ntz << 57) | + ((uint64(in[58] - in[57])) >> ntz << 58) | + ((uint64(in[59] - in[58])) >> ntz << 59) | + ((uint64(in[60] - in[59])) >> ntz << 60) | + ((uint64(in[61] - in[60])) >> ntz << 61) | + ((uint64(in[62] - in[61])) >> ntz << 62) | + ((uint64(in[63] - in[62])) >> ntz << 63) +} + +func deltapack_int64_2(initoffset int64, in *[64]int64, out *[2]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 2) | + ((uint64(in[2] - in[1])) >> ntz << 4) | + ((uint64(in[3] - in[2])) >> ntz << 6) | + ((uint64(in[4] - in[3])) >> ntz << 8) | + ((uint64(in[5] - in[4])) >> ntz << 10) | + ((uint64(in[6] - in[5])) >> ntz << 12) | + ((uint64(in[7] - in[6])) >> ntz << 14) | + ((uint64(in[8] - in[7])) >> ntz << 16) | + ((uint64(in[9] - in[8])) >> ntz << 18) | + ((uint64(in[10] - in[9])) >> ntz << 20) | + ((uint64(in[11] - in[10])) >> ntz << 22) | + ((uint64(in[12] - in[11])) >> ntz << 24) | + ((uint64(in[13] - in[12])) >> ntz << 26) | + ((uint64(in[14] - in[13])) >> ntz << 28) | + ((uint64(in[15] - in[14])) >> ntz << 30) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 34) | + ((uint64(in[18] - in[17])) >> ntz << 36) | + ((uint64(in[19] - in[18])) >> ntz << 38) | + ((uint64(in[20] - in[19])) >> ntz << 40) | + ((uint64(in[21] - in[20])) >> ntz << 42) | + ((uint64(in[22] - in[21])) >> ntz << 44) | + ((uint64(in[23] - in[22])) >> ntz << 46) | + ((uint64(in[24] - in[23])) >> ntz << 48) | + ((uint64(in[25] - in[24])) >> ntz << 50) | + ((uint64(in[26] - in[25])) >> ntz << 52) | + ((uint64(in[27] - in[26])) >> ntz << 54) | + ((uint64(in[28] - in[27])) >> ntz << 56) | + ((uint64(in[29] - in[28])) >> ntz << 58) | + ((uint64(in[30] - in[29])) >> ntz << 60) | + ((uint64(in[31] - in[30])) >> ntz << 62) + out[1] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 2) | + ((uint64(in[34] - in[33])) >> ntz << 4) | + ((uint64(in[35] - in[34])) >> ntz << 6) | + ((uint64(in[36] - in[35])) >> ntz << 8) | + ((uint64(in[37] - in[36])) >> ntz << 10) | + ((uint64(in[38] - in[37])) >> ntz << 12) | + ((uint64(in[39] - in[38])) >> ntz << 14) | + ((uint64(in[40] - in[39])) >> ntz << 16) | + ((uint64(in[41] - in[40])) >> ntz << 18) | + ((uint64(in[42] - in[41])) >> ntz << 20) | + ((uint64(in[43] - in[42])) >> ntz << 22) | + ((uint64(in[44] - in[43])) >> ntz << 24) | + ((uint64(in[45] - in[44])) >> ntz << 26) | + ((uint64(in[46] - in[45])) >> ntz << 28) | + ((uint64(in[47] - in[46])) >> ntz << 30) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 34) | + ((uint64(in[50] - in[49])) >> ntz << 36) | + ((uint64(in[51] - in[50])) >> ntz << 38) | + ((uint64(in[52] - in[51])) >> ntz << 40) | + ((uint64(in[53] - in[52])) >> ntz << 42) | + ((uint64(in[54] - in[53])) >> ntz << 44) | + ((uint64(in[55] - in[54])) >> ntz << 46) | + ((uint64(in[56] - in[55])) >> ntz << 48) | + ((uint64(in[57] - in[56])) >> ntz << 50) | + ((uint64(in[58] - in[57])) >> ntz << 52) | + ((uint64(in[59] - in[58])) >> ntz << 54) | + ((uint64(in[60] - in[59])) >> ntz << 56) | + ((uint64(in[61] - in[60])) >> ntz << 58) | + ((uint64(in[62] - in[61])) >> ntz << 60) | + ((uint64(in[63] - in[62])) >> ntz << 62) +} + +func deltapack_int64_3(initoffset int64, in *[64]int64, out *[3]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 3) | + ((uint64(in[2] - in[1])) >> ntz << 6) | + ((uint64(in[3] - in[2])) >> ntz << 9) | + ((uint64(in[4] - in[3])) >> ntz << 12) | + ((uint64(in[5] - in[4])) >> ntz << 15) | + ((uint64(in[6] - in[5])) >> ntz << 18) | + ((uint64(in[7] - in[6])) >> ntz << 21) | + ((uint64(in[8] - in[7])) >> ntz << 24) | + ((uint64(in[9] - in[8])) >> ntz << 27) | + ((uint64(in[10] - in[9])) >> ntz << 30) | + ((uint64(in[11] - in[10])) >> ntz << 33) | + ((uint64(in[12] - in[11])) >> ntz << 36) | + ((uint64(in[13] - in[12])) >> ntz << 39) | + ((uint64(in[14] - in[13])) >> ntz << 42) | + ((uint64(in[15] - in[14])) >> ntz << 45) | + ((uint64(in[16] - in[15])) >> ntz << 48) | + ((uint64(in[17] - in[16])) >> ntz << 51) | + ((uint64(in[18] - in[17])) >> ntz << 54) | + ((uint64(in[19] - in[18])) >> ntz << 57) | + ((uint64(in[20] - in[19])) >> ntz << 60) | + ((uint64(in[21] - in[20])) >> ntz << 63) + out[1] = + (uint64(in[21] - in[20])) >> (1+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 2) | + ((uint64(in[23] - in[22])) >> ntz << 5) | + ((uint64(in[24] - in[23])) >> ntz << 8) | + ((uint64(in[25] - in[24])) >> ntz << 11) | + ((uint64(in[26] - in[25])) >> ntz << 14) | + ((uint64(in[27] - in[26])) >> ntz << 17) | + ((uint64(in[28] - in[27])) >> ntz << 20) | + ((uint64(in[29] - in[28])) >> ntz << 23) | + ((uint64(in[30] - in[29])) >> ntz << 26) | + ((uint64(in[31] - in[30])) >> ntz << 29) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 35) | + ((uint64(in[34] - in[33])) >> ntz << 38) | + ((uint64(in[35] - in[34])) >> ntz << 41) | + ((uint64(in[36] - in[35])) >> ntz << 44) | + ((uint64(in[37] - in[36])) >> ntz << 47) | + ((uint64(in[38] - in[37])) >> ntz << 50) | + ((uint64(in[39] - in[38])) >> ntz << 53) | + ((uint64(in[40] - in[39])) >> ntz << 56) | + ((uint64(in[41] - in[40])) >> ntz << 59) | + ((uint64(in[42] - in[41])) >> ntz << 62) + out[2] = + (uint64(in[42] - in[41])) >> (2+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 1) | + ((uint64(in[44] - in[43])) >> ntz << 4) | + ((uint64(in[45] - in[44])) >> ntz << 7) | + ((uint64(in[46] - in[45])) >> ntz << 10) | + ((uint64(in[47] - in[46])) >> ntz << 13) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 19) | + ((uint64(in[50] - in[49])) >> ntz << 22) | + ((uint64(in[51] - in[50])) >> ntz << 25) | + ((uint64(in[52] - in[51])) >> ntz << 28) | + ((uint64(in[53] - in[52])) >> ntz << 31) | + ((uint64(in[54] - in[53])) >> ntz << 34) | + ((uint64(in[55] - in[54])) >> ntz << 37) | + ((uint64(in[56] - in[55])) >> ntz << 40) | + ((uint64(in[57] - in[56])) >> ntz << 43) | + ((uint64(in[58] - in[57])) >> ntz << 46) | + ((uint64(in[59] - in[58])) >> ntz << 49) | + ((uint64(in[60] - in[59])) >> ntz << 52) | + ((uint64(in[61] - in[60])) >> ntz << 55) | + ((uint64(in[62] - in[61])) >> ntz << 58) | + ((uint64(in[63] - in[62])) >> ntz << 61) +} + +func deltapack_int64_4(initoffset int64, in *[64]int64, out *[4]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 4) | + ((uint64(in[2] - in[1])) >> ntz << 8) | + ((uint64(in[3] - in[2])) >> ntz << 12) | + ((uint64(in[4] - in[3])) >> ntz << 16) | + ((uint64(in[5] - in[4])) >> ntz << 20) | + ((uint64(in[6] - in[5])) >> ntz << 24) | + ((uint64(in[7] - in[6])) >> ntz << 28) | + ((uint64(in[8] - in[7])) >> ntz << 32) | + ((uint64(in[9] - in[8])) >> ntz << 36) | + ((uint64(in[10] - in[9])) >> ntz << 40) | + ((uint64(in[11] - in[10])) >> ntz << 44) | + ((uint64(in[12] - in[11])) >> ntz << 48) | + ((uint64(in[13] - in[12])) >> ntz << 52) | + ((uint64(in[14] - in[13])) >> ntz << 56) | + ((uint64(in[15] - in[14])) >> ntz << 60) + out[1] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 4) | + ((uint64(in[18] - in[17])) >> ntz << 8) | + ((uint64(in[19] - in[18])) >> ntz << 12) | + ((uint64(in[20] - in[19])) >> ntz << 16) | + ((uint64(in[21] - in[20])) >> ntz << 20) | + ((uint64(in[22] - in[21])) >> ntz << 24) | + ((uint64(in[23] - in[22])) >> ntz << 28) | + ((uint64(in[24] - in[23])) >> ntz << 32) | + ((uint64(in[25] - in[24])) >> ntz << 36) | + ((uint64(in[26] - in[25])) >> ntz << 40) | + ((uint64(in[27] - in[26])) >> ntz << 44) | + ((uint64(in[28] - in[27])) >> ntz << 48) | + ((uint64(in[29] - in[28])) >> ntz << 52) | + ((uint64(in[30] - in[29])) >> ntz << 56) | + ((uint64(in[31] - in[30])) >> ntz << 60) + out[2] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 4) | + ((uint64(in[34] - in[33])) >> ntz << 8) | + ((uint64(in[35] - in[34])) >> ntz << 12) | + ((uint64(in[36] - in[35])) >> ntz << 16) | + ((uint64(in[37] - in[36])) >> ntz << 20) | + ((uint64(in[38] - in[37])) >> ntz << 24) | + ((uint64(in[39] - in[38])) >> ntz << 28) | + ((uint64(in[40] - in[39])) >> ntz << 32) | + ((uint64(in[41] - in[40])) >> ntz << 36) | + ((uint64(in[42] - in[41])) >> ntz << 40) | + ((uint64(in[43] - in[42])) >> ntz << 44) | + ((uint64(in[44] - in[43])) >> ntz << 48) | + ((uint64(in[45] - in[44])) >> ntz << 52) | + ((uint64(in[46] - in[45])) >> ntz << 56) | + ((uint64(in[47] - in[46])) >> ntz << 60) + out[3] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 4) | + ((uint64(in[50] - in[49])) >> ntz << 8) | + ((uint64(in[51] - in[50])) >> ntz << 12) | + ((uint64(in[52] - in[51])) >> ntz << 16) | + ((uint64(in[53] - in[52])) >> ntz << 20) | + ((uint64(in[54] - in[53])) >> ntz << 24) | + ((uint64(in[55] - in[54])) >> ntz << 28) | + ((uint64(in[56] - in[55])) >> ntz << 32) | + ((uint64(in[57] - in[56])) >> ntz << 36) | + ((uint64(in[58] - in[57])) >> ntz << 40) | + ((uint64(in[59] - in[58])) >> ntz << 44) | + ((uint64(in[60] - in[59])) >> ntz << 48) | + ((uint64(in[61] - in[60])) >> ntz << 52) | + ((uint64(in[62] - in[61])) >> ntz << 56) | + ((uint64(in[63] - in[62])) >> ntz << 60) +} + +func deltapack_int64_5(initoffset int64, in *[64]int64, out *[5]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 5) | + ((uint64(in[2] - in[1])) >> ntz << 10) | + ((uint64(in[3] - in[2])) >> ntz << 15) | + ((uint64(in[4] - in[3])) >> ntz << 20) | + ((uint64(in[5] - in[4])) >> ntz << 25) | + ((uint64(in[6] - in[5])) >> ntz << 30) | + ((uint64(in[7] - in[6])) >> ntz << 35) | + ((uint64(in[8] - in[7])) >> ntz << 40) | + ((uint64(in[9] - in[8])) >> ntz << 45) | + ((uint64(in[10] - in[9])) >> ntz << 50) | + ((uint64(in[11] - in[10])) >> ntz << 55) | + ((uint64(in[12] - in[11])) >> ntz << 60) + out[1] = + (uint64(in[12] - in[11])) >> (4+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 1) | + ((uint64(in[14] - in[13])) >> ntz << 6) | + ((uint64(in[15] - in[14])) >> ntz << 11) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 21) | + ((uint64(in[18] - in[17])) >> ntz << 26) | + ((uint64(in[19] - in[18])) >> ntz << 31) | + ((uint64(in[20] - in[19])) >> ntz << 36) | + ((uint64(in[21] - in[20])) >> ntz << 41) | + ((uint64(in[22] - in[21])) >> ntz << 46) | + ((uint64(in[23] - in[22])) >> ntz << 51) | + ((uint64(in[24] - in[23])) >> ntz << 56) | + ((uint64(in[25] - in[24])) >> ntz << 61) + out[2] = + (uint64(in[25] - in[24])) >> (3+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 2) | + ((uint64(in[27] - in[26])) >> ntz << 7) | + ((uint64(in[28] - in[27])) >> ntz << 12) | + ((uint64(in[29] - in[28])) >> ntz << 17) | + ((uint64(in[30] - in[29])) >> ntz << 22) | + ((uint64(in[31] - in[30])) >> ntz << 27) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 37) | + ((uint64(in[34] - in[33])) >> ntz << 42) | + ((uint64(in[35] - in[34])) >> ntz << 47) | + ((uint64(in[36] - in[35])) >> ntz << 52) | + ((uint64(in[37] - in[36])) >> ntz << 57) | + ((uint64(in[38] - in[37])) >> ntz << 62) + out[3] = + (uint64(in[38] - in[37])) >> (2+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 3) | + ((uint64(in[40] - in[39])) >> ntz << 8) | + ((uint64(in[41] - in[40])) >> ntz << 13) | + ((uint64(in[42] - in[41])) >> ntz << 18) | + ((uint64(in[43] - in[42])) >> ntz << 23) | + ((uint64(in[44] - in[43])) >> ntz << 28) | + ((uint64(in[45] - in[44])) >> ntz << 33) | + ((uint64(in[46] - in[45])) >> ntz << 38) | + ((uint64(in[47] - in[46])) >> ntz << 43) | + ((uint64(in[48] - in[47])) >> ntz << 48) | + ((uint64(in[49] - in[48])) >> ntz << 53) | + ((uint64(in[50] - in[49])) >> ntz << 58) | + ((uint64(in[51] - in[50])) >> ntz << 63) + out[4] = + (uint64(in[51] - in[50])) >> (1+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 4) | + ((uint64(in[53] - in[52])) >> ntz << 9) | + ((uint64(in[54] - in[53])) >> ntz << 14) | + ((uint64(in[55] - in[54])) >> ntz << 19) | + ((uint64(in[56] - in[55])) >> ntz << 24) | + ((uint64(in[57] - in[56])) >> ntz << 29) | + ((uint64(in[58] - in[57])) >> ntz << 34) | + ((uint64(in[59] - in[58])) >> ntz << 39) | + ((uint64(in[60] - in[59])) >> ntz << 44) | + ((uint64(in[61] - in[60])) >> ntz << 49) | + ((uint64(in[62] - in[61])) >> ntz << 54) | + ((uint64(in[63] - in[62])) >> ntz << 59) +} + +func deltapack_int64_6(initoffset int64, in *[64]int64, out *[6]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 6) | + ((uint64(in[2] - in[1])) >> ntz << 12) | + ((uint64(in[3] - in[2])) >> ntz << 18) | + ((uint64(in[4] - in[3])) >> ntz << 24) | + ((uint64(in[5] - in[4])) >> ntz << 30) | + ((uint64(in[6] - in[5])) >> ntz << 36) | + ((uint64(in[7] - in[6])) >> ntz << 42) | + ((uint64(in[8] - in[7])) >> ntz << 48) | + ((uint64(in[9] - in[8])) >> ntz << 54) | + ((uint64(in[10] - in[9])) >> ntz << 60) + out[1] = + (uint64(in[10] - in[9])) >> (4+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 2) | + ((uint64(in[12] - in[11])) >> ntz << 8) | + ((uint64(in[13] - in[12])) >> ntz << 14) | + ((uint64(in[14] - in[13])) >> ntz << 20) | + ((uint64(in[15] - in[14])) >> ntz << 26) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 38) | + ((uint64(in[18] - in[17])) >> ntz << 44) | + ((uint64(in[19] - in[18])) >> ntz << 50) | + ((uint64(in[20] - in[19])) >> ntz << 56) | + ((uint64(in[21] - in[20])) >> ntz << 62) + out[2] = + (uint64(in[21] - in[20])) >> (2+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 4) | + ((uint64(in[23] - in[22])) >> ntz << 10) | + ((uint64(in[24] - in[23])) >> ntz << 16) | + ((uint64(in[25] - in[24])) >> ntz << 22) | + ((uint64(in[26] - in[25])) >> ntz << 28) | + ((uint64(in[27] - in[26])) >> ntz << 34) | + ((uint64(in[28] - in[27])) >> ntz << 40) | + ((uint64(in[29] - in[28])) >> ntz << 46) | + ((uint64(in[30] - in[29])) >> ntz << 52) | + ((uint64(in[31] - in[30])) >> ntz << 58) + out[3] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 6) | + ((uint64(in[34] - in[33])) >> ntz << 12) | + ((uint64(in[35] - in[34])) >> ntz << 18) | + ((uint64(in[36] - in[35])) >> ntz << 24) | + ((uint64(in[37] - in[36])) >> ntz << 30) | + ((uint64(in[38] - in[37])) >> ntz << 36) | + ((uint64(in[39] - in[38])) >> ntz << 42) | + ((uint64(in[40] - in[39])) >> ntz << 48) | + ((uint64(in[41] - in[40])) >> ntz << 54) | + ((uint64(in[42] - in[41])) >> ntz << 60) + out[4] = + (uint64(in[42] - in[41])) >> (4+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 2) | + ((uint64(in[44] - in[43])) >> ntz << 8) | + ((uint64(in[45] - in[44])) >> ntz << 14) | + ((uint64(in[46] - in[45])) >> ntz << 20) | + ((uint64(in[47] - in[46])) >> ntz << 26) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 38) | + ((uint64(in[50] - in[49])) >> ntz << 44) | + ((uint64(in[51] - in[50])) >> ntz << 50) | + ((uint64(in[52] - in[51])) >> ntz << 56) | + ((uint64(in[53] - in[52])) >> ntz << 62) + out[5] = + (uint64(in[53] - in[52])) >> (2+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 4) | + ((uint64(in[55] - in[54])) >> ntz << 10) | + ((uint64(in[56] - in[55])) >> ntz << 16) | + ((uint64(in[57] - in[56])) >> ntz << 22) | + ((uint64(in[58] - in[57])) >> ntz << 28) | + ((uint64(in[59] - in[58])) >> ntz << 34) | + ((uint64(in[60] - in[59])) >> ntz << 40) | + ((uint64(in[61] - in[60])) >> ntz << 46) | + ((uint64(in[62] - in[61])) >> ntz << 52) | + ((uint64(in[63] - in[62])) >> ntz << 58) +} + +func deltapack_int64_7(initoffset int64, in *[64]int64, out *[7]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 7) | + ((uint64(in[2] - in[1])) >> ntz << 14) | + ((uint64(in[3] - in[2])) >> ntz << 21) | + ((uint64(in[4] - in[3])) >> ntz << 28) | + ((uint64(in[5] - in[4])) >> ntz << 35) | + ((uint64(in[6] - in[5])) >> ntz << 42) | + ((uint64(in[7] - in[6])) >> ntz << 49) | + ((uint64(in[8] - in[7])) >> ntz << 56) | + ((uint64(in[9] - in[8])) >> ntz << 63) + out[1] = + (uint64(in[9] - in[8])) >> (1+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 6) | + ((uint64(in[11] - in[10])) >> ntz << 13) | + ((uint64(in[12] - in[11])) >> ntz << 20) | + ((uint64(in[13] - in[12])) >> ntz << 27) | + ((uint64(in[14] - in[13])) >> ntz << 34) | + ((uint64(in[15] - in[14])) >> ntz << 41) | + ((uint64(in[16] - in[15])) >> ntz << 48) | + ((uint64(in[17] - in[16])) >> ntz << 55) | + ((uint64(in[18] - in[17])) >> ntz << 62) + out[2] = + (uint64(in[18] - in[17])) >> (2+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 5) | + ((uint64(in[20] - in[19])) >> ntz << 12) | + ((uint64(in[21] - in[20])) >> ntz << 19) | + ((uint64(in[22] - in[21])) >> ntz << 26) | + ((uint64(in[23] - in[22])) >> ntz << 33) | + ((uint64(in[24] - in[23])) >> ntz << 40) | + ((uint64(in[25] - in[24])) >> ntz << 47) | + ((uint64(in[26] - in[25])) >> ntz << 54) | + ((uint64(in[27] - in[26])) >> ntz << 61) + out[3] = + (uint64(in[27] - in[26])) >> (3+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 4) | + ((uint64(in[29] - in[28])) >> ntz << 11) | + ((uint64(in[30] - in[29])) >> ntz << 18) | + ((uint64(in[31] - in[30])) >> ntz << 25) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 39) | + ((uint64(in[34] - in[33])) >> ntz << 46) | + ((uint64(in[35] - in[34])) >> ntz << 53) | + ((uint64(in[36] - in[35])) >> ntz << 60) + out[4] = + (uint64(in[36] - in[35])) >> (4+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 3) | + ((uint64(in[38] - in[37])) >> ntz << 10) | + ((uint64(in[39] - in[38])) >> ntz << 17) | + ((uint64(in[40] - in[39])) >> ntz << 24) | + ((uint64(in[41] - in[40])) >> ntz << 31) | + ((uint64(in[42] - in[41])) >> ntz << 38) | + ((uint64(in[43] - in[42])) >> ntz << 45) | + ((uint64(in[44] - in[43])) >> ntz << 52) | + ((uint64(in[45] - in[44])) >> ntz << 59) + out[5] = + (uint64(in[45] - in[44])) >> (5+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 2) | + ((uint64(in[47] - in[46])) >> ntz << 9) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 23) | + ((uint64(in[50] - in[49])) >> ntz << 30) | + ((uint64(in[51] - in[50])) >> ntz << 37) | + ((uint64(in[52] - in[51])) >> ntz << 44) | + ((uint64(in[53] - in[52])) >> ntz << 51) | + ((uint64(in[54] - in[53])) >> ntz << 58) + out[6] = + (uint64(in[54] - in[53])) >> (6+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 1) | + ((uint64(in[56] - in[55])) >> ntz << 8) | + ((uint64(in[57] - in[56])) >> ntz << 15) | + ((uint64(in[58] - in[57])) >> ntz << 22) | + ((uint64(in[59] - in[58])) >> ntz << 29) | + ((uint64(in[60] - in[59])) >> ntz << 36) | + ((uint64(in[61] - in[60])) >> ntz << 43) | + ((uint64(in[62] - in[61])) >> ntz << 50) | + ((uint64(in[63] - in[62])) >> ntz << 57) +} + +func deltapack_int64_8(initoffset int64, in *[64]int64, out *[8]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 8) | + ((uint64(in[2] - in[1])) >> ntz << 16) | + ((uint64(in[3] - in[2])) >> ntz << 24) | + ((uint64(in[4] - in[3])) >> ntz << 32) | + ((uint64(in[5] - in[4])) >> ntz << 40) | + ((uint64(in[6] - in[5])) >> ntz << 48) | + ((uint64(in[7] - in[6])) >> ntz << 56) + out[1] = + (uint64(in[8] - in[7])) >> ntz | + ((uint64(in[9] - in[8])) >> ntz << 8) | + ((uint64(in[10] - in[9])) >> ntz << 16) | + ((uint64(in[11] - in[10])) >> ntz << 24) | + ((uint64(in[12] - in[11])) >> ntz << 32) | + ((uint64(in[13] - in[12])) >> ntz << 40) | + ((uint64(in[14] - in[13])) >> ntz << 48) | + ((uint64(in[15] - in[14])) >> ntz << 56) + out[2] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 8) | + ((uint64(in[18] - in[17])) >> ntz << 16) | + ((uint64(in[19] - in[18])) >> ntz << 24) | + ((uint64(in[20] - in[19])) >> ntz << 32) | + ((uint64(in[21] - in[20])) >> ntz << 40) | + ((uint64(in[22] - in[21])) >> ntz << 48) | + ((uint64(in[23] - in[22])) >> ntz << 56) + out[3] = + (uint64(in[24] - in[23])) >> ntz | + ((uint64(in[25] - in[24])) >> ntz << 8) | + ((uint64(in[26] - in[25])) >> ntz << 16) | + ((uint64(in[27] - in[26])) >> ntz << 24) | + ((uint64(in[28] - in[27])) >> ntz << 32) | + ((uint64(in[29] - in[28])) >> ntz << 40) | + ((uint64(in[30] - in[29])) >> ntz << 48) | + ((uint64(in[31] - in[30])) >> ntz << 56) + out[4] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 8) | + ((uint64(in[34] - in[33])) >> ntz << 16) | + ((uint64(in[35] - in[34])) >> ntz << 24) | + ((uint64(in[36] - in[35])) >> ntz << 32) | + ((uint64(in[37] - in[36])) >> ntz << 40) | + ((uint64(in[38] - in[37])) >> ntz << 48) | + ((uint64(in[39] - in[38])) >> ntz << 56) + out[5] = + (uint64(in[40] - in[39])) >> ntz | + ((uint64(in[41] - in[40])) >> ntz << 8) | + ((uint64(in[42] - in[41])) >> ntz << 16) | + ((uint64(in[43] - in[42])) >> ntz << 24) | + ((uint64(in[44] - in[43])) >> ntz << 32) | + ((uint64(in[45] - in[44])) >> ntz << 40) | + ((uint64(in[46] - in[45])) >> ntz << 48) | + ((uint64(in[47] - in[46])) >> ntz << 56) + out[6] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 8) | + ((uint64(in[50] - in[49])) >> ntz << 16) | + ((uint64(in[51] - in[50])) >> ntz << 24) | + ((uint64(in[52] - in[51])) >> ntz << 32) | + ((uint64(in[53] - in[52])) >> ntz << 40) | + ((uint64(in[54] - in[53])) >> ntz << 48) | + ((uint64(in[55] - in[54])) >> ntz << 56) + out[7] = + (uint64(in[56] - in[55])) >> ntz | + ((uint64(in[57] - in[56])) >> ntz << 8) | + ((uint64(in[58] - in[57])) >> ntz << 16) | + ((uint64(in[59] - in[58])) >> ntz << 24) | + ((uint64(in[60] - in[59])) >> ntz << 32) | + ((uint64(in[61] - in[60])) >> ntz << 40) | + ((uint64(in[62] - in[61])) >> ntz << 48) | + ((uint64(in[63] - in[62])) >> ntz << 56) +} + +func deltapack_int64_9(initoffset int64, in *[64]int64, out *[9]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 9) | + ((uint64(in[2] - in[1])) >> ntz << 18) | + ((uint64(in[3] - in[2])) >> ntz << 27) | + ((uint64(in[4] - in[3])) >> ntz << 36) | + ((uint64(in[5] - in[4])) >> ntz << 45) | + ((uint64(in[6] - in[5])) >> ntz << 54) | + ((uint64(in[7] - in[6])) >> ntz << 63) + out[1] = + (uint64(in[7] - in[6])) >> (1+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 8) | + ((uint64(in[9] - in[8])) >> ntz << 17) | + ((uint64(in[10] - in[9])) >> ntz << 26) | + ((uint64(in[11] - in[10])) >> ntz << 35) | + ((uint64(in[12] - in[11])) >> ntz << 44) | + ((uint64(in[13] - in[12])) >> ntz << 53) | + ((uint64(in[14] - in[13])) >> ntz << 62) + out[2] = + (uint64(in[14] - in[13])) >> (2+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 7) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 25) | + ((uint64(in[18] - in[17])) >> ntz << 34) | + ((uint64(in[19] - in[18])) >> ntz << 43) | + ((uint64(in[20] - in[19])) >> ntz << 52) | + ((uint64(in[21] - in[20])) >> ntz << 61) + out[3] = + (uint64(in[21] - in[20])) >> (3+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 6) | + ((uint64(in[23] - in[22])) >> ntz << 15) | + ((uint64(in[24] - in[23])) >> ntz << 24) | + ((uint64(in[25] - in[24])) >> ntz << 33) | + ((uint64(in[26] - in[25])) >> ntz << 42) | + ((uint64(in[27] - in[26])) >> ntz << 51) | + ((uint64(in[28] - in[27])) >> ntz << 60) + out[4] = + (uint64(in[28] - in[27])) >> (4+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 5) | + ((uint64(in[30] - in[29])) >> ntz << 14) | + ((uint64(in[31] - in[30])) >> ntz << 23) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 41) | + ((uint64(in[34] - in[33])) >> ntz << 50) | + ((uint64(in[35] - in[34])) >> ntz << 59) + out[5] = + (uint64(in[35] - in[34])) >> (5+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 4) | + ((uint64(in[37] - in[36])) >> ntz << 13) | + ((uint64(in[38] - in[37])) >> ntz << 22) | + ((uint64(in[39] - in[38])) >> ntz << 31) | + ((uint64(in[40] - in[39])) >> ntz << 40) | + ((uint64(in[41] - in[40])) >> ntz << 49) | + ((uint64(in[42] - in[41])) >> ntz << 58) + out[6] = + (uint64(in[42] - in[41])) >> (6+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 3) | + ((uint64(in[44] - in[43])) >> ntz << 12) | + ((uint64(in[45] - in[44])) >> ntz << 21) | + ((uint64(in[46] - in[45])) >> ntz << 30) | + ((uint64(in[47] - in[46])) >> ntz << 39) | + ((uint64(in[48] - in[47])) >> ntz << 48) | + ((uint64(in[49] - in[48])) >> ntz << 57) + out[7] = + (uint64(in[49] - in[48])) >> (7+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 2) | + ((uint64(in[51] - in[50])) >> ntz << 11) | + ((uint64(in[52] - in[51])) >> ntz << 20) | + ((uint64(in[53] - in[52])) >> ntz << 29) | + ((uint64(in[54] - in[53])) >> ntz << 38) | + ((uint64(in[55] - in[54])) >> ntz << 47) | + ((uint64(in[56] - in[55])) >> ntz << 56) + out[8] = + (uint64(in[56] - in[55])) >> (8+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 1) | + ((uint64(in[58] - in[57])) >> ntz << 10) | + ((uint64(in[59] - in[58])) >> ntz << 19) | + ((uint64(in[60] - in[59])) >> ntz << 28) | + ((uint64(in[61] - in[60])) >> ntz << 37) | + ((uint64(in[62] - in[61])) >> ntz << 46) | + ((uint64(in[63] - in[62])) >> ntz << 55) +} + +func deltapack_int64_10(initoffset int64, in *[64]int64, out *[10]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 10) | + ((uint64(in[2] - in[1])) >> ntz << 20) | + ((uint64(in[3] - in[2])) >> ntz << 30) | + ((uint64(in[4] - in[3])) >> ntz << 40) | + ((uint64(in[5] - in[4])) >> ntz << 50) | + ((uint64(in[6] - in[5])) >> ntz << 60) + out[1] = + (uint64(in[6] - in[5])) >> (4+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 6) | + ((uint64(in[8] - in[7])) >> ntz << 16) | + ((uint64(in[9] - in[8])) >> ntz << 26) | + ((uint64(in[10] - in[9])) >> ntz << 36) | + ((uint64(in[11] - in[10])) >> ntz << 46) | + ((uint64(in[12] - in[11])) >> ntz << 56) + out[2] = + (uint64(in[12] - in[11])) >> (8+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 2) | + ((uint64(in[14] - in[13])) >> ntz << 12) | + ((uint64(in[15] - in[14])) >> ntz << 22) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 42) | + ((uint64(in[18] - in[17])) >> ntz << 52) | + ((uint64(in[19] - in[18])) >> ntz << 62) + out[3] = + (uint64(in[19] - in[18])) >> (2+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 8) | + ((uint64(in[21] - in[20])) >> ntz << 18) | + ((uint64(in[22] - in[21])) >> ntz << 28) | + ((uint64(in[23] - in[22])) >> ntz << 38) | + ((uint64(in[24] - in[23])) >> ntz << 48) | + ((uint64(in[25] - in[24])) >> ntz << 58) + out[4] = + (uint64(in[25] - in[24])) >> (6+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 4) | + ((uint64(in[27] - in[26])) >> ntz << 14) | + ((uint64(in[28] - in[27])) >> ntz << 24) | + ((uint64(in[29] - in[28])) >> ntz << 34) | + ((uint64(in[30] - in[29])) >> ntz << 44) | + ((uint64(in[31] - in[30])) >> ntz << 54) + out[5] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 10) | + ((uint64(in[34] - in[33])) >> ntz << 20) | + ((uint64(in[35] - in[34])) >> ntz << 30) | + ((uint64(in[36] - in[35])) >> ntz << 40) | + ((uint64(in[37] - in[36])) >> ntz << 50) | + ((uint64(in[38] - in[37])) >> ntz << 60) + out[6] = + (uint64(in[38] - in[37])) >> (4+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 6) | + ((uint64(in[40] - in[39])) >> ntz << 16) | + ((uint64(in[41] - in[40])) >> ntz << 26) | + ((uint64(in[42] - in[41])) >> ntz << 36) | + ((uint64(in[43] - in[42])) >> ntz << 46) | + ((uint64(in[44] - in[43])) >> ntz << 56) + out[7] = + (uint64(in[44] - in[43])) >> (8+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 2) | + ((uint64(in[46] - in[45])) >> ntz << 12) | + ((uint64(in[47] - in[46])) >> ntz << 22) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 42) | + ((uint64(in[50] - in[49])) >> ntz << 52) | + ((uint64(in[51] - in[50])) >> ntz << 62) + out[8] = + (uint64(in[51] - in[50])) >> (2+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 8) | + ((uint64(in[53] - in[52])) >> ntz << 18) | + ((uint64(in[54] - in[53])) >> ntz << 28) | + ((uint64(in[55] - in[54])) >> ntz << 38) | + ((uint64(in[56] - in[55])) >> ntz << 48) | + ((uint64(in[57] - in[56])) >> ntz << 58) + out[9] = + (uint64(in[57] - in[56])) >> (6+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 4) | + ((uint64(in[59] - in[58])) >> ntz << 14) | + ((uint64(in[60] - in[59])) >> ntz << 24) | + ((uint64(in[61] - in[60])) >> ntz << 34) | + ((uint64(in[62] - in[61])) >> ntz << 44) | + ((uint64(in[63] - in[62])) >> ntz << 54) +} + +func deltapack_int64_11(initoffset int64, in *[64]int64, out *[11]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 11) | + ((uint64(in[2] - in[1])) >> ntz << 22) | + ((uint64(in[3] - in[2])) >> ntz << 33) | + ((uint64(in[4] - in[3])) >> ntz << 44) | + ((uint64(in[5] - in[4])) >> ntz << 55) + out[1] = + (uint64(in[5] - in[4])) >> (9+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 2) | + ((uint64(in[7] - in[6])) >> ntz << 13) | + ((uint64(in[8] - in[7])) >> ntz << 24) | + ((uint64(in[9] - in[8])) >> ntz << 35) | + ((uint64(in[10] - in[9])) >> ntz << 46) | + ((uint64(in[11] - in[10])) >> ntz << 57) + out[2] = + (uint64(in[11] - in[10])) >> (7+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 4) | + ((uint64(in[13] - in[12])) >> ntz << 15) | + ((uint64(in[14] - in[13])) >> ntz << 26) | + ((uint64(in[15] - in[14])) >> ntz << 37) | + ((uint64(in[16] - in[15])) >> ntz << 48) | + ((uint64(in[17] - in[16])) >> ntz << 59) + out[3] = + (uint64(in[17] - in[16])) >> (5+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 6) | + ((uint64(in[19] - in[18])) >> ntz << 17) | + ((uint64(in[20] - in[19])) >> ntz << 28) | + ((uint64(in[21] - in[20])) >> ntz << 39) | + ((uint64(in[22] - in[21])) >> ntz << 50) | + ((uint64(in[23] - in[22])) >> ntz << 61) + out[4] = + (uint64(in[23] - in[22])) >> (3+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 8) | + ((uint64(in[25] - in[24])) >> ntz << 19) | + ((uint64(in[26] - in[25])) >> ntz << 30) | + ((uint64(in[27] - in[26])) >> ntz << 41) | + ((uint64(in[28] - in[27])) >> ntz << 52) | + ((uint64(in[29] - in[28])) >> ntz << 63) + out[5] = + (uint64(in[29] - in[28])) >> (1+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 10) | + ((uint64(in[31] - in[30])) >> ntz << 21) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 43) | + ((uint64(in[34] - in[33])) >> ntz << 54) + out[6] = + (uint64(in[34] - in[33])) >> (10+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 1) | + ((uint64(in[36] - in[35])) >> ntz << 12) | + ((uint64(in[37] - in[36])) >> ntz << 23) | + ((uint64(in[38] - in[37])) >> ntz << 34) | + ((uint64(in[39] - in[38])) >> ntz << 45) | + ((uint64(in[40] - in[39])) >> ntz << 56) + out[7] = + (uint64(in[40] - in[39])) >> (8+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 3) | + ((uint64(in[42] - in[41])) >> ntz << 14) | + ((uint64(in[43] - in[42])) >> ntz << 25) | + ((uint64(in[44] - in[43])) >> ntz << 36) | + ((uint64(in[45] - in[44])) >> ntz << 47) | + ((uint64(in[46] - in[45])) >> ntz << 58) + out[8] = + (uint64(in[46] - in[45])) >> (6+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 5) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 27) | + ((uint64(in[50] - in[49])) >> ntz << 38) | + ((uint64(in[51] - in[50])) >> ntz << 49) | + ((uint64(in[52] - in[51])) >> ntz << 60) + out[9] = + (uint64(in[52] - in[51])) >> (4+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 7) | + ((uint64(in[54] - in[53])) >> ntz << 18) | + ((uint64(in[55] - in[54])) >> ntz << 29) | + ((uint64(in[56] - in[55])) >> ntz << 40) | + ((uint64(in[57] - in[56])) >> ntz << 51) | + ((uint64(in[58] - in[57])) >> ntz << 62) + out[10] = + (uint64(in[58] - in[57])) >> (2+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 9) | + ((uint64(in[60] - in[59])) >> ntz << 20) | + ((uint64(in[61] - in[60])) >> ntz << 31) | + ((uint64(in[62] - in[61])) >> ntz << 42) | + ((uint64(in[63] - in[62])) >> ntz << 53) +} + +func deltapack_int64_12(initoffset int64, in *[64]int64, out *[12]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 12) | + ((uint64(in[2] - in[1])) >> ntz << 24) | + ((uint64(in[3] - in[2])) >> ntz << 36) | + ((uint64(in[4] - in[3])) >> ntz << 48) | + ((uint64(in[5] - in[4])) >> ntz << 60) + out[1] = + (uint64(in[5] - in[4])) >> (4+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 8) | + ((uint64(in[7] - in[6])) >> ntz << 20) | + ((uint64(in[8] - in[7])) >> ntz << 32) | + ((uint64(in[9] - in[8])) >> ntz << 44) | + ((uint64(in[10] - in[9])) >> ntz << 56) + out[2] = + (uint64(in[10] - in[9])) >> (8+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 4) | + ((uint64(in[12] - in[11])) >> ntz << 16) | + ((uint64(in[13] - in[12])) >> ntz << 28) | + ((uint64(in[14] - in[13])) >> ntz << 40) | + ((uint64(in[15] - in[14])) >> ntz << 52) + out[3] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 12) | + ((uint64(in[18] - in[17])) >> ntz << 24) | + ((uint64(in[19] - in[18])) >> ntz << 36) | + ((uint64(in[20] - in[19])) >> ntz << 48) | + ((uint64(in[21] - in[20])) >> ntz << 60) + out[4] = + (uint64(in[21] - in[20])) >> (4+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 8) | + ((uint64(in[23] - in[22])) >> ntz << 20) | + ((uint64(in[24] - in[23])) >> ntz << 32) | + ((uint64(in[25] - in[24])) >> ntz << 44) | + ((uint64(in[26] - in[25])) >> ntz << 56) + out[5] = + (uint64(in[26] - in[25])) >> (8+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 4) | + ((uint64(in[28] - in[27])) >> ntz << 16) | + ((uint64(in[29] - in[28])) >> ntz << 28) | + ((uint64(in[30] - in[29])) >> ntz << 40) | + ((uint64(in[31] - in[30])) >> ntz << 52) + out[6] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 12) | + ((uint64(in[34] - in[33])) >> ntz << 24) | + ((uint64(in[35] - in[34])) >> ntz << 36) | + ((uint64(in[36] - in[35])) >> ntz << 48) | + ((uint64(in[37] - in[36])) >> ntz << 60) + out[7] = + (uint64(in[37] - in[36])) >> (4+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 8) | + ((uint64(in[39] - in[38])) >> ntz << 20) | + ((uint64(in[40] - in[39])) >> ntz << 32) | + ((uint64(in[41] - in[40])) >> ntz << 44) | + ((uint64(in[42] - in[41])) >> ntz << 56) + out[8] = + (uint64(in[42] - in[41])) >> (8+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 4) | + ((uint64(in[44] - in[43])) >> ntz << 16) | + ((uint64(in[45] - in[44])) >> ntz << 28) | + ((uint64(in[46] - in[45])) >> ntz << 40) | + ((uint64(in[47] - in[46])) >> ntz << 52) + out[9] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 12) | + ((uint64(in[50] - in[49])) >> ntz << 24) | + ((uint64(in[51] - in[50])) >> ntz << 36) | + ((uint64(in[52] - in[51])) >> ntz << 48) | + ((uint64(in[53] - in[52])) >> ntz << 60) + out[10] = + (uint64(in[53] - in[52])) >> (4+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 8) | + ((uint64(in[55] - in[54])) >> ntz << 20) | + ((uint64(in[56] - in[55])) >> ntz << 32) | + ((uint64(in[57] - in[56])) >> ntz << 44) | + ((uint64(in[58] - in[57])) >> ntz << 56) + out[11] = + (uint64(in[58] - in[57])) >> (8+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 4) | + ((uint64(in[60] - in[59])) >> ntz << 16) | + ((uint64(in[61] - in[60])) >> ntz << 28) | + ((uint64(in[62] - in[61])) >> ntz << 40) | + ((uint64(in[63] - in[62])) >> ntz << 52) +} + +func deltapack_int64_13(initoffset int64, in *[64]int64, out *[13]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 13) | + ((uint64(in[2] - in[1])) >> ntz << 26) | + ((uint64(in[3] - in[2])) >> ntz << 39) | + ((uint64(in[4] - in[3])) >> ntz << 52) + out[1] = + (uint64(in[4] - in[3])) >> (12+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 1) | + ((uint64(in[6] - in[5])) >> ntz << 14) | + ((uint64(in[7] - in[6])) >> ntz << 27) | + ((uint64(in[8] - in[7])) >> ntz << 40) | + ((uint64(in[9] - in[8])) >> ntz << 53) + out[2] = + (uint64(in[9] - in[8])) >> (11+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 2) | + ((uint64(in[11] - in[10])) >> ntz << 15) | + ((uint64(in[12] - in[11])) >> ntz << 28) | + ((uint64(in[13] - in[12])) >> ntz << 41) | + ((uint64(in[14] - in[13])) >> ntz << 54) + out[3] = + (uint64(in[14] - in[13])) >> (10+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 3) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 29) | + ((uint64(in[18] - in[17])) >> ntz << 42) | + ((uint64(in[19] - in[18])) >> ntz << 55) + out[4] = + (uint64(in[19] - in[18])) >> (9+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 4) | + ((uint64(in[21] - in[20])) >> ntz << 17) | + ((uint64(in[22] - in[21])) >> ntz << 30) | + ((uint64(in[23] - in[22])) >> ntz << 43) | + ((uint64(in[24] - in[23])) >> ntz << 56) + out[5] = + (uint64(in[24] - in[23])) >> (8+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 5) | + ((uint64(in[26] - in[25])) >> ntz << 18) | + ((uint64(in[27] - in[26])) >> ntz << 31) | + ((uint64(in[28] - in[27])) >> ntz << 44) | + ((uint64(in[29] - in[28])) >> ntz << 57) + out[6] = + (uint64(in[29] - in[28])) >> (7+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 6) | + ((uint64(in[31] - in[30])) >> ntz << 19) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 45) | + ((uint64(in[34] - in[33])) >> ntz << 58) + out[7] = + (uint64(in[34] - in[33])) >> (6+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 7) | + ((uint64(in[36] - in[35])) >> ntz << 20) | + ((uint64(in[37] - in[36])) >> ntz << 33) | + ((uint64(in[38] - in[37])) >> ntz << 46) | + ((uint64(in[39] - in[38])) >> ntz << 59) + out[8] = + (uint64(in[39] - in[38])) >> (5+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 8) | + ((uint64(in[41] - in[40])) >> ntz << 21) | + ((uint64(in[42] - in[41])) >> ntz << 34) | + ((uint64(in[43] - in[42])) >> ntz << 47) | + ((uint64(in[44] - in[43])) >> ntz << 60) + out[9] = + (uint64(in[44] - in[43])) >> (4+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 9) | + ((uint64(in[46] - in[45])) >> ntz << 22) | + ((uint64(in[47] - in[46])) >> ntz << 35) | + ((uint64(in[48] - in[47])) >> ntz << 48) | + ((uint64(in[49] - in[48])) >> ntz << 61) + out[10] = + (uint64(in[49] - in[48])) >> (3+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 10) | + ((uint64(in[51] - in[50])) >> ntz << 23) | + ((uint64(in[52] - in[51])) >> ntz << 36) | + ((uint64(in[53] - in[52])) >> ntz << 49) | + ((uint64(in[54] - in[53])) >> ntz << 62) + out[11] = + (uint64(in[54] - in[53])) >> (2+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 11) | + ((uint64(in[56] - in[55])) >> ntz << 24) | + ((uint64(in[57] - in[56])) >> ntz << 37) | + ((uint64(in[58] - in[57])) >> ntz << 50) | + ((uint64(in[59] - in[58])) >> ntz << 63) + out[12] = + (uint64(in[59] - in[58])) >> (1+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 12) | + ((uint64(in[61] - in[60])) >> ntz << 25) | + ((uint64(in[62] - in[61])) >> ntz << 38) | + ((uint64(in[63] - in[62])) >> ntz << 51) +} + +func deltapack_int64_14(initoffset int64, in *[64]int64, out *[14]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 14) | + ((uint64(in[2] - in[1])) >> ntz << 28) | + ((uint64(in[3] - in[2])) >> ntz << 42) | + ((uint64(in[4] - in[3])) >> ntz << 56) + out[1] = + (uint64(in[4] - in[3])) >> (8+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 6) | + ((uint64(in[6] - in[5])) >> ntz << 20) | + ((uint64(in[7] - in[6])) >> ntz << 34) | + ((uint64(in[8] - in[7])) >> ntz << 48) | + ((uint64(in[9] - in[8])) >> ntz << 62) + out[2] = + (uint64(in[9] - in[8])) >> (2+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 12) | + ((uint64(in[11] - in[10])) >> ntz << 26) | + ((uint64(in[12] - in[11])) >> ntz << 40) | + ((uint64(in[13] - in[12])) >> ntz << 54) + out[3] = + (uint64(in[13] - in[12])) >> (10+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 4) | + ((uint64(in[15] - in[14])) >> ntz << 18) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 46) | + ((uint64(in[18] - in[17])) >> ntz << 60) + out[4] = + (uint64(in[18] - in[17])) >> (4+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 10) | + ((uint64(in[20] - in[19])) >> ntz << 24) | + ((uint64(in[21] - in[20])) >> ntz << 38) | + ((uint64(in[22] - in[21])) >> ntz << 52) + out[5] = + (uint64(in[22] - in[21])) >> (12+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 2) | + ((uint64(in[24] - in[23])) >> ntz << 16) | + ((uint64(in[25] - in[24])) >> ntz << 30) | + ((uint64(in[26] - in[25])) >> ntz << 44) | + ((uint64(in[27] - in[26])) >> ntz << 58) + out[6] = + (uint64(in[27] - in[26])) >> (6+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 8) | + ((uint64(in[29] - in[28])) >> ntz << 22) | + ((uint64(in[30] - in[29])) >> ntz << 36) | + ((uint64(in[31] - in[30])) >> ntz << 50) + out[7] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 14) | + ((uint64(in[34] - in[33])) >> ntz << 28) | + ((uint64(in[35] - in[34])) >> ntz << 42) | + ((uint64(in[36] - in[35])) >> ntz << 56) + out[8] = + (uint64(in[36] - in[35])) >> (8+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 6) | + ((uint64(in[38] - in[37])) >> ntz << 20) | + ((uint64(in[39] - in[38])) >> ntz << 34) | + ((uint64(in[40] - in[39])) >> ntz << 48) | + ((uint64(in[41] - in[40])) >> ntz << 62) + out[9] = + (uint64(in[41] - in[40])) >> (2+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 12) | + ((uint64(in[43] - in[42])) >> ntz << 26) | + ((uint64(in[44] - in[43])) >> ntz << 40) | + ((uint64(in[45] - in[44])) >> ntz << 54) + out[10] = + (uint64(in[45] - in[44])) >> (10+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 4) | + ((uint64(in[47] - in[46])) >> ntz << 18) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 46) | + ((uint64(in[50] - in[49])) >> ntz << 60) + out[11] = + (uint64(in[50] - in[49])) >> (4+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 10) | + ((uint64(in[52] - in[51])) >> ntz << 24) | + ((uint64(in[53] - in[52])) >> ntz << 38) | + ((uint64(in[54] - in[53])) >> ntz << 52) + out[12] = + (uint64(in[54] - in[53])) >> (12+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 2) | + ((uint64(in[56] - in[55])) >> ntz << 16) | + ((uint64(in[57] - in[56])) >> ntz << 30) | + ((uint64(in[58] - in[57])) >> ntz << 44) | + ((uint64(in[59] - in[58])) >> ntz << 58) + out[13] = + (uint64(in[59] - in[58])) >> (6+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 8) | + ((uint64(in[61] - in[60])) >> ntz << 22) | + ((uint64(in[62] - in[61])) >> ntz << 36) | + ((uint64(in[63] - in[62])) >> ntz << 50) +} + +func deltapack_int64_15(initoffset int64, in *[64]int64, out *[15]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 15) | + ((uint64(in[2] - in[1])) >> ntz << 30) | + ((uint64(in[3] - in[2])) >> ntz << 45) | + ((uint64(in[4] - in[3])) >> ntz << 60) + out[1] = + (uint64(in[4] - in[3])) >> (4+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 11) | + ((uint64(in[6] - in[5])) >> ntz << 26) | + ((uint64(in[7] - in[6])) >> ntz << 41) | + ((uint64(in[8] - in[7])) >> ntz << 56) + out[2] = + (uint64(in[8] - in[7])) >> (8+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 7) | + ((uint64(in[10] - in[9])) >> ntz << 22) | + ((uint64(in[11] - in[10])) >> ntz << 37) | + ((uint64(in[12] - in[11])) >> ntz << 52) + out[3] = + (uint64(in[12] - in[11])) >> (12+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 3) | + ((uint64(in[14] - in[13])) >> ntz << 18) | + ((uint64(in[15] - in[14])) >> ntz << 33) | + ((uint64(in[16] - in[15])) >> ntz << 48) | + ((uint64(in[17] - in[16])) >> ntz << 63) + out[4] = + (uint64(in[17] - in[16])) >> (1+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 14) | + ((uint64(in[19] - in[18])) >> ntz << 29) | + ((uint64(in[20] - in[19])) >> ntz << 44) | + ((uint64(in[21] - in[20])) >> ntz << 59) + out[5] = + (uint64(in[21] - in[20])) >> (5+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 10) | + ((uint64(in[23] - in[22])) >> ntz << 25) | + ((uint64(in[24] - in[23])) >> ntz << 40) | + ((uint64(in[25] - in[24])) >> ntz << 55) + out[6] = + (uint64(in[25] - in[24])) >> (9+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 6) | + ((uint64(in[27] - in[26])) >> ntz << 21) | + ((uint64(in[28] - in[27])) >> ntz << 36) | + ((uint64(in[29] - in[28])) >> ntz << 51) + out[7] = + (uint64(in[29] - in[28])) >> (13+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 2) | + ((uint64(in[31] - in[30])) >> ntz << 17) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 47) | + ((uint64(in[34] - in[33])) >> ntz << 62) + out[8] = + (uint64(in[34] - in[33])) >> (2+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 13) | + ((uint64(in[36] - in[35])) >> ntz << 28) | + ((uint64(in[37] - in[36])) >> ntz << 43) | + ((uint64(in[38] - in[37])) >> ntz << 58) + out[9] = + (uint64(in[38] - in[37])) >> (6+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 9) | + ((uint64(in[40] - in[39])) >> ntz << 24) | + ((uint64(in[41] - in[40])) >> ntz << 39) | + ((uint64(in[42] - in[41])) >> ntz << 54) + out[10] = + (uint64(in[42] - in[41])) >> (10+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 5) | + ((uint64(in[44] - in[43])) >> ntz << 20) | + ((uint64(in[45] - in[44])) >> ntz << 35) | + ((uint64(in[46] - in[45])) >> ntz << 50) + out[11] = + (uint64(in[46] - in[45])) >> (14+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 1) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 31) | + ((uint64(in[50] - in[49])) >> ntz << 46) | + ((uint64(in[51] - in[50])) >> ntz << 61) + out[12] = + (uint64(in[51] - in[50])) >> (3+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 12) | + ((uint64(in[53] - in[52])) >> ntz << 27) | + ((uint64(in[54] - in[53])) >> ntz << 42) | + ((uint64(in[55] - in[54])) >> ntz << 57) + out[13] = + (uint64(in[55] - in[54])) >> (7+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 8) | + ((uint64(in[57] - in[56])) >> ntz << 23) | + ((uint64(in[58] - in[57])) >> ntz << 38) | + ((uint64(in[59] - in[58])) >> ntz << 53) + out[14] = + (uint64(in[59] - in[58])) >> (11+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 4) | + ((uint64(in[61] - in[60])) >> ntz << 19) | + ((uint64(in[62] - in[61])) >> ntz << 34) | + ((uint64(in[63] - in[62])) >> ntz << 49) +} + +func deltapack_int64_16(initoffset int64, in *[64]int64, out *[16]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 16) | + ((uint64(in[2] - in[1])) >> ntz << 32) | + ((uint64(in[3] - in[2])) >> ntz << 48) + out[1] = + (uint64(in[4] - in[3])) >> ntz | + ((uint64(in[5] - in[4])) >> ntz << 16) | + ((uint64(in[6] - in[5])) >> ntz << 32) | + ((uint64(in[7] - in[6])) >> ntz << 48) + out[2] = + (uint64(in[8] - in[7])) >> ntz | + ((uint64(in[9] - in[8])) >> ntz << 16) | + ((uint64(in[10] - in[9])) >> ntz << 32) | + ((uint64(in[11] - in[10])) >> ntz << 48) + out[3] = + (uint64(in[12] - in[11])) >> ntz | + ((uint64(in[13] - in[12])) >> ntz << 16) | + ((uint64(in[14] - in[13])) >> ntz << 32) | + ((uint64(in[15] - in[14])) >> ntz << 48) + out[4] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 16) | + ((uint64(in[18] - in[17])) >> ntz << 32) | + ((uint64(in[19] - in[18])) >> ntz << 48) + out[5] = + (uint64(in[20] - in[19])) >> ntz | + ((uint64(in[21] - in[20])) >> ntz << 16) | + ((uint64(in[22] - in[21])) >> ntz << 32) | + ((uint64(in[23] - in[22])) >> ntz << 48) + out[6] = + (uint64(in[24] - in[23])) >> ntz | + ((uint64(in[25] - in[24])) >> ntz << 16) | + ((uint64(in[26] - in[25])) >> ntz << 32) | + ((uint64(in[27] - in[26])) >> ntz << 48) + out[7] = + (uint64(in[28] - in[27])) >> ntz | + ((uint64(in[29] - in[28])) >> ntz << 16) | + ((uint64(in[30] - in[29])) >> ntz << 32) | + ((uint64(in[31] - in[30])) >> ntz << 48) + out[8] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 16) | + ((uint64(in[34] - in[33])) >> ntz << 32) | + ((uint64(in[35] - in[34])) >> ntz << 48) + out[9] = + (uint64(in[36] - in[35])) >> ntz | + ((uint64(in[37] - in[36])) >> ntz << 16) | + ((uint64(in[38] - in[37])) >> ntz << 32) | + ((uint64(in[39] - in[38])) >> ntz << 48) + out[10] = + (uint64(in[40] - in[39])) >> ntz | + ((uint64(in[41] - in[40])) >> ntz << 16) | + ((uint64(in[42] - in[41])) >> ntz << 32) | + ((uint64(in[43] - in[42])) >> ntz << 48) + out[11] = + (uint64(in[44] - in[43])) >> ntz | + ((uint64(in[45] - in[44])) >> ntz << 16) | + ((uint64(in[46] - in[45])) >> ntz << 32) | + ((uint64(in[47] - in[46])) >> ntz << 48) + out[12] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 16) | + ((uint64(in[50] - in[49])) >> ntz << 32) | + ((uint64(in[51] - in[50])) >> ntz << 48) + out[13] = + (uint64(in[52] - in[51])) >> ntz | + ((uint64(in[53] - in[52])) >> ntz << 16) | + ((uint64(in[54] - in[53])) >> ntz << 32) | + ((uint64(in[55] - in[54])) >> ntz << 48) + out[14] = + (uint64(in[56] - in[55])) >> ntz | + ((uint64(in[57] - in[56])) >> ntz << 16) | + ((uint64(in[58] - in[57])) >> ntz << 32) | + ((uint64(in[59] - in[58])) >> ntz << 48) + out[15] = + (uint64(in[60] - in[59])) >> ntz | + ((uint64(in[61] - in[60])) >> ntz << 16) | + ((uint64(in[62] - in[61])) >> ntz << 32) | + ((uint64(in[63] - in[62])) >> ntz << 48) +} + +func deltapack_int64_17(initoffset int64, in *[64]int64, out *[17]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 17) | + ((uint64(in[2] - in[1])) >> ntz << 34) | + ((uint64(in[3] - in[2])) >> ntz << 51) + out[1] = + (uint64(in[3] - in[2])) >> (13+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 4) | + ((uint64(in[5] - in[4])) >> ntz << 21) | + ((uint64(in[6] - in[5])) >> ntz << 38) | + ((uint64(in[7] - in[6])) >> ntz << 55) + out[2] = + (uint64(in[7] - in[6])) >> (9+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 8) | + ((uint64(in[9] - in[8])) >> ntz << 25) | + ((uint64(in[10] - in[9])) >> ntz << 42) | + ((uint64(in[11] - in[10])) >> ntz << 59) + out[3] = + (uint64(in[11] - in[10])) >> (5+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 12) | + ((uint64(in[13] - in[12])) >> ntz << 29) | + ((uint64(in[14] - in[13])) >> ntz << 46) | + ((uint64(in[15] - in[14])) >> ntz << 63) + out[4] = + (uint64(in[15] - in[14])) >> (1+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 33) | + ((uint64(in[18] - in[17])) >> ntz << 50) + out[5] = + (uint64(in[18] - in[17])) >> (14+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 3) | + ((uint64(in[20] - in[19])) >> ntz << 20) | + ((uint64(in[21] - in[20])) >> ntz << 37) | + ((uint64(in[22] - in[21])) >> ntz << 54) + out[6] = + (uint64(in[22] - in[21])) >> (10+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 7) | + ((uint64(in[24] - in[23])) >> ntz << 24) | + ((uint64(in[25] - in[24])) >> ntz << 41) | + ((uint64(in[26] - in[25])) >> ntz << 58) + out[7] = + (uint64(in[26] - in[25])) >> (6+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 11) | + ((uint64(in[28] - in[27])) >> ntz << 28) | + ((uint64(in[29] - in[28])) >> ntz << 45) | + ((uint64(in[30] - in[29])) >> ntz << 62) + out[8] = + (uint64(in[30] - in[29])) >> (2+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 15) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 49) + out[9] = + (uint64(in[33] - in[32])) >> (15+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 2) | + ((uint64(in[35] - in[34])) >> ntz << 19) | + ((uint64(in[36] - in[35])) >> ntz << 36) | + ((uint64(in[37] - in[36])) >> ntz << 53) + out[10] = + (uint64(in[37] - in[36])) >> (11+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 6) | + ((uint64(in[39] - in[38])) >> ntz << 23) | + ((uint64(in[40] - in[39])) >> ntz << 40) | + ((uint64(in[41] - in[40])) >> ntz << 57) + out[11] = + (uint64(in[41] - in[40])) >> (7+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 10) | + ((uint64(in[43] - in[42])) >> ntz << 27) | + ((uint64(in[44] - in[43])) >> ntz << 44) | + ((uint64(in[45] - in[44])) >> ntz << 61) + out[12] = + (uint64(in[45] - in[44])) >> (3+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 14) | + ((uint64(in[47] - in[46])) >> ntz << 31) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[13] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 1) | + ((uint64(in[50] - in[49])) >> ntz << 18) | + ((uint64(in[51] - in[50])) >> ntz << 35) | + ((uint64(in[52] - in[51])) >> ntz << 52) + out[14] = + (uint64(in[52] - in[51])) >> (12+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 5) | + ((uint64(in[54] - in[53])) >> ntz << 22) | + ((uint64(in[55] - in[54])) >> ntz << 39) | + ((uint64(in[56] - in[55])) >> ntz << 56) + out[15] = + (uint64(in[56] - in[55])) >> (8+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 9) | + ((uint64(in[58] - in[57])) >> ntz << 26) | + ((uint64(in[59] - in[58])) >> ntz << 43) | + ((uint64(in[60] - in[59])) >> ntz << 60) + out[16] = + (uint64(in[60] - in[59])) >> (4+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 13) | + ((uint64(in[62] - in[61])) >> ntz << 30) | + ((uint64(in[63] - in[62])) >> ntz << 47) +} + +func deltapack_int64_18(initoffset int64, in *[64]int64, out *[18]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 18) | + ((uint64(in[2] - in[1])) >> ntz << 36) | + ((uint64(in[3] - in[2])) >> ntz << 54) + out[1] = + (uint64(in[3] - in[2])) >> (10+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 8) | + ((uint64(in[5] - in[4])) >> ntz << 26) | + ((uint64(in[6] - in[5])) >> ntz << 44) | + ((uint64(in[7] - in[6])) >> ntz << 62) + out[2] = + (uint64(in[7] - in[6])) >> (2+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 16) | + ((uint64(in[9] - in[8])) >> ntz << 34) | + ((uint64(in[10] - in[9])) >> ntz << 52) + out[3] = + (uint64(in[10] - in[9])) >> (12+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 6) | + ((uint64(in[12] - in[11])) >> ntz << 24) | + ((uint64(in[13] - in[12])) >> ntz << 42) | + ((uint64(in[14] - in[13])) >> ntz << 60) + out[4] = + (uint64(in[14] - in[13])) >> (4+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 14) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 50) + out[5] = + (uint64(in[17] - in[16])) >> (14+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 4) | + ((uint64(in[19] - in[18])) >> ntz << 22) | + ((uint64(in[20] - in[19])) >> ntz << 40) | + ((uint64(in[21] - in[20])) >> ntz << 58) + out[6] = + (uint64(in[21] - in[20])) >> (6+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 12) | + ((uint64(in[23] - in[22])) >> ntz << 30) | + ((uint64(in[24] - in[23])) >> ntz << 48) + out[7] = + (uint64(in[24] - in[23])) >> (16+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 2) | + ((uint64(in[26] - in[25])) >> ntz << 20) | + ((uint64(in[27] - in[26])) >> ntz << 38) | + ((uint64(in[28] - in[27])) >> ntz << 56) + out[8] = + (uint64(in[28] - in[27])) >> (8+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 10) | + ((uint64(in[30] - in[29])) >> ntz << 28) | + ((uint64(in[31] - in[30])) >> ntz << 46) + out[9] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 18) | + ((uint64(in[34] - in[33])) >> ntz << 36) | + ((uint64(in[35] - in[34])) >> ntz << 54) + out[10] = + (uint64(in[35] - in[34])) >> (10+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 8) | + ((uint64(in[37] - in[36])) >> ntz << 26) | + ((uint64(in[38] - in[37])) >> ntz << 44) | + ((uint64(in[39] - in[38])) >> ntz << 62) + out[11] = + (uint64(in[39] - in[38])) >> (2+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 16) | + ((uint64(in[41] - in[40])) >> ntz << 34) | + ((uint64(in[42] - in[41])) >> ntz << 52) + out[12] = + (uint64(in[42] - in[41])) >> (12+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 6) | + ((uint64(in[44] - in[43])) >> ntz << 24) | + ((uint64(in[45] - in[44])) >> ntz << 42) | + ((uint64(in[46] - in[45])) >> ntz << 60) + out[13] = + (uint64(in[46] - in[45])) >> (4+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 14) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 50) + out[14] = + (uint64(in[49] - in[48])) >> (14+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 4) | + ((uint64(in[51] - in[50])) >> ntz << 22) | + ((uint64(in[52] - in[51])) >> ntz << 40) | + ((uint64(in[53] - in[52])) >> ntz << 58) + out[15] = + (uint64(in[53] - in[52])) >> (6+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 12) | + ((uint64(in[55] - in[54])) >> ntz << 30) | + ((uint64(in[56] - in[55])) >> ntz << 48) + out[16] = + (uint64(in[56] - in[55])) >> (16+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 2) | + ((uint64(in[58] - in[57])) >> ntz << 20) | + ((uint64(in[59] - in[58])) >> ntz << 38) | + ((uint64(in[60] - in[59])) >> ntz << 56) + out[17] = + (uint64(in[60] - in[59])) >> (8+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 10) | + ((uint64(in[62] - in[61])) >> ntz << 28) | + ((uint64(in[63] - in[62])) >> ntz << 46) +} + +func deltapack_int64_19(initoffset int64, in *[64]int64, out *[19]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 19) | + ((uint64(in[2] - in[1])) >> ntz << 38) | + ((uint64(in[3] - in[2])) >> ntz << 57) + out[1] = + (uint64(in[3] - in[2])) >> (7+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 12) | + ((uint64(in[5] - in[4])) >> ntz << 31) | + ((uint64(in[6] - in[5])) >> ntz << 50) + out[2] = + (uint64(in[6] - in[5])) >> (14+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 5) | + ((uint64(in[8] - in[7])) >> ntz << 24) | + ((uint64(in[9] - in[8])) >> ntz << 43) | + ((uint64(in[10] - in[9])) >> ntz << 62) + out[3] = + (uint64(in[10] - in[9])) >> (2+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 17) | + ((uint64(in[12] - in[11])) >> ntz << 36) | + ((uint64(in[13] - in[12])) >> ntz << 55) + out[4] = + (uint64(in[13] - in[12])) >> (9+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 10) | + ((uint64(in[15] - in[14])) >> ntz << 29) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[5] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 3) | + ((uint64(in[18] - in[17])) >> ntz << 22) | + ((uint64(in[19] - in[18])) >> ntz << 41) | + ((uint64(in[20] - in[19])) >> ntz << 60) + out[6] = + (uint64(in[20] - in[19])) >> (4+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 15) | + ((uint64(in[22] - in[21])) >> ntz << 34) | + ((uint64(in[23] - in[22])) >> ntz << 53) + out[7] = + (uint64(in[23] - in[22])) >> (11+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 8) | + ((uint64(in[25] - in[24])) >> ntz << 27) | + ((uint64(in[26] - in[25])) >> ntz << 46) + out[8] = + (uint64(in[26] - in[25])) >> (18+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 1) | + ((uint64(in[28] - in[27])) >> ntz << 20) | + ((uint64(in[29] - in[28])) >> ntz << 39) | + ((uint64(in[30] - in[29])) >> ntz << 58) + out[9] = + (uint64(in[30] - in[29])) >> (6+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 13) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 51) + out[10] = + (uint64(in[33] - in[32])) >> (13+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 6) | + ((uint64(in[35] - in[34])) >> ntz << 25) | + ((uint64(in[36] - in[35])) >> ntz << 44) | + ((uint64(in[37] - in[36])) >> ntz << 63) + out[11] = + (uint64(in[37] - in[36])) >> (1+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 18) | + ((uint64(in[39] - in[38])) >> ntz << 37) | + ((uint64(in[40] - in[39])) >> ntz << 56) + out[12] = + (uint64(in[40] - in[39])) >> (8+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 11) | + ((uint64(in[42] - in[41])) >> ntz << 30) | + ((uint64(in[43] - in[42])) >> ntz << 49) + out[13] = + (uint64(in[43] - in[42])) >> (15+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 4) | + ((uint64(in[45] - in[44])) >> ntz << 23) | + ((uint64(in[46] - in[45])) >> ntz << 42) | + ((uint64(in[47] - in[46])) >> ntz << 61) + out[14] = + (uint64(in[47] - in[46])) >> (3+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 35) | + ((uint64(in[50] - in[49])) >> ntz << 54) + out[15] = + (uint64(in[50] - in[49])) >> (10+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 9) | + ((uint64(in[52] - in[51])) >> ntz << 28) | + ((uint64(in[53] - in[52])) >> ntz << 47) + out[16] = + (uint64(in[53] - in[52])) >> (17+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 2) | + ((uint64(in[55] - in[54])) >> ntz << 21) | + ((uint64(in[56] - in[55])) >> ntz << 40) | + ((uint64(in[57] - in[56])) >> ntz << 59) + out[17] = + (uint64(in[57] - in[56])) >> (5+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 14) | + ((uint64(in[59] - in[58])) >> ntz << 33) | + ((uint64(in[60] - in[59])) >> ntz << 52) + out[18] = + (uint64(in[60] - in[59])) >> (12+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 7) | + ((uint64(in[62] - in[61])) >> ntz << 26) | + ((uint64(in[63] - in[62])) >> ntz << 45) +} + +func deltapack_int64_20(initoffset int64, in *[64]int64, out *[20]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 20) | + ((uint64(in[2] - in[1])) >> ntz << 40) | + ((uint64(in[3] - in[2])) >> ntz << 60) + out[1] = + (uint64(in[3] - in[2])) >> (4+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 16) | + ((uint64(in[5] - in[4])) >> ntz << 36) | + ((uint64(in[6] - in[5])) >> ntz << 56) + out[2] = + (uint64(in[6] - in[5])) >> (8+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 12) | + ((uint64(in[8] - in[7])) >> ntz << 32) | + ((uint64(in[9] - in[8])) >> ntz << 52) + out[3] = + (uint64(in[9] - in[8])) >> (12+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 8) | + ((uint64(in[11] - in[10])) >> ntz << 28) | + ((uint64(in[12] - in[11])) >> ntz << 48) + out[4] = + (uint64(in[12] - in[11])) >> (16+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 4) | + ((uint64(in[14] - in[13])) >> ntz << 24) | + ((uint64(in[15] - in[14])) >> ntz << 44) + out[5] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 20) | + ((uint64(in[18] - in[17])) >> ntz << 40) | + ((uint64(in[19] - in[18])) >> ntz << 60) + out[6] = + (uint64(in[19] - in[18])) >> (4+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 16) | + ((uint64(in[21] - in[20])) >> ntz << 36) | + ((uint64(in[22] - in[21])) >> ntz << 56) + out[7] = + (uint64(in[22] - in[21])) >> (8+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 12) | + ((uint64(in[24] - in[23])) >> ntz << 32) | + ((uint64(in[25] - in[24])) >> ntz << 52) + out[8] = + (uint64(in[25] - in[24])) >> (12+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 8) | + ((uint64(in[27] - in[26])) >> ntz << 28) | + ((uint64(in[28] - in[27])) >> ntz << 48) + out[9] = + (uint64(in[28] - in[27])) >> (16+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 4) | + ((uint64(in[30] - in[29])) >> ntz << 24) | + ((uint64(in[31] - in[30])) >> ntz << 44) + out[10] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 20) | + ((uint64(in[34] - in[33])) >> ntz << 40) | + ((uint64(in[35] - in[34])) >> ntz << 60) + out[11] = + (uint64(in[35] - in[34])) >> (4+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 16) | + ((uint64(in[37] - in[36])) >> ntz << 36) | + ((uint64(in[38] - in[37])) >> ntz << 56) + out[12] = + (uint64(in[38] - in[37])) >> (8+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 12) | + ((uint64(in[40] - in[39])) >> ntz << 32) | + ((uint64(in[41] - in[40])) >> ntz << 52) + out[13] = + (uint64(in[41] - in[40])) >> (12+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 8) | + ((uint64(in[43] - in[42])) >> ntz << 28) | + ((uint64(in[44] - in[43])) >> ntz << 48) + out[14] = + (uint64(in[44] - in[43])) >> (16+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 4) | + ((uint64(in[46] - in[45])) >> ntz << 24) | + ((uint64(in[47] - in[46])) >> ntz << 44) + out[15] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 20) | + ((uint64(in[50] - in[49])) >> ntz << 40) | + ((uint64(in[51] - in[50])) >> ntz << 60) + out[16] = + (uint64(in[51] - in[50])) >> (4+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 16) | + ((uint64(in[53] - in[52])) >> ntz << 36) | + ((uint64(in[54] - in[53])) >> ntz << 56) + out[17] = + (uint64(in[54] - in[53])) >> (8+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 12) | + ((uint64(in[56] - in[55])) >> ntz << 32) | + ((uint64(in[57] - in[56])) >> ntz << 52) + out[18] = + (uint64(in[57] - in[56])) >> (12+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 8) | + ((uint64(in[59] - in[58])) >> ntz << 28) | + ((uint64(in[60] - in[59])) >> ntz << 48) + out[19] = + (uint64(in[60] - in[59])) >> (16+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 4) | + ((uint64(in[62] - in[61])) >> ntz << 24) | + ((uint64(in[63] - in[62])) >> ntz << 44) +} + +func deltapack_int64_21(initoffset int64, in *[64]int64, out *[21]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 21) | + ((uint64(in[2] - in[1])) >> ntz << 42) | + ((uint64(in[3] - in[2])) >> ntz << 63) + out[1] = + (uint64(in[3] - in[2])) >> (1+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 20) | + ((uint64(in[5] - in[4])) >> ntz << 41) | + ((uint64(in[6] - in[5])) >> ntz << 62) + out[2] = + (uint64(in[6] - in[5])) >> (2+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 19) | + ((uint64(in[8] - in[7])) >> ntz << 40) | + ((uint64(in[9] - in[8])) >> ntz << 61) + out[3] = + (uint64(in[9] - in[8])) >> (3+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 18) | + ((uint64(in[11] - in[10])) >> ntz << 39) | + ((uint64(in[12] - in[11])) >> ntz << 60) + out[4] = + (uint64(in[12] - in[11])) >> (4+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 17) | + ((uint64(in[14] - in[13])) >> ntz << 38) | + ((uint64(in[15] - in[14])) >> ntz << 59) + out[5] = + (uint64(in[15] - in[14])) >> (5+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 37) | + ((uint64(in[18] - in[17])) >> ntz << 58) + out[6] = + (uint64(in[18] - in[17])) >> (6+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 15) | + ((uint64(in[20] - in[19])) >> ntz << 36) | + ((uint64(in[21] - in[20])) >> ntz << 57) + out[7] = + (uint64(in[21] - in[20])) >> (7+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 14) | + ((uint64(in[23] - in[22])) >> ntz << 35) | + ((uint64(in[24] - in[23])) >> ntz << 56) + out[8] = + (uint64(in[24] - in[23])) >> (8+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 13) | + ((uint64(in[26] - in[25])) >> ntz << 34) | + ((uint64(in[27] - in[26])) >> ntz << 55) + out[9] = + (uint64(in[27] - in[26])) >> (9+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 12) | + ((uint64(in[29] - in[28])) >> ntz << 33) | + ((uint64(in[30] - in[29])) >> ntz << 54) + out[10] = + (uint64(in[30] - in[29])) >> (10+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 11) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 53) + out[11] = + (uint64(in[33] - in[32])) >> (11+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 10) | + ((uint64(in[35] - in[34])) >> ntz << 31) | + ((uint64(in[36] - in[35])) >> ntz << 52) + out[12] = + (uint64(in[36] - in[35])) >> (12+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 9) | + ((uint64(in[38] - in[37])) >> ntz << 30) | + ((uint64(in[39] - in[38])) >> ntz << 51) + out[13] = + (uint64(in[39] - in[38])) >> (13+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 8) | + ((uint64(in[41] - in[40])) >> ntz << 29) | + ((uint64(in[42] - in[41])) >> ntz << 50) + out[14] = + (uint64(in[42] - in[41])) >> (14+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 7) | + ((uint64(in[44] - in[43])) >> ntz << 28) | + ((uint64(in[45] - in[44])) >> ntz << 49) + out[15] = + (uint64(in[45] - in[44])) >> (15+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 6) | + ((uint64(in[47] - in[46])) >> ntz << 27) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[16] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 5) | + ((uint64(in[50] - in[49])) >> ntz << 26) | + ((uint64(in[51] - in[50])) >> ntz << 47) + out[17] = + (uint64(in[51] - in[50])) >> (17+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 4) | + ((uint64(in[53] - in[52])) >> ntz << 25) | + ((uint64(in[54] - in[53])) >> ntz << 46) + out[18] = + (uint64(in[54] - in[53])) >> (18+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 3) | + ((uint64(in[56] - in[55])) >> ntz << 24) | + ((uint64(in[57] - in[56])) >> ntz << 45) + out[19] = + (uint64(in[57] - in[56])) >> (19+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 2) | + ((uint64(in[59] - in[58])) >> ntz << 23) | + ((uint64(in[60] - in[59])) >> ntz << 44) + out[20] = + (uint64(in[60] - in[59])) >> (20+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 1) | + ((uint64(in[62] - in[61])) >> ntz << 22) | + ((uint64(in[63] - in[62])) >> ntz << 43) +} + +func deltapack_int64_22(initoffset int64, in *[64]int64, out *[22]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 22) | + ((uint64(in[2] - in[1])) >> ntz << 44) + out[1] = + (uint64(in[2] - in[1])) >> (20+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 2) | + ((uint64(in[4] - in[3])) >> ntz << 24) | + ((uint64(in[5] - in[4])) >> ntz << 46) + out[2] = + (uint64(in[5] - in[4])) >> (18+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 4) | + ((uint64(in[7] - in[6])) >> ntz << 26) | + ((uint64(in[8] - in[7])) >> ntz << 48) + out[3] = + (uint64(in[8] - in[7])) >> (16+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 6) | + ((uint64(in[10] - in[9])) >> ntz << 28) | + ((uint64(in[11] - in[10])) >> ntz << 50) + out[4] = + (uint64(in[11] - in[10])) >> (14+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 8) | + ((uint64(in[13] - in[12])) >> ntz << 30) | + ((uint64(in[14] - in[13])) >> ntz << 52) + out[5] = + (uint64(in[14] - in[13])) >> (12+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 10) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 54) + out[6] = + (uint64(in[17] - in[16])) >> (10+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 12) | + ((uint64(in[19] - in[18])) >> ntz << 34) | + ((uint64(in[20] - in[19])) >> ntz << 56) + out[7] = + (uint64(in[20] - in[19])) >> (8+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 14) | + ((uint64(in[22] - in[21])) >> ntz << 36) | + ((uint64(in[23] - in[22])) >> ntz << 58) + out[8] = + (uint64(in[23] - in[22])) >> (6+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 16) | + ((uint64(in[25] - in[24])) >> ntz << 38) | + ((uint64(in[26] - in[25])) >> ntz << 60) + out[9] = + (uint64(in[26] - in[25])) >> (4+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 18) | + ((uint64(in[28] - in[27])) >> ntz << 40) | + ((uint64(in[29] - in[28])) >> ntz << 62) + out[10] = + (uint64(in[29] - in[28])) >> (2+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 20) | + ((uint64(in[31] - in[30])) >> ntz << 42) + out[11] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 22) | + ((uint64(in[34] - in[33])) >> ntz << 44) + out[12] = + (uint64(in[34] - in[33])) >> (20+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 2) | + ((uint64(in[36] - in[35])) >> ntz << 24) | + ((uint64(in[37] - in[36])) >> ntz << 46) + out[13] = + (uint64(in[37] - in[36])) >> (18+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 4) | + ((uint64(in[39] - in[38])) >> ntz << 26) | + ((uint64(in[40] - in[39])) >> ntz << 48) + out[14] = + (uint64(in[40] - in[39])) >> (16+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 6) | + ((uint64(in[42] - in[41])) >> ntz << 28) | + ((uint64(in[43] - in[42])) >> ntz << 50) + out[15] = + (uint64(in[43] - in[42])) >> (14+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 8) | + ((uint64(in[45] - in[44])) >> ntz << 30) | + ((uint64(in[46] - in[45])) >> ntz << 52) + out[16] = + (uint64(in[46] - in[45])) >> (12+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 10) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 54) + out[17] = + (uint64(in[49] - in[48])) >> (10+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 12) | + ((uint64(in[51] - in[50])) >> ntz << 34) | + ((uint64(in[52] - in[51])) >> ntz << 56) + out[18] = + (uint64(in[52] - in[51])) >> (8+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 14) | + ((uint64(in[54] - in[53])) >> ntz << 36) | + ((uint64(in[55] - in[54])) >> ntz << 58) + out[19] = + (uint64(in[55] - in[54])) >> (6+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 16) | + ((uint64(in[57] - in[56])) >> ntz << 38) | + ((uint64(in[58] - in[57])) >> ntz << 60) + out[20] = + (uint64(in[58] - in[57])) >> (4+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 18) | + ((uint64(in[60] - in[59])) >> ntz << 40) | + ((uint64(in[61] - in[60])) >> ntz << 62) + out[21] = + (uint64(in[61] - in[60])) >> (2+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 20) | + ((uint64(in[63] - in[62])) >> ntz << 42) +} + +func deltapack_int64_23(initoffset int64, in *[64]int64, out *[23]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 23) | + ((uint64(in[2] - in[1])) >> ntz << 46) + out[1] = + (uint64(in[2] - in[1])) >> (18+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 5) | + ((uint64(in[4] - in[3])) >> ntz << 28) | + ((uint64(in[5] - in[4])) >> ntz << 51) + out[2] = + (uint64(in[5] - in[4])) >> (13+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 10) | + ((uint64(in[7] - in[6])) >> ntz << 33) | + ((uint64(in[8] - in[7])) >> ntz << 56) + out[3] = + (uint64(in[8] - in[7])) >> (8+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 15) | + ((uint64(in[10] - in[9])) >> ntz << 38) | + ((uint64(in[11] - in[10])) >> ntz << 61) + out[4] = + (uint64(in[11] - in[10])) >> (3+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 20) | + ((uint64(in[13] - in[12])) >> ntz << 43) + out[5] = + (uint64(in[13] - in[12])) >> (21+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 2) | + ((uint64(in[15] - in[14])) >> ntz << 25) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[6] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 7) | + ((uint64(in[18] - in[17])) >> ntz << 30) | + ((uint64(in[19] - in[18])) >> ntz << 53) + out[7] = + (uint64(in[19] - in[18])) >> (11+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 12) | + ((uint64(in[21] - in[20])) >> ntz << 35) | + ((uint64(in[22] - in[21])) >> ntz << 58) + out[8] = + (uint64(in[22] - in[21])) >> (6+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 17) | + ((uint64(in[24] - in[23])) >> ntz << 40) | + ((uint64(in[25] - in[24])) >> ntz << 63) + out[9] = + (uint64(in[25] - in[24])) >> (1+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 22) | + ((uint64(in[27] - in[26])) >> ntz << 45) + out[10] = + (uint64(in[27] - in[26])) >> (19+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 4) | + ((uint64(in[29] - in[28])) >> ntz << 27) | + ((uint64(in[30] - in[29])) >> ntz << 50) + out[11] = + (uint64(in[30] - in[29])) >> (14+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 9) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 55) + out[12] = + (uint64(in[33] - in[32])) >> (9+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 14) | + ((uint64(in[35] - in[34])) >> ntz << 37) | + ((uint64(in[36] - in[35])) >> ntz << 60) + out[13] = + (uint64(in[36] - in[35])) >> (4+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 19) | + ((uint64(in[38] - in[37])) >> ntz << 42) + out[14] = + (uint64(in[38] - in[37])) >> (22+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 1) | + ((uint64(in[40] - in[39])) >> ntz << 24) | + ((uint64(in[41] - in[40])) >> ntz << 47) + out[15] = + (uint64(in[41] - in[40])) >> (17+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 6) | + ((uint64(in[43] - in[42])) >> ntz << 29) | + ((uint64(in[44] - in[43])) >> ntz << 52) + out[16] = + (uint64(in[44] - in[43])) >> (12+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 11) | + ((uint64(in[46] - in[45])) >> ntz << 34) | + ((uint64(in[47] - in[46])) >> ntz << 57) + out[17] = + (uint64(in[47] - in[46])) >> (7+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 39) | + ((uint64(in[50] - in[49])) >> ntz << 62) + out[18] = + (uint64(in[50] - in[49])) >> (2+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 21) | + ((uint64(in[52] - in[51])) >> ntz << 44) + out[19] = + (uint64(in[52] - in[51])) >> (20+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 3) | + ((uint64(in[54] - in[53])) >> ntz << 26) | + ((uint64(in[55] - in[54])) >> ntz << 49) + out[20] = + (uint64(in[55] - in[54])) >> (15+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 8) | + ((uint64(in[57] - in[56])) >> ntz << 31) | + ((uint64(in[58] - in[57])) >> ntz << 54) + out[21] = + (uint64(in[58] - in[57])) >> (10+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 13) | + ((uint64(in[60] - in[59])) >> ntz << 36) | + ((uint64(in[61] - in[60])) >> ntz << 59) + out[22] = + (uint64(in[61] - in[60])) >> (5+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 18) | + ((uint64(in[63] - in[62])) >> ntz << 41) +} + +func deltapack_int64_24(initoffset int64, in *[64]int64, out *[24]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 24) | + ((uint64(in[2] - in[1])) >> ntz << 48) + out[1] = + (uint64(in[2] - in[1])) >> (16+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 8) | + ((uint64(in[4] - in[3])) >> ntz << 32) | + ((uint64(in[5] - in[4])) >> ntz << 56) + out[2] = + (uint64(in[5] - in[4])) >> (8+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 16) | + ((uint64(in[7] - in[6])) >> ntz << 40) + out[3] = + (uint64(in[8] - in[7])) >> ntz | + ((uint64(in[9] - in[8])) >> ntz << 24) | + ((uint64(in[10] - in[9])) >> ntz << 48) + out[4] = + (uint64(in[10] - in[9])) >> (16+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 8) | + ((uint64(in[12] - in[11])) >> ntz << 32) | + ((uint64(in[13] - in[12])) >> ntz << 56) + out[5] = + (uint64(in[13] - in[12])) >> (8+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 16) | + ((uint64(in[15] - in[14])) >> ntz << 40) + out[6] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 24) | + ((uint64(in[18] - in[17])) >> ntz << 48) + out[7] = + (uint64(in[18] - in[17])) >> (16+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 8) | + ((uint64(in[20] - in[19])) >> ntz << 32) | + ((uint64(in[21] - in[20])) >> ntz << 56) + out[8] = + (uint64(in[21] - in[20])) >> (8+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 16) | + ((uint64(in[23] - in[22])) >> ntz << 40) + out[9] = + (uint64(in[24] - in[23])) >> ntz | + ((uint64(in[25] - in[24])) >> ntz << 24) | + ((uint64(in[26] - in[25])) >> ntz << 48) + out[10] = + (uint64(in[26] - in[25])) >> (16+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 8) | + ((uint64(in[28] - in[27])) >> ntz << 32) | + ((uint64(in[29] - in[28])) >> ntz << 56) + out[11] = + (uint64(in[29] - in[28])) >> (8+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 16) | + ((uint64(in[31] - in[30])) >> ntz << 40) + out[12] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 24) | + ((uint64(in[34] - in[33])) >> ntz << 48) + out[13] = + (uint64(in[34] - in[33])) >> (16+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 8) | + ((uint64(in[36] - in[35])) >> ntz << 32) | + ((uint64(in[37] - in[36])) >> ntz << 56) + out[14] = + (uint64(in[37] - in[36])) >> (8+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 16) | + ((uint64(in[39] - in[38])) >> ntz << 40) + out[15] = + (uint64(in[40] - in[39])) >> ntz | + ((uint64(in[41] - in[40])) >> ntz << 24) | + ((uint64(in[42] - in[41])) >> ntz << 48) + out[16] = + (uint64(in[42] - in[41])) >> (16+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 8) | + ((uint64(in[44] - in[43])) >> ntz << 32) | + ((uint64(in[45] - in[44])) >> ntz << 56) + out[17] = + (uint64(in[45] - in[44])) >> (8+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 16) | + ((uint64(in[47] - in[46])) >> ntz << 40) + out[18] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 24) | + ((uint64(in[50] - in[49])) >> ntz << 48) + out[19] = + (uint64(in[50] - in[49])) >> (16+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 8) | + ((uint64(in[52] - in[51])) >> ntz << 32) | + ((uint64(in[53] - in[52])) >> ntz << 56) + out[20] = + (uint64(in[53] - in[52])) >> (8+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 16) | + ((uint64(in[55] - in[54])) >> ntz << 40) + out[21] = + (uint64(in[56] - in[55])) >> ntz | + ((uint64(in[57] - in[56])) >> ntz << 24) | + ((uint64(in[58] - in[57])) >> ntz << 48) + out[22] = + (uint64(in[58] - in[57])) >> (16+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 8) | + ((uint64(in[60] - in[59])) >> ntz << 32) | + ((uint64(in[61] - in[60])) >> ntz << 56) + out[23] = + (uint64(in[61] - in[60])) >> (8+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 16) | + ((uint64(in[63] - in[62])) >> ntz << 40) +} + +func deltapack_int64_25(initoffset int64, in *[64]int64, out *[25]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 25) | + ((uint64(in[2] - in[1])) >> ntz << 50) + out[1] = + (uint64(in[2] - in[1])) >> (14+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 11) | + ((uint64(in[4] - in[3])) >> ntz << 36) | + ((uint64(in[5] - in[4])) >> ntz << 61) + out[2] = + (uint64(in[5] - in[4])) >> (3+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 22) | + ((uint64(in[7] - in[6])) >> ntz << 47) + out[3] = + (uint64(in[7] - in[6])) >> (17+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 8) | + ((uint64(in[9] - in[8])) >> ntz << 33) | + ((uint64(in[10] - in[9])) >> ntz << 58) + out[4] = + (uint64(in[10] - in[9])) >> (6+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 19) | + ((uint64(in[12] - in[11])) >> ntz << 44) + out[5] = + (uint64(in[12] - in[11])) >> (20+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 5) | + ((uint64(in[14] - in[13])) >> ntz << 30) | + ((uint64(in[15] - in[14])) >> ntz << 55) + out[6] = + (uint64(in[15] - in[14])) >> (9+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 41) + out[7] = + (uint64(in[17] - in[16])) >> (23+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 2) | + ((uint64(in[19] - in[18])) >> ntz << 27) | + ((uint64(in[20] - in[19])) >> ntz << 52) + out[8] = + (uint64(in[20] - in[19])) >> (12+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 13) | + ((uint64(in[22] - in[21])) >> ntz << 38) | + ((uint64(in[23] - in[22])) >> ntz << 63) + out[9] = + (uint64(in[23] - in[22])) >> (1+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 24) | + ((uint64(in[25] - in[24])) >> ntz << 49) + out[10] = + (uint64(in[25] - in[24])) >> (15+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 10) | + ((uint64(in[27] - in[26])) >> ntz << 35) | + ((uint64(in[28] - in[27])) >> ntz << 60) + out[11] = + (uint64(in[28] - in[27])) >> (4+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 21) | + ((uint64(in[30] - in[29])) >> ntz << 46) + out[12] = + (uint64(in[30] - in[29])) >> (18+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 7) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 57) + out[13] = + (uint64(in[33] - in[32])) >> (7+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 18) | + ((uint64(in[35] - in[34])) >> ntz << 43) + out[14] = + (uint64(in[35] - in[34])) >> (21+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 4) | + ((uint64(in[37] - in[36])) >> ntz << 29) | + ((uint64(in[38] - in[37])) >> ntz << 54) + out[15] = + (uint64(in[38] - in[37])) >> (10+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 15) | + ((uint64(in[40] - in[39])) >> ntz << 40) + out[16] = + (uint64(in[40] - in[39])) >> (24+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 1) | + ((uint64(in[42] - in[41])) >> ntz << 26) | + ((uint64(in[43] - in[42])) >> ntz << 51) + out[17] = + (uint64(in[43] - in[42])) >> (13+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 12) | + ((uint64(in[45] - in[44])) >> ntz << 37) | + ((uint64(in[46] - in[45])) >> ntz << 62) + out[18] = + (uint64(in[46] - in[45])) >> (2+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 23) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[19] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 9) | + ((uint64(in[50] - in[49])) >> ntz << 34) | + ((uint64(in[51] - in[50])) >> ntz << 59) + out[20] = + (uint64(in[51] - in[50])) >> (5+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 20) | + ((uint64(in[53] - in[52])) >> ntz << 45) + out[21] = + (uint64(in[53] - in[52])) >> (19+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 6) | + ((uint64(in[55] - in[54])) >> ntz << 31) | + ((uint64(in[56] - in[55])) >> ntz << 56) + out[22] = + (uint64(in[56] - in[55])) >> (8+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 17) | + ((uint64(in[58] - in[57])) >> ntz << 42) + out[23] = + (uint64(in[58] - in[57])) >> (22+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 3) | + ((uint64(in[60] - in[59])) >> ntz << 28) | + ((uint64(in[61] - in[60])) >> ntz << 53) + out[24] = + (uint64(in[61] - in[60])) >> (11+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 14) | + ((uint64(in[63] - in[62])) >> ntz << 39) +} + +func deltapack_int64_26(initoffset int64, in *[64]int64, out *[26]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 26) | + ((uint64(in[2] - in[1])) >> ntz << 52) + out[1] = + (uint64(in[2] - in[1])) >> (12+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 14) | + ((uint64(in[4] - in[3])) >> ntz << 40) + out[2] = + (uint64(in[4] - in[3])) >> (24+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 2) | + ((uint64(in[6] - in[5])) >> ntz << 28) | + ((uint64(in[7] - in[6])) >> ntz << 54) + out[3] = + (uint64(in[7] - in[6])) >> (10+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 16) | + ((uint64(in[9] - in[8])) >> ntz << 42) + out[4] = + (uint64(in[9] - in[8])) >> (22+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 4) | + ((uint64(in[11] - in[10])) >> ntz << 30) | + ((uint64(in[12] - in[11])) >> ntz << 56) + out[5] = + (uint64(in[12] - in[11])) >> (8+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 18) | + ((uint64(in[14] - in[13])) >> ntz << 44) + out[6] = + (uint64(in[14] - in[13])) >> (20+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 6) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 58) + out[7] = + (uint64(in[17] - in[16])) >> (6+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 20) | + ((uint64(in[19] - in[18])) >> ntz << 46) + out[8] = + (uint64(in[19] - in[18])) >> (18+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 8) | + ((uint64(in[21] - in[20])) >> ntz << 34) | + ((uint64(in[22] - in[21])) >> ntz << 60) + out[9] = + (uint64(in[22] - in[21])) >> (4+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 22) | + ((uint64(in[24] - in[23])) >> ntz << 48) + out[10] = + (uint64(in[24] - in[23])) >> (16+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 10) | + ((uint64(in[26] - in[25])) >> ntz << 36) | + ((uint64(in[27] - in[26])) >> ntz << 62) + out[11] = + (uint64(in[27] - in[26])) >> (2+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 24) | + ((uint64(in[29] - in[28])) >> ntz << 50) + out[12] = + (uint64(in[29] - in[28])) >> (14+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 12) | + ((uint64(in[31] - in[30])) >> ntz << 38) + out[13] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 26) | + ((uint64(in[34] - in[33])) >> ntz << 52) + out[14] = + (uint64(in[34] - in[33])) >> (12+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 14) | + ((uint64(in[36] - in[35])) >> ntz << 40) + out[15] = + (uint64(in[36] - in[35])) >> (24+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 2) | + ((uint64(in[38] - in[37])) >> ntz << 28) | + ((uint64(in[39] - in[38])) >> ntz << 54) + out[16] = + (uint64(in[39] - in[38])) >> (10+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 16) | + ((uint64(in[41] - in[40])) >> ntz << 42) + out[17] = + (uint64(in[41] - in[40])) >> (22+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 4) | + ((uint64(in[43] - in[42])) >> ntz << 30) | + ((uint64(in[44] - in[43])) >> ntz << 56) + out[18] = + (uint64(in[44] - in[43])) >> (8+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 18) | + ((uint64(in[46] - in[45])) >> ntz << 44) + out[19] = + (uint64(in[46] - in[45])) >> (20+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 6) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 58) + out[20] = + (uint64(in[49] - in[48])) >> (6+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 20) | + ((uint64(in[51] - in[50])) >> ntz << 46) + out[21] = + (uint64(in[51] - in[50])) >> (18+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 8) | + ((uint64(in[53] - in[52])) >> ntz << 34) | + ((uint64(in[54] - in[53])) >> ntz << 60) + out[22] = + (uint64(in[54] - in[53])) >> (4+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 22) | + ((uint64(in[56] - in[55])) >> ntz << 48) + out[23] = + (uint64(in[56] - in[55])) >> (16+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 10) | + ((uint64(in[58] - in[57])) >> ntz << 36) | + ((uint64(in[59] - in[58])) >> ntz << 62) + out[24] = + (uint64(in[59] - in[58])) >> (2+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 24) | + ((uint64(in[61] - in[60])) >> ntz << 50) + out[25] = + (uint64(in[61] - in[60])) >> (14+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 12) | + ((uint64(in[63] - in[62])) >> ntz << 38) +} + +func deltapack_int64_27(initoffset int64, in *[64]int64, out *[27]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 27) | + ((uint64(in[2] - in[1])) >> ntz << 54) + out[1] = + (uint64(in[2] - in[1])) >> (10+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 17) | + ((uint64(in[4] - in[3])) >> ntz << 44) + out[2] = + (uint64(in[4] - in[3])) >> (20+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 7) | + ((uint64(in[6] - in[5])) >> ntz << 34) | + ((uint64(in[7] - in[6])) >> ntz << 61) + out[3] = + (uint64(in[7] - in[6])) >> (3+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 24) | + ((uint64(in[9] - in[8])) >> ntz << 51) + out[4] = + (uint64(in[9] - in[8])) >> (13+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 14) | + ((uint64(in[11] - in[10])) >> ntz << 41) + out[5] = + (uint64(in[11] - in[10])) >> (23+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 4) | + ((uint64(in[13] - in[12])) >> ntz << 31) | + ((uint64(in[14] - in[13])) >> ntz << 58) + out[6] = + (uint64(in[14] - in[13])) >> (6+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 21) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[7] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 11) | + ((uint64(in[18] - in[17])) >> ntz << 38) + out[8] = + (uint64(in[18] - in[17])) >> (26+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 1) | + ((uint64(in[20] - in[19])) >> ntz << 28) | + ((uint64(in[21] - in[20])) >> ntz << 55) + out[9] = + (uint64(in[21] - in[20])) >> (9+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 18) | + ((uint64(in[23] - in[22])) >> ntz << 45) + out[10] = + (uint64(in[23] - in[22])) >> (19+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 8) | + ((uint64(in[25] - in[24])) >> ntz << 35) | + ((uint64(in[26] - in[25])) >> ntz << 62) + out[11] = + (uint64(in[26] - in[25])) >> (2+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 25) | + ((uint64(in[28] - in[27])) >> ntz << 52) + out[12] = + (uint64(in[28] - in[27])) >> (12+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 15) | + ((uint64(in[30] - in[29])) >> ntz << 42) + out[13] = + (uint64(in[30] - in[29])) >> (22+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 5) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 59) + out[14] = + (uint64(in[33] - in[32])) >> (5+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 22) | + ((uint64(in[35] - in[34])) >> ntz << 49) + out[15] = + (uint64(in[35] - in[34])) >> (15+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 12) | + ((uint64(in[37] - in[36])) >> ntz << 39) + out[16] = + (uint64(in[37] - in[36])) >> (25+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 2) | + ((uint64(in[39] - in[38])) >> ntz << 29) | + ((uint64(in[40] - in[39])) >> ntz << 56) + out[17] = + (uint64(in[40] - in[39])) >> (8+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 19) | + ((uint64(in[42] - in[41])) >> ntz << 46) + out[18] = + (uint64(in[42] - in[41])) >> (18+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 9) | + ((uint64(in[44] - in[43])) >> ntz << 36) | + ((uint64(in[45] - in[44])) >> ntz << 63) + out[19] = + (uint64(in[45] - in[44])) >> (1+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 26) | + ((uint64(in[47] - in[46])) >> ntz << 53) + out[20] = + (uint64(in[47] - in[46])) >> (11+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 43) + out[21] = + (uint64(in[49] - in[48])) >> (21+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 6) | + ((uint64(in[51] - in[50])) >> ntz << 33) | + ((uint64(in[52] - in[51])) >> ntz << 60) + out[22] = + (uint64(in[52] - in[51])) >> (4+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 23) | + ((uint64(in[54] - in[53])) >> ntz << 50) + out[23] = + (uint64(in[54] - in[53])) >> (14+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 13) | + ((uint64(in[56] - in[55])) >> ntz << 40) + out[24] = + (uint64(in[56] - in[55])) >> (24+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 3) | + ((uint64(in[58] - in[57])) >> ntz << 30) | + ((uint64(in[59] - in[58])) >> ntz << 57) + out[25] = + (uint64(in[59] - in[58])) >> (7+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 20) | + ((uint64(in[61] - in[60])) >> ntz << 47) + out[26] = + (uint64(in[61] - in[60])) >> (17+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 10) | + ((uint64(in[63] - in[62])) >> ntz << 37) +} + +func deltapack_int64_28(initoffset int64, in *[64]int64, out *[28]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 28) | + ((uint64(in[2] - in[1])) >> ntz << 56) + out[1] = + (uint64(in[2] - in[1])) >> (8+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 20) | + ((uint64(in[4] - in[3])) >> ntz << 48) + out[2] = + (uint64(in[4] - in[3])) >> (16+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 12) | + ((uint64(in[6] - in[5])) >> ntz << 40) + out[3] = + (uint64(in[6] - in[5])) >> (24+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 4) | + ((uint64(in[8] - in[7])) >> ntz << 32) | + ((uint64(in[9] - in[8])) >> ntz << 60) + out[4] = + (uint64(in[9] - in[8])) >> (4+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 24) | + ((uint64(in[11] - in[10])) >> ntz << 52) + out[5] = + (uint64(in[11] - in[10])) >> (12+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 16) | + ((uint64(in[13] - in[12])) >> ntz << 44) + out[6] = + (uint64(in[13] - in[12])) >> (20+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 8) | + ((uint64(in[15] - in[14])) >> ntz << 36) + out[7] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 28) | + ((uint64(in[18] - in[17])) >> ntz << 56) + out[8] = + (uint64(in[18] - in[17])) >> (8+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 20) | + ((uint64(in[20] - in[19])) >> ntz << 48) + out[9] = + (uint64(in[20] - in[19])) >> (16+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 12) | + ((uint64(in[22] - in[21])) >> ntz << 40) + out[10] = + (uint64(in[22] - in[21])) >> (24+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 4) | + ((uint64(in[24] - in[23])) >> ntz << 32) | + ((uint64(in[25] - in[24])) >> ntz << 60) + out[11] = + (uint64(in[25] - in[24])) >> (4+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 24) | + ((uint64(in[27] - in[26])) >> ntz << 52) + out[12] = + (uint64(in[27] - in[26])) >> (12+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 16) | + ((uint64(in[29] - in[28])) >> ntz << 44) + out[13] = + (uint64(in[29] - in[28])) >> (20+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 8) | + ((uint64(in[31] - in[30])) >> ntz << 36) + out[14] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 28) | + ((uint64(in[34] - in[33])) >> ntz << 56) + out[15] = + (uint64(in[34] - in[33])) >> (8+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 20) | + ((uint64(in[36] - in[35])) >> ntz << 48) + out[16] = + (uint64(in[36] - in[35])) >> (16+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 12) | + ((uint64(in[38] - in[37])) >> ntz << 40) + out[17] = + (uint64(in[38] - in[37])) >> (24+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 4) | + ((uint64(in[40] - in[39])) >> ntz << 32) | + ((uint64(in[41] - in[40])) >> ntz << 60) + out[18] = + (uint64(in[41] - in[40])) >> (4+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 24) | + ((uint64(in[43] - in[42])) >> ntz << 52) + out[19] = + (uint64(in[43] - in[42])) >> (12+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 16) | + ((uint64(in[45] - in[44])) >> ntz << 44) + out[20] = + (uint64(in[45] - in[44])) >> (20+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 8) | + ((uint64(in[47] - in[46])) >> ntz << 36) + out[21] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 28) | + ((uint64(in[50] - in[49])) >> ntz << 56) + out[22] = + (uint64(in[50] - in[49])) >> (8+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 20) | + ((uint64(in[52] - in[51])) >> ntz << 48) + out[23] = + (uint64(in[52] - in[51])) >> (16+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 12) | + ((uint64(in[54] - in[53])) >> ntz << 40) + out[24] = + (uint64(in[54] - in[53])) >> (24+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 4) | + ((uint64(in[56] - in[55])) >> ntz << 32) | + ((uint64(in[57] - in[56])) >> ntz << 60) + out[25] = + (uint64(in[57] - in[56])) >> (4+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 24) | + ((uint64(in[59] - in[58])) >> ntz << 52) + out[26] = + (uint64(in[59] - in[58])) >> (12+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 16) | + ((uint64(in[61] - in[60])) >> ntz << 44) + out[27] = + (uint64(in[61] - in[60])) >> (20+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 8) | + ((uint64(in[63] - in[62])) >> ntz << 36) +} + +func deltapack_int64_29(initoffset int64, in *[64]int64, out *[29]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 29) | + ((uint64(in[2] - in[1])) >> ntz << 58) + out[1] = + (uint64(in[2] - in[1])) >> (6+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 23) | + ((uint64(in[4] - in[3])) >> ntz << 52) + out[2] = + (uint64(in[4] - in[3])) >> (12+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 17) | + ((uint64(in[6] - in[5])) >> ntz << 46) + out[3] = + (uint64(in[6] - in[5])) >> (18+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 11) | + ((uint64(in[8] - in[7])) >> ntz << 40) + out[4] = + (uint64(in[8] - in[7])) >> (24+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 5) | + ((uint64(in[10] - in[9])) >> ntz << 34) | + ((uint64(in[11] - in[10])) >> ntz << 63) + out[5] = + (uint64(in[11] - in[10])) >> (1+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 28) | + ((uint64(in[13] - in[12])) >> ntz << 57) + out[6] = + (uint64(in[13] - in[12])) >> (7+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 22) | + ((uint64(in[15] - in[14])) >> ntz << 51) + out[7] = + (uint64(in[15] - in[14])) >> (13+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 45) + out[8] = + (uint64(in[17] - in[16])) >> (19+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 10) | + ((uint64(in[19] - in[18])) >> ntz << 39) + out[9] = + (uint64(in[19] - in[18])) >> (25+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 4) | + ((uint64(in[21] - in[20])) >> ntz << 33) | + ((uint64(in[22] - in[21])) >> ntz << 62) + out[10] = + (uint64(in[22] - in[21])) >> (2+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 27) | + ((uint64(in[24] - in[23])) >> ntz << 56) + out[11] = + (uint64(in[24] - in[23])) >> (8+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 21) | + ((uint64(in[26] - in[25])) >> ntz << 50) + out[12] = + (uint64(in[26] - in[25])) >> (14+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 15) | + ((uint64(in[28] - in[27])) >> ntz << 44) + out[13] = + (uint64(in[28] - in[27])) >> (20+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 9) | + ((uint64(in[30] - in[29])) >> ntz << 38) + out[14] = + (uint64(in[30] - in[29])) >> (26+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 3) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 61) + out[15] = + (uint64(in[33] - in[32])) >> (3+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 26) | + ((uint64(in[35] - in[34])) >> ntz << 55) + out[16] = + (uint64(in[35] - in[34])) >> (9+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 20) | + ((uint64(in[37] - in[36])) >> ntz << 49) + out[17] = + (uint64(in[37] - in[36])) >> (15+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 14) | + ((uint64(in[39] - in[38])) >> ntz << 43) + out[18] = + (uint64(in[39] - in[38])) >> (21+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 8) | + ((uint64(in[41] - in[40])) >> ntz << 37) + out[19] = + (uint64(in[41] - in[40])) >> (27+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 2) | + ((uint64(in[43] - in[42])) >> ntz << 31) | + ((uint64(in[44] - in[43])) >> ntz << 60) + out[20] = + (uint64(in[44] - in[43])) >> (4+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 25) | + ((uint64(in[46] - in[45])) >> ntz << 54) + out[21] = + (uint64(in[46] - in[45])) >> (10+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 19) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[22] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 13) | + ((uint64(in[50] - in[49])) >> ntz << 42) + out[23] = + (uint64(in[50] - in[49])) >> (22+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 7) | + ((uint64(in[52] - in[51])) >> ntz << 36) + out[24] = + (uint64(in[52] - in[51])) >> (28+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 1) | + ((uint64(in[54] - in[53])) >> ntz << 30) | + ((uint64(in[55] - in[54])) >> ntz << 59) + out[25] = + (uint64(in[55] - in[54])) >> (5+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 24) | + ((uint64(in[57] - in[56])) >> ntz << 53) + out[26] = + (uint64(in[57] - in[56])) >> (11+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 18) | + ((uint64(in[59] - in[58])) >> ntz << 47) + out[27] = + (uint64(in[59] - in[58])) >> (17+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 12) | + ((uint64(in[61] - in[60])) >> ntz << 41) + out[28] = + (uint64(in[61] - in[60])) >> (23+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 6) | + ((uint64(in[63] - in[62])) >> ntz << 35) +} + +func deltapack_int64_30(initoffset int64, in *[64]int64, out *[30]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 30) | + ((uint64(in[2] - in[1])) >> ntz << 60) + out[1] = + (uint64(in[2] - in[1])) >> (4+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 26) | + ((uint64(in[4] - in[3])) >> ntz << 56) + out[2] = + (uint64(in[4] - in[3])) >> (8+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 22) | + ((uint64(in[6] - in[5])) >> ntz << 52) + out[3] = + (uint64(in[6] - in[5])) >> (12+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 18) | + ((uint64(in[8] - in[7])) >> ntz << 48) + out[4] = + (uint64(in[8] - in[7])) >> (16+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 14) | + ((uint64(in[10] - in[9])) >> ntz << 44) + out[5] = + (uint64(in[10] - in[9])) >> (20+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 10) | + ((uint64(in[12] - in[11])) >> ntz << 40) + out[6] = + (uint64(in[12] - in[11])) >> (24+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 6) | + ((uint64(in[14] - in[13])) >> ntz << 36) + out[7] = + (uint64(in[14] - in[13])) >> (28+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 2) | + ((uint64(in[16] - in[15])) >> ntz << 32) | + ((uint64(in[17] - in[16])) >> ntz << 62) + out[8] = + (uint64(in[17] - in[16])) >> (2+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 28) | + ((uint64(in[19] - in[18])) >> ntz << 58) + out[9] = + (uint64(in[19] - in[18])) >> (6+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 24) | + ((uint64(in[21] - in[20])) >> ntz << 54) + out[10] = + (uint64(in[21] - in[20])) >> (10+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 20) | + ((uint64(in[23] - in[22])) >> ntz << 50) + out[11] = + (uint64(in[23] - in[22])) >> (14+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 16) | + ((uint64(in[25] - in[24])) >> ntz << 46) + out[12] = + (uint64(in[25] - in[24])) >> (18+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 12) | + ((uint64(in[27] - in[26])) >> ntz << 42) + out[13] = + (uint64(in[27] - in[26])) >> (22+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 8) | + ((uint64(in[29] - in[28])) >> ntz << 38) + out[14] = + (uint64(in[29] - in[28])) >> (26+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 4) | + ((uint64(in[31] - in[30])) >> ntz << 34) + out[15] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 30) | + ((uint64(in[34] - in[33])) >> ntz << 60) + out[16] = + (uint64(in[34] - in[33])) >> (4+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 26) | + ((uint64(in[36] - in[35])) >> ntz << 56) + out[17] = + (uint64(in[36] - in[35])) >> (8+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 22) | + ((uint64(in[38] - in[37])) >> ntz << 52) + out[18] = + (uint64(in[38] - in[37])) >> (12+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 18) | + ((uint64(in[40] - in[39])) >> ntz << 48) + out[19] = + (uint64(in[40] - in[39])) >> (16+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 14) | + ((uint64(in[42] - in[41])) >> ntz << 44) + out[20] = + (uint64(in[42] - in[41])) >> (20+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 10) | + ((uint64(in[44] - in[43])) >> ntz << 40) + out[21] = + (uint64(in[44] - in[43])) >> (24+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 6) | + ((uint64(in[46] - in[45])) >> ntz << 36) + out[22] = + (uint64(in[46] - in[45])) >> (28+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 2) | + ((uint64(in[48] - in[47])) >> ntz << 32) | + ((uint64(in[49] - in[48])) >> ntz << 62) + out[23] = + (uint64(in[49] - in[48])) >> (2+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 28) | + ((uint64(in[51] - in[50])) >> ntz << 58) + out[24] = + (uint64(in[51] - in[50])) >> (6+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 24) | + ((uint64(in[53] - in[52])) >> ntz << 54) + out[25] = + (uint64(in[53] - in[52])) >> (10+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 20) | + ((uint64(in[55] - in[54])) >> ntz << 50) + out[26] = + (uint64(in[55] - in[54])) >> (14+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 16) | + ((uint64(in[57] - in[56])) >> ntz << 46) + out[27] = + (uint64(in[57] - in[56])) >> (18+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 12) | + ((uint64(in[59] - in[58])) >> ntz << 42) + out[28] = + (uint64(in[59] - in[58])) >> (22+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 8) | + ((uint64(in[61] - in[60])) >> ntz << 38) + out[29] = + (uint64(in[61] - in[60])) >> (26+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 4) | + ((uint64(in[63] - in[62])) >> ntz << 34) +} + +func deltapack_int64_31(initoffset int64, in *[64]int64, out *[31]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 31) | + ((uint64(in[2] - in[1])) >> ntz << 62) + out[1] = + (uint64(in[2] - in[1])) >> (2+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 29) | + ((uint64(in[4] - in[3])) >> ntz << 60) + out[2] = + (uint64(in[4] - in[3])) >> (4+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 27) | + ((uint64(in[6] - in[5])) >> ntz << 58) + out[3] = + (uint64(in[6] - in[5])) >> (6+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 25) | + ((uint64(in[8] - in[7])) >> ntz << 56) + out[4] = + (uint64(in[8] - in[7])) >> (8+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 23) | + ((uint64(in[10] - in[9])) >> ntz << 54) + out[5] = + (uint64(in[10] - in[9])) >> (10+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 21) | + ((uint64(in[12] - in[11])) >> ntz << 52) + out[6] = + (uint64(in[12] - in[11])) >> (12+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 19) | + ((uint64(in[14] - in[13])) >> ntz << 50) + out[7] = + (uint64(in[14] - in[13])) >> (14+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 17) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[8] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 15) | + ((uint64(in[18] - in[17])) >> ntz << 46) + out[9] = + (uint64(in[18] - in[17])) >> (18+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 13) | + ((uint64(in[20] - in[19])) >> ntz << 44) + out[10] = + (uint64(in[20] - in[19])) >> (20+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 11) | + ((uint64(in[22] - in[21])) >> ntz << 42) + out[11] = + (uint64(in[22] - in[21])) >> (22+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 9) | + ((uint64(in[24] - in[23])) >> ntz << 40) + out[12] = + (uint64(in[24] - in[23])) >> (24+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 7) | + ((uint64(in[26] - in[25])) >> ntz << 38) + out[13] = + (uint64(in[26] - in[25])) >> (26+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 5) | + ((uint64(in[28] - in[27])) >> ntz << 36) + out[14] = + (uint64(in[28] - in[27])) >> (28+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 3) | + ((uint64(in[30] - in[29])) >> ntz << 34) + out[15] = + (uint64(in[30] - in[29])) >> (30+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 1) | + ((uint64(in[32] - in[31])) >> ntz << 32) | + ((uint64(in[33] - in[32])) >> ntz << 63) + out[16] = + (uint64(in[33] - in[32])) >> (1+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 30) | + ((uint64(in[35] - in[34])) >> ntz << 61) + out[17] = + (uint64(in[35] - in[34])) >> (3+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 28) | + ((uint64(in[37] - in[36])) >> ntz << 59) + out[18] = + (uint64(in[37] - in[36])) >> (5+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 26) | + ((uint64(in[39] - in[38])) >> ntz << 57) + out[19] = + (uint64(in[39] - in[38])) >> (7+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 24) | + ((uint64(in[41] - in[40])) >> ntz << 55) + out[20] = + (uint64(in[41] - in[40])) >> (9+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 22) | + ((uint64(in[43] - in[42])) >> ntz << 53) + out[21] = + (uint64(in[43] - in[42])) >> (11+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 20) | + ((uint64(in[45] - in[44])) >> ntz << 51) + out[22] = + (uint64(in[45] - in[44])) >> (13+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 18) | + ((uint64(in[47] - in[46])) >> ntz << 49) + out[23] = + (uint64(in[47] - in[46])) >> (15+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 47) + out[24] = + (uint64(in[49] - in[48])) >> (17+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 14) | + ((uint64(in[51] - in[50])) >> ntz << 45) + out[25] = + (uint64(in[51] - in[50])) >> (19+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 12) | + ((uint64(in[53] - in[52])) >> ntz << 43) + out[26] = + (uint64(in[53] - in[52])) >> (21+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 10) | + ((uint64(in[55] - in[54])) >> ntz << 41) + out[27] = + (uint64(in[55] - in[54])) >> (23+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 8) | + ((uint64(in[57] - in[56])) >> ntz << 39) + out[28] = + (uint64(in[57] - in[56])) >> (25+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 6) | + ((uint64(in[59] - in[58])) >> ntz << 37) + out[29] = + (uint64(in[59] - in[58])) >> (27+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 4) | + ((uint64(in[61] - in[60])) >> ntz << 35) + out[30] = + (uint64(in[61] - in[60])) >> (29+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 2) | + ((uint64(in[63] - in[62])) >> ntz << 33) +} + +func deltapack_int64_32(initoffset int64, in *[64]int64, out *[32]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 32) + out[1] = + (uint64(in[2] - in[1])) >> ntz | + ((uint64(in[3] - in[2])) >> ntz << 32) + out[2] = + (uint64(in[4] - in[3])) >> ntz | + ((uint64(in[5] - in[4])) >> ntz << 32) + out[3] = + (uint64(in[6] - in[5])) >> ntz | + ((uint64(in[7] - in[6])) >> ntz << 32) + out[4] = + (uint64(in[8] - in[7])) >> ntz | + ((uint64(in[9] - in[8])) >> ntz << 32) + out[5] = + (uint64(in[10] - in[9])) >> ntz | + ((uint64(in[11] - in[10])) >> ntz << 32) + out[6] = + (uint64(in[12] - in[11])) >> ntz | + ((uint64(in[13] - in[12])) >> ntz << 32) + out[7] = + (uint64(in[14] - in[13])) >> ntz | + ((uint64(in[15] - in[14])) >> ntz << 32) + out[8] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 32) + out[9] = + (uint64(in[18] - in[17])) >> ntz | + ((uint64(in[19] - in[18])) >> ntz << 32) + out[10] = + (uint64(in[20] - in[19])) >> ntz | + ((uint64(in[21] - in[20])) >> ntz << 32) + out[11] = + (uint64(in[22] - in[21])) >> ntz | + ((uint64(in[23] - in[22])) >> ntz << 32) + out[12] = + (uint64(in[24] - in[23])) >> ntz | + ((uint64(in[25] - in[24])) >> ntz << 32) + out[13] = + (uint64(in[26] - in[25])) >> ntz | + ((uint64(in[27] - in[26])) >> ntz << 32) + out[14] = + (uint64(in[28] - in[27])) >> ntz | + ((uint64(in[29] - in[28])) >> ntz << 32) + out[15] = + (uint64(in[30] - in[29])) >> ntz | + ((uint64(in[31] - in[30])) >> ntz << 32) + out[16] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 32) + out[17] = + (uint64(in[34] - in[33])) >> ntz | + ((uint64(in[35] - in[34])) >> ntz << 32) + out[18] = + (uint64(in[36] - in[35])) >> ntz | + ((uint64(in[37] - in[36])) >> ntz << 32) + out[19] = + (uint64(in[38] - in[37])) >> ntz | + ((uint64(in[39] - in[38])) >> ntz << 32) + out[20] = + (uint64(in[40] - in[39])) >> ntz | + ((uint64(in[41] - in[40])) >> ntz << 32) + out[21] = + (uint64(in[42] - in[41])) >> ntz | + ((uint64(in[43] - in[42])) >> ntz << 32) + out[22] = + (uint64(in[44] - in[43])) >> ntz | + ((uint64(in[45] - in[44])) >> ntz << 32) + out[23] = + (uint64(in[46] - in[45])) >> ntz | + ((uint64(in[47] - in[46])) >> ntz << 32) + out[24] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 32) + out[25] = + (uint64(in[50] - in[49])) >> ntz | + ((uint64(in[51] - in[50])) >> ntz << 32) + out[26] = + (uint64(in[52] - in[51])) >> ntz | + ((uint64(in[53] - in[52])) >> ntz << 32) + out[27] = + (uint64(in[54] - in[53])) >> ntz | + ((uint64(in[55] - in[54])) >> ntz << 32) + out[28] = + (uint64(in[56] - in[55])) >> ntz | + ((uint64(in[57] - in[56])) >> ntz << 32) + out[29] = + (uint64(in[58] - in[57])) >> ntz | + ((uint64(in[59] - in[58])) >> ntz << 32) + out[30] = + (uint64(in[60] - in[59])) >> ntz | + ((uint64(in[61] - in[60])) >> ntz << 32) + out[31] = + (uint64(in[62] - in[61])) >> ntz | + ((uint64(in[63] - in[62])) >> ntz << 32) +} + +func deltapack_int64_33(initoffset int64, in *[64]int64, out *[33]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 33) + out[1] = + (uint64(in[1] - in[0])) >> (31+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 2) | + ((uint64(in[3] - in[2])) >> ntz << 35) + out[2] = + (uint64(in[3] - in[2])) >> (29+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 4) | + ((uint64(in[5] - in[4])) >> ntz << 37) + out[3] = + (uint64(in[5] - in[4])) >> (27+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 6) | + ((uint64(in[7] - in[6])) >> ntz << 39) + out[4] = + (uint64(in[7] - in[6])) >> (25+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 8) | + ((uint64(in[9] - in[8])) >> ntz << 41) + out[5] = + (uint64(in[9] - in[8])) >> (23+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 10) | + ((uint64(in[11] - in[10])) >> ntz << 43) + out[6] = + (uint64(in[11] - in[10])) >> (21+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 12) | + ((uint64(in[13] - in[12])) >> ntz << 45) + out[7] = + (uint64(in[13] - in[12])) >> (19+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 14) | + ((uint64(in[15] - in[14])) >> ntz << 47) + out[8] = + (uint64(in[15] - in[14])) >> (17+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 49) + out[9] = + (uint64(in[17] - in[16])) >> (15+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 18) | + ((uint64(in[19] - in[18])) >> ntz << 51) + out[10] = + (uint64(in[19] - in[18])) >> (13+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 20) | + ((uint64(in[21] - in[20])) >> ntz << 53) + out[11] = + (uint64(in[21] - in[20])) >> (11+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 22) | + ((uint64(in[23] - in[22])) >> ntz << 55) + out[12] = + (uint64(in[23] - in[22])) >> (9+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 24) | + ((uint64(in[25] - in[24])) >> ntz << 57) + out[13] = + (uint64(in[25] - in[24])) >> (7+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 26) | + ((uint64(in[27] - in[26])) >> ntz << 59) + out[14] = + (uint64(in[27] - in[26])) >> (5+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 28) | + ((uint64(in[29] - in[28])) >> ntz << 61) + out[15] = + (uint64(in[29] - in[28])) >> (3+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 30) | + ((uint64(in[31] - in[30])) >> ntz << 63) + out[16] = + (uint64(in[31] - in[30])) >> (1+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[17] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 1) | + ((uint64(in[34] - in[33])) >> ntz << 34) + out[18] = + (uint64(in[34] - in[33])) >> (30+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 3) | + ((uint64(in[36] - in[35])) >> ntz << 36) + out[19] = + (uint64(in[36] - in[35])) >> (28+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 5) | + ((uint64(in[38] - in[37])) >> ntz << 38) + out[20] = + (uint64(in[38] - in[37])) >> (26+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 7) | + ((uint64(in[40] - in[39])) >> ntz << 40) + out[21] = + (uint64(in[40] - in[39])) >> (24+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 9) | + ((uint64(in[42] - in[41])) >> ntz << 42) + out[22] = + (uint64(in[42] - in[41])) >> (22+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 11) | + ((uint64(in[44] - in[43])) >> ntz << 44) + out[23] = + (uint64(in[44] - in[43])) >> (20+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 13) | + ((uint64(in[46] - in[45])) >> ntz << 46) + out[24] = + (uint64(in[46] - in[45])) >> (18+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 15) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[25] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 17) | + ((uint64(in[50] - in[49])) >> ntz << 50) + out[26] = + (uint64(in[50] - in[49])) >> (14+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 19) | + ((uint64(in[52] - in[51])) >> ntz << 52) + out[27] = + (uint64(in[52] - in[51])) >> (12+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 21) | + ((uint64(in[54] - in[53])) >> ntz << 54) + out[28] = + (uint64(in[54] - in[53])) >> (10+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 23) | + ((uint64(in[56] - in[55])) >> ntz << 56) + out[29] = + (uint64(in[56] - in[55])) >> (8+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 25) | + ((uint64(in[58] - in[57])) >> ntz << 58) + out[30] = + (uint64(in[58] - in[57])) >> (6+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 27) | + ((uint64(in[60] - in[59])) >> ntz << 60) + out[31] = + (uint64(in[60] - in[59])) >> (4+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 29) | + ((uint64(in[62] - in[61])) >> ntz << 62) + out[32] = + (uint64(in[62] - in[61])) >> (2+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 31) +} + +func deltapack_int64_34(initoffset int64, in *[64]int64, out *[34]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 34) + out[1] = + (uint64(in[1] - in[0])) >> (30+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 4) | + ((uint64(in[3] - in[2])) >> ntz << 38) + out[2] = + (uint64(in[3] - in[2])) >> (26+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 8) | + ((uint64(in[5] - in[4])) >> ntz << 42) + out[3] = + (uint64(in[5] - in[4])) >> (22+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 12) | + ((uint64(in[7] - in[6])) >> ntz << 46) + out[4] = + (uint64(in[7] - in[6])) >> (18+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 16) | + ((uint64(in[9] - in[8])) >> ntz << 50) + out[5] = + (uint64(in[9] - in[8])) >> (14+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 20) | + ((uint64(in[11] - in[10])) >> ntz << 54) + out[6] = + (uint64(in[11] - in[10])) >> (10+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 24) | + ((uint64(in[13] - in[12])) >> ntz << 58) + out[7] = + (uint64(in[13] - in[12])) >> (6+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 28) | + ((uint64(in[15] - in[14])) >> ntz << 62) + out[8] = + (uint64(in[15] - in[14])) >> (2+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[9] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 2) | + ((uint64(in[18] - in[17])) >> ntz << 36) + out[10] = + (uint64(in[18] - in[17])) >> (28+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 6) | + ((uint64(in[20] - in[19])) >> ntz << 40) + out[11] = + (uint64(in[20] - in[19])) >> (24+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 10) | + ((uint64(in[22] - in[21])) >> ntz << 44) + out[12] = + (uint64(in[22] - in[21])) >> (20+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 14) | + ((uint64(in[24] - in[23])) >> ntz << 48) + out[13] = + (uint64(in[24] - in[23])) >> (16+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 18) | + ((uint64(in[26] - in[25])) >> ntz << 52) + out[14] = + (uint64(in[26] - in[25])) >> (12+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 22) | + ((uint64(in[28] - in[27])) >> ntz << 56) + out[15] = + (uint64(in[28] - in[27])) >> (8+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 26) | + ((uint64(in[30] - in[29])) >> ntz << 60) + out[16] = + (uint64(in[30] - in[29])) >> (4+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 30) + out[17] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 34) + out[18] = + (uint64(in[33] - in[32])) >> (30+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 4) | + ((uint64(in[35] - in[34])) >> ntz << 38) + out[19] = + (uint64(in[35] - in[34])) >> (26+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 8) | + ((uint64(in[37] - in[36])) >> ntz << 42) + out[20] = + (uint64(in[37] - in[36])) >> (22+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 12) | + ((uint64(in[39] - in[38])) >> ntz << 46) + out[21] = + (uint64(in[39] - in[38])) >> (18+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 16) | + ((uint64(in[41] - in[40])) >> ntz << 50) + out[22] = + (uint64(in[41] - in[40])) >> (14+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 20) | + ((uint64(in[43] - in[42])) >> ntz << 54) + out[23] = + (uint64(in[43] - in[42])) >> (10+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 24) | + ((uint64(in[45] - in[44])) >> ntz << 58) + out[24] = + (uint64(in[45] - in[44])) >> (6+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 28) | + ((uint64(in[47] - in[46])) >> ntz << 62) + out[25] = + (uint64(in[47] - in[46])) >> (2+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[26] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 2) | + ((uint64(in[50] - in[49])) >> ntz << 36) + out[27] = + (uint64(in[50] - in[49])) >> (28+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 6) | + ((uint64(in[52] - in[51])) >> ntz << 40) + out[28] = + (uint64(in[52] - in[51])) >> (24+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 10) | + ((uint64(in[54] - in[53])) >> ntz << 44) + out[29] = + (uint64(in[54] - in[53])) >> (20+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 14) | + ((uint64(in[56] - in[55])) >> ntz << 48) + out[30] = + (uint64(in[56] - in[55])) >> (16+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 18) | + ((uint64(in[58] - in[57])) >> ntz << 52) + out[31] = + (uint64(in[58] - in[57])) >> (12+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 22) | + ((uint64(in[60] - in[59])) >> ntz << 56) + out[32] = + (uint64(in[60] - in[59])) >> (8+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 26) | + ((uint64(in[62] - in[61])) >> ntz << 60) + out[33] = + (uint64(in[62] - in[61])) >> (4+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 30) +} + +func deltapack_int64_35(initoffset int64, in *[64]int64, out *[35]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 35) + out[1] = + (uint64(in[1] - in[0])) >> (29+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 6) | + ((uint64(in[3] - in[2])) >> ntz << 41) + out[2] = + (uint64(in[3] - in[2])) >> (23+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 12) | + ((uint64(in[5] - in[4])) >> ntz << 47) + out[3] = + (uint64(in[5] - in[4])) >> (17+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 18) | + ((uint64(in[7] - in[6])) >> ntz << 53) + out[4] = + (uint64(in[7] - in[6])) >> (11+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 24) | + ((uint64(in[9] - in[8])) >> ntz << 59) + out[5] = + (uint64(in[9] - in[8])) >> (5+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 30) + out[6] = + (uint64(in[10] - in[9])) >> (34+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 1) | + ((uint64(in[12] - in[11])) >> ntz << 36) + out[7] = + (uint64(in[12] - in[11])) >> (28+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 7) | + ((uint64(in[14] - in[13])) >> ntz << 42) + out[8] = + (uint64(in[14] - in[13])) >> (22+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 13) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[9] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 19) | + ((uint64(in[18] - in[17])) >> ntz << 54) + out[10] = + (uint64(in[18] - in[17])) >> (10+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 25) | + ((uint64(in[20] - in[19])) >> ntz << 60) + out[11] = + (uint64(in[20] - in[19])) >> (4+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 31) + out[12] = + (uint64(in[21] - in[20])) >> (33+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 2) | + ((uint64(in[23] - in[22])) >> ntz << 37) + out[13] = + (uint64(in[23] - in[22])) >> (27+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 8) | + ((uint64(in[25] - in[24])) >> ntz << 43) + out[14] = + (uint64(in[25] - in[24])) >> (21+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 14) | + ((uint64(in[27] - in[26])) >> ntz << 49) + out[15] = + (uint64(in[27] - in[26])) >> (15+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 20) | + ((uint64(in[29] - in[28])) >> ntz << 55) + out[16] = + (uint64(in[29] - in[28])) >> (9+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 26) | + ((uint64(in[31] - in[30])) >> ntz << 61) + out[17] = + (uint64(in[31] - in[30])) >> (3+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[18] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 3) | + ((uint64(in[34] - in[33])) >> ntz << 38) + out[19] = + (uint64(in[34] - in[33])) >> (26+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 9) | + ((uint64(in[36] - in[35])) >> ntz << 44) + out[20] = + (uint64(in[36] - in[35])) >> (20+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 15) | + ((uint64(in[38] - in[37])) >> ntz << 50) + out[21] = + (uint64(in[38] - in[37])) >> (14+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 21) | + ((uint64(in[40] - in[39])) >> ntz << 56) + out[22] = + (uint64(in[40] - in[39])) >> (8+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 27) | + ((uint64(in[42] - in[41])) >> ntz << 62) + out[23] = + (uint64(in[42] - in[41])) >> (2+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 33) + out[24] = + (uint64(in[43] - in[42])) >> (31+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 4) | + ((uint64(in[45] - in[44])) >> ntz << 39) + out[25] = + (uint64(in[45] - in[44])) >> (25+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 10) | + ((uint64(in[47] - in[46])) >> ntz << 45) + out[26] = + (uint64(in[47] - in[46])) >> (19+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 51) + out[27] = + (uint64(in[49] - in[48])) >> (13+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 22) | + ((uint64(in[51] - in[50])) >> ntz << 57) + out[28] = + (uint64(in[51] - in[50])) >> (7+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 28) | + ((uint64(in[53] - in[52])) >> ntz << 63) + out[29] = + (uint64(in[53] - in[52])) >> (1+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 34) + out[30] = + (uint64(in[54] - in[53])) >> (30+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 5) | + ((uint64(in[56] - in[55])) >> ntz << 40) + out[31] = + (uint64(in[56] - in[55])) >> (24+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 11) | + ((uint64(in[58] - in[57])) >> ntz << 46) + out[32] = + (uint64(in[58] - in[57])) >> (18+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 17) | + ((uint64(in[60] - in[59])) >> ntz << 52) + out[33] = + (uint64(in[60] - in[59])) >> (12+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 23) | + ((uint64(in[62] - in[61])) >> ntz << 58) + out[34] = + (uint64(in[62] - in[61])) >> (6+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 29) +} + +func deltapack_int64_36(initoffset int64, in *[64]int64, out *[36]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 36) + out[1] = + (uint64(in[1] - in[0])) >> (28+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 8) | + ((uint64(in[3] - in[2])) >> ntz << 44) + out[2] = + (uint64(in[3] - in[2])) >> (20+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 16) | + ((uint64(in[5] - in[4])) >> ntz << 52) + out[3] = + (uint64(in[5] - in[4])) >> (12+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 24) | + ((uint64(in[7] - in[6])) >> ntz << 60) + out[4] = + (uint64(in[7] - in[6])) >> (4+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 32) + out[5] = + (uint64(in[8] - in[7])) >> (32+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 4) | + ((uint64(in[10] - in[9])) >> ntz << 40) + out[6] = + (uint64(in[10] - in[9])) >> (24+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 12) | + ((uint64(in[12] - in[11])) >> ntz << 48) + out[7] = + (uint64(in[12] - in[11])) >> (16+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 20) | + ((uint64(in[14] - in[13])) >> ntz << 56) + out[8] = + (uint64(in[14] - in[13])) >> (8+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 28) + out[9] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 36) + out[10] = + (uint64(in[17] - in[16])) >> (28+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 8) | + ((uint64(in[19] - in[18])) >> ntz << 44) + out[11] = + (uint64(in[19] - in[18])) >> (20+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 16) | + ((uint64(in[21] - in[20])) >> ntz << 52) + out[12] = + (uint64(in[21] - in[20])) >> (12+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 24) | + ((uint64(in[23] - in[22])) >> ntz << 60) + out[13] = + (uint64(in[23] - in[22])) >> (4+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 32) + out[14] = + (uint64(in[24] - in[23])) >> (32+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 4) | + ((uint64(in[26] - in[25])) >> ntz << 40) + out[15] = + (uint64(in[26] - in[25])) >> (24+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 12) | + ((uint64(in[28] - in[27])) >> ntz << 48) + out[16] = + (uint64(in[28] - in[27])) >> (16+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 20) | + ((uint64(in[30] - in[29])) >> ntz << 56) + out[17] = + (uint64(in[30] - in[29])) >> (8+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 28) + out[18] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 36) + out[19] = + (uint64(in[33] - in[32])) >> (28+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 8) | + ((uint64(in[35] - in[34])) >> ntz << 44) + out[20] = + (uint64(in[35] - in[34])) >> (20+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 16) | + ((uint64(in[37] - in[36])) >> ntz << 52) + out[21] = + (uint64(in[37] - in[36])) >> (12+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 24) | + ((uint64(in[39] - in[38])) >> ntz << 60) + out[22] = + (uint64(in[39] - in[38])) >> (4+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 32) + out[23] = + (uint64(in[40] - in[39])) >> (32+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 4) | + ((uint64(in[42] - in[41])) >> ntz << 40) + out[24] = + (uint64(in[42] - in[41])) >> (24+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 12) | + ((uint64(in[44] - in[43])) >> ntz << 48) + out[25] = + (uint64(in[44] - in[43])) >> (16+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 20) | + ((uint64(in[46] - in[45])) >> ntz << 56) + out[26] = + (uint64(in[46] - in[45])) >> (8+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 28) + out[27] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 36) + out[28] = + (uint64(in[49] - in[48])) >> (28+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 8) | + ((uint64(in[51] - in[50])) >> ntz << 44) + out[29] = + (uint64(in[51] - in[50])) >> (20+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 16) | + ((uint64(in[53] - in[52])) >> ntz << 52) + out[30] = + (uint64(in[53] - in[52])) >> (12+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 24) | + ((uint64(in[55] - in[54])) >> ntz << 60) + out[31] = + (uint64(in[55] - in[54])) >> (4+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 32) + out[32] = + (uint64(in[56] - in[55])) >> (32+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 4) | + ((uint64(in[58] - in[57])) >> ntz << 40) + out[33] = + (uint64(in[58] - in[57])) >> (24+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 12) | + ((uint64(in[60] - in[59])) >> ntz << 48) + out[34] = + (uint64(in[60] - in[59])) >> (16+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 20) | + ((uint64(in[62] - in[61])) >> ntz << 56) + out[35] = + (uint64(in[62] - in[61])) >> (8+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 28) +} + +func deltapack_int64_37(initoffset int64, in *[64]int64, out *[37]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 37) + out[1] = + (uint64(in[1] - in[0])) >> (27+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 10) | + ((uint64(in[3] - in[2])) >> ntz << 47) + out[2] = + (uint64(in[3] - in[2])) >> (17+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 20) | + ((uint64(in[5] - in[4])) >> ntz << 57) + out[3] = + (uint64(in[5] - in[4])) >> (7+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 30) + out[4] = + (uint64(in[6] - in[5])) >> (34+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 3) | + ((uint64(in[8] - in[7])) >> ntz << 40) + out[5] = + (uint64(in[8] - in[7])) >> (24+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 13) | + ((uint64(in[10] - in[9])) >> ntz << 50) + out[6] = + (uint64(in[10] - in[9])) >> (14+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 23) | + ((uint64(in[12] - in[11])) >> ntz << 60) + out[7] = + (uint64(in[12] - in[11])) >> (4+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 33) + out[8] = + (uint64(in[13] - in[12])) >> (31+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 6) | + ((uint64(in[15] - in[14])) >> ntz << 43) + out[9] = + (uint64(in[15] - in[14])) >> (21+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 53) + out[10] = + (uint64(in[17] - in[16])) >> (11+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 26) | + ((uint64(in[19] - in[18])) >> ntz << 63) + out[11] = + (uint64(in[19] - in[18])) >> (1+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 36) + out[12] = + (uint64(in[20] - in[19])) >> (28+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 9) | + ((uint64(in[22] - in[21])) >> ntz << 46) + out[13] = + (uint64(in[22] - in[21])) >> (18+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 19) | + ((uint64(in[24] - in[23])) >> ntz << 56) + out[14] = + (uint64(in[24] - in[23])) >> (8+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 29) + out[15] = + (uint64(in[25] - in[24])) >> (35+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 2) | + ((uint64(in[27] - in[26])) >> ntz << 39) + out[16] = + (uint64(in[27] - in[26])) >> (25+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 12) | + ((uint64(in[29] - in[28])) >> ntz << 49) + out[17] = + (uint64(in[29] - in[28])) >> (15+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 22) | + ((uint64(in[31] - in[30])) >> ntz << 59) + out[18] = + (uint64(in[31] - in[30])) >> (5+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[19] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 5) | + ((uint64(in[34] - in[33])) >> ntz << 42) + out[20] = + (uint64(in[34] - in[33])) >> (22+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 15) | + ((uint64(in[36] - in[35])) >> ntz << 52) + out[21] = + (uint64(in[36] - in[35])) >> (12+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 25) | + ((uint64(in[38] - in[37])) >> ntz << 62) + out[22] = + (uint64(in[38] - in[37])) >> (2+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 35) + out[23] = + (uint64(in[39] - in[38])) >> (29+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 8) | + ((uint64(in[41] - in[40])) >> ntz << 45) + out[24] = + (uint64(in[41] - in[40])) >> (19+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 18) | + ((uint64(in[43] - in[42])) >> ntz << 55) + out[25] = + (uint64(in[43] - in[42])) >> (9+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 28) + out[26] = + (uint64(in[44] - in[43])) >> (36+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 1) | + ((uint64(in[46] - in[45])) >> ntz << 38) + out[27] = + (uint64(in[46] - in[45])) >> (26+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 11) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[28] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 21) | + ((uint64(in[50] - in[49])) >> ntz << 58) + out[29] = + (uint64(in[50] - in[49])) >> (6+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 31) + out[30] = + (uint64(in[51] - in[50])) >> (33+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 4) | + ((uint64(in[53] - in[52])) >> ntz << 41) + out[31] = + (uint64(in[53] - in[52])) >> (23+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 14) | + ((uint64(in[55] - in[54])) >> ntz << 51) + out[32] = + (uint64(in[55] - in[54])) >> (13+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 24) | + ((uint64(in[57] - in[56])) >> ntz << 61) + out[33] = + (uint64(in[57] - in[56])) >> (3+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 34) + out[34] = + (uint64(in[58] - in[57])) >> (30+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 7) | + ((uint64(in[60] - in[59])) >> ntz << 44) + out[35] = + (uint64(in[60] - in[59])) >> (20+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 17) | + ((uint64(in[62] - in[61])) >> ntz << 54) + out[36] = + (uint64(in[62] - in[61])) >> (10+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 27) +} + +func deltapack_int64_38(initoffset int64, in *[64]int64, out *[38]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 38) + out[1] = + (uint64(in[1] - in[0])) >> (26+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 12) | + ((uint64(in[3] - in[2])) >> ntz << 50) + out[2] = + (uint64(in[3] - in[2])) >> (14+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 24) | + ((uint64(in[5] - in[4])) >> ntz << 62) + out[3] = + (uint64(in[5] - in[4])) >> (2+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 36) + out[4] = + (uint64(in[6] - in[5])) >> (28+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 10) | + ((uint64(in[8] - in[7])) >> ntz << 48) + out[5] = + (uint64(in[8] - in[7])) >> (16+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 22) | + ((uint64(in[10] - in[9])) >> ntz << 60) + out[6] = + (uint64(in[10] - in[9])) >> (4+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 34) + out[7] = + (uint64(in[11] - in[10])) >> (30+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 8) | + ((uint64(in[13] - in[12])) >> ntz << 46) + out[8] = + (uint64(in[13] - in[12])) >> (18+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 20) | + ((uint64(in[15] - in[14])) >> ntz << 58) + out[9] = + (uint64(in[15] - in[14])) >> (6+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[10] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 6) | + ((uint64(in[18] - in[17])) >> ntz << 44) + out[11] = + (uint64(in[18] - in[17])) >> (20+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 18) | + ((uint64(in[20] - in[19])) >> ntz << 56) + out[12] = + (uint64(in[20] - in[19])) >> (8+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 30) + out[13] = + (uint64(in[21] - in[20])) >> (34+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 4) | + ((uint64(in[23] - in[22])) >> ntz << 42) + out[14] = + (uint64(in[23] - in[22])) >> (22+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 16) | + ((uint64(in[25] - in[24])) >> ntz << 54) + out[15] = + (uint64(in[25] - in[24])) >> (10+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 28) + out[16] = + (uint64(in[26] - in[25])) >> (36+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 2) | + ((uint64(in[28] - in[27])) >> ntz << 40) + out[17] = + (uint64(in[28] - in[27])) >> (24+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 14) | + ((uint64(in[30] - in[29])) >> ntz << 52) + out[18] = + (uint64(in[30] - in[29])) >> (12+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 26) + out[19] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 38) + out[20] = + (uint64(in[33] - in[32])) >> (26+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 12) | + ((uint64(in[35] - in[34])) >> ntz << 50) + out[21] = + (uint64(in[35] - in[34])) >> (14+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 24) | + ((uint64(in[37] - in[36])) >> ntz << 62) + out[22] = + (uint64(in[37] - in[36])) >> (2+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 36) + out[23] = + (uint64(in[38] - in[37])) >> (28+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 10) | + ((uint64(in[40] - in[39])) >> ntz << 48) + out[24] = + (uint64(in[40] - in[39])) >> (16+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 22) | + ((uint64(in[42] - in[41])) >> ntz << 60) + out[25] = + (uint64(in[42] - in[41])) >> (4+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 34) + out[26] = + (uint64(in[43] - in[42])) >> (30+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 8) | + ((uint64(in[45] - in[44])) >> ntz << 46) + out[27] = + (uint64(in[45] - in[44])) >> (18+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 20) | + ((uint64(in[47] - in[46])) >> ntz << 58) + out[28] = + (uint64(in[47] - in[46])) >> (6+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[29] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 6) | + ((uint64(in[50] - in[49])) >> ntz << 44) + out[30] = + (uint64(in[50] - in[49])) >> (20+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 18) | + ((uint64(in[52] - in[51])) >> ntz << 56) + out[31] = + (uint64(in[52] - in[51])) >> (8+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 30) + out[32] = + (uint64(in[53] - in[52])) >> (34+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 4) | + ((uint64(in[55] - in[54])) >> ntz << 42) + out[33] = + (uint64(in[55] - in[54])) >> (22+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 16) | + ((uint64(in[57] - in[56])) >> ntz << 54) + out[34] = + (uint64(in[57] - in[56])) >> (10+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 28) + out[35] = + (uint64(in[58] - in[57])) >> (36+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 2) | + ((uint64(in[60] - in[59])) >> ntz << 40) + out[36] = + (uint64(in[60] - in[59])) >> (24+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 14) | + ((uint64(in[62] - in[61])) >> ntz << 52) + out[37] = + (uint64(in[62] - in[61])) >> (12+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 26) +} + +func deltapack_int64_39(initoffset int64, in *[64]int64, out *[39]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 39) + out[1] = + (uint64(in[1] - in[0])) >> (25+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 14) | + ((uint64(in[3] - in[2])) >> ntz << 53) + out[2] = + (uint64(in[3] - in[2])) >> (11+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 28) + out[3] = + (uint64(in[4] - in[3])) >> (36+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 3) | + ((uint64(in[6] - in[5])) >> ntz << 42) + out[4] = + (uint64(in[6] - in[5])) >> (22+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 17) | + ((uint64(in[8] - in[7])) >> ntz << 56) + out[5] = + (uint64(in[8] - in[7])) >> (8+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 31) + out[6] = + (uint64(in[9] - in[8])) >> (33+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 6) | + ((uint64(in[11] - in[10])) >> ntz << 45) + out[7] = + (uint64(in[11] - in[10])) >> (19+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 20) | + ((uint64(in[13] - in[12])) >> ntz << 59) + out[8] = + (uint64(in[13] - in[12])) >> (5+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 34) + out[9] = + (uint64(in[14] - in[13])) >> (30+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 9) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[10] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 23) | + ((uint64(in[18] - in[17])) >> ntz << 62) + out[11] = + (uint64(in[18] - in[17])) >> (2+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 37) + out[12] = + (uint64(in[19] - in[18])) >> (27+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 12) | + ((uint64(in[21] - in[20])) >> ntz << 51) + out[13] = + (uint64(in[21] - in[20])) >> (13+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 26) + out[14] = + (uint64(in[22] - in[21])) >> (38+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 1) | + ((uint64(in[24] - in[23])) >> ntz << 40) + out[15] = + (uint64(in[24] - in[23])) >> (24+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 15) | + ((uint64(in[26] - in[25])) >> ntz << 54) + out[16] = + (uint64(in[26] - in[25])) >> (10+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 29) + out[17] = + (uint64(in[27] - in[26])) >> (35+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 4) | + ((uint64(in[29] - in[28])) >> ntz << 43) + out[18] = + (uint64(in[29] - in[28])) >> (21+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 18) | + ((uint64(in[31] - in[30])) >> ntz << 57) + out[19] = + (uint64(in[31] - in[30])) >> (7+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[20] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 7) | + ((uint64(in[34] - in[33])) >> ntz << 46) + out[21] = + (uint64(in[34] - in[33])) >> (18+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 21) | + ((uint64(in[36] - in[35])) >> ntz << 60) + out[22] = + (uint64(in[36] - in[35])) >> (4+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 35) + out[23] = + (uint64(in[37] - in[36])) >> (29+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 10) | + ((uint64(in[39] - in[38])) >> ntz << 49) + out[24] = + (uint64(in[39] - in[38])) >> (15+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 24) | + ((uint64(in[41] - in[40])) >> ntz << 63) + out[25] = + (uint64(in[41] - in[40])) >> (1+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 38) + out[26] = + (uint64(in[42] - in[41])) >> (26+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 13) | + ((uint64(in[44] - in[43])) >> ntz << 52) + out[27] = + (uint64(in[44] - in[43])) >> (12+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 27) + out[28] = + (uint64(in[45] - in[44])) >> (37+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 2) | + ((uint64(in[47] - in[46])) >> ntz << 41) + out[29] = + (uint64(in[47] - in[46])) >> (23+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 55) + out[30] = + (uint64(in[49] - in[48])) >> (9+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 30) + out[31] = + (uint64(in[50] - in[49])) >> (34+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 5) | + ((uint64(in[52] - in[51])) >> ntz << 44) + out[32] = + (uint64(in[52] - in[51])) >> (20+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 19) | + ((uint64(in[54] - in[53])) >> ntz << 58) + out[33] = + (uint64(in[54] - in[53])) >> (6+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 33) + out[34] = + (uint64(in[55] - in[54])) >> (31+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 8) | + ((uint64(in[57] - in[56])) >> ntz << 47) + out[35] = + (uint64(in[57] - in[56])) >> (17+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 22) | + ((uint64(in[59] - in[58])) >> ntz << 61) + out[36] = + (uint64(in[59] - in[58])) >> (3+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 36) + out[37] = + (uint64(in[60] - in[59])) >> (28+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 11) | + ((uint64(in[62] - in[61])) >> ntz << 50) + out[38] = + (uint64(in[62] - in[61])) >> (14+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 25) +} + +func deltapack_int64_40(initoffset int64, in *[64]int64, out *[40]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 40) + out[1] = + (uint64(in[1] - in[0])) >> (24+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 16) | + ((uint64(in[3] - in[2])) >> ntz << 56) + out[2] = + (uint64(in[3] - in[2])) >> (8+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 32) + out[3] = + (uint64(in[4] - in[3])) >> (32+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 8) | + ((uint64(in[6] - in[5])) >> ntz << 48) + out[4] = + (uint64(in[6] - in[5])) >> (16+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 24) + out[5] = + (uint64(in[8] - in[7])) >> ntz | + ((uint64(in[9] - in[8])) >> ntz << 40) + out[6] = + (uint64(in[9] - in[8])) >> (24+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 16) | + ((uint64(in[11] - in[10])) >> ntz << 56) + out[7] = + (uint64(in[11] - in[10])) >> (8+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 32) + out[8] = + (uint64(in[12] - in[11])) >> (32+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 8) | + ((uint64(in[14] - in[13])) >> ntz << 48) + out[9] = + (uint64(in[14] - in[13])) >> (16+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 24) + out[10] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 40) + out[11] = + (uint64(in[17] - in[16])) >> (24+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 16) | + ((uint64(in[19] - in[18])) >> ntz << 56) + out[12] = + (uint64(in[19] - in[18])) >> (8+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 32) + out[13] = + (uint64(in[20] - in[19])) >> (32+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 8) | + ((uint64(in[22] - in[21])) >> ntz << 48) + out[14] = + (uint64(in[22] - in[21])) >> (16+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 24) + out[15] = + (uint64(in[24] - in[23])) >> ntz | + ((uint64(in[25] - in[24])) >> ntz << 40) + out[16] = + (uint64(in[25] - in[24])) >> (24+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 16) | + ((uint64(in[27] - in[26])) >> ntz << 56) + out[17] = + (uint64(in[27] - in[26])) >> (8+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 32) + out[18] = + (uint64(in[28] - in[27])) >> (32+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 8) | + ((uint64(in[30] - in[29])) >> ntz << 48) + out[19] = + (uint64(in[30] - in[29])) >> (16+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 24) + out[20] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 40) + out[21] = + (uint64(in[33] - in[32])) >> (24+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 16) | + ((uint64(in[35] - in[34])) >> ntz << 56) + out[22] = + (uint64(in[35] - in[34])) >> (8+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 32) + out[23] = + (uint64(in[36] - in[35])) >> (32+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 8) | + ((uint64(in[38] - in[37])) >> ntz << 48) + out[24] = + (uint64(in[38] - in[37])) >> (16+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 24) + out[25] = + (uint64(in[40] - in[39])) >> ntz | + ((uint64(in[41] - in[40])) >> ntz << 40) + out[26] = + (uint64(in[41] - in[40])) >> (24+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 16) | + ((uint64(in[43] - in[42])) >> ntz << 56) + out[27] = + (uint64(in[43] - in[42])) >> (8+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 32) + out[28] = + (uint64(in[44] - in[43])) >> (32+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 8) | + ((uint64(in[46] - in[45])) >> ntz << 48) + out[29] = + (uint64(in[46] - in[45])) >> (16+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 24) + out[30] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 40) + out[31] = + (uint64(in[49] - in[48])) >> (24+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 16) | + ((uint64(in[51] - in[50])) >> ntz << 56) + out[32] = + (uint64(in[51] - in[50])) >> (8+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 32) + out[33] = + (uint64(in[52] - in[51])) >> (32+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 8) | + ((uint64(in[54] - in[53])) >> ntz << 48) + out[34] = + (uint64(in[54] - in[53])) >> (16+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 24) + out[35] = + (uint64(in[56] - in[55])) >> ntz | + ((uint64(in[57] - in[56])) >> ntz << 40) + out[36] = + (uint64(in[57] - in[56])) >> (24+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 16) | + ((uint64(in[59] - in[58])) >> ntz << 56) + out[37] = + (uint64(in[59] - in[58])) >> (8+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 32) + out[38] = + (uint64(in[60] - in[59])) >> (32+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 8) | + ((uint64(in[62] - in[61])) >> ntz << 48) + out[39] = + (uint64(in[62] - in[61])) >> (16+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 24) +} + +func deltapack_int64_41(initoffset int64, in *[64]int64, out *[41]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 41) + out[1] = + (uint64(in[1] - in[0])) >> (23+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 18) | + ((uint64(in[3] - in[2])) >> ntz << 59) + out[2] = + (uint64(in[3] - in[2])) >> (5+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 36) + out[3] = + (uint64(in[4] - in[3])) >> (28+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 13) | + ((uint64(in[6] - in[5])) >> ntz << 54) + out[4] = + (uint64(in[6] - in[5])) >> (10+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 31) + out[5] = + (uint64(in[7] - in[6])) >> (33+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 8) | + ((uint64(in[9] - in[8])) >> ntz << 49) + out[6] = + (uint64(in[9] - in[8])) >> (15+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 26) + out[7] = + (uint64(in[10] - in[9])) >> (38+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 3) | + ((uint64(in[12] - in[11])) >> ntz << 44) + out[8] = + (uint64(in[12] - in[11])) >> (20+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 21) | + ((uint64(in[14] - in[13])) >> ntz << 62) + out[9] = + (uint64(in[14] - in[13])) >> (2+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 39) + out[10] = + (uint64(in[15] - in[14])) >> (25+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 57) + out[11] = + (uint64(in[17] - in[16])) >> (7+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 34) + out[12] = + (uint64(in[18] - in[17])) >> (30+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 11) | + ((uint64(in[20] - in[19])) >> ntz << 52) + out[13] = + (uint64(in[20] - in[19])) >> (12+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 29) + out[14] = + (uint64(in[21] - in[20])) >> (35+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 6) | + ((uint64(in[23] - in[22])) >> ntz << 47) + out[15] = + (uint64(in[23] - in[22])) >> (17+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 24) + out[16] = + (uint64(in[24] - in[23])) >> (40+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 1) | + ((uint64(in[26] - in[25])) >> ntz << 42) + out[17] = + (uint64(in[26] - in[25])) >> (22+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 19) | + ((uint64(in[28] - in[27])) >> ntz << 60) + out[18] = + (uint64(in[28] - in[27])) >> (4+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 37) + out[19] = + (uint64(in[29] - in[28])) >> (27+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 14) | + ((uint64(in[31] - in[30])) >> ntz << 55) + out[20] = + (uint64(in[31] - in[30])) >> (9+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[21] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 9) | + ((uint64(in[34] - in[33])) >> ntz << 50) + out[22] = + (uint64(in[34] - in[33])) >> (14+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 27) + out[23] = + (uint64(in[35] - in[34])) >> (37+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 4) | + ((uint64(in[37] - in[36])) >> ntz << 45) + out[24] = + (uint64(in[37] - in[36])) >> (19+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 22) | + ((uint64(in[39] - in[38])) >> ntz << 63) + out[25] = + (uint64(in[39] - in[38])) >> (1+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 40) + out[26] = + (uint64(in[40] - in[39])) >> (24+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 17) | + ((uint64(in[42] - in[41])) >> ntz << 58) + out[27] = + (uint64(in[42] - in[41])) >> (6+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 35) + out[28] = + (uint64(in[43] - in[42])) >> (29+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 12) | + ((uint64(in[45] - in[44])) >> ntz << 53) + out[29] = + (uint64(in[45] - in[44])) >> (11+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 30) + out[30] = + (uint64(in[46] - in[45])) >> (34+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 7) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[31] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 25) + out[32] = + (uint64(in[49] - in[48])) >> (39+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 2) | + ((uint64(in[51] - in[50])) >> ntz << 43) + out[33] = + (uint64(in[51] - in[50])) >> (21+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 20) | + ((uint64(in[53] - in[52])) >> ntz << 61) + out[34] = + (uint64(in[53] - in[52])) >> (3+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 38) + out[35] = + (uint64(in[54] - in[53])) >> (26+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 15) | + ((uint64(in[56] - in[55])) >> ntz << 56) + out[36] = + (uint64(in[56] - in[55])) >> (8+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 33) + out[37] = + (uint64(in[57] - in[56])) >> (31+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 10) | + ((uint64(in[59] - in[58])) >> ntz << 51) + out[38] = + (uint64(in[59] - in[58])) >> (13+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 28) + out[39] = + (uint64(in[60] - in[59])) >> (36+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 5) | + ((uint64(in[62] - in[61])) >> ntz << 46) + out[40] = + (uint64(in[62] - in[61])) >> (18+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 23) +} + +func deltapack_int64_42(initoffset int64, in *[64]int64, out *[42]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 42) + out[1] = + (uint64(in[1] - in[0])) >> (22+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 20) | + ((uint64(in[3] - in[2])) >> ntz << 62) + out[2] = + (uint64(in[3] - in[2])) >> (2+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 40) + out[3] = + (uint64(in[4] - in[3])) >> (24+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 18) | + ((uint64(in[6] - in[5])) >> ntz << 60) + out[4] = + (uint64(in[6] - in[5])) >> (4+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 38) + out[5] = + (uint64(in[7] - in[6])) >> (26+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 16) | + ((uint64(in[9] - in[8])) >> ntz << 58) + out[6] = + (uint64(in[9] - in[8])) >> (6+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 36) + out[7] = + (uint64(in[10] - in[9])) >> (28+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 14) | + ((uint64(in[12] - in[11])) >> ntz << 56) + out[8] = + (uint64(in[12] - in[11])) >> (8+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 34) + out[9] = + (uint64(in[13] - in[12])) >> (30+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 12) | + ((uint64(in[15] - in[14])) >> ntz << 54) + out[10] = + (uint64(in[15] - in[14])) >> (10+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[11] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 10) | + ((uint64(in[18] - in[17])) >> ntz << 52) + out[12] = + (uint64(in[18] - in[17])) >> (12+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 30) + out[13] = + (uint64(in[19] - in[18])) >> (34+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 8) | + ((uint64(in[21] - in[20])) >> ntz << 50) + out[14] = + (uint64(in[21] - in[20])) >> (14+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 28) + out[15] = + (uint64(in[22] - in[21])) >> (36+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 6) | + ((uint64(in[24] - in[23])) >> ntz << 48) + out[16] = + (uint64(in[24] - in[23])) >> (16+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 26) + out[17] = + (uint64(in[25] - in[24])) >> (38+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 4) | + ((uint64(in[27] - in[26])) >> ntz << 46) + out[18] = + (uint64(in[27] - in[26])) >> (18+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 24) + out[19] = + (uint64(in[28] - in[27])) >> (40+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 2) | + ((uint64(in[30] - in[29])) >> ntz << 44) + out[20] = + (uint64(in[30] - in[29])) >> (20+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 22) + out[21] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 42) + out[22] = + (uint64(in[33] - in[32])) >> (22+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 20) | + ((uint64(in[35] - in[34])) >> ntz << 62) + out[23] = + (uint64(in[35] - in[34])) >> (2+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 40) + out[24] = + (uint64(in[36] - in[35])) >> (24+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 18) | + ((uint64(in[38] - in[37])) >> ntz << 60) + out[25] = + (uint64(in[38] - in[37])) >> (4+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 38) + out[26] = + (uint64(in[39] - in[38])) >> (26+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 16) | + ((uint64(in[41] - in[40])) >> ntz << 58) + out[27] = + (uint64(in[41] - in[40])) >> (6+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 36) + out[28] = + (uint64(in[42] - in[41])) >> (28+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 14) | + ((uint64(in[44] - in[43])) >> ntz << 56) + out[29] = + (uint64(in[44] - in[43])) >> (8+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 34) + out[30] = + (uint64(in[45] - in[44])) >> (30+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 12) | + ((uint64(in[47] - in[46])) >> ntz << 54) + out[31] = + (uint64(in[47] - in[46])) >> (10+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[32] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 10) | + ((uint64(in[50] - in[49])) >> ntz << 52) + out[33] = + (uint64(in[50] - in[49])) >> (12+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 30) + out[34] = + (uint64(in[51] - in[50])) >> (34+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 8) | + ((uint64(in[53] - in[52])) >> ntz << 50) + out[35] = + (uint64(in[53] - in[52])) >> (14+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 28) + out[36] = + (uint64(in[54] - in[53])) >> (36+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 6) | + ((uint64(in[56] - in[55])) >> ntz << 48) + out[37] = + (uint64(in[56] - in[55])) >> (16+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 26) + out[38] = + (uint64(in[57] - in[56])) >> (38+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 4) | + ((uint64(in[59] - in[58])) >> ntz << 46) + out[39] = + (uint64(in[59] - in[58])) >> (18+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 24) + out[40] = + (uint64(in[60] - in[59])) >> (40+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 2) | + ((uint64(in[62] - in[61])) >> ntz << 44) + out[41] = + (uint64(in[62] - in[61])) >> (20+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 22) +} + +func deltapack_int64_43(initoffset int64, in *[64]int64, out *[43]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 43) + out[1] = + (uint64(in[1] - in[0])) >> (21+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 22) + out[2] = + (uint64(in[2] - in[1])) >> (42+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 1) | + ((uint64(in[4] - in[3])) >> ntz << 44) + out[3] = + (uint64(in[4] - in[3])) >> (20+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 23) + out[4] = + (uint64(in[5] - in[4])) >> (41+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 2) | + ((uint64(in[7] - in[6])) >> ntz << 45) + out[5] = + (uint64(in[7] - in[6])) >> (19+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 24) + out[6] = + (uint64(in[8] - in[7])) >> (40+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 3) | + ((uint64(in[10] - in[9])) >> ntz << 46) + out[7] = + (uint64(in[10] - in[9])) >> (18+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 25) + out[8] = + (uint64(in[11] - in[10])) >> (39+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 4) | + ((uint64(in[13] - in[12])) >> ntz << 47) + out[9] = + (uint64(in[13] - in[12])) >> (17+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 26) + out[10] = + (uint64(in[14] - in[13])) >> (38+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 5) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[11] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 27) + out[12] = + (uint64(in[17] - in[16])) >> (37+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 6) | + ((uint64(in[19] - in[18])) >> ntz << 49) + out[13] = + (uint64(in[19] - in[18])) >> (15+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 28) + out[14] = + (uint64(in[20] - in[19])) >> (36+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 7) | + ((uint64(in[22] - in[21])) >> ntz << 50) + out[15] = + (uint64(in[22] - in[21])) >> (14+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 29) + out[16] = + (uint64(in[23] - in[22])) >> (35+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 8) | + ((uint64(in[25] - in[24])) >> ntz << 51) + out[17] = + (uint64(in[25] - in[24])) >> (13+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 30) + out[18] = + (uint64(in[26] - in[25])) >> (34+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 9) | + ((uint64(in[28] - in[27])) >> ntz << 52) + out[19] = + (uint64(in[28] - in[27])) >> (12+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 31) + out[20] = + (uint64(in[29] - in[28])) >> (33+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 10) | + ((uint64(in[31] - in[30])) >> ntz << 53) + out[21] = + (uint64(in[31] - in[30])) >> (11+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[22] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 11) | + ((uint64(in[34] - in[33])) >> ntz << 54) + out[23] = + (uint64(in[34] - in[33])) >> (10+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 33) + out[24] = + (uint64(in[35] - in[34])) >> (31+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 12) | + ((uint64(in[37] - in[36])) >> ntz << 55) + out[25] = + (uint64(in[37] - in[36])) >> (9+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 34) + out[26] = + (uint64(in[38] - in[37])) >> (30+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 13) | + ((uint64(in[40] - in[39])) >> ntz << 56) + out[27] = + (uint64(in[40] - in[39])) >> (8+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 35) + out[28] = + (uint64(in[41] - in[40])) >> (29+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 14) | + ((uint64(in[43] - in[42])) >> ntz << 57) + out[29] = + (uint64(in[43] - in[42])) >> (7+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 36) + out[30] = + (uint64(in[44] - in[43])) >> (28+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 15) | + ((uint64(in[46] - in[45])) >> ntz << 58) + out[31] = + (uint64(in[46] - in[45])) >> (6+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 37) + out[32] = + (uint64(in[47] - in[46])) >> (27+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 59) + out[33] = + (uint64(in[49] - in[48])) >> (5+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 38) + out[34] = + (uint64(in[50] - in[49])) >> (26+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 17) | + ((uint64(in[52] - in[51])) >> ntz << 60) + out[35] = + (uint64(in[52] - in[51])) >> (4+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 39) + out[36] = + (uint64(in[53] - in[52])) >> (25+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 18) | + ((uint64(in[55] - in[54])) >> ntz << 61) + out[37] = + (uint64(in[55] - in[54])) >> (3+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 40) + out[38] = + (uint64(in[56] - in[55])) >> (24+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 19) | + ((uint64(in[58] - in[57])) >> ntz << 62) + out[39] = + (uint64(in[58] - in[57])) >> (2+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 41) + out[40] = + (uint64(in[59] - in[58])) >> (23+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 20) | + ((uint64(in[61] - in[60])) >> ntz << 63) + out[41] = + (uint64(in[61] - in[60])) >> (1+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 42) + out[42] = + (uint64(in[62] - in[61])) >> (22+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 21) +} + +func deltapack_int64_44(initoffset int64, in *[64]int64, out *[44]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 44) + out[1] = + (uint64(in[1] - in[0])) >> (20+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 24) + out[2] = + (uint64(in[2] - in[1])) >> (40+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 4) | + ((uint64(in[4] - in[3])) >> ntz << 48) + out[3] = + (uint64(in[4] - in[3])) >> (16+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 28) + out[4] = + (uint64(in[5] - in[4])) >> (36+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 8) | + ((uint64(in[7] - in[6])) >> ntz << 52) + out[5] = + (uint64(in[7] - in[6])) >> (12+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 32) + out[6] = + (uint64(in[8] - in[7])) >> (32+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 12) | + ((uint64(in[10] - in[9])) >> ntz << 56) + out[7] = + (uint64(in[10] - in[9])) >> (8+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 36) + out[8] = + (uint64(in[11] - in[10])) >> (28+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 16) | + ((uint64(in[13] - in[12])) >> ntz << 60) + out[9] = + (uint64(in[13] - in[12])) >> (4+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 40) + out[10] = + (uint64(in[14] - in[13])) >> (24+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 20) + out[11] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 44) + out[12] = + (uint64(in[17] - in[16])) >> (20+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 24) + out[13] = + (uint64(in[18] - in[17])) >> (40+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 4) | + ((uint64(in[20] - in[19])) >> ntz << 48) + out[14] = + (uint64(in[20] - in[19])) >> (16+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 28) + out[15] = + (uint64(in[21] - in[20])) >> (36+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 8) | + ((uint64(in[23] - in[22])) >> ntz << 52) + out[16] = + (uint64(in[23] - in[22])) >> (12+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 32) + out[17] = + (uint64(in[24] - in[23])) >> (32+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 12) | + ((uint64(in[26] - in[25])) >> ntz << 56) + out[18] = + (uint64(in[26] - in[25])) >> (8+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 36) + out[19] = + (uint64(in[27] - in[26])) >> (28+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 16) | + ((uint64(in[29] - in[28])) >> ntz << 60) + out[20] = + (uint64(in[29] - in[28])) >> (4+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 40) + out[21] = + (uint64(in[30] - in[29])) >> (24+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 20) + out[22] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 44) + out[23] = + (uint64(in[33] - in[32])) >> (20+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 24) + out[24] = + (uint64(in[34] - in[33])) >> (40+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 4) | + ((uint64(in[36] - in[35])) >> ntz << 48) + out[25] = + (uint64(in[36] - in[35])) >> (16+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 28) + out[26] = + (uint64(in[37] - in[36])) >> (36+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 8) | + ((uint64(in[39] - in[38])) >> ntz << 52) + out[27] = + (uint64(in[39] - in[38])) >> (12+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 32) + out[28] = + (uint64(in[40] - in[39])) >> (32+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 12) | + ((uint64(in[42] - in[41])) >> ntz << 56) + out[29] = + (uint64(in[42] - in[41])) >> (8+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 36) + out[30] = + (uint64(in[43] - in[42])) >> (28+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 16) | + ((uint64(in[45] - in[44])) >> ntz << 60) + out[31] = + (uint64(in[45] - in[44])) >> (4+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 40) + out[32] = + (uint64(in[46] - in[45])) >> (24+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 20) + out[33] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 44) + out[34] = + (uint64(in[49] - in[48])) >> (20+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 24) + out[35] = + (uint64(in[50] - in[49])) >> (40+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 4) | + ((uint64(in[52] - in[51])) >> ntz << 48) + out[36] = + (uint64(in[52] - in[51])) >> (16+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 28) + out[37] = + (uint64(in[53] - in[52])) >> (36+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 8) | + ((uint64(in[55] - in[54])) >> ntz << 52) + out[38] = + (uint64(in[55] - in[54])) >> (12+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 32) + out[39] = + (uint64(in[56] - in[55])) >> (32+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 12) | + ((uint64(in[58] - in[57])) >> ntz << 56) + out[40] = + (uint64(in[58] - in[57])) >> (8+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 36) + out[41] = + (uint64(in[59] - in[58])) >> (28+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 16) | + ((uint64(in[61] - in[60])) >> ntz << 60) + out[42] = + (uint64(in[61] - in[60])) >> (4+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 40) + out[43] = + (uint64(in[62] - in[61])) >> (24+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 20) +} + +func deltapack_int64_45(initoffset int64, in *[64]int64, out *[45]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 45) + out[1] = + (uint64(in[1] - in[0])) >> (19+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 26) + out[2] = + (uint64(in[2] - in[1])) >> (38+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 7) | + ((uint64(in[4] - in[3])) >> ntz << 52) + out[3] = + (uint64(in[4] - in[3])) >> (12+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 33) + out[4] = + (uint64(in[5] - in[4])) >> (31+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 14) | + ((uint64(in[7] - in[6])) >> ntz << 59) + out[5] = + (uint64(in[7] - in[6])) >> (5+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 40) + out[6] = + (uint64(in[8] - in[7])) >> (24+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 21) + out[7] = + (uint64(in[9] - in[8])) >> (43+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 2) | + ((uint64(in[11] - in[10])) >> ntz << 47) + out[8] = + (uint64(in[11] - in[10])) >> (17+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 28) + out[9] = + (uint64(in[12] - in[11])) >> (36+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 9) | + ((uint64(in[14] - in[13])) >> ntz << 54) + out[10] = + (uint64(in[14] - in[13])) >> (10+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 35) + out[11] = + (uint64(in[15] - in[14])) >> (29+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) | + ((uint64(in[17] - in[16])) >> ntz << 61) + out[12] = + (uint64(in[17] - in[16])) >> (3+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 42) + out[13] = + (uint64(in[18] - in[17])) >> (22+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 23) + out[14] = + (uint64(in[19] - in[18])) >> (41+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 4) | + ((uint64(in[21] - in[20])) >> ntz << 49) + out[15] = + (uint64(in[21] - in[20])) >> (15+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 30) + out[16] = + (uint64(in[22] - in[21])) >> (34+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 11) | + ((uint64(in[24] - in[23])) >> ntz << 56) + out[17] = + (uint64(in[24] - in[23])) >> (8+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 37) + out[18] = + (uint64(in[25] - in[24])) >> (27+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 18) | + ((uint64(in[27] - in[26])) >> ntz << 63) + out[19] = + (uint64(in[27] - in[26])) >> (1+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 44) + out[20] = + (uint64(in[28] - in[27])) >> (20+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 25) + out[21] = + (uint64(in[29] - in[28])) >> (39+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 6) | + ((uint64(in[31] - in[30])) >> ntz << 51) + out[22] = + (uint64(in[31] - in[30])) >> (13+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[23] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 13) | + ((uint64(in[34] - in[33])) >> ntz << 58) + out[24] = + (uint64(in[34] - in[33])) >> (6+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 39) + out[25] = + (uint64(in[35] - in[34])) >> (25+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 20) + out[26] = + (uint64(in[36] - in[35])) >> (44+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 1) | + ((uint64(in[38] - in[37])) >> ntz << 46) + out[27] = + (uint64(in[38] - in[37])) >> (18+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 27) + out[28] = + (uint64(in[39] - in[38])) >> (37+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 8) | + ((uint64(in[41] - in[40])) >> ntz << 53) + out[29] = + (uint64(in[41] - in[40])) >> (11+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 34) + out[30] = + (uint64(in[42] - in[41])) >> (30+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 15) | + ((uint64(in[44] - in[43])) >> ntz << 60) + out[31] = + (uint64(in[44] - in[43])) >> (4+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 41) + out[32] = + (uint64(in[45] - in[44])) >> (23+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 22) + out[33] = + (uint64(in[46] - in[45])) >> (42+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 3) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[34] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 29) + out[35] = + (uint64(in[49] - in[48])) >> (35+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 10) | + ((uint64(in[51] - in[50])) >> ntz << 55) + out[36] = + (uint64(in[51] - in[50])) >> (9+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 36) + out[37] = + (uint64(in[52] - in[51])) >> (28+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 17) | + ((uint64(in[54] - in[53])) >> ntz << 62) + out[38] = + (uint64(in[54] - in[53])) >> (2+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 43) + out[39] = + (uint64(in[55] - in[54])) >> (21+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 24) + out[40] = + (uint64(in[56] - in[55])) >> (40+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 5) | + ((uint64(in[58] - in[57])) >> ntz << 50) + out[41] = + (uint64(in[58] - in[57])) >> (14+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 31) + out[42] = + (uint64(in[59] - in[58])) >> (33+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 12) | + ((uint64(in[61] - in[60])) >> ntz << 57) + out[43] = + (uint64(in[61] - in[60])) >> (7+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 38) + out[44] = + (uint64(in[62] - in[61])) >> (26+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 19) +} + +func deltapack_int64_46(initoffset int64, in *[64]int64, out *[46]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 46) + out[1] = + (uint64(in[1] - in[0])) >> (18+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 28) + out[2] = + (uint64(in[2] - in[1])) >> (36+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 10) | + ((uint64(in[4] - in[3])) >> ntz << 56) + out[3] = + (uint64(in[4] - in[3])) >> (8+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 38) + out[4] = + (uint64(in[5] - in[4])) >> (26+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 20) + out[5] = + (uint64(in[6] - in[5])) >> (44+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 2) | + ((uint64(in[8] - in[7])) >> ntz << 48) + out[6] = + (uint64(in[8] - in[7])) >> (16+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 30) + out[7] = + (uint64(in[9] - in[8])) >> (34+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 12) | + ((uint64(in[11] - in[10])) >> ntz << 58) + out[8] = + (uint64(in[11] - in[10])) >> (6+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 40) + out[9] = + (uint64(in[12] - in[11])) >> (24+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 22) + out[10] = + (uint64(in[13] - in[12])) >> (42+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 4) | + ((uint64(in[15] - in[14])) >> ntz << 50) + out[11] = + (uint64(in[15] - in[14])) >> (14+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[12] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 14) | + ((uint64(in[18] - in[17])) >> ntz << 60) + out[13] = + (uint64(in[18] - in[17])) >> (4+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 42) + out[14] = + (uint64(in[19] - in[18])) >> (22+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 24) + out[15] = + (uint64(in[20] - in[19])) >> (40+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 6) | + ((uint64(in[22] - in[21])) >> ntz << 52) + out[16] = + (uint64(in[22] - in[21])) >> (12+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 34) + out[17] = + (uint64(in[23] - in[22])) >> (30+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 16) | + ((uint64(in[25] - in[24])) >> ntz << 62) + out[18] = + (uint64(in[25] - in[24])) >> (2+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 44) + out[19] = + (uint64(in[26] - in[25])) >> (20+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 26) + out[20] = + (uint64(in[27] - in[26])) >> (38+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 8) | + ((uint64(in[29] - in[28])) >> ntz << 54) + out[21] = + (uint64(in[29] - in[28])) >> (10+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 36) + out[22] = + (uint64(in[30] - in[29])) >> (28+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 18) + out[23] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 46) + out[24] = + (uint64(in[33] - in[32])) >> (18+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 28) + out[25] = + (uint64(in[34] - in[33])) >> (36+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 10) | + ((uint64(in[36] - in[35])) >> ntz << 56) + out[26] = + (uint64(in[36] - in[35])) >> (8+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 38) + out[27] = + (uint64(in[37] - in[36])) >> (26+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 20) + out[28] = + (uint64(in[38] - in[37])) >> (44+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 2) | + ((uint64(in[40] - in[39])) >> ntz << 48) + out[29] = + (uint64(in[40] - in[39])) >> (16+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 30) + out[30] = + (uint64(in[41] - in[40])) >> (34+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 12) | + ((uint64(in[43] - in[42])) >> ntz << 58) + out[31] = + (uint64(in[43] - in[42])) >> (6+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 40) + out[32] = + (uint64(in[44] - in[43])) >> (24+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 22) + out[33] = + (uint64(in[45] - in[44])) >> (42+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 4) | + ((uint64(in[47] - in[46])) >> ntz << 50) + out[34] = + (uint64(in[47] - in[46])) >> (14+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[35] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 14) | + ((uint64(in[50] - in[49])) >> ntz << 60) + out[36] = + (uint64(in[50] - in[49])) >> (4+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 42) + out[37] = + (uint64(in[51] - in[50])) >> (22+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 24) + out[38] = + (uint64(in[52] - in[51])) >> (40+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 6) | + ((uint64(in[54] - in[53])) >> ntz << 52) + out[39] = + (uint64(in[54] - in[53])) >> (12+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 34) + out[40] = + (uint64(in[55] - in[54])) >> (30+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 16) | + ((uint64(in[57] - in[56])) >> ntz << 62) + out[41] = + (uint64(in[57] - in[56])) >> (2+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 44) + out[42] = + (uint64(in[58] - in[57])) >> (20+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 26) + out[43] = + (uint64(in[59] - in[58])) >> (38+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 8) | + ((uint64(in[61] - in[60])) >> ntz << 54) + out[44] = + (uint64(in[61] - in[60])) >> (10+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 36) + out[45] = + (uint64(in[62] - in[61])) >> (28+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 18) +} + +func deltapack_int64_47(initoffset int64, in *[64]int64, out *[47]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 47) + out[1] = + (uint64(in[1] - in[0])) >> (17+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 30) + out[2] = + (uint64(in[2] - in[1])) >> (34+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 13) | + ((uint64(in[4] - in[3])) >> ntz << 60) + out[3] = + (uint64(in[4] - in[3])) >> (4+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 43) + out[4] = + (uint64(in[5] - in[4])) >> (21+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 26) + out[5] = + (uint64(in[6] - in[5])) >> (38+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 9) | + ((uint64(in[8] - in[7])) >> ntz << 56) + out[6] = + (uint64(in[8] - in[7])) >> (8+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 39) + out[7] = + (uint64(in[9] - in[8])) >> (25+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 22) + out[8] = + (uint64(in[10] - in[9])) >> (42+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 5) | + ((uint64(in[12] - in[11])) >> ntz << 52) + out[9] = + (uint64(in[12] - in[11])) >> (12+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 35) + out[10] = + (uint64(in[13] - in[12])) >> (29+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 18) + out[11] = + (uint64(in[14] - in[13])) >> (46+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 1) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[12] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 31) + out[13] = + (uint64(in[17] - in[16])) >> (33+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 14) | + ((uint64(in[19] - in[18])) >> ntz << 61) + out[14] = + (uint64(in[19] - in[18])) >> (3+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 44) + out[15] = + (uint64(in[20] - in[19])) >> (20+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 27) + out[16] = + (uint64(in[21] - in[20])) >> (37+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 10) | + ((uint64(in[23] - in[22])) >> ntz << 57) + out[17] = + (uint64(in[23] - in[22])) >> (7+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 40) + out[18] = + (uint64(in[24] - in[23])) >> (24+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 23) + out[19] = + (uint64(in[25] - in[24])) >> (41+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 6) | + ((uint64(in[27] - in[26])) >> ntz << 53) + out[20] = + (uint64(in[27] - in[26])) >> (11+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 36) + out[21] = + (uint64(in[28] - in[27])) >> (28+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 19) + out[22] = + (uint64(in[29] - in[28])) >> (45+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 2) | + ((uint64(in[31] - in[30])) >> ntz << 49) + out[23] = + (uint64(in[31] - in[30])) >> (15+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[24] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 15) | + ((uint64(in[34] - in[33])) >> ntz << 62) + out[25] = + (uint64(in[34] - in[33])) >> (2+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 45) + out[26] = + (uint64(in[35] - in[34])) >> (19+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 28) + out[27] = + (uint64(in[36] - in[35])) >> (36+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 11) | + ((uint64(in[38] - in[37])) >> ntz << 58) + out[28] = + (uint64(in[38] - in[37])) >> (6+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 41) + out[29] = + (uint64(in[39] - in[38])) >> (23+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 24) + out[30] = + (uint64(in[40] - in[39])) >> (40+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 7) | + ((uint64(in[42] - in[41])) >> ntz << 54) + out[31] = + (uint64(in[42] - in[41])) >> (10+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 37) + out[32] = + (uint64(in[43] - in[42])) >> (27+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 20) + out[33] = + (uint64(in[44] - in[43])) >> (44+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 3) | + ((uint64(in[46] - in[45])) >> ntz << 50) + out[34] = + (uint64(in[46] - in[45])) >> (14+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 33) + out[35] = + (uint64(in[47] - in[46])) >> (31+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) | + ((uint64(in[49] - in[48])) >> ntz << 63) + out[36] = + (uint64(in[49] - in[48])) >> (1+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 46) + out[37] = + (uint64(in[50] - in[49])) >> (18+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 29) + out[38] = + (uint64(in[51] - in[50])) >> (35+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 12) | + ((uint64(in[53] - in[52])) >> ntz << 59) + out[39] = + (uint64(in[53] - in[52])) >> (5+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 42) + out[40] = + (uint64(in[54] - in[53])) >> (22+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 25) + out[41] = + (uint64(in[55] - in[54])) >> (39+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 8) | + ((uint64(in[57] - in[56])) >> ntz << 55) + out[42] = + (uint64(in[57] - in[56])) >> (9+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 38) + out[43] = + (uint64(in[58] - in[57])) >> (26+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 21) + out[44] = + (uint64(in[59] - in[58])) >> (43+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 4) | + ((uint64(in[61] - in[60])) >> ntz << 51) + out[45] = + (uint64(in[61] - in[60])) >> (13+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 34) + out[46] = + (uint64(in[62] - in[61])) >> (30+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 17) +} + +func deltapack_int64_48(initoffset int64, in *[64]int64, out *[48]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 48) + out[1] = + (uint64(in[1] - in[0])) >> (16+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 32) + out[2] = + (uint64(in[2] - in[1])) >> (32+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 16) + out[3] = + (uint64(in[4] - in[3])) >> ntz | + ((uint64(in[5] - in[4])) >> ntz << 48) + out[4] = + (uint64(in[5] - in[4])) >> (16+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 32) + out[5] = + (uint64(in[6] - in[5])) >> (32+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 16) + out[6] = + (uint64(in[8] - in[7])) >> ntz | + ((uint64(in[9] - in[8])) >> ntz << 48) + out[7] = + (uint64(in[9] - in[8])) >> (16+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 32) + out[8] = + (uint64(in[10] - in[9])) >> (32+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 16) + out[9] = + (uint64(in[12] - in[11])) >> ntz | + ((uint64(in[13] - in[12])) >> ntz << 48) + out[10] = + (uint64(in[13] - in[12])) >> (16+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 32) + out[11] = + (uint64(in[14] - in[13])) >> (32+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 16) + out[12] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 48) + out[13] = + (uint64(in[17] - in[16])) >> (16+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 32) + out[14] = + (uint64(in[18] - in[17])) >> (32+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 16) + out[15] = + (uint64(in[20] - in[19])) >> ntz | + ((uint64(in[21] - in[20])) >> ntz << 48) + out[16] = + (uint64(in[21] - in[20])) >> (16+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 32) + out[17] = + (uint64(in[22] - in[21])) >> (32+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 16) + out[18] = + (uint64(in[24] - in[23])) >> ntz | + ((uint64(in[25] - in[24])) >> ntz << 48) + out[19] = + (uint64(in[25] - in[24])) >> (16+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 32) + out[20] = + (uint64(in[26] - in[25])) >> (32+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 16) + out[21] = + (uint64(in[28] - in[27])) >> ntz | + ((uint64(in[29] - in[28])) >> ntz << 48) + out[22] = + (uint64(in[29] - in[28])) >> (16+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 32) + out[23] = + (uint64(in[30] - in[29])) >> (32+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 16) + out[24] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 48) + out[25] = + (uint64(in[33] - in[32])) >> (16+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 32) + out[26] = + (uint64(in[34] - in[33])) >> (32+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 16) + out[27] = + (uint64(in[36] - in[35])) >> ntz | + ((uint64(in[37] - in[36])) >> ntz << 48) + out[28] = + (uint64(in[37] - in[36])) >> (16+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 32) + out[29] = + (uint64(in[38] - in[37])) >> (32+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 16) + out[30] = + (uint64(in[40] - in[39])) >> ntz | + ((uint64(in[41] - in[40])) >> ntz << 48) + out[31] = + (uint64(in[41] - in[40])) >> (16+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 32) + out[32] = + (uint64(in[42] - in[41])) >> (32+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 16) + out[33] = + (uint64(in[44] - in[43])) >> ntz | + ((uint64(in[45] - in[44])) >> ntz << 48) + out[34] = + (uint64(in[45] - in[44])) >> (16+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 32) + out[35] = + (uint64(in[46] - in[45])) >> (32+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 16) + out[36] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 48) + out[37] = + (uint64(in[49] - in[48])) >> (16+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 32) + out[38] = + (uint64(in[50] - in[49])) >> (32+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 16) + out[39] = + (uint64(in[52] - in[51])) >> ntz | + ((uint64(in[53] - in[52])) >> ntz << 48) + out[40] = + (uint64(in[53] - in[52])) >> (16+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 32) + out[41] = + (uint64(in[54] - in[53])) >> (32+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 16) + out[42] = + (uint64(in[56] - in[55])) >> ntz | + ((uint64(in[57] - in[56])) >> ntz << 48) + out[43] = + (uint64(in[57] - in[56])) >> (16+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 32) + out[44] = + (uint64(in[58] - in[57])) >> (32+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 16) + out[45] = + (uint64(in[60] - in[59])) >> ntz | + ((uint64(in[61] - in[60])) >> ntz << 48) + out[46] = + (uint64(in[61] - in[60])) >> (16+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 32) + out[47] = + (uint64(in[62] - in[61])) >> (32+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 16) +} + +func deltapack_int64_49(initoffset int64, in *[64]int64, out *[49]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 49) + out[1] = + (uint64(in[1] - in[0])) >> (15+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 34) + out[2] = + (uint64(in[2] - in[1])) >> (30+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 19) + out[3] = + (uint64(in[3] - in[2])) >> (45+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 4) | + ((uint64(in[5] - in[4])) >> ntz << 53) + out[4] = + (uint64(in[5] - in[4])) >> (11+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 38) + out[5] = + (uint64(in[6] - in[5])) >> (26+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 23) + out[6] = + (uint64(in[7] - in[6])) >> (41+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 8) | + ((uint64(in[9] - in[8])) >> ntz << 57) + out[7] = + (uint64(in[9] - in[8])) >> (7+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 42) + out[8] = + (uint64(in[10] - in[9])) >> (22+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 27) + out[9] = + (uint64(in[11] - in[10])) >> (37+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 12) | + ((uint64(in[13] - in[12])) >> ntz << 61) + out[10] = + (uint64(in[13] - in[12])) >> (3+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 46) + out[11] = + (uint64(in[14] - in[13])) >> (18+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 31) + out[12] = + (uint64(in[15] - in[14])) >> (33+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) + out[13] = + (uint64(in[16] - in[15])) >> (48+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 1) | + ((uint64(in[18] - in[17])) >> ntz << 50) + out[14] = + (uint64(in[18] - in[17])) >> (14+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 35) + out[15] = + (uint64(in[19] - in[18])) >> (29+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 20) + out[16] = + (uint64(in[20] - in[19])) >> (44+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 5) | + ((uint64(in[22] - in[21])) >> ntz << 54) + out[17] = + (uint64(in[22] - in[21])) >> (10+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 39) + out[18] = + (uint64(in[23] - in[22])) >> (25+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 24) + out[19] = + (uint64(in[24] - in[23])) >> (40+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 9) | + ((uint64(in[26] - in[25])) >> ntz << 58) + out[20] = + (uint64(in[26] - in[25])) >> (6+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 43) + out[21] = + (uint64(in[27] - in[26])) >> (21+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 28) + out[22] = + (uint64(in[28] - in[27])) >> (36+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 13) | + ((uint64(in[30] - in[29])) >> ntz << 62) + out[23] = + (uint64(in[30] - in[29])) >> (2+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 47) + out[24] = + (uint64(in[31] - in[30])) >> (17+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[25] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 17) + out[26] = + (uint64(in[33] - in[32])) >> (47+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 2) | + ((uint64(in[35] - in[34])) >> ntz << 51) + out[27] = + (uint64(in[35] - in[34])) >> (13+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 36) + out[28] = + (uint64(in[36] - in[35])) >> (28+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 21) + out[29] = + (uint64(in[37] - in[36])) >> (43+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 6) | + ((uint64(in[39] - in[38])) >> ntz << 55) + out[30] = + (uint64(in[39] - in[38])) >> (9+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 40) + out[31] = + (uint64(in[40] - in[39])) >> (24+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 25) + out[32] = + (uint64(in[41] - in[40])) >> (39+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 10) | + ((uint64(in[43] - in[42])) >> ntz << 59) + out[33] = + (uint64(in[43] - in[42])) >> (5+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 44) + out[34] = + (uint64(in[44] - in[43])) >> (20+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 29) + out[35] = + (uint64(in[45] - in[44])) >> (35+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 14) | + ((uint64(in[47] - in[46])) >> ntz << 63) + out[36] = + (uint64(in[47] - in[46])) >> (1+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[37] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 33) + out[38] = + (uint64(in[49] - in[48])) >> (31+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 18) + out[39] = + (uint64(in[50] - in[49])) >> (46+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 3) | + ((uint64(in[52] - in[51])) >> ntz << 52) + out[40] = + (uint64(in[52] - in[51])) >> (12+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 37) + out[41] = + (uint64(in[53] - in[52])) >> (27+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 22) + out[42] = + (uint64(in[54] - in[53])) >> (42+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 7) | + ((uint64(in[56] - in[55])) >> ntz << 56) + out[43] = + (uint64(in[56] - in[55])) >> (8+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 41) + out[44] = + (uint64(in[57] - in[56])) >> (23+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 26) + out[45] = + (uint64(in[58] - in[57])) >> (38+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 11) | + ((uint64(in[60] - in[59])) >> ntz << 60) + out[46] = + (uint64(in[60] - in[59])) >> (4+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 45) + out[47] = + (uint64(in[61] - in[60])) >> (19+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 30) + out[48] = + (uint64(in[62] - in[61])) >> (34+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 15) +} + +func deltapack_int64_50(initoffset int64, in *[64]int64, out *[50]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 50) + out[1] = + (uint64(in[1] - in[0])) >> (14+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 36) + out[2] = + (uint64(in[2] - in[1])) >> (28+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 22) + out[3] = + (uint64(in[3] - in[2])) >> (42+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 8) | + ((uint64(in[5] - in[4])) >> ntz << 58) + out[4] = + (uint64(in[5] - in[4])) >> (6+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 44) + out[5] = + (uint64(in[6] - in[5])) >> (20+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 30) + out[6] = + (uint64(in[7] - in[6])) >> (34+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 16) + out[7] = + (uint64(in[8] - in[7])) >> (48+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 2) | + ((uint64(in[10] - in[9])) >> ntz << 52) + out[8] = + (uint64(in[10] - in[9])) >> (12+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 38) + out[9] = + (uint64(in[11] - in[10])) >> (26+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 24) + out[10] = + (uint64(in[12] - in[11])) >> (40+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 10) | + ((uint64(in[14] - in[13])) >> ntz << 60) + out[11] = + (uint64(in[14] - in[13])) >> (4+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 46) + out[12] = + (uint64(in[15] - in[14])) >> (18+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[13] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 18) + out[14] = + (uint64(in[17] - in[16])) >> (46+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 4) | + ((uint64(in[19] - in[18])) >> ntz << 54) + out[15] = + (uint64(in[19] - in[18])) >> (10+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 40) + out[16] = + (uint64(in[20] - in[19])) >> (24+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 26) + out[17] = + (uint64(in[21] - in[20])) >> (38+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 12) | + ((uint64(in[23] - in[22])) >> ntz << 62) + out[18] = + (uint64(in[23] - in[22])) >> (2+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 48) + out[19] = + (uint64(in[24] - in[23])) >> (16+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 34) + out[20] = + (uint64(in[25] - in[24])) >> (30+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 20) + out[21] = + (uint64(in[26] - in[25])) >> (44+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 6) | + ((uint64(in[28] - in[27])) >> ntz << 56) + out[22] = + (uint64(in[28] - in[27])) >> (8+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 42) + out[23] = + (uint64(in[29] - in[28])) >> (22+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 28) + out[24] = + (uint64(in[30] - in[29])) >> (36+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 14) + out[25] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 50) + out[26] = + (uint64(in[33] - in[32])) >> (14+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 36) + out[27] = + (uint64(in[34] - in[33])) >> (28+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 22) + out[28] = + (uint64(in[35] - in[34])) >> (42+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 8) | + ((uint64(in[37] - in[36])) >> ntz << 58) + out[29] = + (uint64(in[37] - in[36])) >> (6+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 44) + out[30] = + (uint64(in[38] - in[37])) >> (20+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 30) + out[31] = + (uint64(in[39] - in[38])) >> (34+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 16) + out[32] = + (uint64(in[40] - in[39])) >> (48+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 2) | + ((uint64(in[42] - in[41])) >> ntz << 52) + out[33] = + (uint64(in[42] - in[41])) >> (12+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 38) + out[34] = + (uint64(in[43] - in[42])) >> (26+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 24) + out[35] = + (uint64(in[44] - in[43])) >> (40+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 10) | + ((uint64(in[46] - in[45])) >> ntz << 60) + out[36] = + (uint64(in[46] - in[45])) >> (4+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 46) + out[37] = + (uint64(in[47] - in[46])) >> (18+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[38] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 18) + out[39] = + (uint64(in[49] - in[48])) >> (46+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 4) | + ((uint64(in[51] - in[50])) >> ntz << 54) + out[40] = + (uint64(in[51] - in[50])) >> (10+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 40) + out[41] = + (uint64(in[52] - in[51])) >> (24+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 26) + out[42] = + (uint64(in[53] - in[52])) >> (38+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 12) | + ((uint64(in[55] - in[54])) >> ntz << 62) + out[43] = + (uint64(in[55] - in[54])) >> (2+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 48) + out[44] = + (uint64(in[56] - in[55])) >> (16+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 34) + out[45] = + (uint64(in[57] - in[56])) >> (30+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 20) + out[46] = + (uint64(in[58] - in[57])) >> (44+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 6) | + ((uint64(in[60] - in[59])) >> ntz << 56) + out[47] = + (uint64(in[60] - in[59])) >> (8+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 42) + out[48] = + (uint64(in[61] - in[60])) >> (22+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 28) + out[49] = + (uint64(in[62] - in[61])) >> (36+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 14) +} + +func deltapack_int64_51(initoffset int64, in *[64]int64, out *[51]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 51) + out[1] = + (uint64(in[1] - in[0])) >> (13+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 38) + out[2] = + (uint64(in[2] - in[1])) >> (26+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 25) + out[3] = + (uint64(in[3] - in[2])) >> (39+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 12) | + ((uint64(in[5] - in[4])) >> ntz << 63) + out[4] = + (uint64(in[5] - in[4])) >> (1+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 50) + out[5] = + (uint64(in[6] - in[5])) >> (14+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 37) + out[6] = + (uint64(in[7] - in[6])) >> (27+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 24) + out[7] = + (uint64(in[8] - in[7])) >> (40+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 11) | + ((uint64(in[10] - in[9])) >> ntz << 62) + out[8] = + (uint64(in[10] - in[9])) >> (2+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 49) + out[9] = + (uint64(in[11] - in[10])) >> (15+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 36) + out[10] = + (uint64(in[12] - in[11])) >> (28+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 23) + out[11] = + (uint64(in[13] - in[12])) >> (41+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 10) | + ((uint64(in[15] - in[14])) >> ntz << 61) + out[12] = + (uint64(in[15] - in[14])) >> (3+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[13] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 35) + out[14] = + (uint64(in[17] - in[16])) >> (29+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 22) + out[15] = + (uint64(in[18] - in[17])) >> (42+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 9) | + ((uint64(in[20] - in[19])) >> ntz << 60) + out[16] = + (uint64(in[20] - in[19])) >> (4+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 47) + out[17] = + (uint64(in[21] - in[20])) >> (17+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 34) + out[18] = + (uint64(in[22] - in[21])) >> (30+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 21) + out[19] = + (uint64(in[23] - in[22])) >> (43+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 8) | + ((uint64(in[25] - in[24])) >> ntz << 59) + out[20] = + (uint64(in[25] - in[24])) >> (5+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 46) + out[21] = + (uint64(in[26] - in[25])) >> (18+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 33) + out[22] = + (uint64(in[27] - in[26])) >> (31+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 20) + out[23] = + (uint64(in[28] - in[27])) >> (44+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 7) | + ((uint64(in[30] - in[29])) >> ntz << 58) + out[24] = + (uint64(in[30] - in[29])) >> (6+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 45) + out[25] = + (uint64(in[31] - in[30])) >> (19+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[26] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 19) + out[27] = + (uint64(in[33] - in[32])) >> (45+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 6) | + ((uint64(in[35] - in[34])) >> ntz << 57) + out[28] = + (uint64(in[35] - in[34])) >> (7+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 44) + out[29] = + (uint64(in[36] - in[35])) >> (20+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 31) + out[30] = + (uint64(in[37] - in[36])) >> (33+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 18) + out[31] = + (uint64(in[38] - in[37])) >> (46+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 5) | + ((uint64(in[40] - in[39])) >> ntz << 56) + out[32] = + (uint64(in[40] - in[39])) >> (8+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 43) + out[33] = + (uint64(in[41] - in[40])) >> (21+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 30) + out[34] = + (uint64(in[42] - in[41])) >> (34+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 17) + out[35] = + (uint64(in[43] - in[42])) >> (47+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 4) | + ((uint64(in[45] - in[44])) >> ntz << 55) + out[36] = + (uint64(in[45] - in[44])) >> (9+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 42) + out[37] = + (uint64(in[46] - in[45])) >> (22+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 29) + out[38] = + (uint64(in[47] - in[46])) >> (35+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) + out[39] = + (uint64(in[48] - in[47])) >> (48+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 3) | + ((uint64(in[50] - in[49])) >> ntz << 54) + out[40] = + (uint64(in[50] - in[49])) >> (10+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 41) + out[41] = + (uint64(in[51] - in[50])) >> (23+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 28) + out[42] = + (uint64(in[52] - in[51])) >> (36+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 15) + out[43] = + (uint64(in[53] - in[52])) >> (49+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 2) | + ((uint64(in[55] - in[54])) >> ntz << 53) + out[44] = + (uint64(in[55] - in[54])) >> (11+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 40) + out[45] = + (uint64(in[56] - in[55])) >> (24+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 27) + out[46] = + (uint64(in[57] - in[56])) >> (37+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 14) + out[47] = + (uint64(in[58] - in[57])) >> (50+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 1) | + ((uint64(in[60] - in[59])) >> ntz << 52) + out[48] = + (uint64(in[60] - in[59])) >> (12+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 39) + out[49] = + (uint64(in[61] - in[60])) >> (25+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 26) + out[50] = + (uint64(in[62] - in[61])) >> (38+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 13) +} + +func deltapack_int64_52(initoffset int64, in *[64]int64, out *[52]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 52) + out[1] = + (uint64(in[1] - in[0])) >> (12+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 40) + out[2] = + (uint64(in[2] - in[1])) >> (24+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 28) + out[3] = + (uint64(in[3] - in[2])) >> (36+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 16) + out[4] = + (uint64(in[4] - in[3])) >> (48+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 4) | + ((uint64(in[6] - in[5])) >> ntz << 56) + out[5] = + (uint64(in[6] - in[5])) >> (8+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 44) + out[6] = + (uint64(in[7] - in[6])) >> (20+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 32) + out[7] = + (uint64(in[8] - in[7])) >> (32+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 20) + out[8] = + (uint64(in[9] - in[8])) >> (44+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 8) | + ((uint64(in[11] - in[10])) >> ntz << 60) + out[9] = + (uint64(in[11] - in[10])) >> (4+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 48) + out[10] = + (uint64(in[12] - in[11])) >> (16+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 36) + out[11] = + (uint64(in[13] - in[12])) >> (28+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 24) + out[12] = + (uint64(in[14] - in[13])) >> (40+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 12) + out[13] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 52) + out[14] = + (uint64(in[17] - in[16])) >> (12+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 40) + out[15] = + (uint64(in[18] - in[17])) >> (24+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 28) + out[16] = + (uint64(in[19] - in[18])) >> (36+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 16) + out[17] = + (uint64(in[20] - in[19])) >> (48+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 4) | + ((uint64(in[22] - in[21])) >> ntz << 56) + out[18] = + (uint64(in[22] - in[21])) >> (8+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 44) + out[19] = + (uint64(in[23] - in[22])) >> (20+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 32) + out[20] = + (uint64(in[24] - in[23])) >> (32+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 20) + out[21] = + (uint64(in[25] - in[24])) >> (44+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 8) | + ((uint64(in[27] - in[26])) >> ntz << 60) + out[22] = + (uint64(in[27] - in[26])) >> (4+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 48) + out[23] = + (uint64(in[28] - in[27])) >> (16+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 36) + out[24] = + (uint64(in[29] - in[28])) >> (28+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 24) + out[25] = + (uint64(in[30] - in[29])) >> (40+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 12) + out[26] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 52) + out[27] = + (uint64(in[33] - in[32])) >> (12+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 40) + out[28] = + (uint64(in[34] - in[33])) >> (24+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 28) + out[29] = + (uint64(in[35] - in[34])) >> (36+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 16) + out[30] = + (uint64(in[36] - in[35])) >> (48+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 4) | + ((uint64(in[38] - in[37])) >> ntz << 56) + out[31] = + (uint64(in[38] - in[37])) >> (8+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 44) + out[32] = + (uint64(in[39] - in[38])) >> (20+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 32) + out[33] = + (uint64(in[40] - in[39])) >> (32+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 20) + out[34] = + (uint64(in[41] - in[40])) >> (44+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 8) | + ((uint64(in[43] - in[42])) >> ntz << 60) + out[35] = + (uint64(in[43] - in[42])) >> (4+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 48) + out[36] = + (uint64(in[44] - in[43])) >> (16+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 36) + out[37] = + (uint64(in[45] - in[44])) >> (28+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 24) + out[38] = + (uint64(in[46] - in[45])) >> (40+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 12) + out[39] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 52) + out[40] = + (uint64(in[49] - in[48])) >> (12+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 40) + out[41] = + (uint64(in[50] - in[49])) >> (24+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 28) + out[42] = + (uint64(in[51] - in[50])) >> (36+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 16) + out[43] = + (uint64(in[52] - in[51])) >> (48+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 4) | + ((uint64(in[54] - in[53])) >> ntz << 56) + out[44] = + (uint64(in[54] - in[53])) >> (8+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 44) + out[45] = + (uint64(in[55] - in[54])) >> (20+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 32) + out[46] = + (uint64(in[56] - in[55])) >> (32+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 20) + out[47] = + (uint64(in[57] - in[56])) >> (44+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 8) | + ((uint64(in[59] - in[58])) >> ntz << 60) + out[48] = + (uint64(in[59] - in[58])) >> (4+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 48) + out[49] = + (uint64(in[60] - in[59])) >> (16+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 36) + out[50] = + (uint64(in[61] - in[60])) >> (28+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 24) + out[51] = + (uint64(in[62] - in[61])) >> (40+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 12) +} + +func deltapack_int64_53(initoffset int64, in *[64]int64, out *[53]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 53) + out[1] = + (uint64(in[1] - in[0])) >> (11+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 42) + out[2] = + (uint64(in[2] - in[1])) >> (22+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 31) + out[3] = + (uint64(in[3] - in[2])) >> (33+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 20) + out[4] = + (uint64(in[4] - in[3])) >> (44+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 9) | + ((uint64(in[6] - in[5])) >> ntz << 62) + out[5] = + (uint64(in[6] - in[5])) >> (2+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 51) + out[6] = + (uint64(in[7] - in[6])) >> (13+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 40) + out[7] = + (uint64(in[8] - in[7])) >> (24+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 29) + out[8] = + (uint64(in[9] - in[8])) >> (35+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 18) + out[9] = + (uint64(in[10] - in[9])) >> (46+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 7) | + ((uint64(in[12] - in[11])) >> ntz << 60) + out[10] = + (uint64(in[12] - in[11])) >> (4+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 49) + out[11] = + (uint64(in[13] - in[12])) >> (15+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 38) + out[12] = + (uint64(in[14] - in[13])) >> (26+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 27) + out[13] = + (uint64(in[15] - in[14])) >> (37+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) + out[14] = + (uint64(in[16] - in[15])) >> (48+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 5) | + ((uint64(in[18] - in[17])) >> ntz << 58) + out[15] = + (uint64(in[18] - in[17])) >> (6+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 47) + out[16] = + (uint64(in[19] - in[18])) >> (17+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 36) + out[17] = + (uint64(in[20] - in[19])) >> (28+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 25) + out[18] = + (uint64(in[21] - in[20])) >> (39+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 14) + out[19] = + (uint64(in[22] - in[21])) >> (50+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 3) | + ((uint64(in[24] - in[23])) >> ntz << 56) + out[20] = + (uint64(in[24] - in[23])) >> (8+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 45) + out[21] = + (uint64(in[25] - in[24])) >> (19+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 34) + out[22] = + (uint64(in[26] - in[25])) >> (30+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 23) + out[23] = + (uint64(in[27] - in[26])) >> (41+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 12) + out[24] = + (uint64(in[28] - in[27])) >> (52+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 1) | + ((uint64(in[30] - in[29])) >> ntz << 54) + out[25] = + (uint64(in[30] - in[29])) >> (10+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 43) + out[26] = + (uint64(in[31] - in[30])) >> (21+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[27] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 21) + out[28] = + (uint64(in[33] - in[32])) >> (43+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 10) | + ((uint64(in[35] - in[34])) >> ntz << 63) + out[29] = + (uint64(in[35] - in[34])) >> (1+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 52) + out[30] = + (uint64(in[36] - in[35])) >> (12+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 41) + out[31] = + (uint64(in[37] - in[36])) >> (23+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 30) + out[32] = + (uint64(in[38] - in[37])) >> (34+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 19) + out[33] = + (uint64(in[39] - in[38])) >> (45+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 8) | + ((uint64(in[41] - in[40])) >> ntz << 61) + out[34] = + (uint64(in[41] - in[40])) >> (3+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 50) + out[35] = + (uint64(in[42] - in[41])) >> (14+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 39) + out[36] = + (uint64(in[43] - in[42])) >> (25+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 28) + out[37] = + (uint64(in[44] - in[43])) >> (36+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 17) + out[38] = + (uint64(in[45] - in[44])) >> (47+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 6) | + ((uint64(in[47] - in[46])) >> ntz << 59) + out[39] = + (uint64(in[47] - in[46])) >> (5+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[40] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 37) + out[41] = + (uint64(in[49] - in[48])) >> (27+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 26) + out[42] = + (uint64(in[50] - in[49])) >> (38+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 15) + out[43] = + (uint64(in[51] - in[50])) >> (49+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 4) | + ((uint64(in[53] - in[52])) >> ntz << 57) + out[44] = + (uint64(in[53] - in[52])) >> (7+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 46) + out[45] = + (uint64(in[54] - in[53])) >> (18+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 35) + out[46] = + (uint64(in[55] - in[54])) >> (29+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 24) + out[47] = + (uint64(in[56] - in[55])) >> (40+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 13) + out[48] = + (uint64(in[57] - in[56])) >> (51+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 2) | + ((uint64(in[59] - in[58])) >> ntz << 55) + out[49] = + (uint64(in[59] - in[58])) >> (9+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 44) + out[50] = + (uint64(in[60] - in[59])) >> (20+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 33) + out[51] = + (uint64(in[61] - in[60])) >> (31+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 22) + out[52] = + (uint64(in[62] - in[61])) >> (42+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 11) +} + +func deltapack_int64_54(initoffset int64, in *[64]int64, out *[54]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 54) + out[1] = + (uint64(in[1] - in[0])) >> (10+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 44) + out[2] = + (uint64(in[2] - in[1])) >> (20+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 34) + out[3] = + (uint64(in[3] - in[2])) >> (30+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 24) + out[4] = + (uint64(in[4] - in[3])) >> (40+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 14) + out[5] = + (uint64(in[5] - in[4])) >> (50+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 4) | + ((uint64(in[7] - in[6])) >> ntz << 58) + out[6] = + (uint64(in[7] - in[6])) >> (6+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 48) + out[7] = + (uint64(in[8] - in[7])) >> (16+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 38) + out[8] = + (uint64(in[9] - in[8])) >> (26+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 28) + out[9] = + (uint64(in[10] - in[9])) >> (36+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 18) + out[10] = + (uint64(in[11] - in[10])) >> (46+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 8) | + ((uint64(in[13] - in[12])) >> ntz << 62) + out[11] = + (uint64(in[13] - in[12])) >> (2+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 52) + out[12] = + (uint64(in[14] - in[13])) >> (12+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 42) + out[13] = + (uint64(in[15] - in[14])) >> (22+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[14] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 22) + out[15] = + (uint64(in[17] - in[16])) >> (42+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 12) + out[16] = + (uint64(in[18] - in[17])) >> (52+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 2) | + ((uint64(in[20] - in[19])) >> ntz << 56) + out[17] = + (uint64(in[20] - in[19])) >> (8+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 46) + out[18] = + (uint64(in[21] - in[20])) >> (18+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 36) + out[19] = + (uint64(in[22] - in[21])) >> (28+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 26) + out[20] = + (uint64(in[23] - in[22])) >> (38+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 16) + out[21] = + (uint64(in[24] - in[23])) >> (48+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 6) | + ((uint64(in[26] - in[25])) >> ntz << 60) + out[22] = + (uint64(in[26] - in[25])) >> (4+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 50) + out[23] = + (uint64(in[27] - in[26])) >> (14+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 40) + out[24] = + (uint64(in[28] - in[27])) >> (24+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 30) + out[25] = + (uint64(in[29] - in[28])) >> (34+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 20) + out[26] = + (uint64(in[30] - in[29])) >> (44+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 10) + out[27] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 54) + out[28] = + (uint64(in[33] - in[32])) >> (10+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 44) + out[29] = + (uint64(in[34] - in[33])) >> (20+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 34) + out[30] = + (uint64(in[35] - in[34])) >> (30+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 24) + out[31] = + (uint64(in[36] - in[35])) >> (40+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 14) + out[32] = + (uint64(in[37] - in[36])) >> (50+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 4) | + ((uint64(in[39] - in[38])) >> ntz << 58) + out[33] = + (uint64(in[39] - in[38])) >> (6+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 48) + out[34] = + (uint64(in[40] - in[39])) >> (16+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 38) + out[35] = + (uint64(in[41] - in[40])) >> (26+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 28) + out[36] = + (uint64(in[42] - in[41])) >> (36+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 18) + out[37] = + (uint64(in[43] - in[42])) >> (46+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 8) | + ((uint64(in[45] - in[44])) >> ntz << 62) + out[38] = + (uint64(in[45] - in[44])) >> (2+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 52) + out[39] = + (uint64(in[46] - in[45])) >> (12+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 42) + out[40] = + (uint64(in[47] - in[46])) >> (22+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[41] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 22) + out[42] = + (uint64(in[49] - in[48])) >> (42+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 12) + out[43] = + (uint64(in[50] - in[49])) >> (52+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 2) | + ((uint64(in[52] - in[51])) >> ntz << 56) + out[44] = + (uint64(in[52] - in[51])) >> (8+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 46) + out[45] = + (uint64(in[53] - in[52])) >> (18+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 36) + out[46] = + (uint64(in[54] - in[53])) >> (28+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 26) + out[47] = + (uint64(in[55] - in[54])) >> (38+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 16) + out[48] = + (uint64(in[56] - in[55])) >> (48+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 6) | + ((uint64(in[58] - in[57])) >> ntz << 60) + out[49] = + (uint64(in[58] - in[57])) >> (4+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 50) + out[50] = + (uint64(in[59] - in[58])) >> (14+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 40) + out[51] = + (uint64(in[60] - in[59])) >> (24+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 30) + out[52] = + (uint64(in[61] - in[60])) >> (34+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 20) + out[53] = + (uint64(in[62] - in[61])) >> (44+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 10) +} + +func deltapack_int64_55(initoffset int64, in *[64]int64, out *[55]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 55) + out[1] = + (uint64(in[1] - in[0])) >> (9+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 46) + out[2] = + (uint64(in[2] - in[1])) >> (18+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 37) + out[3] = + (uint64(in[3] - in[2])) >> (27+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 28) + out[4] = + (uint64(in[4] - in[3])) >> (36+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 19) + out[5] = + (uint64(in[5] - in[4])) >> (45+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 10) + out[6] = + (uint64(in[6] - in[5])) >> (54+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 1) | + ((uint64(in[8] - in[7])) >> ntz << 56) + out[7] = + (uint64(in[8] - in[7])) >> (8+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 47) + out[8] = + (uint64(in[9] - in[8])) >> (17+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 38) + out[9] = + (uint64(in[10] - in[9])) >> (26+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 29) + out[10] = + (uint64(in[11] - in[10])) >> (35+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 20) + out[11] = + (uint64(in[12] - in[11])) >> (44+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 11) + out[12] = + (uint64(in[13] - in[12])) >> (53+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 2) | + ((uint64(in[15] - in[14])) >> ntz << 57) + out[13] = + (uint64(in[15] - in[14])) >> (7+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[14] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 39) + out[15] = + (uint64(in[17] - in[16])) >> (25+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 30) + out[16] = + (uint64(in[18] - in[17])) >> (34+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 21) + out[17] = + (uint64(in[19] - in[18])) >> (43+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 12) + out[18] = + (uint64(in[20] - in[19])) >> (52+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 3) | + ((uint64(in[22] - in[21])) >> ntz << 58) + out[19] = + (uint64(in[22] - in[21])) >> (6+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 49) + out[20] = + (uint64(in[23] - in[22])) >> (15+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 40) + out[21] = + (uint64(in[24] - in[23])) >> (24+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 31) + out[22] = + (uint64(in[25] - in[24])) >> (33+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 22) + out[23] = + (uint64(in[26] - in[25])) >> (42+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 13) + out[24] = + (uint64(in[27] - in[26])) >> (51+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 4) | + ((uint64(in[29] - in[28])) >> ntz << 59) + out[25] = + (uint64(in[29] - in[28])) >> (5+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 50) + out[26] = + (uint64(in[30] - in[29])) >> (14+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 41) + out[27] = + (uint64(in[31] - in[30])) >> (23+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[28] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 23) + out[29] = + (uint64(in[33] - in[32])) >> (41+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 14) + out[30] = + (uint64(in[34] - in[33])) >> (50+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 5) | + ((uint64(in[36] - in[35])) >> ntz << 60) + out[31] = + (uint64(in[36] - in[35])) >> (4+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 51) + out[32] = + (uint64(in[37] - in[36])) >> (13+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 42) + out[33] = + (uint64(in[38] - in[37])) >> (22+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 33) + out[34] = + (uint64(in[39] - in[38])) >> (31+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 24) + out[35] = + (uint64(in[40] - in[39])) >> (40+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 15) + out[36] = + (uint64(in[41] - in[40])) >> (49+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 6) | + ((uint64(in[43] - in[42])) >> ntz << 61) + out[37] = + (uint64(in[43] - in[42])) >> (3+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 52) + out[38] = + (uint64(in[44] - in[43])) >> (12+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 43) + out[39] = + (uint64(in[45] - in[44])) >> (21+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 34) + out[40] = + (uint64(in[46] - in[45])) >> (30+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 25) + out[41] = + (uint64(in[47] - in[46])) >> (39+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) + out[42] = + (uint64(in[48] - in[47])) >> (48+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 7) | + ((uint64(in[50] - in[49])) >> ntz << 62) + out[43] = + (uint64(in[50] - in[49])) >> (2+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 53) + out[44] = + (uint64(in[51] - in[50])) >> (11+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 44) + out[45] = + (uint64(in[52] - in[51])) >> (20+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 35) + out[46] = + (uint64(in[53] - in[52])) >> (29+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 26) + out[47] = + (uint64(in[54] - in[53])) >> (38+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 17) + out[48] = + (uint64(in[55] - in[54])) >> (47+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 8) | + ((uint64(in[57] - in[56])) >> ntz << 63) + out[49] = + (uint64(in[57] - in[56])) >> (1+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 54) + out[50] = + (uint64(in[58] - in[57])) >> (10+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 45) + out[51] = + (uint64(in[59] - in[58])) >> (19+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 36) + out[52] = + (uint64(in[60] - in[59])) >> (28+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 27) + out[53] = + (uint64(in[61] - in[60])) >> (37+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 18) + out[54] = + (uint64(in[62] - in[61])) >> (46+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 9) +} + +func deltapack_int64_56(initoffset int64, in *[64]int64, out *[56]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 56) + out[1] = + (uint64(in[1] - in[0])) >> (8+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 48) + out[2] = + (uint64(in[2] - in[1])) >> (16+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 40) + out[3] = + (uint64(in[3] - in[2])) >> (24+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 32) + out[4] = + (uint64(in[4] - in[3])) >> (32+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 24) + out[5] = + (uint64(in[5] - in[4])) >> (40+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 16) + out[6] = + (uint64(in[6] - in[5])) >> (48+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 8) + out[7] = + (uint64(in[8] - in[7])) >> ntz | + ((uint64(in[9] - in[8])) >> ntz << 56) + out[8] = + (uint64(in[9] - in[8])) >> (8+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 48) + out[9] = + (uint64(in[10] - in[9])) >> (16+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 40) + out[10] = + (uint64(in[11] - in[10])) >> (24+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 32) + out[11] = + (uint64(in[12] - in[11])) >> (32+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 24) + out[12] = + (uint64(in[13] - in[12])) >> (40+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 16) + out[13] = + (uint64(in[14] - in[13])) >> (48+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 8) + out[14] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 56) + out[15] = + (uint64(in[17] - in[16])) >> (8+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 48) + out[16] = + (uint64(in[18] - in[17])) >> (16+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 40) + out[17] = + (uint64(in[19] - in[18])) >> (24+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 32) + out[18] = + (uint64(in[20] - in[19])) >> (32+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 24) + out[19] = + (uint64(in[21] - in[20])) >> (40+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 16) + out[20] = + (uint64(in[22] - in[21])) >> (48+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 8) + out[21] = + (uint64(in[24] - in[23])) >> ntz | + ((uint64(in[25] - in[24])) >> ntz << 56) + out[22] = + (uint64(in[25] - in[24])) >> (8+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 48) + out[23] = + (uint64(in[26] - in[25])) >> (16+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 40) + out[24] = + (uint64(in[27] - in[26])) >> (24+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 32) + out[25] = + (uint64(in[28] - in[27])) >> (32+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 24) + out[26] = + (uint64(in[29] - in[28])) >> (40+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 16) + out[27] = + (uint64(in[30] - in[29])) >> (48+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 8) + out[28] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 56) + out[29] = + (uint64(in[33] - in[32])) >> (8+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 48) + out[30] = + (uint64(in[34] - in[33])) >> (16+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 40) + out[31] = + (uint64(in[35] - in[34])) >> (24+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 32) + out[32] = + (uint64(in[36] - in[35])) >> (32+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 24) + out[33] = + (uint64(in[37] - in[36])) >> (40+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 16) + out[34] = + (uint64(in[38] - in[37])) >> (48+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 8) + out[35] = + (uint64(in[40] - in[39])) >> ntz | + ((uint64(in[41] - in[40])) >> ntz << 56) + out[36] = + (uint64(in[41] - in[40])) >> (8+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 48) + out[37] = + (uint64(in[42] - in[41])) >> (16+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 40) + out[38] = + (uint64(in[43] - in[42])) >> (24+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 32) + out[39] = + (uint64(in[44] - in[43])) >> (32+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 24) + out[40] = + (uint64(in[45] - in[44])) >> (40+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 16) + out[41] = + (uint64(in[46] - in[45])) >> (48+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 8) + out[42] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 56) + out[43] = + (uint64(in[49] - in[48])) >> (8+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 48) + out[44] = + (uint64(in[50] - in[49])) >> (16+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 40) + out[45] = + (uint64(in[51] - in[50])) >> (24+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 32) + out[46] = + (uint64(in[52] - in[51])) >> (32+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 24) + out[47] = + (uint64(in[53] - in[52])) >> (40+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 16) + out[48] = + (uint64(in[54] - in[53])) >> (48+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 8) + out[49] = + (uint64(in[56] - in[55])) >> ntz | + ((uint64(in[57] - in[56])) >> ntz << 56) + out[50] = + (uint64(in[57] - in[56])) >> (8+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 48) + out[51] = + (uint64(in[58] - in[57])) >> (16+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 40) + out[52] = + (uint64(in[59] - in[58])) >> (24+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 32) + out[53] = + (uint64(in[60] - in[59])) >> (32+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 24) + out[54] = + (uint64(in[61] - in[60])) >> (40+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 16) + out[55] = + (uint64(in[62] - in[61])) >> (48+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 8) +} + +func deltapack_int64_57(initoffset int64, in *[64]int64, out *[57]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 57) + out[1] = + (uint64(in[1] - in[0])) >> (7+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 50) + out[2] = + (uint64(in[2] - in[1])) >> (14+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 43) + out[3] = + (uint64(in[3] - in[2])) >> (21+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 36) + out[4] = + (uint64(in[4] - in[3])) >> (28+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 29) + out[5] = + (uint64(in[5] - in[4])) >> (35+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 22) + out[6] = + (uint64(in[6] - in[5])) >> (42+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 15) + out[7] = + (uint64(in[7] - in[6])) >> (49+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 8) + out[8] = + (uint64(in[8] - in[7])) >> (56+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 1) | + ((uint64(in[10] - in[9])) >> ntz << 58) + out[9] = + (uint64(in[10] - in[9])) >> (6+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 51) + out[10] = + (uint64(in[11] - in[10])) >> (13+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 44) + out[11] = + (uint64(in[12] - in[11])) >> (20+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 37) + out[12] = + (uint64(in[13] - in[12])) >> (27+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 30) + out[13] = + (uint64(in[14] - in[13])) >> (34+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 23) + out[14] = + (uint64(in[15] - in[14])) >> (41+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) + out[15] = + (uint64(in[16] - in[15])) >> (48+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 9) + out[16] = + (uint64(in[17] - in[16])) >> (55+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 2) | + ((uint64(in[19] - in[18])) >> ntz << 59) + out[17] = + (uint64(in[19] - in[18])) >> (5+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 52) + out[18] = + (uint64(in[20] - in[19])) >> (12+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 45) + out[19] = + (uint64(in[21] - in[20])) >> (19+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 38) + out[20] = + (uint64(in[22] - in[21])) >> (26+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 31) + out[21] = + (uint64(in[23] - in[22])) >> (33+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 24) + out[22] = + (uint64(in[24] - in[23])) >> (40+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 17) + out[23] = + (uint64(in[25] - in[24])) >> (47+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 10) + out[24] = + (uint64(in[26] - in[25])) >> (54+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 3) | + ((uint64(in[28] - in[27])) >> ntz << 60) + out[25] = + (uint64(in[28] - in[27])) >> (4+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 53) + out[26] = + (uint64(in[29] - in[28])) >> (11+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 46) + out[27] = + (uint64(in[30] - in[29])) >> (18+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 39) + out[28] = + (uint64(in[31] - in[30])) >> (25+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[29] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 25) + out[30] = + (uint64(in[33] - in[32])) >> (39+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 18) + out[31] = + (uint64(in[34] - in[33])) >> (46+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 11) + out[32] = + (uint64(in[35] - in[34])) >> (53+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 4) | + ((uint64(in[37] - in[36])) >> ntz << 61) + out[33] = + (uint64(in[37] - in[36])) >> (3+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 54) + out[34] = + (uint64(in[38] - in[37])) >> (10+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 47) + out[35] = + (uint64(in[39] - in[38])) >> (17+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 40) + out[36] = + (uint64(in[40] - in[39])) >> (24+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 33) + out[37] = + (uint64(in[41] - in[40])) >> (31+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 26) + out[38] = + (uint64(in[42] - in[41])) >> (38+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 19) + out[39] = + (uint64(in[43] - in[42])) >> (45+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 12) + out[40] = + (uint64(in[44] - in[43])) >> (52+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 5) | + ((uint64(in[46] - in[45])) >> ntz << 62) + out[41] = + (uint64(in[46] - in[45])) >> (2+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 55) + out[42] = + (uint64(in[47] - in[46])) >> (9+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[43] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 41) + out[44] = + (uint64(in[49] - in[48])) >> (23+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 34) + out[45] = + (uint64(in[50] - in[49])) >> (30+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 27) + out[46] = + (uint64(in[51] - in[50])) >> (37+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 20) + out[47] = + (uint64(in[52] - in[51])) >> (44+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 13) + out[48] = + (uint64(in[53] - in[52])) >> (51+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 6) | + ((uint64(in[55] - in[54])) >> ntz << 63) + out[49] = + (uint64(in[55] - in[54])) >> (1+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 56) + out[50] = + (uint64(in[56] - in[55])) >> (8+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 49) + out[51] = + (uint64(in[57] - in[56])) >> (15+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 42) + out[52] = + (uint64(in[58] - in[57])) >> (22+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 35) + out[53] = + (uint64(in[59] - in[58])) >> (29+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 28) + out[54] = + (uint64(in[60] - in[59])) >> (36+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 21) + out[55] = + (uint64(in[61] - in[60])) >> (43+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 14) + out[56] = + (uint64(in[62] - in[61])) >> (50+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 7) +} + +func deltapack_int64_58(initoffset int64, in *[64]int64, out *[58]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 58) + out[1] = + (uint64(in[1] - in[0])) >> (6+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 52) + out[2] = + (uint64(in[2] - in[1])) >> (12+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 46) + out[3] = + (uint64(in[3] - in[2])) >> (18+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 40) + out[4] = + (uint64(in[4] - in[3])) >> (24+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 34) + out[5] = + (uint64(in[5] - in[4])) >> (30+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 28) + out[6] = + (uint64(in[6] - in[5])) >> (36+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 22) + out[7] = + (uint64(in[7] - in[6])) >> (42+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 16) + out[8] = + (uint64(in[8] - in[7])) >> (48+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 10) + out[9] = + (uint64(in[9] - in[8])) >> (54+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 4) | + ((uint64(in[11] - in[10])) >> ntz << 62) + out[10] = + (uint64(in[11] - in[10])) >> (2+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 56) + out[11] = + (uint64(in[12] - in[11])) >> (8+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 50) + out[12] = + (uint64(in[13] - in[12])) >> (14+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 44) + out[13] = + (uint64(in[14] - in[13])) >> (20+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 38) + out[14] = + (uint64(in[15] - in[14])) >> (26+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[15] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 26) + out[16] = + (uint64(in[17] - in[16])) >> (38+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 20) + out[17] = + (uint64(in[18] - in[17])) >> (44+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 14) + out[18] = + (uint64(in[19] - in[18])) >> (50+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 8) + out[19] = + (uint64(in[20] - in[19])) >> (56+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 2) | + ((uint64(in[22] - in[21])) >> ntz << 60) + out[20] = + (uint64(in[22] - in[21])) >> (4+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 54) + out[21] = + (uint64(in[23] - in[22])) >> (10+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 48) + out[22] = + (uint64(in[24] - in[23])) >> (16+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 42) + out[23] = + (uint64(in[25] - in[24])) >> (22+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 36) + out[24] = + (uint64(in[26] - in[25])) >> (28+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 30) + out[25] = + (uint64(in[27] - in[26])) >> (34+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 24) + out[26] = + (uint64(in[28] - in[27])) >> (40+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 18) + out[27] = + (uint64(in[29] - in[28])) >> (46+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 12) + out[28] = + (uint64(in[30] - in[29])) >> (52+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 6) + out[29] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 58) + out[30] = + (uint64(in[33] - in[32])) >> (6+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 52) + out[31] = + (uint64(in[34] - in[33])) >> (12+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 46) + out[32] = + (uint64(in[35] - in[34])) >> (18+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 40) + out[33] = + (uint64(in[36] - in[35])) >> (24+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 34) + out[34] = + (uint64(in[37] - in[36])) >> (30+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 28) + out[35] = + (uint64(in[38] - in[37])) >> (36+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 22) + out[36] = + (uint64(in[39] - in[38])) >> (42+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 16) + out[37] = + (uint64(in[40] - in[39])) >> (48+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 10) + out[38] = + (uint64(in[41] - in[40])) >> (54+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 4) | + ((uint64(in[43] - in[42])) >> ntz << 62) + out[39] = + (uint64(in[43] - in[42])) >> (2+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 56) + out[40] = + (uint64(in[44] - in[43])) >> (8+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 50) + out[41] = + (uint64(in[45] - in[44])) >> (14+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 44) + out[42] = + (uint64(in[46] - in[45])) >> (20+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 38) + out[43] = + (uint64(in[47] - in[46])) >> (26+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[44] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 26) + out[45] = + (uint64(in[49] - in[48])) >> (38+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 20) + out[46] = + (uint64(in[50] - in[49])) >> (44+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 14) + out[47] = + (uint64(in[51] - in[50])) >> (50+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 8) + out[48] = + (uint64(in[52] - in[51])) >> (56+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 2) | + ((uint64(in[54] - in[53])) >> ntz << 60) + out[49] = + (uint64(in[54] - in[53])) >> (4+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 54) + out[50] = + (uint64(in[55] - in[54])) >> (10+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 48) + out[51] = + (uint64(in[56] - in[55])) >> (16+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 42) + out[52] = + (uint64(in[57] - in[56])) >> (22+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 36) + out[53] = + (uint64(in[58] - in[57])) >> (28+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 30) + out[54] = + (uint64(in[59] - in[58])) >> (34+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 24) + out[55] = + (uint64(in[60] - in[59])) >> (40+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 18) + out[56] = + (uint64(in[61] - in[60])) >> (46+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 12) + out[57] = + (uint64(in[62] - in[61])) >> (52+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 6) +} + +func deltapack_int64_59(initoffset int64, in *[64]int64, out *[59]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 59) + out[1] = + (uint64(in[1] - in[0])) >> (5+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 54) + out[2] = + (uint64(in[2] - in[1])) >> (10+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 49) + out[3] = + (uint64(in[3] - in[2])) >> (15+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 44) + out[4] = + (uint64(in[4] - in[3])) >> (20+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 39) + out[5] = + (uint64(in[5] - in[4])) >> (25+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 34) + out[6] = + (uint64(in[6] - in[5])) >> (30+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 29) + out[7] = + (uint64(in[7] - in[6])) >> (35+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 24) + out[8] = + (uint64(in[8] - in[7])) >> (40+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 19) + out[9] = + (uint64(in[9] - in[8])) >> (45+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 14) + out[10] = + (uint64(in[10] - in[9])) >> (50+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 9) + out[11] = + (uint64(in[11] - in[10])) >> (55+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 4) | + ((uint64(in[13] - in[12])) >> ntz << 63) + out[12] = + (uint64(in[13] - in[12])) >> (1+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 58) + out[13] = + (uint64(in[14] - in[13])) >> (6+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 53) + out[14] = + (uint64(in[15] - in[14])) >> (11+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[15] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 43) + out[16] = + (uint64(in[17] - in[16])) >> (21+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 38) + out[17] = + (uint64(in[18] - in[17])) >> (26+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 33) + out[18] = + (uint64(in[19] - in[18])) >> (31+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 28) + out[19] = + (uint64(in[20] - in[19])) >> (36+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 23) + out[20] = + (uint64(in[21] - in[20])) >> (41+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 18) + out[21] = + (uint64(in[22] - in[21])) >> (46+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 13) + out[22] = + (uint64(in[23] - in[22])) >> (51+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 8) + out[23] = + (uint64(in[24] - in[23])) >> (56+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 3) | + ((uint64(in[26] - in[25])) >> ntz << 62) + out[24] = + (uint64(in[26] - in[25])) >> (2+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 57) + out[25] = + (uint64(in[27] - in[26])) >> (7+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 52) + out[26] = + (uint64(in[28] - in[27])) >> (12+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 47) + out[27] = + (uint64(in[29] - in[28])) >> (17+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 42) + out[28] = + (uint64(in[30] - in[29])) >> (22+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 37) + out[29] = + (uint64(in[31] - in[30])) >> (27+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[30] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 27) + out[31] = + (uint64(in[33] - in[32])) >> (37+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 22) + out[32] = + (uint64(in[34] - in[33])) >> (42+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 17) + out[33] = + (uint64(in[35] - in[34])) >> (47+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 12) + out[34] = + (uint64(in[36] - in[35])) >> (52+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 7) + out[35] = + (uint64(in[37] - in[36])) >> (57+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 2) | + ((uint64(in[39] - in[38])) >> ntz << 61) + out[36] = + (uint64(in[39] - in[38])) >> (3+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 56) + out[37] = + (uint64(in[40] - in[39])) >> (8+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 51) + out[38] = + (uint64(in[41] - in[40])) >> (13+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 46) + out[39] = + (uint64(in[42] - in[41])) >> (18+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 41) + out[40] = + (uint64(in[43] - in[42])) >> (23+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 36) + out[41] = + (uint64(in[44] - in[43])) >> (28+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 31) + out[42] = + (uint64(in[45] - in[44])) >> (33+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 26) + out[43] = + (uint64(in[46] - in[45])) >> (38+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 21) + out[44] = + (uint64(in[47] - in[46])) >> (43+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) + out[45] = + (uint64(in[48] - in[47])) >> (48+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 11) + out[46] = + (uint64(in[49] - in[48])) >> (53+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 6) + out[47] = + (uint64(in[50] - in[49])) >> (58+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 1) | + ((uint64(in[52] - in[51])) >> ntz << 60) + out[48] = + (uint64(in[52] - in[51])) >> (4+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 55) + out[49] = + (uint64(in[53] - in[52])) >> (9+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 50) + out[50] = + (uint64(in[54] - in[53])) >> (14+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 45) + out[51] = + (uint64(in[55] - in[54])) >> (19+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 40) + out[52] = + (uint64(in[56] - in[55])) >> (24+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 35) + out[53] = + (uint64(in[57] - in[56])) >> (29+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 30) + out[54] = + (uint64(in[58] - in[57])) >> (34+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 25) + out[55] = + (uint64(in[59] - in[58])) >> (39+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 20) + out[56] = + (uint64(in[60] - in[59])) >> (44+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 15) + out[57] = + (uint64(in[61] - in[60])) >> (49+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 10) + out[58] = + (uint64(in[62] - in[61])) >> (54+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 5) +} + +func deltapack_int64_60(initoffset int64, in *[64]int64, out *[60]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 60) + out[1] = + (uint64(in[1] - in[0])) >> (4+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 56) + out[2] = + (uint64(in[2] - in[1])) >> (8+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 52) + out[3] = + (uint64(in[3] - in[2])) >> (12+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 48) + out[4] = + (uint64(in[4] - in[3])) >> (16+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 44) + out[5] = + (uint64(in[5] - in[4])) >> (20+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 40) + out[6] = + (uint64(in[6] - in[5])) >> (24+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 36) + out[7] = + (uint64(in[7] - in[6])) >> (28+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 32) + out[8] = + (uint64(in[8] - in[7])) >> (32+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 28) + out[9] = + (uint64(in[9] - in[8])) >> (36+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 24) + out[10] = + (uint64(in[10] - in[9])) >> (40+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 20) + out[11] = + (uint64(in[11] - in[10])) >> (44+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 16) + out[12] = + (uint64(in[12] - in[11])) >> (48+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 12) + out[13] = + (uint64(in[13] - in[12])) >> (52+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 8) + out[14] = + (uint64(in[14] - in[13])) >> (56+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 4) + out[15] = + (uint64(in[16] - in[15])) >> ntz | + ((uint64(in[17] - in[16])) >> ntz << 60) + out[16] = + (uint64(in[17] - in[16])) >> (4+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 56) + out[17] = + (uint64(in[18] - in[17])) >> (8+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 52) + out[18] = + (uint64(in[19] - in[18])) >> (12+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 48) + out[19] = + (uint64(in[20] - in[19])) >> (16+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 44) + out[20] = + (uint64(in[21] - in[20])) >> (20+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 40) + out[21] = + (uint64(in[22] - in[21])) >> (24+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 36) + out[22] = + (uint64(in[23] - in[22])) >> (28+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 32) + out[23] = + (uint64(in[24] - in[23])) >> (32+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 28) + out[24] = + (uint64(in[25] - in[24])) >> (36+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 24) + out[25] = + (uint64(in[26] - in[25])) >> (40+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 20) + out[26] = + (uint64(in[27] - in[26])) >> (44+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 16) + out[27] = + (uint64(in[28] - in[27])) >> (48+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 12) + out[28] = + (uint64(in[29] - in[28])) >> (52+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 8) + out[29] = + (uint64(in[30] - in[29])) >> (56+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 4) + out[30] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 60) + out[31] = + (uint64(in[33] - in[32])) >> (4+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 56) + out[32] = + (uint64(in[34] - in[33])) >> (8+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 52) + out[33] = + (uint64(in[35] - in[34])) >> (12+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 48) + out[34] = + (uint64(in[36] - in[35])) >> (16+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 44) + out[35] = + (uint64(in[37] - in[36])) >> (20+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 40) + out[36] = + (uint64(in[38] - in[37])) >> (24+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 36) + out[37] = + (uint64(in[39] - in[38])) >> (28+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 32) + out[38] = + (uint64(in[40] - in[39])) >> (32+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 28) + out[39] = + (uint64(in[41] - in[40])) >> (36+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 24) + out[40] = + (uint64(in[42] - in[41])) >> (40+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 20) + out[41] = + (uint64(in[43] - in[42])) >> (44+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 16) + out[42] = + (uint64(in[44] - in[43])) >> (48+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 12) + out[43] = + (uint64(in[45] - in[44])) >> (52+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 8) + out[44] = + (uint64(in[46] - in[45])) >> (56+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 4) + out[45] = + (uint64(in[48] - in[47])) >> ntz | + ((uint64(in[49] - in[48])) >> ntz << 60) + out[46] = + (uint64(in[49] - in[48])) >> (4+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 56) + out[47] = + (uint64(in[50] - in[49])) >> (8+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 52) + out[48] = + (uint64(in[51] - in[50])) >> (12+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 48) + out[49] = + (uint64(in[52] - in[51])) >> (16+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 44) + out[50] = + (uint64(in[53] - in[52])) >> (20+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 40) + out[51] = + (uint64(in[54] - in[53])) >> (24+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 36) + out[52] = + (uint64(in[55] - in[54])) >> (28+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 32) + out[53] = + (uint64(in[56] - in[55])) >> (32+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 28) + out[54] = + (uint64(in[57] - in[56])) >> (36+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 24) + out[55] = + (uint64(in[58] - in[57])) >> (40+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 20) + out[56] = + (uint64(in[59] - in[58])) >> (44+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 16) + out[57] = + (uint64(in[60] - in[59])) >> (48+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 12) + out[58] = + (uint64(in[61] - in[60])) >> (52+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 8) + out[59] = + (uint64(in[62] - in[61])) >> (56+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 4) +} + +func deltapack_int64_61(initoffset int64, in *[64]int64, out *[61]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 61) + out[1] = + (uint64(in[1] - in[0])) >> (3+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 58) + out[2] = + (uint64(in[2] - in[1])) >> (6+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 55) + out[3] = + (uint64(in[3] - in[2])) >> (9+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 52) + out[4] = + (uint64(in[4] - in[3])) >> (12+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 49) + out[5] = + (uint64(in[5] - in[4])) >> (15+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 46) + out[6] = + (uint64(in[6] - in[5])) >> (18+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 43) + out[7] = + (uint64(in[7] - in[6])) >> (21+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 40) + out[8] = + (uint64(in[8] - in[7])) >> (24+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 37) + out[9] = + (uint64(in[9] - in[8])) >> (27+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 34) + out[10] = + (uint64(in[10] - in[9])) >> (30+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 31) + out[11] = + (uint64(in[11] - in[10])) >> (33+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 28) + out[12] = + (uint64(in[12] - in[11])) >> (36+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 25) + out[13] = + (uint64(in[13] - in[12])) >> (39+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 22) + out[14] = + (uint64(in[14] - in[13])) >> (42+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 19) + out[15] = + (uint64(in[15] - in[14])) >> (45+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 16) + out[16] = + (uint64(in[16] - in[15])) >> (48+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 13) + out[17] = + (uint64(in[17] - in[16])) >> (51+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 10) + out[18] = + (uint64(in[18] - in[17])) >> (54+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 7) + out[19] = + (uint64(in[19] - in[18])) >> (57+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 4) + out[20] = + (uint64(in[20] - in[19])) >> (60+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 1) | + ((uint64(in[22] - in[21])) >> ntz << 62) + out[21] = + (uint64(in[22] - in[21])) >> (2+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 59) + out[22] = + (uint64(in[23] - in[22])) >> (5+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 56) + out[23] = + (uint64(in[24] - in[23])) >> (8+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 53) + out[24] = + (uint64(in[25] - in[24])) >> (11+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 50) + out[25] = + (uint64(in[26] - in[25])) >> (14+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 47) + out[26] = + (uint64(in[27] - in[26])) >> (17+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 44) + out[27] = + (uint64(in[28] - in[27])) >> (20+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 41) + out[28] = + (uint64(in[29] - in[28])) >> (23+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 38) + out[29] = + (uint64(in[30] - in[29])) >> (26+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 35) + out[30] = + (uint64(in[31] - in[30])) >> (29+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[31] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 29) + out[32] = + (uint64(in[33] - in[32])) >> (35+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 26) + out[33] = + (uint64(in[34] - in[33])) >> (38+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 23) + out[34] = + (uint64(in[35] - in[34])) >> (41+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 20) + out[35] = + (uint64(in[36] - in[35])) >> (44+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 17) + out[36] = + (uint64(in[37] - in[36])) >> (47+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 14) + out[37] = + (uint64(in[38] - in[37])) >> (50+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 11) + out[38] = + (uint64(in[39] - in[38])) >> (53+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 8) + out[39] = + (uint64(in[40] - in[39])) >> (56+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 5) + out[40] = + (uint64(in[41] - in[40])) >> (59+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 2) | + ((uint64(in[43] - in[42])) >> ntz << 63) + out[41] = + (uint64(in[43] - in[42])) >> (1+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 60) + out[42] = + (uint64(in[44] - in[43])) >> (4+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 57) + out[43] = + (uint64(in[45] - in[44])) >> (7+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 54) + out[44] = + (uint64(in[46] - in[45])) >> (10+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 51) + out[45] = + (uint64(in[47] - in[46])) >> (13+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 48) + out[46] = + (uint64(in[48] - in[47])) >> (16+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 45) + out[47] = + (uint64(in[49] - in[48])) >> (19+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 42) + out[48] = + (uint64(in[50] - in[49])) >> (22+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 39) + out[49] = + (uint64(in[51] - in[50])) >> (25+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 36) + out[50] = + (uint64(in[52] - in[51])) >> (28+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 33) + out[51] = + (uint64(in[53] - in[52])) >> (31+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 30) + out[52] = + (uint64(in[54] - in[53])) >> (34+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 27) + out[53] = + (uint64(in[55] - in[54])) >> (37+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 24) + out[54] = + (uint64(in[56] - in[55])) >> (40+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 21) + out[55] = + (uint64(in[57] - in[56])) >> (43+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 18) + out[56] = + (uint64(in[58] - in[57])) >> (46+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 15) + out[57] = + (uint64(in[59] - in[58])) >> (49+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 12) + out[58] = + (uint64(in[60] - in[59])) >> (52+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 9) + out[59] = + (uint64(in[61] - in[60])) >> (55+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 6) + out[60] = + (uint64(in[62] - in[61])) >> (58+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 3) +} + +func deltapack_int64_62(initoffset int64, in *[64]int64, out *[62]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 62) + out[1] = + (uint64(in[1] - in[0])) >> (2+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 60) + out[2] = + (uint64(in[2] - in[1])) >> (4+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 58) + out[3] = + (uint64(in[3] - in[2])) >> (6+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 56) + out[4] = + (uint64(in[4] - in[3])) >> (8+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 54) + out[5] = + (uint64(in[5] - in[4])) >> (10+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 52) + out[6] = + (uint64(in[6] - in[5])) >> (12+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 50) + out[7] = + (uint64(in[7] - in[6])) >> (14+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 48) + out[8] = + (uint64(in[8] - in[7])) >> (16+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 46) + out[9] = + (uint64(in[9] - in[8])) >> (18+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 44) + out[10] = + (uint64(in[10] - in[9])) >> (20+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 42) + out[11] = + (uint64(in[11] - in[10])) >> (22+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 40) + out[12] = + (uint64(in[12] - in[11])) >> (24+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 38) + out[13] = + (uint64(in[13] - in[12])) >> (26+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 36) + out[14] = + (uint64(in[14] - in[13])) >> (28+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 34) + out[15] = + (uint64(in[15] - in[14])) >> (30+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 32) + out[16] = + (uint64(in[16] - in[15])) >> (32+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 30) + out[17] = + (uint64(in[17] - in[16])) >> (34+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 28) + out[18] = + (uint64(in[18] - in[17])) >> (36+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 26) + out[19] = + (uint64(in[19] - in[18])) >> (38+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 24) + out[20] = + (uint64(in[20] - in[19])) >> (40+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 22) + out[21] = + (uint64(in[21] - in[20])) >> (42+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 20) + out[22] = + (uint64(in[22] - in[21])) >> (44+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 18) + out[23] = + (uint64(in[23] - in[22])) >> (46+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 16) + out[24] = + (uint64(in[24] - in[23])) >> (48+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 14) + out[25] = + (uint64(in[25] - in[24])) >> (50+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 12) + out[26] = + (uint64(in[26] - in[25])) >> (52+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 10) + out[27] = + (uint64(in[27] - in[26])) >> (54+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 8) + out[28] = + (uint64(in[28] - in[27])) >> (56+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 6) + out[29] = + (uint64(in[29] - in[28])) >> (58+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 4) + out[30] = + (uint64(in[30] - in[29])) >> (60+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 2) + out[31] = + (uint64(in[32] - in[31])) >> ntz | + ((uint64(in[33] - in[32])) >> ntz << 62) + out[32] = + (uint64(in[33] - in[32])) >> (2+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 60) + out[33] = + (uint64(in[34] - in[33])) >> (4+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 58) + out[34] = + (uint64(in[35] - in[34])) >> (6+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 56) + out[35] = + (uint64(in[36] - in[35])) >> (8+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 54) + out[36] = + (uint64(in[37] - in[36])) >> (10+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 52) + out[37] = + (uint64(in[38] - in[37])) >> (12+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 50) + out[38] = + (uint64(in[39] - in[38])) >> (14+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 48) + out[39] = + (uint64(in[40] - in[39])) >> (16+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 46) + out[40] = + (uint64(in[41] - in[40])) >> (18+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 44) + out[41] = + (uint64(in[42] - in[41])) >> (20+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 42) + out[42] = + (uint64(in[43] - in[42])) >> (22+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 40) + out[43] = + (uint64(in[44] - in[43])) >> (24+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 38) + out[44] = + (uint64(in[45] - in[44])) >> (26+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 36) + out[45] = + (uint64(in[46] - in[45])) >> (28+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 34) + out[46] = + (uint64(in[47] - in[46])) >> (30+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 32) + out[47] = + (uint64(in[48] - in[47])) >> (32+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 30) + out[48] = + (uint64(in[49] - in[48])) >> (34+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 28) + out[49] = + (uint64(in[50] - in[49])) >> (36+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 26) + out[50] = + (uint64(in[51] - in[50])) >> (38+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 24) + out[51] = + (uint64(in[52] - in[51])) >> (40+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 22) + out[52] = + (uint64(in[53] - in[52])) >> (42+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 20) + out[53] = + (uint64(in[54] - in[53])) >> (44+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 18) + out[54] = + (uint64(in[55] - in[54])) >> (46+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 16) + out[55] = + (uint64(in[56] - in[55])) >> (48+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 14) + out[56] = + (uint64(in[57] - in[56])) >> (50+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 12) + out[57] = + (uint64(in[58] - in[57])) >> (52+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 10) + out[58] = + (uint64(in[59] - in[58])) >> (54+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 8) + out[59] = + (uint64(in[60] - in[59])) >> (56+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 6) + out[60] = + (uint64(in[61] - in[60])) >> (58+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 4) + out[61] = + (uint64(in[62] - in[61])) >> (60+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 2) +} + +func deltapack_int64_63(initoffset int64, in *[64]int64, out *[63]uint64, ntz int) { + out[0] = + (uint64(in[0] - initoffset)) >> ntz | + ((uint64(in[1] - in[0])) >> ntz << 63) + out[1] = + (uint64(in[1] - in[0])) >> (1+ntz) | + ((uint64(in[2] - in[1])) >> ntz << 62) + out[2] = + (uint64(in[2] - in[1])) >> (2+ntz) | + ((uint64(in[3] - in[2])) >> ntz << 61) + out[3] = + (uint64(in[3] - in[2])) >> (3+ntz) | + ((uint64(in[4] - in[3])) >> ntz << 60) + out[4] = + (uint64(in[4] - in[3])) >> (4+ntz) | + ((uint64(in[5] - in[4])) >> ntz << 59) + out[5] = + (uint64(in[5] - in[4])) >> (5+ntz) | + ((uint64(in[6] - in[5])) >> ntz << 58) + out[6] = + (uint64(in[6] - in[5])) >> (6+ntz) | + ((uint64(in[7] - in[6])) >> ntz << 57) + out[7] = + (uint64(in[7] - in[6])) >> (7+ntz) | + ((uint64(in[8] - in[7])) >> ntz << 56) + out[8] = + (uint64(in[8] - in[7])) >> (8+ntz) | + ((uint64(in[9] - in[8])) >> ntz << 55) + out[9] = + (uint64(in[9] - in[8])) >> (9+ntz) | + ((uint64(in[10] - in[9])) >> ntz << 54) + out[10] = + (uint64(in[10] - in[9])) >> (10+ntz) | + ((uint64(in[11] - in[10])) >> ntz << 53) + out[11] = + (uint64(in[11] - in[10])) >> (11+ntz) | + ((uint64(in[12] - in[11])) >> ntz << 52) + out[12] = + (uint64(in[12] - in[11])) >> (12+ntz) | + ((uint64(in[13] - in[12])) >> ntz << 51) + out[13] = + (uint64(in[13] - in[12])) >> (13+ntz) | + ((uint64(in[14] - in[13])) >> ntz << 50) + out[14] = + (uint64(in[14] - in[13])) >> (14+ntz) | + ((uint64(in[15] - in[14])) >> ntz << 49) + out[15] = + (uint64(in[15] - in[14])) >> (15+ntz) | + ((uint64(in[16] - in[15])) >> ntz << 48) + out[16] = + (uint64(in[16] - in[15])) >> (16+ntz) | + ((uint64(in[17] - in[16])) >> ntz << 47) + out[17] = + (uint64(in[17] - in[16])) >> (17+ntz) | + ((uint64(in[18] - in[17])) >> ntz << 46) + out[18] = + (uint64(in[18] - in[17])) >> (18+ntz) | + ((uint64(in[19] - in[18])) >> ntz << 45) + out[19] = + (uint64(in[19] - in[18])) >> (19+ntz) | + ((uint64(in[20] - in[19])) >> ntz << 44) + out[20] = + (uint64(in[20] - in[19])) >> (20+ntz) | + ((uint64(in[21] - in[20])) >> ntz << 43) + out[21] = + (uint64(in[21] - in[20])) >> (21+ntz) | + ((uint64(in[22] - in[21])) >> ntz << 42) + out[22] = + (uint64(in[22] - in[21])) >> (22+ntz) | + ((uint64(in[23] - in[22])) >> ntz << 41) + out[23] = + (uint64(in[23] - in[22])) >> (23+ntz) | + ((uint64(in[24] - in[23])) >> ntz << 40) + out[24] = + (uint64(in[24] - in[23])) >> (24+ntz) | + ((uint64(in[25] - in[24])) >> ntz << 39) + out[25] = + (uint64(in[25] - in[24])) >> (25+ntz) | + ((uint64(in[26] - in[25])) >> ntz << 38) + out[26] = + (uint64(in[26] - in[25])) >> (26+ntz) | + ((uint64(in[27] - in[26])) >> ntz << 37) + out[27] = + (uint64(in[27] - in[26])) >> (27+ntz) | + ((uint64(in[28] - in[27])) >> ntz << 36) + out[28] = + (uint64(in[28] - in[27])) >> (28+ntz) | + ((uint64(in[29] - in[28])) >> ntz << 35) + out[29] = + (uint64(in[29] - in[28])) >> (29+ntz) | + ((uint64(in[30] - in[29])) >> ntz << 34) + out[30] = + (uint64(in[30] - in[29])) >> (30+ntz) | + ((uint64(in[31] - in[30])) >> ntz << 33) + out[31] = + (uint64(in[31] - in[30])) >> (31+ntz) | + ((uint64(in[32] - in[31])) >> ntz << 32) + out[32] = + (uint64(in[32] - in[31])) >> (32+ntz) | + ((uint64(in[33] - in[32])) >> ntz << 31) + out[33] = + (uint64(in[33] - in[32])) >> (33+ntz) | + ((uint64(in[34] - in[33])) >> ntz << 30) + out[34] = + (uint64(in[34] - in[33])) >> (34+ntz) | + ((uint64(in[35] - in[34])) >> ntz << 29) + out[35] = + (uint64(in[35] - in[34])) >> (35+ntz) | + ((uint64(in[36] - in[35])) >> ntz << 28) + out[36] = + (uint64(in[36] - in[35])) >> (36+ntz) | + ((uint64(in[37] - in[36])) >> ntz << 27) + out[37] = + (uint64(in[37] - in[36])) >> (37+ntz) | + ((uint64(in[38] - in[37])) >> ntz << 26) + out[38] = + (uint64(in[38] - in[37])) >> (38+ntz) | + ((uint64(in[39] - in[38])) >> ntz << 25) + out[39] = + (uint64(in[39] - in[38])) >> (39+ntz) | + ((uint64(in[40] - in[39])) >> ntz << 24) + out[40] = + (uint64(in[40] - in[39])) >> (40+ntz) | + ((uint64(in[41] - in[40])) >> ntz << 23) + out[41] = + (uint64(in[41] - in[40])) >> (41+ntz) | + ((uint64(in[42] - in[41])) >> ntz << 22) + out[42] = + (uint64(in[42] - in[41])) >> (42+ntz) | + ((uint64(in[43] - in[42])) >> ntz << 21) + out[43] = + (uint64(in[43] - in[42])) >> (43+ntz) | + ((uint64(in[44] - in[43])) >> ntz << 20) + out[44] = + (uint64(in[44] - in[43])) >> (44+ntz) | + ((uint64(in[45] - in[44])) >> ntz << 19) + out[45] = + (uint64(in[45] - in[44])) >> (45+ntz) | + ((uint64(in[46] - in[45])) >> ntz << 18) + out[46] = + (uint64(in[46] - in[45])) >> (46+ntz) | + ((uint64(in[47] - in[46])) >> ntz << 17) + out[47] = + (uint64(in[47] - in[46])) >> (47+ntz) | + ((uint64(in[48] - in[47])) >> ntz << 16) + out[48] = + (uint64(in[48] - in[47])) >> (48+ntz) | + ((uint64(in[49] - in[48])) >> ntz << 15) + out[49] = + (uint64(in[49] - in[48])) >> (49+ntz) | + ((uint64(in[50] - in[49])) >> ntz << 14) + out[50] = + (uint64(in[50] - in[49])) >> (50+ntz) | + ((uint64(in[51] - in[50])) >> ntz << 13) + out[51] = + (uint64(in[51] - in[50])) >> (51+ntz) | + ((uint64(in[52] - in[51])) >> ntz << 12) + out[52] = + (uint64(in[52] - in[51])) >> (52+ntz) | + ((uint64(in[53] - in[52])) >> ntz << 11) + out[53] = + (uint64(in[53] - in[52])) >> (53+ntz) | + ((uint64(in[54] - in[53])) >> ntz << 10) + out[54] = + (uint64(in[54] - in[53])) >> (54+ntz) | + ((uint64(in[55] - in[54])) >> ntz << 9) + out[55] = + (uint64(in[55] - in[54])) >> (55+ntz) | + ((uint64(in[56] - in[55])) >> ntz << 8) + out[56] = + (uint64(in[56] - in[55])) >> (56+ntz) | + ((uint64(in[57] - in[56])) >> ntz << 7) + out[57] = + (uint64(in[57] - in[56])) >> (57+ntz) | + ((uint64(in[58] - in[57])) >> ntz << 6) + out[58] = + (uint64(in[58] - in[57])) >> (58+ntz) | + ((uint64(in[59] - in[58])) >> ntz << 5) + out[59] = + (uint64(in[59] - in[58])) >> (59+ntz) | + ((uint64(in[60] - in[59])) >> ntz << 4) + out[60] = + (uint64(in[60] - in[59])) >> (60+ntz) | + ((uint64(in[61] - in[60])) >> ntz << 3) + out[61] = + (uint64(in[61] - in[60])) >> (61+ntz) | + ((uint64(in[62] - in[61])) >> ntz << 2) + out[62] = + (uint64(in[62] - in[61])) >> (62+ntz) | + ((uint64(in[63] - in[62])) >> ntz << 1) +} + +func deltaunpack_int64_0(initoffset int64, in *[0]uint64, out *[64]int64, ntz int) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset + out[32] = initoffset + out[33] = initoffset + out[34] = initoffset + out[35] = initoffset + out[36] = initoffset + out[37] = initoffset + out[38] = initoffset + out[39] = initoffset + out[40] = initoffset + out[41] = initoffset + out[42] = initoffset + out[43] = initoffset + out[44] = initoffset + out[45] = initoffset + out[46] = initoffset + out[47] = initoffset + out[48] = initoffset + out[49] = initoffset + out[50] = initoffset + out[51] = initoffset + out[52] = initoffset + out[53] = initoffset + out[54] = initoffset + out[55] = initoffset + out[56] = initoffset + out[57] = initoffset + out[58] = initoffset + out[59] = initoffset + out[60] = initoffset + out[61] = initoffset + out[62] = initoffset + out[63] = initoffset +} + +func deltaunpack_int64_1(initoffset int64, in *[1]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1) << ntz + initoffset + out[1] = int64((in[0] >> 1) & 0x1) << ntz + out[0] + out[2] = int64((in[0] >> 2) & 0x1) << ntz + out[1] + out[3] = int64((in[0] >> 3) & 0x1) << ntz + out[2] + out[4] = int64((in[0] >> 4) & 0x1) << ntz + out[3] + out[5] = int64((in[0] >> 5) & 0x1) << ntz + out[4] + out[6] = int64((in[0] >> 6) & 0x1) << ntz + out[5] + out[7] = int64((in[0] >> 7) & 0x1) << ntz + out[6] + out[8] = int64((in[0] >> 8) & 0x1) << ntz + out[7] + out[9] = int64((in[0] >> 9) & 0x1) << ntz + out[8] + out[10] = int64((in[0] >> 10) & 0x1) << ntz + out[9] + out[11] = int64((in[0] >> 11) & 0x1) << ntz + out[10] + out[12] = int64((in[0] >> 12) & 0x1) << ntz + out[11] + out[13] = int64((in[0] >> 13) & 0x1) << ntz + out[12] + out[14] = int64((in[0] >> 14) & 0x1) << ntz + out[13] + out[15] = int64((in[0] >> 15) & 0x1) << ntz + out[14] + out[16] = int64((in[0] >> 16) & 0x1) << ntz + out[15] + out[17] = int64((in[0] >> 17) & 0x1) << ntz + out[16] + out[18] = int64((in[0] >> 18) & 0x1) << ntz + out[17] + out[19] = int64((in[0] >> 19) & 0x1) << ntz + out[18] + out[20] = int64((in[0] >> 20) & 0x1) << ntz + out[19] + out[21] = int64((in[0] >> 21) & 0x1) << ntz + out[20] + out[22] = int64((in[0] >> 22) & 0x1) << ntz + out[21] + out[23] = int64((in[0] >> 23) & 0x1) << ntz + out[22] + out[24] = int64((in[0] >> 24) & 0x1) << ntz + out[23] + out[25] = int64((in[0] >> 25) & 0x1) << ntz + out[24] + out[26] = int64((in[0] >> 26) & 0x1) << ntz + out[25] + out[27] = int64((in[0] >> 27) & 0x1) << ntz + out[26] + out[28] = int64((in[0] >> 28) & 0x1) << ntz + out[27] + out[29] = int64((in[0] >> 29) & 0x1) << ntz + out[28] + out[30] = int64((in[0] >> 30) & 0x1) << ntz + out[29] + out[31] = int64((in[0] >> 31) & 0x1) << ntz + out[30] + out[32] = int64((in[0] >> 32) & 0x1) << ntz + out[31] + out[33] = int64((in[0] >> 33) & 0x1) << ntz + out[32] + out[34] = int64((in[0] >> 34) & 0x1) << ntz + out[33] + out[35] = int64((in[0] >> 35) & 0x1) << ntz + out[34] + out[36] = int64((in[0] >> 36) & 0x1) << ntz + out[35] + out[37] = int64((in[0] >> 37) & 0x1) << ntz + out[36] + out[38] = int64((in[0] >> 38) & 0x1) << ntz + out[37] + out[39] = int64((in[0] >> 39) & 0x1) << ntz + out[38] + out[40] = int64((in[0] >> 40) & 0x1) << ntz + out[39] + out[41] = int64((in[0] >> 41) & 0x1) << ntz + out[40] + out[42] = int64((in[0] >> 42) & 0x1) << ntz + out[41] + out[43] = int64((in[0] >> 43) & 0x1) << ntz + out[42] + out[44] = int64((in[0] >> 44) & 0x1) << ntz + out[43] + out[45] = int64((in[0] >> 45) & 0x1) << ntz + out[44] + out[46] = int64((in[0] >> 46) & 0x1) << ntz + out[45] + out[47] = int64((in[0] >> 47) & 0x1) << ntz + out[46] + out[48] = int64((in[0] >> 48) & 0x1) << ntz + out[47] + out[49] = int64((in[0] >> 49) & 0x1) << ntz + out[48] + out[50] = int64((in[0] >> 50) & 0x1) << ntz + out[49] + out[51] = int64((in[0] >> 51) & 0x1) << ntz + out[50] + out[52] = int64((in[0] >> 52) & 0x1) << ntz + out[51] + out[53] = int64((in[0] >> 53) & 0x1) << ntz + out[52] + out[54] = int64((in[0] >> 54) & 0x1) << ntz + out[53] + out[55] = int64((in[0] >> 55) & 0x1) << ntz + out[54] + out[56] = int64((in[0] >> 56) & 0x1) << ntz + out[55] + out[57] = int64((in[0] >> 57) & 0x1) << ntz + out[56] + out[58] = int64((in[0] >> 58) & 0x1) << ntz + out[57] + out[59] = int64((in[0] >> 59) & 0x1) << ntz + out[58] + out[60] = int64((in[0] >> 60) & 0x1) << ntz + out[59] + out[61] = int64((in[0] >> 61) & 0x1) << ntz + out[60] + out[62] = int64((in[0] >> 62) & 0x1) << ntz + out[61] + out[63] = int64((in[0] >> 63)) << ntz + out[62] +} + +func deltaunpack_int64_2(initoffset int64, in *[2]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3) << ntz + initoffset + out[1] = int64((in[0] >> 2) & 0x3) << ntz + out[0] + out[2] = int64((in[0] >> 4) & 0x3) << ntz + out[1] + out[3] = int64((in[0] >> 6) & 0x3) << ntz + out[2] + out[4] = int64((in[0] >> 8) & 0x3) << ntz + out[3] + out[5] = int64((in[0] >> 10) & 0x3) << ntz + out[4] + out[6] = int64((in[0] >> 12) & 0x3) << ntz + out[5] + out[7] = int64((in[0] >> 14) & 0x3) << ntz + out[6] + out[8] = int64((in[0] >> 16) & 0x3) << ntz + out[7] + out[9] = int64((in[0] >> 18) & 0x3) << ntz + out[8] + out[10] = int64((in[0] >> 20) & 0x3) << ntz + out[9] + out[11] = int64((in[0] >> 22) & 0x3) << ntz + out[10] + out[12] = int64((in[0] >> 24) & 0x3) << ntz + out[11] + out[13] = int64((in[0] >> 26) & 0x3) << ntz + out[12] + out[14] = int64((in[0] >> 28) & 0x3) << ntz + out[13] + out[15] = int64((in[0] >> 30) & 0x3) << ntz + out[14] + out[16] = int64((in[0] >> 32) & 0x3) << ntz + out[15] + out[17] = int64((in[0] >> 34) & 0x3) << ntz + out[16] + out[18] = int64((in[0] >> 36) & 0x3) << ntz + out[17] + out[19] = int64((in[0] >> 38) & 0x3) << ntz + out[18] + out[20] = int64((in[0] >> 40) & 0x3) << ntz + out[19] + out[21] = int64((in[0] >> 42) & 0x3) << ntz + out[20] + out[22] = int64((in[0] >> 44) & 0x3) << ntz + out[21] + out[23] = int64((in[0] >> 46) & 0x3) << ntz + out[22] + out[24] = int64((in[0] >> 48) & 0x3) << ntz + out[23] + out[25] = int64((in[0] >> 50) & 0x3) << ntz + out[24] + out[26] = int64((in[0] >> 52) & 0x3) << ntz + out[25] + out[27] = int64((in[0] >> 54) & 0x3) << ntz + out[26] + out[28] = int64((in[0] >> 56) & 0x3) << ntz + out[27] + out[29] = int64((in[0] >> 58) & 0x3) << ntz + out[28] + out[30] = int64((in[0] >> 60) & 0x3) << ntz + out[29] + out[31] = int64((in[0] >> 62)) << ntz + out[30] + out[32] = int64((in[1] >> 0) & 0x3) << ntz + out[31] + out[33] = int64((in[1] >> 2) & 0x3) << ntz + out[32] + out[34] = int64((in[1] >> 4) & 0x3) << ntz + out[33] + out[35] = int64((in[1] >> 6) & 0x3) << ntz + out[34] + out[36] = int64((in[1] >> 8) & 0x3) << ntz + out[35] + out[37] = int64((in[1] >> 10) & 0x3) << ntz + out[36] + out[38] = int64((in[1] >> 12) & 0x3) << ntz + out[37] + out[39] = int64((in[1] >> 14) & 0x3) << ntz + out[38] + out[40] = int64((in[1] >> 16) & 0x3) << ntz + out[39] + out[41] = int64((in[1] >> 18) & 0x3) << ntz + out[40] + out[42] = int64((in[1] >> 20) & 0x3) << ntz + out[41] + out[43] = int64((in[1] >> 22) & 0x3) << ntz + out[42] + out[44] = int64((in[1] >> 24) & 0x3) << ntz + out[43] + out[45] = int64((in[1] >> 26) & 0x3) << ntz + out[44] + out[46] = int64((in[1] >> 28) & 0x3) << ntz + out[45] + out[47] = int64((in[1] >> 30) & 0x3) << ntz + out[46] + out[48] = int64((in[1] >> 32) & 0x3) << ntz + out[47] + out[49] = int64((in[1] >> 34) & 0x3) << ntz + out[48] + out[50] = int64((in[1] >> 36) & 0x3) << ntz + out[49] + out[51] = int64((in[1] >> 38) & 0x3) << ntz + out[50] + out[52] = int64((in[1] >> 40) & 0x3) << ntz + out[51] + out[53] = int64((in[1] >> 42) & 0x3) << ntz + out[52] + out[54] = int64((in[1] >> 44) & 0x3) << ntz + out[53] + out[55] = int64((in[1] >> 46) & 0x3) << ntz + out[54] + out[56] = int64((in[1] >> 48) & 0x3) << ntz + out[55] + out[57] = int64((in[1] >> 50) & 0x3) << ntz + out[56] + out[58] = int64((in[1] >> 52) & 0x3) << ntz + out[57] + out[59] = int64((in[1] >> 54) & 0x3) << ntz + out[58] + out[60] = int64((in[1] >> 56) & 0x3) << ntz + out[59] + out[61] = int64((in[1] >> 58) & 0x3) << ntz + out[60] + out[62] = int64((in[1] >> 60) & 0x3) << ntz + out[61] + out[63] = int64((in[1] >> 62)) << ntz + out[62] +} + +func deltaunpack_int64_3(initoffset int64, in *[3]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7) << ntz + initoffset + out[1] = int64((in[0] >> 3) & 0x7) << ntz + out[0] + out[2] = int64((in[0] >> 6) & 0x7) << ntz + out[1] + out[3] = int64((in[0] >> 9) & 0x7) << ntz + out[2] + out[4] = int64((in[0] >> 12) & 0x7) << ntz + out[3] + out[5] = int64((in[0] >> 15) & 0x7) << ntz + out[4] + out[6] = int64((in[0] >> 18) & 0x7) << ntz + out[5] + out[7] = int64((in[0] >> 21) & 0x7) << ntz + out[6] + out[8] = int64((in[0] >> 24) & 0x7) << ntz + out[7] + out[9] = int64((in[0] >> 27) & 0x7) << ntz + out[8] + out[10] = int64((in[0] >> 30) & 0x7) << ntz + out[9] + out[11] = int64((in[0] >> 33) & 0x7) << ntz + out[10] + out[12] = int64((in[0] >> 36) & 0x7) << ntz + out[11] + out[13] = int64((in[0] >> 39) & 0x7) << ntz + out[12] + out[14] = int64((in[0] >> 42) & 0x7) << ntz + out[13] + out[15] = int64((in[0] >> 45) & 0x7) << ntz + out[14] + out[16] = int64((in[0] >> 48) & 0x7) << ntz + out[15] + out[17] = int64((in[0] >> 51) & 0x7) << ntz + out[16] + out[18] = int64((in[0] >> 54) & 0x7) << ntz + out[17] + out[19] = int64((in[0] >> 57) & 0x7) << ntz + out[18] + out[20] = int64((in[0] >> 60) & 0x7) << ntz + out[19] + out[21] = int64(((in[0] >> 63) | ((in[1] & 0x3) << 1))) << ntz + out[20] + out[22] = int64((in[1] >> 2) & 0x7) << ntz + out[21] + out[23] = int64((in[1] >> 5) & 0x7) << ntz + out[22] + out[24] = int64((in[1] >> 8) & 0x7) << ntz + out[23] + out[25] = int64((in[1] >> 11) & 0x7) << ntz + out[24] + out[26] = int64((in[1] >> 14) & 0x7) << ntz + out[25] + out[27] = int64((in[1] >> 17) & 0x7) << ntz + out[26] + out[28] = int64((in[1] >> 20) & 0x7) << ntz + out[27] + out[29] = int64((in[1] >> 23) & 0x7) << ntz + out[28] + out[30] = int64((in[1] >> 26) & 0x7) << ntz + out[29] + out[31] = int64((in[1] >> 29) & 0x7) << ntz + out[30] + out[32] = int64((in[1] >> 32) & 0x7) << ntz + out[31] + out[33] = int64((in[1] >> 35) & 0x7) << ntz + out[32] + out[34] = int64((in[1] >> 38) & 0x7) << ntz + out[33] + out[35] = int64((in[1] >> 41) & 0x7) << ntz + out[34] + out[36] = int64((in[1] >> 44) & 0x7) << ntz + out[35] + out[37] = int64((in[1] >> 47) & 0x7) << ntz + out[36] + out[38] = int64((in[1] >> 50) & 0x7) << ntz + out[37] + out[39] = int64((in[1] >> 53) & 0x7) << ntz + out[38] + out[40] = int64((in[1] >> 56) & 0x7) << ntz + out[39] + out[41] = int64((in[1] >> 59) & 0x7) << ntz + out[40] + out[42] = int64(((in[1] >> 62) | ((in[2] & 0x1) << 2))) << ntz + out[41] + out[43] = int64((in[2] >> 1) & 0x7) << ntz + out[42] + out[44] = int64((in[2] >> 4) & 0x7) << ntz + out[43] + out[45] = int64((in[2] >> 7) & 0x7) << ntz + out[44] + out[46] = int64((in[2] >> 10) & 0x7) << ntz + out[45] + out[47] = int64((in[2] >> 13) & 0x7) << ntz + out[46] + out[48] = int64((in[2] >> 16) & 0x7) << ntz + out[47] + out[49] = int64((in[2] >> 19) & 0x7) << ntz + out[48] + out[50] = int64((in[2] >> 22) & 0x7) << ntz + out[49] + out[51] = int64((in[2] >> 25) & 0x7) << ntz + out[50] + out[52] = int64((in[2] >> 28) & 0x7) << ntz + out[51] + out[53] = int64((in[2] >> 31) & 0x7) << ntz + out[52] + out[54] = int64((in[2] >> 34) & 0x7) << ntz + out[53] + out[55] = int64((in[2] >> 37) & 0x7) << ntz + out[54] + out[56] = int64((in[2] >> 40) & 0x7) << ntz + out[55] + out[57] = int64((in[2] >> 43) & 0x7) << ntz + out[56] + out[58] = int64((in[2] >> 46) & 0x7) << ntz + out[57] + out[59] = int64((in[2] >> 49) & 0x7) << ntz + out[58] + out[60] = int64((in[2] >> 52) & 0x7) << ntz + out[59] + out[61] = int64((in[2] >> 55) & 0x7) << ntz + out[60] + out[62] = int64((in[2] >> 58) & 0x7) << ntz + out[61] + out[63] = int64((in[2] >> 61)) << ntz + out[62] +} + +func deltaunpack_int64_4(initoffset int64, in *[4]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xF) << ntz + initoffset + out[1] = int64((in[0] >> 4) & 0xF) << ntz + out[0] + out[2] = int64((in[0] >> 8) & 0xF) << ntz + out[1] + out[3] = int64((in[0] >> 12) & 0xF) << ntz + out[2] + out[4] = int64((in[0] >> 16) & 0xF) << ntz + out[3] + out[5] = int64((in[0] >> 20) & 0xF) << ntz + out[4] + out[6] = int64((in[0] >> 24) & 0xF) << ntz + out[5] + out[7] = int64((in[0] >> 28) & 0xF) << ntz + out[6] + out[8] = int64((in[0] >> 32) & 0xF) << ntz + out[7] + out[9] = int64((in[0] >> 36) & 0xF) << ntz + out[8] + out[10] = int64((in[0] >> 40) & 0xF) << ntz + out[9] + out[11] = int64((in[0] >> 44) & 0xF) << ntz + out[10] + out[12] = int64((in[0] >> 48) & 0xF) << ntz + out[11] + out[13] = int64((in[0] >> 52) & 0xF) << ntz + out[12] + out[14] = int64((in[0] >> 56) & 0xF) << ntz + out[13] + out[15] = int64((in[0] >> 60)) << ntz + out[14] + out[16] = int64((in[1] >> 0) & 0xF) << ntz + out[15] + out[17] = int64((in[1] >> 4) & 0xF) << ntz + out[16] + out[18] = int64((in[1] >> 8) & 0xF) << ntz + out[17] + out[19] = int64((in[1] >> 12) & 0xF) << ntz + out[18] + out[20] = int64((in[1] >> 16) & 0xF) << ntz + out[19] + out[21] = int64((in[1] >> 20) & 0xF) << ntz + out[20] + out[22] = int64((in[1] >> 24) & 0xF) << ntz + out[21] + out[23] = int64((in[1] >> 28) & 0xF) << ntz + out[22] + out[24] = int64((in[1] >> 32) & 0xF) << ntz + out[23] + out[25] = int64((in[1] >> 36) & 0xF) << ntz + out[24] + out[26] = int64((in[1] >> 40) & 0xF) << ntz + out[25] + out[27] = int64((in[1] >> 44) & 0xF) << ntz + out[26] + out[28] = int64((in[1] >> 48) & 0xF) << ntz + out[27] + out[29] = int64((in[1] >> 52) & 0xF) << ntz + out[28] + out[30] = int64((in[1] >> 56) & 0xF) << ntz + out[29] + out[31] = int64((in[1] >> 60)) << ntz + out[30] + out[32] = int64((in[2] >> 0) & 0xF) << ntz + out[31] + out[33] = int64((in[2] >> 4) & 0xF) << ntz + out[32] + out[34] = int64((in[2] >> 8) & 0xF) << ntz + out[33] + out[35] = int64((in[2] >> 12) & 0xF) << ntz + out[34] + out[36] = int64((in[2] >> 16) & 0xF) << ntz + out[35] + out[37] = int64((in[2] >> 20) & 0xF) << ntz + out[36] + out[38] = int64((in[2] >> 24) & 0xF) << ntz + out[37] + out[39] = int64((in[2] >> 28) & 0xF) << ntz + out[38] + out[40] = int64((in[2] >> 32) & 0xF) << ntz + out[39] + out[41] = int64((in[2] >> 36) & 0xF) << ntz + out[40] + out[42] = int64((in[2] >> 40) & 0xF) << ntz + out[41] + out[43] = int64((in[2] >> 44) & 0xF) << ntz + out[42] + out[44] = int64((in[2] >> 48) & 0xF) << ntz + out[43] + out[45] = int64((in[2] >> 52) & 0xF) << ntz + out[44] + out[46] = int64((in[2] >> 56) & 0xF) << ntz + out[45] + out[47] = int64((in[2] >> 60)) << ntz + out[46] + out[48] = int64((in[3] >> 0) & 0xF) << ntz + out[47] + out[49] = int64((in[3] >> 4) & 0xF) << ntz + out[48] + out[50] = int64((in[3] >> 8) & 0xF) << ntz + out[49] + out[51] = int64((in[3] >> 12) & 0xF) << ntz + out[50] + out[52] = int64((in[3] >> 16) & 0xF) << ntz + out[51] + out[53] = int64((in[3] >> 20) & 0xF) << ntz + out[52] + out[54] = int64((in[3] >> 24) & 0xF) << ntz + out[53] + out[55] = int64((in[3] >> 28) & 0xF) << ntz + out[54] + out[56] = int64((in[3] >> 32) & 0xF) << ntz + out[55] + out[57] = int64((in[3] >> 36) & 0xF) << ntz + out[56] + out[58] = int64((in[3] >> 40) & 0xF) << ntz + out[57] + out[59] = int64((in[3] >> 44) & 0xF) << ntz + out[58] + out[60] = int64((in[3] >> 48) & 0xF) << ntz + out[59] + out[61] = int64((in[3] >> 52) & 0xF) << ntz + out[60] + out[62] = int64((in[3] >> 56) & 0xF) << ntz + out[61] + out[63] = int64((in[3] >> 60)) << ntz + out[62] +} + +func deltaunpack_int64_5(initoffset int64, in *[5]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1F) << ntz + initoffset + out[1] = int64((in[0] >> 5) & 0x1F) << ntz + out[0] + out[2] = int64((in[0] >> 10) & 0x1F) << ntz + out[1] + out[3] = int64((in[0] >> 15) & 0x1F) << ntz + out[2] + out[4] = int64((in[0] >> 20) & 0x1F) << ntz + out[3] + out[5] = int64((in[0] >> 25) & 0x1F) << ntz + out[4] + out[6] = int64((in[0] >> 30) & 0x1F) << ntz + out[5] + out[7] = int64((in[0] >> 35) & 0x1F) << ntz + out[6] + out[8] = int64((in[0] >> 40) & 0x1F) << ntz + out[7] + out[9] = int64((in[0] >> 45) & 0x1F) << ntz + out[8] + out[10] = int64((in[0] >> 50) & 0x1F) << ntz + out[9] + out[11] = int64((in[0] >> 55) & 0x1F) << ntz + out[10] + out[12] = int64(((in[0] >> 60) | ((in[1] & 0x1) << 4))) << ntz + out[11] + out[13] = int64((in[1] >> 1) & 0x1F) << ntz + out[12] + out[14] = int64((in[1] >> 6) & 0x1F) << ntz + out[13] + out[15] = int64((in[1] >> 11) & 0x1F) << ntz + out[14] + out[16] = int64((in[1] >> 16) & 0x1F) << ntz + out[15] + out[17] = int64((in[1] >> 21) & 0x1F) << ntz + out[16] + out[18] = int64((in[1] >> 26) & 0x1F) << ntz + out[17] + out[19] = int64((in[1] >> 31) & 0x1F) << ntz + out[18] + out[20] = int64((in[1] >> 36) & 0x1F) << ntz + out[19] + out[21] = int64((in[1] >> 41) & 0x1F) << ntz + out[20] + out[22] = int64((in[1] >> 46) & 0x1F) << ntz + out[21] + out[23] = int64((in[1] >> 51) & 0x1F) << ntz + out[22] + out[24] = int64((in[1] >> 56) & 0x1F) << ntz + out[23] + out[25] = int64(((in[1] >> 61) | ((in[2] & 0x3) << 3))) << ntz + out[24] + out[26] = int64((in[2] >> 2) & 0x1F) << ntz + out[25] + out[27] = int64((in[2] >> 7) & 0x1F) << ntz + out[26] + out[28] = int64((in[2] >> 12) & 0x1F) << ntz + out[27] + out[29] = int64((in[2] >> 17) & 0x1F) << ntz + out[28] + out[30] = int64((in[2] >> 22) & 0x1F) << ntz + out[29] + out[31] = int64((in[2] >> 27) & 0x1F) << ntz + out[30] + out[32] = int64((in[2] >> 32) & 0x1F) << ntz + out[31] + out[33] = int64((in[2] >> 37) & 0x1F) << ntz + out[32] + out[34] = int64((in[2] >> 42) & 0x1F) << ntz + out[33] + out[35] = int64((in[2] >> 47) & 0x1F) << ntz + out[34] + out[36] = int64((in[2] >> 52) & 0x1F) << ntz + out[35] + out[37] = int64((in[2] >> 57) & 0x1F) << ntz + out[36] + out[38] = int64(((in[2] >> 62) | ((in[3] & 0x7) << 2))) << ntz + out[37] + out[39] = int64((in[3] >> 3) & 0x1F) << ntz + out[38] + out[40] = int64((in[3] >> 8) & 0x1F) << ntz + out[39] + out[41] = int64((in[3] >> 13) & 0x1F) << ntz + out[40] + out[42] = int64((in[3] >> 18) & 0x1F) << ntz + out[41] + out[43] = int64((in[3] >> 23) & 0x1F) << ntz + out[42] + out[44] = int64((in[3] >> 28) & 0x1F) << ntz + out[43] + out[45] = int64((in[3] >> 33) & 0x1F) << ntz + out[44] + out[46] = int64((in[3] >> 38) & 0x1F) << ntz + out[45] + out[47] = int64((in[3] >> 43) & 0x1F) << ntz + out[46] + out[48] = int64((in[3] >> 48) & 0x1F) << ntz + out[47] + out[49] = int64((in[3] >> 53) & 0x1F) << ntz + out[48] + out[50] = int64((in[3] >> 58) & 0x1F) << ntz + out[49] + out[51] = int64(((in[3] >> 63) | ((in[4] & 0xF) << 1))) << ntz + out[50] + out[52] = int64((in[4] >> 4) & 0x1F) << ntz + out[51] + out[53] = int64((in[4] >> 9) & 0x1F) << ntz + out[52] + out[54] = int64((in[4] >> 14) & 0x1F) << ntz + out[53] + out[55] = int64((in[4] >> 19) & 0x1F) << ntz + out[54] + out[56] = int64((in[4] >> 24) & 0x1F) << ntz + out[55] + out[57] = int64((in[4] >> 29) & 0x1F) << ntz + out[56] + out[58] = int64((in[4] >> 34) & 0x1F) << ntz + out[57] + out[59] = int64((in[4] >> 39) & 0x1F) << ntz + out[58] + out[60] = int64((in[4] >> 44) & 0x1F) << ntz + out[59] + out[61] = int64((in[4] >> 49) & 0x1F) << ntz + out[60] + out[62] = int64((in[4] >> 54) & 0x1F) << ntz + out[61] + out[63] = int64((in[4] >> 59)) << ntz + out[62] +} + +func deltaunpack_int64_6(initoffset int64, in *[6]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3F) << ntz + initoffset + out[1] = int64((in[0] >> 6) & 0x3F) << ntz + out[0] + out[2] = int64((in[0] >> 12) & 0x3F) << ntz + out[1] + out[3] = int64((in[0] >> 18) & 0x3F) << ntz + out[2] + out[4] = int64((in[0] >> 24) & 0x3F) << ntz + out[3] + out[5] = int64((in[0] >> 30) & 0x3F) << ntz + out[4] + out[6] = int64((in[0] >> 36) & 0x3F) << ntz + out[5] + out[7] = int64((in[0] >> 42) & 0x3F) << ntz + out[6] + out[8] = int64((in[0] >> 48) & 0x3F) << ntz + out[7] + out[9] = int64((in[0] >> 54) & 0x3F) << ntz + out[8] + out[10] = int64(((in[0] >> 60) | ((in[1] & 0x3) << 4))) << ntz + out[9] + out[11] = int64((in[1] >> 2) & 0x3F) << ntz + out[10] + out[12] = int64((in[1] >> 8) & 0x3F) << ntz + out[11] + out[13] = int64((in[1] >> 14) & 0x3F) << ntz + out[12] + out[14] = int64((in[1] >> 20) & 0x3F) << ntz + out[13] + out[15] = int64((in[1] >> 26) & 0x3F) << ntz + out[14] + out[16] = int64((in[1] >> 32) & 0x3F) << ntz + out[15] + out[17] = int64((in[1] >> 38) & 0x3F) << ntz + out[16] + out[18] = int64((in[1] >> 44) & 0x3F) << ntz + out[17] + out[19] = int64((in[1] >> 50) & 0x3F) << ntz + out[18] + out[20] = int64((in[1] >> 56) & 0x3F) << ntz + out[19] + out[21] = int64(((in[1] >> 62) | ((in[2] & 0xF) << 2))) << ntz + out[20] + out[22] = int64((in[2] >> 4) & 0x3F) << ntz + out[21] + out[23] = int64((in[2] >> 10) & 0x3F) << ntz + out[22] + out[24] = int64((in[2] >> 16) & 0x3F) << ntz + out[23] + out[25] = int64((in[2] >> 22) & 0x3F) << ntz + out[24] + out[26] = int64((in[2] >> 28) & 0x3F) << ntz + out[25] + out[27] = int64((in[2] >> 34) & 0x3F) << ntz + out[26] + out[28] = int64((in[2] >> 40) & 0x3F) << ntz + out[27] + out[29] = int64((in[2] >> 46) & 0x3F) << ntz + out[28] + out[30] = int64((in[2] >> 52) & 0x3F) << ntz + out[29] + out[31] = int64((in[2] >> 58)) << ntz + out[30] + out[32] = int64((in[3] >> 0) & 0x3F) << ntz + out[31] + out[33] = int64((in[3] >> 6) & 0x3F) << ntz + out[32] + out[34] = int64((in[3] >> 12) & 0x3F) << ntz + out[33] + out[35] = int64((in[3] >> 18) & 0x3F) << ntz + out[34] + out[36] = int64((in[3] >> 24) & 0x3F) << ntz + out[35] + out[37] = int64((in[3] >> 30) & 0x3F) << ntz + out[36] + out[38] = int64((in[3] >> 36) & 0x3F) << ntz + out[37] + out[39] = int64((in[3] >> 42) & 0x3F) << ntz + out[38] + out[40] = int64((in[3] >> 48) & 0x3F) << ntz + out[39] + out[41] = int64((in[3] >> 54) & 0x3F) << ntz + out[40] + out[42] = int64(((in[3] >> 60) | ((in[4] & 0x3) << 4))) << ntz + out[41] + out[43] = int64((in[4] >> 2) & 0x3F) << ntz + out[42] + out[44] = int64((in[4] >> 8) & 0x3F) << ntz + out[43] + out[45] = int64((in[4] >> 14) & 0x3F) << ntz + out[44] + out[46] = int64((in[4] >> 20) & 0x3F) << ntz + out[45] + out[47] = int64((in[4] >> 26) & 0x3F) << ntz + out[46] + out[48] = int64((in[4] >> 32) & 0x3F) << ntz + out[47] + out[49] = int64((in[4] >> 38) & 0x3F) << ntz + out[48] + out[50] = int64((in[4] >> 44) & 0x3F) << ntz + out[49] + out[51] = int64((in[4] >> 50) & 0x3F) << ntz + out[50] + out[52] = int64((in[4] >> 56) & 0x3F) << ntz + out[51] + out[53] = int64(((in[4] >> 62) | ((in[5] & 0xF) << 2))) << ntz + out[52] + out[54] = int64((in[5] >> 4) & 0x3F) << ntz + out[53] + out[55] = int64((in[5] >> 10) & 0x3F) << ntz + out[54] + out[56] = int64((in[5] >> 16) & 0x3F) << ntz + out[55] + out[57] = int64((in[5] >> 22) & 0x3F) << ntz + out[56] + out[58] = int64((in[5] >> 28) & 0x3F) << ntz + out[57] + out[59] = int64((in[5] >> 34) & 0x3F) << ntz + out[58] + out[60] = int64((in[5] >> 40) & 0x3F) << ntz + out[59] + out[61] = int64((in[5] >> 46) & 0x3F) << ntz + out[60] + out[62] = int64((in[5] >> 52) & 0x3F) << ntz + out[61] + out[63] = int64((in[5] >> 58)) << ntz + out[62] +} + +func deltaunpack_int64_7(initoffset int64, in *[7]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7F) << ntz + initoffset + out[1] = int64((in[0] >> 7) & 0x7F) << ntz + out[0] + out[2] = int64((in[0] >> 14) & 0x7F) << ntz + out[1] + out[3] = int64((in[0] >> 21) & 0x7F) << ntz + out[2] + out[4] = int64((in[0] >> 28) & 0x7F) << ntz + out[3] + out[5] = int64((in[0] >> 35) & 0x7F) << ntz + out[4] + out[6] = int64((in[0] >> 42) & 0x7F) << ntz + out[5] + out[7] = int64((in[0] >> 49) & 0x7F) << ntz + out[6] + out[8] = int64((in[0] >> 56) & 0x7F) << ntz + out[7] + out[9] = int64(((in[0] >> 63) | ((in[1] & 0x3F) << 1))) << ntz + out[8] + out[10] = int64((in[1] >> 6) & 0x7F) << ntz + out[9] + out[11] = int64((in[1] >> 13) & 0x7F) << ntz + out[10] + out[12] = int64((in[1] >> 20) & 0x7F) << ntz + out[11] + out[13] = int64((in[1] >> 27) & 0x7F) << ntz + out[12] + out[14] = int64((in[1] >> 34) & 0x7F) << ntz + out[13] + out[15] = int64((in[1] >> 41) & 0x7F) << ntz + out[14] + out[16] = int64((in[1] >> 48) & 0x7F) << ntz + out[15] + out[17] = int64((in[1] >> 55) & 0x7F) << ntz + out[16] + out[18] = int64(((in[1] >> 62) | ((in[2] & 0x1F) << 2))) << ntz + out[17] + out[19] = int64((in[2] >> 5) & 0x7F) << ntz + out[18] + out[20] = int64((in[2] >> 12) & 0x7F) << ntz + out[19] + out[21] = int64((in[2] >> 19) & 0x7F) << ntz + out[20] + out[22] = int64((in[2] >> 26) & 0x7F) << ntz + out[21] + out[23] = int64((in[2] >> 33) & 0x7F) << ntz + out[22] + out[24] = int64((in[2] >> 40) & 0x7F) << ntz + out[23] + out[25] = int64((in[2] >> 47) & 0x7F) << ntz + out[24] + out[26] = int64((in[2] >> 54) & 0x7F) << ntz + out[25] + out[27] = int64(((in[2] >> 61) | ((in[3] & 0xF) << 3))) << ntz + out[26] + out[28] = int64((in[3] >> 4) & 0x7F) << ntz + out[27] + out[29] = int64((in[3] >> 11) & 0x7F) << ntz + out[28] + out[30] = int64((in[3] >> 18) & 0x7F) << ntz + out[29] + out[31] = int64((in[3] >> 25) & 0x7F) << ntz + out[30] + out[32] = int64((in[3] >> 32) & 0x7F) << ntz + out[31] + out[33] = int64((in[3] >> 39) & 0x7F) << ntz + out[32] + out[34] = int64((in[3] >> 46) & 0x7F) << ntz + out[33] + out[35] = int64((in[3] >> 53) & 0x7F) << ntz + out[34] + out[36] = int64(((in[3] >> 60) | ((in[4] & 0x7) << 4))) << ntz + out[35] + out[37] = int64((in[4] >> 3) & 0x7F) << ntz + out[36] + out[38] = int64((in[4] >> 10) & 0x7F) << ntz + out[37] + out[39] = int64((in[4] >> 17) & 0x7F) << ntz + out[38] + out[40] = int64((in[4] >> 24) & 0x7F) << ntz + out[39] + out[41] = int64((in[4] >> 31) & 0x7F) << ntz + out[40] + out[42] = int64((in[4] >> 38) & 0x7F) << ntz + out[41] + out[43] = int64((in[4] >> 45) & 0x7F) << ntz + out[42] + out[44] = int64((in[4] >> 52) & 0x7F) << ntz + out[43] + out[45] = int64(((in[4] >> 59) | ((in[5] & 0x3) << 5))) << ntz + out[44] + out[46] = int64((in[5] >> 2) & 0x7F) << ntz + out[45] + out[47] = int64((in[5] >> 9) & 0x7F) << ntz + out[46] + out[48] = int64((in[5] >> 16) & 0x7F) << ntz + out[47] + out[49] = int64((in[5] >> 23) & 0x7F) << ntz + out[48] + out[50] = int64((in[5] >> 30) & 0x7F) << ntz + out[49] + out[51] = int64((in[5] >> 37) & 0x7F) << ntz + out[50] + out[52] = int64((in[5] >> 44) & 0x7F) << ntz + out[51] + out[53] = int64((in[5] >> 51) & 0x7F) << ntz + out[52] + out[54] = int64(((in[5] >> 58) | ((in[6] & 0x1) << 6))) << ntz + out[53] + out[55] = int64((in[6] >> 1) & 0x7F) << ntz + out[54] + out[56] = int64((in[6] >> 8) & 0x7F) << ntz + out[55] + out[57] = int64((in[6] >> 15) & 0x7F) << ntz + out[56] + out[58] = int64((in[6] >> 22) & 0x7F) << ntz + out[57] + out[59] = int64((in[6] >> 29) & 0x7F) << ntz + out[58] + out[60] = int64((in[6] >> 36) & 0x7F) << ntz + out[59] + out[61] = int64((in[6] >> 43) & 0x7F) << ntz + out[60] + out[62] = int64((in[6] >> 50) & 0x7F) << ntz + out[61] + out[63] = int64((in[6] >> 57)) << ntz + out[62] +} + +func deltaunpack_int64_8(initoffset int64, in *[8]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFF) << ntz + initoffset + out[1] = int64((in[0] >> 8) & 0xFF) << ntz + out[0] + out[2] = int64((in[0] >> 16) & 0xFF) << ntz + out[1] + out[3] = int64((in[0] >> 24) & 0xFF) << ntz + out[2] + out[4] = int64((in[0] >> 32) & 0xFF) << ntz + out[3] + out[5] = int64((in[0] >> 40) & 0xFF) << ntz + out[4] + out[6] = int64((in[0] >> 48) & 0xFF) << ntz + out[5] + out[7] = int64((in[0] >> 56)) << ntz + out[6] + out[8] = int64((in[1] >> 0) & 0xFF) << ntz + out[7] + out[9] = int64((in[1] >> 8) & 0xFF) << ntz + out[8] + out[10] = int64((in[1] >> 16) & 0xFF) << ntz + out[9] + out[11] = int64((in[1] >> 24) & 0xFF) << ntz + out[10] + out[12] = int64((in[1] >> 32) & 0xFF) << ntz + out[11] + out[13] = int64((in[1] >> 40) & 0xFF) << ntz + out[12] + out[14] = int64((in[1] >> 48) & 0xFF) << ntz + out[13] + out[15] = int64((in[1] >> 56)) << ntz + out[14] + out[16] = int64((in[2] >> 0) & 0xFF) << ntz + out[15] + out[17] = int64((in[2] >> 8) & 0xFF) << ntz + out[16] + out[18] = int64((in[2] >> 16) & 0xFF) << ntz + out[17] + out[19] = int64((in[2] >> 24) & 0xFF) << ntz + out[18] + out[20] = int64((in[2] >> 32) & 0xFF) << ntz + out[19] + out[21] = int64((in[2] >> 40) & 0xFF) << ntz + out[20] + out[22] = int64((in[2] >> 48) & 0xFF) << ntz + out[21] + out[23] = int64((in[2] >> 56)) << ntz + out[22] + out[24] = int64((in[3] >> 0) & 0xFF) << ntz + out[23] + out[25] = int64((in[3] >> 8) & 0xFF) << ntz + out[24] + out[26] = int64((in[3] >> 16) & 0xFF) << ntz + out[25] + out[27] = int64((in[3] >> 24) & 0xFF) << ntz + out[26] + out[28] = int64((in[3] >> 32) & 0xFF) << ntz + out[27] + out[29] = int64((in[3] >> 40) & 0xFF) << ntz + out[28] + out[30] = int64((in[3] >> 48) & 0xFF) << ntz + out[29] + out[31] = int64((in[3] >> 56)) << ntz + out[30] + out[32] = int64((in[4] >> 0) & 0xFF) << ntz + out[31] + out[33] = int64((in[4] >> 8) & 0xFF) << ntz + out[32] + out[34] = int64((in[4] >> 16) & 0xFF) << ntz + out[33] + out[35] = int64((in[4] >> 24) & 0xFF) << ntz + out[34] + out[36] = int64((in[4] >> 32) & 0xFF) << ntz + out[35] + out[37] = int64((in[4] >> 40) & 0xFF) << ntz + out[36] + out[38] = int64((in[4] >> 48) & 0xFF) << ntz + out[37] + out[39] = int64((in[4] >> 56)) << ntz + out[38] + out[40] = int64((in[5] >> 0) & 0xFF) << ntz + out[39] + out[41] = int64((in[5] >> 8) & 0xFF) << ntz + out[40] + out[42] = int64((in[5] >> 16) & 0xFF) << ntz + out[41] + out[43] = int64((in[5] >> 24) & 0xFF) << ntz + out[42] + out[44] = int64((in[5] >> 32) & 0xFF) << ntz + out[43] + out[45] = int64((in[5] >> 40) & 0xFF) << ntz + out[44] + out[46] = int64((in[5] >> 48) & 0xFF) << ntz + out[45] + out[47] = int64((in[5] >> 56)) << ntz + out[46] + out[48] = int64((in[6] >> 0) & 0xFF) << ntz + out[47] + out[49] = int64((in[6] >> 8) & 0xFF) << ntz + out[48] + out[50] = int64((in[6] >> 16) & 0xFF) << ntz + out[49] + out[51] = int64((in[6] >> 24) & 0xFF) << ntz + out[50] + out[52] = int64((in[6] >> 32) & 0xFF) << ntz + out[51] + out[53] = int64((in[6] >> 40) & 0xFF) << ntz + out[52] + out[54] = int64((in[6] >> 48) & 0xFF) << ntz + out[53] + out[55] = int64((in[6] >> 56)) << ntz + out[54] + out[56] = int64((in[7] >> 0) & 0xFF) << ntz + out[55] + out[57] = int64((in[7] >> 8) & 0xFF) << ntz + out[56] + out[58] = int64((in[7] >> 16) & 0xFF) << ntz + out[57] + out[59] = int64((in[7] >> 24) & 0xFF) << ntz + out[58] + out[60] = int64((in[7] >> 32) & 0xFF) << ntz + out[59] + out[61] = int64((in[7] >> 40) & 0xFF) << ntz + out[60] + out[62] = int64((in[7] >> 48) & 0xFF) << ntz + out[61] + out[63] = int64((in[7] >> 56)) << ntz + out[62] +} + +func deltaunpack_int64_9(initoffset int64, in *[9]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FF) << ntz + initoffset + out[1] = int64((in[0] >> 9) & 0x1FF) << ntz + out[0] + out[2] = int64((in[0] >> 18) & 0x1FF) << ntz + out[1] + out[3] = int64((in[0] >> 27) & 0x1FF) << ntz + out[2] + out[4] = int64((in[0] >> 36) & 0x1FF) << ntz + out[3] + out[5] = int64((in[0] >> 45) & 0x1FF) << ntz + out[4] + out[6] = int64((in[0] >> 54) & 0x1FF) << ntz + out[5] + out[7] = int64(((in[0] >> 63) | ((in[1] & 0xFF) << 1))) << ntz + out[6] + out[8] = int64((in[1] >> 8) & 0x1FF) << ntz + out[7] + out[9] = int64((in[1] >> 17) & 0x1FF) << ntz + out[8] + out[10] = int64((in[1] >> 26) & 0x1FF) << ntz + out[9] + out[11] = int64((in[1] >> 35) & 0x1FF) << ntz + out[10] + out[12] = int64((in[1] >> 44) & 0x1FF) << ntz + out[11] + out[13] = int64((in[1] >> 53) & 0x1FF) << ntz + out[12] + out[14] = int64(((in[1] >> 62) | ((in[2] & 0x7F) << 2))) << ntz + out[13] + out[15] = int64((in[2] >> 7) & 0x1FF) << ntz + out[14] + out[16] = int64((in[2] >> 16) & 0x1FF) << ntz + out[15] + out[17] = int64((in[2] >> 25) & 0x1FF) << ntz + out[16] + out[18] = int64((in[2] >> 34) & 0x1FF) << ntz + out[17] + out[19] = int64((in[2] >> 43) & 0x1FF) << ntz + out[18] + out[20] = int64((in[2] >> 52) & 0x1FF) << ntz + out[19] + out[21] = int64(((in[2] >> 61) | ((in[3] & 0x3F) << 3))) << ntz + out[20] + out[22] = int64((in[3] >> 6) & 0x1FF) << ntz + out[21] + out[23] = int64((in[3] >> 15) & 0x1FF) << ntz + out[22] + out[24] = int64((in[3] >> 24) & 0x1FF) << ntz + out[23] + out[25] = int64((in[3] >> 33) & 0x1FF) << ntz + out[24] + out[26] = int64((in[3] >> 42) & 0x1FF) << ntz + out[25] + out[27] = int64((in[3] >> 51) & 0x1FF) << ntz + out[26] + out[28] = int64(((in[3] >> 60) | ((in[4] & 0x1F) << 4))) << ntz + out[27] + out[29] = int64((in[4] >> 5) & 0x1FF) << ntz + out[28] + out[30] = int64((in[4] >> 14) & 0x1FF) << ntz + out[29] + out[31] = int64((in[4] >> 23) & 0x1FF) << ntz + out[30] + out[32] = int64((in[4] >> 32) & 0x1FF) << ntz + out[31] + out[33] = int64((in[4] >> 41) & 0x1FF) << ntz + out[32] + out[34] = int64((in[4] >> 50) & 0x1FF) << ntz + out[33] + out[35] = int64(((in[4] >> 59) | ((in[5] & 0xF) << 5))) << ntz + out[34] + out[36] = int64((in[5] >> 4) & 0x1FF) << ntz + out[35] + out[37] = int64((in[5] >> 13) & 0x1FF) << ntz + out[36] + out[38] = int64((in[5] >> 22) & 0x1FF) << ntz + out[37] + out[39] = int64((in[5] >> 31) & 0x1FF) << ntz + out[38] + out[40] = int64((in[5] >> 40) & 0x1FF) << ntz + out[39] + out[41] = int64((in[5] >> 49) & 0x1FF) << ntz + out[40] + out[42] = int64(((in[5] >> 58) | ((in[6] & 0x7) << 6))) << ntz + out[41] + out[43] = int64((in[6] >> 3) & 0x1FF) << ntz + out[42] + out[44] = int64((in[6] >> 12) & 0x1FF) << ntz + out[43] + out[45] = int64((in[6] >> 21) & 0x1FF) << ntz + out[44] + out[46] = int64((in[6] >> 30) & 0x1FF) << ntz + out[45] + out[47] = int64((in[6] >> 39) & 0x1FF) << ntz + out[46] + out[48] = int64((in[6] >> 48) & 0x1FF) << ntz + out[47] + out[49] = int64(((in[6] >> 57) | ((in[7] & 0x3) << 7))) << ntz + out[48] + out[50] = int64((in[7] >> 2) & 0x1FF) << ntz + out[49] + out[51] = int64((in[7] >> 11) & 0x1FF) << ntz + out[50] + out[52] = int64((in[7] >> 20) & 0x1FF) << ntz + out[51] + out[53] = int64((in[7] >> 29) & 0x1FF) << ntz + out[52] + out[54] = int64((in[7] >> 38) & 0x1FF) << ntz + out[53] + out[55] = int64((in[7] >> 47) & 0x1FF) << ntz + out[54] + out[56] = int64(((in[7] >> 56) | ((in[8] & 0x1) << 8))) << ntz + out[55] + out[57] = int64((in[8] >> 1) & 0x1FF) << ntz + out[56] + out[58] = int64((in[8] >> 10) & 0x1FF) << ntz + out[57] + out[59] = int64((in[8] >> 19) & 0x1FF) << ntz + out[58] + out[60] = int64((in[8] >> 28) & 0x1FF) << ntz + out[59] + out[61] = int64((in[8] >> 37) & 0x1FF) << ntz + out[60] + out[62] = int64((in[8] >> 46) & 0x1FF) << ntz + out[61] + out[63] = int64((in[8] >> 55)) << ntz + out[62] +} + +func deltaunpack_int64_10(initoffset int64, in *[10]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FF) << ntz + initoffset + out[1] = int64((in[0] >> 10) & 0x3FF) << ntz + out[0] + out[2] = int64((in[0] >> 20) & 0x3FF) << ntz + out[1] + out[3] = int64((in[0] >> 30) & 0x3FF) << ntz + out[2] + out[4] = int64((in[0] >> 40) & 0x3FF) << ntz + out[3] + out[5] = int64((in[0] >> 50) & 0x3FF) << ntz + out[4] + out[6] = int64(((in[0] >> 60) | ((in[1] & 0x3F) << 4))) << ntz + out[5] + out[7] = int64((in[1] >> 6) & 0x3FF) << ntz + out[6] + out[8] = int64((in[1] >> 16) & 0x3FF) << ntz + out[7] + out[9] = int64((in[1] >> 26) & 0x3FF) << ntz + out[8] + out[10] = int64((in[1] >> 36) & 0x3FF) << ntz + out[9] + out[11] = int64((in[1] >> 46) & 0x3FF) << ntz + out[10] + out[12] = int64(((in[1] >> 56) | ((in[2] & 0x3) << 8))) << ntz + out[11] + out[13] = int64((in[2] >> 2) & 0x3FF) << ntz + out[12] + out[14] = int64((in[2] >> 12) & 0x3FF) << ntz + out[13] + out[15] = int64((in[2] >> 22) & 0x3FF) << ntz + out[14] + out[16] = int64((in[2] >> 32) & 0x3FF) << ntz + out[15] + out[17] = int64((in[2] >> 42) & 0x3FF) << ntz + out[16] + out[18] = int64((in[2] >> 52) & 0x3FF) << ntz + out[17] + out[19] = int64(((in[2] >> 62) | ((in[3] & 0xFF) << 2))) << ntz + out[18] + out[20] = int64((in[3] >> 8) & 0x3FF) << ntz + out[19] + out[21] = int64((in[3] >> 18) & 0x3FF) << ntz + out[20] + out[22] = int64((in[3] >> 28) & 0x3FF) << ntz + out[21] + out[23] = int64((in[3] >> 38) & 0x3FF) << ntz + out[22] + out[24] = int64((in[3] >> 48) & 0x3FF) << ntz + out[23] + out[25] = int64(((in[3] >> 58) | ((in[4] & 0xF) << 6))) << ntz + out[24] + out[26] = int64((in[4] >> 4) & 0x3FF) << ntz + out[25] + out[27] = int64((in[4] >> 14) & 0x3FF) << ntz + out[26] + out[28] = int64((in[4] >> 24) & 0x3FF) << ntz + out[27] + out[29] = int64((in[4] >> 34) & 0x3FF) << ntz + out[28] + out[30] = int64((in[4] >> 44) & 0x3FF) << ntz + out[29] + out[31] = int64((in[4] >> 54)) << ntz + out[30] + out[32] = int64((in[5] >> 0) & 0x3FF) << ntz + out[31] + out[33] = int64((in[5] >> 10) & 0x3FF) << ntz + out[32] + out[34] = int64((in[5] >> 20) & 0x3FF) << ntz + out[33] + out[35] = int64((in[5] >> 30) & 0x3FF) << ntz + out[34] + out[36] = int64((in[5] >> 40) & 0x3FF) << ntz + out[35] + out[37] = int64((in[5] >> 50) & 0x3FF) << ntz + out[36] + out[38] = int64(((in[5] >> 60) | ((in[6] & 0x3F) << 4))) << ntz + out[37] + out[39] = int64((in[6] >> 6) & 0x3FF) << ntz + out[38] + out[40] = int64((in[6] >> 16) & 0x3FF) << ntz + out[39] + out[41] = int64((in[6] >> 26) & 0x3FF) << ntz + out[40] + out[42] = int64((in[6] >> 36) & 0x3FF) << ntz + out[41] + out[43] = int64((in[6] >> 46) & 0x3FF) << ntz + out[42] + out[44] = int64(((in[6] >> 56) | ((in[7] & 0x3) << 8))) << ntz + out[43] + out[45] = int64((in[7] >> 2) & 0x3FF) << ntz + out[44] + out[46] = int64((in[7] >> 12) & 0x3FF) << ntz + out[45] + out[47] = int64((in[7] >> 22) & 0x3FF) << ntz + out[46] + out[48] = int64((in[7] >> 32) & 0x3FF) << ntz + out[47] + out[49] = int64((in[7] >> 42) & 0x3FF) << ntz + out[48] + out[50] = int64((in[7] >> 52) & 0x3FF) << ntz + out[49] + out[51] = int64(((in[7] >> 62) | ((in[8] & 0xFF) << 2))) << ntz + out[50] + out[52] = int64((in[8] >> 8) & 0x3FF) << ntz + out[51] + out[53] = int64((in[8] >> 18) & 0x3FF) << ntz + out[52] + out[54] = int64((in[8] >> 28) & 0x3FF) << ntz + out[53] + out[55] = int64((in[8] >> 38) & 0x3FF) << ntz + out[54] + out[56] = int64((in[8] >> 48) & 0x3FF) << ntz + out[55] + out[57] = int64(((in[8] >> 58) | ((in[9] & 0xF) << 6))) << ntz + out[56] + out[58] = int64((in[9] >> 4) & 0x3FF) << ntz + out[57] + out[59] = int64((in[9] >> 14) & 0x3FF) << ntz + out[58] + out[60] = int64((in[9] >> 24) & 0x3FF) << ntz + out[59] + out[61] = int64((in[9] >> 34) & 0x3FF) << ntz + out[60] + out[62] = int64((in[9] >> 44) & 0x3FF) << ntz + out[61] + out[63] = int64((in[9] >> 54)) << ntz + out[62] +} + +func deltaunpack_int64_11(initoffset int64, in *[11]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FF) << ntz + initoffset + out[1] = int64((in[0] >> 11) & 0x7FF) << ntz + out[0] + out[2] = int64((in[0] >> 22) & 0x7FF) << ntz + out[1] + out[3] = int64((in[0] >> 33) & 0x7FF) << ntz + out[2] + out[4] = int64((in[0] >> 44) & 0x7FF) << ntz + out[3] + out[5] = int64(((in[0] >> 55) | ((in[1] & 0x3) << 9))) << ntz + out[4] + out[6] = int64((in[1] >> 2) & 0x7FF) << ntz + out[5] + out[7] = int64((in[1] >> 13) & 0x7FF) << ntz + out[6] + out[8] = int64((in[1] >> 24) & 0x7FF) << ntz + out[7] + out[9] = int64((in[1] >> 35) & 0x7FF) << ntz + out[8] + out[10] = int64((in[1] >> 46) & 0x7FF) << ntz + out[9] + out[11] = int64(((in[1] >> 57) | ((in[2] & 0xF) << 7))) << ntz + out[10] + out[12] = int64((in[2] >> 4) & 0x7FF) << ntz + out[11] + out[13] = int64((in[2] >> 15) & 0x7FF) << ntz + out[12] + out[14] = int64((in[2] >> 26) & 0x7FF) << ntz + out[13] + out[15] = int64((in[2] >> 37) & 0x7FF) << ntz + out[14] + out[16] = int64((in[2] >> 48) & 0x7FF) << ntz + out[15] + out[17] = int64(((in[2] >> 59) | ((in[3] & 0x3F) << 5))) << ntz + out[16] + out[18] = int64((in[3] >> 6) & 0x7FF) << ntz + out[17] + out[19] = int64((in[3] >> 17) & 0x7FF) << ntz + out[18] + out[20] = int64((in[3] >> 28) & 0x7FF) << ntz + out[19] + out[21] = int64((in[3] >> 39) & 0x7FF) << ntz + out[20] + out[22] = int64((in[3] >> 50) & 0x7FF) << ntz + out[21] + out[23] = int64(((in[3] >> 61) | ((in[4] & 0xFF) << 3))) << ntz + out[22] + out[24] = int64((in[4] >> 8) & 0x7FF) << ntz + out[23] + out[25] = int64((in[4] >> 19) & 0x7FF) << ntz + out[24] + out[26] = int64((in[4] >> 30) & 0x7FF) << ntz + out[25] + out[27] = int64((in[4] >> 41) & 0x7FF) << ntz + out[26] + out[28] = int64((in[4] >> 52) & 0x7FF) << ntz + out[27] + out[29] = int64(((in[4] >> 63) | ((in[5] & 0x3FF) << 1))) << ntz + out[28] + out[30] = int64((in[5] >> 10) & 0x7FF) << ntz + out[29] + out[31] = int64((in[5] >> 21) & 0x7FF) << ntz + out[30] + out[32] = int64((in[5] >> 32) & 0x7FF) << ntz + out[31] + out[33] = int64((in[5] >> 43) & 0x7FF) << ntz + out[32] + out[34] = int64(((in[5] >> 54) | ((in[6] & 0x1) << 10))) << ntz + out[33] + out[35] = int64((in[6] >> 1) & 0x7FF) << ntz + out[34] + out[36] = int64((in[6] >> 12) & 0x7FF) << ntz + out[35] + out[37] = int64((in[6] >> 23) & 0x7FF) << ntz + out[36] + out[38] = int64((in[6] >> 34) & 0x7FF) << ntz + out[37] + out[39] = int64((in[6] >> 45) & 0x7FF) << ntz + out[38] + out[40] = int64(((in[6] >> 56) | ((in[7] & 0x7) << 8))) << ntz + out[39] + out[41] = int64((in[7] >> 3) & 0x7FF) << ntz + out[40] + out[42] = int64((in[7] >> 14) & 0x7FF) << ntz + out[41] + out[43] = int64((in[7] >> 25) & 0x7FF) << ntz + out[42] + out[44] = int64((in[7] >> 36) & 0x7FF) << ntz + out[43] + out[45] = int64((in[7] >> 47) & 0x7FF) << ntz + out[44] + out[46] = int64(((in[7] >> 58) | ((in[8] & 0x1F) << 6))) << ntz + out[45] + out[47] = int64((in[8] >> 5) & 0x7FF) << ntz + out[46] + out[48] = int64((in[8] >> 16) & 0x7FF) << ntz + out[47] + out[49] = int64((in[8] >> 27) & 0x7FF) << ntz + out[48] + out[50] = int64((in[8] >> 38) & 0x7FF) << ntz + out[49] + out[51] = int64((in[8] >> 49) & 0x7FF) << ntz + out[50] + out[52] = int64(((in[8] >> 60) | ((in[9] & 0x7F) << 4))) << ntz + out[51] + out[53] = int64((in[9] >> 7) & 0x7FF) << ntz + out[52] + out[54] = int64((in[9] >> 18) & 0x7FF) << ntz + out[53] + out[55] = int64((in[9] >> 29) & 0x7FF) << ntz + out[54] + out[56] = int64((in[9] >> 40) & 0x7FF) << ntz + out[55] + out[57] = int64((in[9] >> 51) & 0x7FF) << ntz + out[56] + out[58] = int64(((in[9] >> 62) | ((in[10] & 0x1FF) << 2))) << ntz + out[57] + out[59] = int64((in[10] >> 9) & 0x7FF) << ntz + out[58] + out[60] = int64((in[10] >> 20) & 0x7FF) << ntz + out[59] + out[61] = int64((in[10] >> 31) & 0x7FF) << ntz + out[60] + out[62] = int64((in[10] >> 42) & 0x7FF) << ntz + out[61] + out[63] = int64((in[10] >> 53)) << ntz + out[62] +} + +func deltaunpack_int64_12(initoffset int64, in *[12]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFF) << ntz + initoffset + out[1] = int64((in[0] >> 12) & 0xFFF) << ntz + out[0] + out[2] = int64((in[0] >> 24) & 0xFFF) << ntz + out[1] + out[3] = int64((in[0] >> 36) & 0xFFF) << ntz + out[2] + out[4] = int64((in[0] >> 48) & 0xFFF) << ntz + out[3] + out[5] = int64(((in[0] >> 60) | ((in[1] & 0xFF) << 4))) << ntz + out[4] + out[6] = int64((in[1] >> 8) & 0xFFF) << ntz + out[5] + out[7] = int64((in[1] >> 20) & 0xFFF) << ntz + out[6] + out[8] = int64((in[1] >> 32) & 0xFFF) << ntz + out[7] + out[9] = int64((in[1] >> 44) & 0xFFF) << ntz + out[8] + out[10] = int64(((in[1] >> 56) | ((in[2] & 0xF) << 8))) << ntz + out[9] + out[11] = int64((in[2] >> 4) & 0xFFF) << ntz + out[10] + out[12] = int64((in[2] >> 16) & 0xFFF) << ntz + out[11] + out[13] = int64((in[2] >> 28) & 0xFFF) << ntz + out[12] + out[14] = int64((in[2] >> 40) & 0xFFF) << ntz + out[13] + out[15] = int64((in[2] >> 52)) << ntz + out[14] + out[16] = int64((in[3] >> 0) & 0xFFF) << ntz + out[15] + out[17] = int64((in[3] >> 12) & 0xFFF) << ntz + out[16] + out[18] = int64((in[3] >> 24) & 0xFFF) << ntz + out[17] + out[19] = int64((in[3] >> 36) & 0xFFF) << ntz + out[18] + out[20] = int64((in[3] >> 48) & 0xFFF) << ntz + out[19] + out[21] = int64(((in[3] >> 60) | ((in[4] & 0xFF) << 4))) << ntz + out[20] + out[22] = int64((in[4] >> 8) & 0xFFF) << ntz + out[21] + out[23] = int64((in[4] >> 20) & 0xFFF) << ntz + out[22] + out[24] = int64((in[4] >> 32) & 0xFFF) << ntz + out[23] + out[25] = int64((in[4] >> 44) & 0xFFF) << ntz + out[24] + out[26] = int64(((in[4] >> 56) | ((in[5] & 0xF) << 8))) << ntz + out[25] + out[27] = int64((in[5] >> 4) & 0xFFF) << ntz + out[26] + out[28] = int64((in[5] >> 16) & 0xFFF) << ntz + out[27] + out[29] = int64((in[5] >> 28) & 0xFFF) << ntz + out[28] + out[30] = int64((in[5] >> 40) & 0xFFF) << ntz + out[29] + out[31] = int64((in[5] >> 52)) << ntz + out[30] + out[32] = int64((in[6] >> 0) & 0xFFF) << ntz + out[31] + out[33] = int64((in[6] >> 12) & 0xFFF) << ntz + out[32] + out[34] = int64((in[6] >> 24) & 0xFFF) << ntz + out[33] + out[35] = int64((in[6] >> 36) & 0xFFF) << ntz + out[34] + out[36] = int64((in[6] >> 48) & 0xFFF) << ntz + out[35] + out[37] = int64(((in[6] >> 60) | ((in[7] & 0xFF) << 4))) << ntz + out[36] + out[38] = int64((in[7] >> 8) & 0xFFF) << ntz + out[37] + out[39] = int64((in[7] >> 20) & 0xFFF) << ntz + out[38] + out[40] = int64((in[7] >> 32) & 0xFFF) << ntz + out[39] + out[41] = int64((in[7] >> 44) & 0xFFF) << ntz + out[40] + out[42] = int64(((in[7] >> 56) | ((in[8] & 0xF) << 8))) << ntz + out[41] + out[43] = int64((in[8] >> 4) & 0xFFF) << ntz + out[42] + out[44] = int64((in[8] >> 16) & 0xFFF) << ntz + out[43] + out[45] = int64((in[8] >> 28) & 0xFFF) << ntz + out[44] + out[46] = int64((in[8] >> 40) & 0xFFF) << ntz + out[45] + out[47] = int64((in[8] >> 52)) << ntz + out[46] + out[48] = int64((in[9] >> 0) & 0xFFF) << ntz + out[47] + out[49] = int64((in[9] >> 12) & 0xFFF) << ntz + out[48] + out[50] = int64((in[9] >> 24) & 0xFFF) << ntz + out[49] + out[51] = int64((in[9] >> 36) & 0xFFF) << ntz + out[50] + out[52] = int64((in[9] >> 48) & 0xFFF) << ntz + out[51] + out[53] = int64(((in[9] >> 60) | ((in[10] & 0xFF) << 4))) << ntz + out[52] + out[54] = int64((in[10] >> 8) & 0xFFF) << ntz + out[53] + out[55] = int64((in[10] >> 20) & 0xFFF) << ntz + out[54] + out[56] = int64((in[10] >> 32) & 0xFFF) << ntz + out[55] + out[57] = int64((in[10] >> 44) & 0xFFF) << ntz + out[56] + out[58] = int64(((in[10] >> 56) | ((in[11] & 0xF) << 8))) << ntz + out[57] + out[59] = int64((in[11] >> 4) & 0xFFF) << ntz + out[58] + out[60] = int64((in[11] >> 16) & 0xFFF) << ntz + out[59] + out[61] = int64((in[11] >> 28) & 0xFFF) << ntz + out[60] + out[62] = int64((in[11] >> 40) & 0xFFF) << ntz + out[61] + out[63] = int64((in[11] >> 52)) << ntz + out[62] +} + +func deltaunpack_int64_13(initoffset int64, in *[13]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFF) << ntz + initoffset + out[1] = int64((in[0] >> 13) & 0x1FFF) << ntz + out[0] + out[2] = int64((in[0] >> 26) & 0x1FFF) << ntz + out[1] + out[3] = int64((in[0] >> 39) & 0x1FFF) << ntz + out[2] + out[4] = int64(((in[0] >> 52) | ((in[1] & 0x1) << 12))) << ntz + out[3] + out[5] = int64((in[1] >> 1) & 0x1FFF) << ntz + out[4] + out[6] = int64((in[1] >> 14) & 0x1FFF) << ntz + out[5] + out[7] = int64((in[1] >> 27) & 0x1FFF) << ntz + out[6] + out[8] = int64((in[1] >> 40) & 0x1FFF) << ntz + out[7] + out[9] = int64(((in[1] >> 53) | ((in[2] & 0x3) << 11))) << ntz + out[8] + out[10] = int64((in[2] >> 2) & 0x1FFF) << ntz + out[9] + out[11] = int64((in[2] >> 15) & 0x1FFF) << ntz + out[10] + out[12] = int64((in[2] >> 28) & 0x1FFF) << ntz + out[11] + out[13] = int64((in[2] >> 41) & 0x1FFF) << ntz + out[12] + out[14] = int64(((in[2] >> 54) | ((in[3] & 0x7) << 10))) << ntz + out[13] + out[15] = int64((in[3] >> 3) & 0x1FFF) << ntz + out[14] + out[16] = int64((in[3] >> 16) & 0x1FFF) << ntz + out[15] + out[17] = int64((in[3] >> 29) & 0x1FFF) << ntz + out[16] + out[18] = int64((in[3] >> 42) & 0x1FFF) << ntz + out[17] + out[19] = int64(((in[3] >> 55) | ((in[4] & 0xF) << 9))) << ntz + out[18] + out[20] = int64((in[4] >> 4) & 0x1FFF) << ntz + out[19] + out[21] = int64((in[4] >> 17) & 0x1FFF) << ntz + out[20] + out[22] = int64((in[4] >> 30) & 0x1FFF) << ntz + out[21] + out[23] = int64((in[4] >> 43) & 0x1FFF) << ntz + out[22] + out[24] = int64(((in[4] >> 56) | ((in[5] & 0x1F) << 8))) << ntz + out[23] + out[25] = int64((in[5] >> 5) & 0x1FFF) << ntz + out[24] + out[26] = int64((in[5] >> 18) & 0x1FFF) << ntz + out[25] + out[27] = int64((in[5] >> 31) & 0x1FFF) << ntz + out[26] + out[28] = int64((in[5] >> 44) & 0x1FFF) << ntz + out[27] + out[29] = int64(((in[5] >> 57) | ((in[6] & 0x3F) << 7))) << ntz + out[28] + out[30] = int64((in[6] >> 6) & 0x1FFF) << ntz + out[29] + out[31] = int64((in[6] >> 19) & 0x1FFF) << ntz + out[30] + out[32] = int64((in[6] >> 32) & 0x1FFF) << ntz + out[31] + out[33] = int64((in[6] >> 45) & 0x1FFF) << ntz + out[32] + out[34] = int64(((in[6] >> 58) | ((in[7] & 0x7F) << 6))) << ntz + out[33] + out[35] = int64((in[7] >> 7) & 0x1FFF) << ntz + out[34] + out[36] = int64((in[7] >> 20) & 0x1FFF) << ntz + out[35] + out[37] = int64((in[7] >> 33) & 0x1FFF) << ntz + out[36] + out[38] = int64((in[7] >> 46) & 0x1FFF) << ntz + out[37] + out[39] = int64(((in[7] >> 59) | ((in[8] & 0xFF) << 5))) << ntz + out[38] + out[40] = int64((in[8] >> 8) & 0x1FFF) << ntz + out[39] + out[41] = int64((in[8] >> 21) & 0x1FFF) << ntz + out[40] + out[42] = int64((in[8] >> 34) & 0x1FFF) << ntz + out[41] + out[43] = int64((in[8] >> 47) & 0x1FFF) << ntz + out[42] + out[44] = int64(((in[8] >> 60) | ((in[9] & 0x1FF) << 4))) << ntz + out[43] + out[45] = int64((in[9] >> 9) & 0x1FFF) << ntz + out[44] + out[46] = int64((in[9] >> 22) & 0x1FFF) << ntz + out[45] + out[47] = int64((in[9] >> 35) & 0x1FFF) << ntz + out[46] + out[48] = int64((in[9] >> 48) & 0x1FFF) << ntz + out[47] + out[49] = int64(((in[9] >> 61) | ((in[10] & 0x3FF) << 3))) << ntz + out[48] + out[50] = int64((in[10] >> 10) & 0x1FFF) << ntz + out[49] + out[51] = int64((in[10] >> 23) & 0x1FFF) << ntz + out[50] + out[52] = int64((in[10] >> 36) & 0x1FFF) << ntz + out[51] + out[53] = int64((in[10] >> 49) & 0x1FFF) << ntz + out[52] + out[54] = int64(((in[10] >> 62) | ((in[11] & 0x7FF) << 2))) << ntz + out[53] + out[55] = int64((in[11] >> 11) & 0x1FFF) << ntz + out[54] + out[56] = int64((in[11] >> 24) & 0x1FFF) << ntz + out[55] + out[57] = int64((in[11] >> 37) & 0x1FFF) << ntz + out[56] + out[58] = int64((in[11] >> 50) & 0x1FFF) << ntz + out[57] + out[59] = int64(((in[11] >> 63) | ((in[12] & 0xFFF) << 1))) << ntz + out[58] + out[60] = int64((in[12] >> 12) & 0x1FFF) << ntz + out[59] + out[61] = int64((in[12] >> 25) & 0x1FFF) << ntz + out[60] + out[62] = int64((in[12] >> 38) & 0x1FFF) << ntz + out[61] + out[63] = int64((in[12] >> 51)) << ntz + out[62] +} + +func deltaunpack_int64_14(initoffset int64, in *[14]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFF) << ntz + initoffset + out[1] = int64((in[0] >> 14) & 0x3FFF) << ntz + out[0] + out[2] = int64((in[0] >> 28) & 0x3FFF) << ntz + out[1] + out[3] = int64((in[0] >> 42) & 0x3FFF) << ntz + out[2] + out[4] = int64(((in[0] >> 56) | ((in[1] & 0x3F) << 8))) << ntz + out[3] + out[5] = int64((in[1] >> 6) & 0x3FFF) << ntz + out[4] + out[6] = int64((in[1] >> 20) & 0x3FFF) << ntz + out[5] + out[7] = int64((in[1] >> 34) & 0x3FFF) << ntz + out[6] + out[8] = int64((in[1] >> 48) & 0x3FFF) << ntz + out[7] + out[9] = int64(((in[1] >> 62) | ((in[2] & 0xFFF) << 2))) << ntz + out[8] + out[10] = int64((in[2] >> 12) & 0x3FFF) << ntz + out[9] + out[11] = int64((in[2] >> 26) & 0x3FFF) << ntz + out[10] + out[12] = int64((in[2] >> 40) & 0x3FFF) << ntz + out[11] + out[13] = int64(((in[2] >> 54) | ((in[3] & 0xF) << 10))) << ntz + out[12] + out[14] = int64((in[3] >> 4) & 0x3FFF) << ntz + out[13] + out[15] = int64((in[3] >> 18) & 0x3FFF) << ntz + out[14] + out[16] = int64((in[3] >> 32) & 0x3FFF) << ntz + out[15] + out[17] = int64((in[3] >> 46) & 0x3FFF) << ntz + out[16] + out[18] = int64(((in[3] >> 60) | ((in[4] & 0x3FF) << 4))) << ntz + out[17] + out[19] = int64((in[4] >> 10) & 0x3FFF) << ntz + out[18] + out[20] = int64((in[4] >> 24) & 0x3FFF) << ntz + out[19] + out[21] = int64((in[4] >> 38) & 0x3FFF) << ntz + out[20] + out[22] = int64(((in[4] >> 52) | ((in[5] & 0x3) << 12))) << ntz + out[21] + out[23] = int64((in[5] >> 2) & 0x3FFF) << ntz + out[22] + out[24] = int64((in[5] >> 16) & 0x3FFF) << ntz + out[23] + out[25] = int64((in[5] >> 30) & 0x3FFF) << ntz + out[24] + out[26] = int64((in[5] >> 44) & 0x3FFF) << ntz + out[25] + out[27] = int64(((in[5] >> 58) | ((in[6] & 0xFF) << 6))) << ntz + out[26] + out[28] = int64((in[6] >> 8) & 0x3FFF) << ntz + out[27] + out[29] = int64((in[6] >> 22) & 0x3FFF) << ntz + out[28] + out[30] = int64((in[6] >> 36) & 0x3FFF) << ntz + out[29] + out[31] = int64((in[6] >> 50)) << ntz + out[30] + out[32] = int64((in[7] >> 0) & 0x3FFF) << ntz + out[31] + out[33] = int64((in[7] >> 14) & 0x3FFF) << ntz + out[32] + out[34] = int64((in[7] >> 28) & 0x3FFF) << ntz + out[33] + out[35] = int64((in[7] >> 42) & 0x3FFF) << ntz + out[34] + out[36] = int64(((in[7] >> 56) | ((in[8] & 0x3F) << 8))) << ntz + out[35] + out[37] = int64((in[8] >> 6) & 0x3FFF) << ntz + out[36] + out[38] = int64((in[8] >> 20) & 0x3FFF) << ntz + out[37] + out[39] = int64((in[8] >> 34) & 0x3FFF) << ntz + out[38] + out[40] = int64((in[8] >> 48) & 0x3FFF) << ntz + out[39] + out[41] = int64(((in[8] >> 62) | ((in[9] & 0xFFF) << 2))) << ntz + out[40] + out[42] = int64((in[9] >> 12) & 0x3FFF) << ntz + out[41] + out[43] = int64((in[9] >> 26) & 0x3FFF) << ntz + out[42] + out[44] = int64((in[9] >> 40) & 0x3FFF) << ntz + out[43] + out[45] = int64(((in[9] >> 54) | ((in[10] & 0xF) << 10))) << ntz + out[44] + out[46] = int64((in[10] >> 4) & 0x3FFF) << ntz + out[45] + out[47] = int64((in[10] >> 18) & 0x3FFF) << ntz + out[46] + out[48] = int64((in[10] >> 32) & 0x3FFF) << ntz + out[47] + out[49] = int64((in[10] >> 46) & 0x3FFF) << ntz + out[48] + out[50] = int64(((in[10] >> 60) | ((in[11] & 0x3FF) << 4))) << ntz + out[49] + out[51] = int64((in[11] >> 10) & 0x3FFF) << ntz + out[50] + out[52] = int64((in[11] >> 24) & 0x3FFF) << ntz + out[51] + out[53] = int64((in[11] >> 38) & 0x3FFF) << ntz + out[52] + out[54] = int64(((in[11] >> 52) | ((in[12] & 0x3) << 12))) << ntz + out[53] + out[55] = int64((in[12] >> 2) & 0x3FFF) << ntz + out[54] + out[56] = int64((in[12] >> 16) & 0x3FFF) << ntz + out[55] + out[57] = int64((in[12] >> 30) & 0x3FFF) << ntz + out[56] + out[58] = int64((in[12] >> 44) & 0x3FFF) << ntz + out[57] + out[59] = int64(((in[12] >> 58) | ((in[13] & 0xFF) << 6))) << ntz + out[58] + out[60] = int64((in[13] >> 8) & 0x3FFF) << ntz + out[59] + out[61] = int64((in[13] >> 22) & 0x3FFF) << ntz + out[60] + out[62] = int64((in[13] >> 36) & 0x3FFF) << ntz + out[61] + out[63] = int64((in[13] >> 50)) << ntz + out[62] +} + +func deltaunpack_int64_15(initoffset int64, in *[15]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFF) << ntz + initoffset + out[1] = int64((in[0] >> 15) & 0x7FFF) << ntz + out[0] + out[2] = int64((in[0] >> 30) & 0x7FFF) << ntz + out[1] + out[3] = int64((in[0] >> 45) & 0x7FFF) << ntz + out[2] + out[4] = int64(((in[0] >> 60) | ((in[1] & 0x7FF) << 4))) << ntz + out[3] + out[5] = int64((in[1] >> 11) & 0x7FFF) << ntz + out[4] + out[6] = int64((in[1] >> 26) & 0x7FFF) << ntz + out[5] + out[7] = int64((in[1] >> 41) & 0x7FFF) << ntz + out[6] + out[8] = int64(((in[1] >> 56) | ((in[2] & 0x7F) << 8))) << ntz + out[7] + out[9] = int64((in[2] >> 7) & 0x7FFF) << ntz + out[8] + out[10] = int64((in[2] >> 22) & 0x7FFF) << ntz + out[9] + out[11] = int64((in[2] >> 37) & 0x7FFF) << ntz + out[10] + out[12] = int64(((in[2] >> 52) | ((in[3] & 0x7) << 12))) << ntz + out[11] + out[13] = int64((in[3] >> 3) & 0x7FFF) << ntz + out[12] + out[14] = int64((in[3] >> 18) & 0x7FFF) << ntz + out[13] + out[15] = int64((in[3] >> 33) & 0x7FFF) << ntz + out[14] + out[16] = int64((in[3] >> 48) & 0x7FFF) << ntz + out[15] + out[17] = int64(((in[3] >> 63) | ((in[4] & 0x3FFF) << 1))) << ntz + out[16] + out[18] = int64((in[4] >> 14) & 0x7FFF) << ntz + out[17] + out[19] = int64((in[4] >> 29) & 0x7FFF) << ntz + out[18] + out[20] = int64((in[4] >> 44) & 0x7FFF) << ntz + out[19] + out[21] = int64(((in[4] >> 59) | ((in[5] & 0x3FF) << 5))) << ntz + out[20] + out[22] = int64((in[5] >> 10) & 0x7FFF) << ntz + out[21] + out[23] = int64((in[5] >> 25) & 0x7FFF) << ntz + out[22] + out[24] = int64((in[5] >> 40) & 0x7FFF) << ntz + out[23] + out[25] = int64(((in[5] >> 55) | ((in[6] & 0x3F) << 9))) << ntz + out[24] + out[26] = int64((in[6] >> 6) & 0x7FFF) << ntz + out[25] + out[27] = int64((in[6] >> 21) & 0x7FFF) << ntz + out[26] + out[28] = int64((in[6] >> 36) & 0x7FFF) << ntz + out[27] + out[29] = int64(((in[6] >> 51) | ((in[7] & 0x3) << 13))) << ntz + out[28] + out[30] = int64((in[7] >> 2) & 0x7FFF) << ntz + out[29] + out[31] = int64((in[7] >> 17) & 0x7FFF) << ntz + out[30] + out[32] = int64((in[7] >> 32) & 0x7FFF) << ntz + out[31] + out[33] = int64((in[7] >> 47) & 0x7FFF) << ntz + out[32] + out[34] = int64(((in[7] >> 62) | ((in[8] & 0x1FFF) << 2))) << ntz + out[33] + out[35] = int64((in[8] >> 13) & 0x7FFF) << ntz + out[34] + out[36] = int64((in[8] >> 28) & 0x7FFF) << ntz + out[35] + out[37] = int64((in[8] >> 43) & 0x7FFF) << ntz + out[36] + out[38] = int64(((in[8] >> 58) | ((in[9] & 0x1FF) << 6))) << ntz + out[37] + out[39] = int64((in[9] >> 9) & 0x7FFF) << ntz + out[38] + out[40] = int64((in[9] >> 24) & 0x7FFF) << ntz + out[39] + out[41] = int64((in[9] >> 39) & 0x7FFF) << ntz + out[40] + out[42] = int64(((in[9] >> 54) | ((in[10] & 0x1F) << 10))) << ntz + out[41] + out[43] = int64((in[10] >> 5) & 0x7FFF) << ntz + out[42] + out[44] = int64((in[10] >> 20) & 0x7FFF) << ntz + out[43] + out[45] = int64((in[10] >> 35) & 0x7FFF) << ntz + out[44] + out[46] = int64(((in[10] >> 50) | ((in[11] & 0x1) << 14))) << ntz + out[45] + out[47] = int64((in[11] >> 1) & 0x7FFF) << ntz + out[46] + out[48] = int64((in[11] >> 16) & 0x7FFF) << ntz + out[47] + out[49] = int64((in[11] >> 31) & 0x7FFF) << ntz + out[48] + out[50] = int64((in[11] >> 46) & 0x7FFF) << ntz + out[49] + out[51] = int64(((in[11] >> 61) | ((in[12] & 0xFFF) << 3))) << ntz + out[50] + out[52] = int64((in[12] >> 12) & 0x7FFF) << ntz + out[51] + out[53] = int64((in[12] >> 27) & 0x7FFF) << ntz + out[52] + out[54] = int64((in[12] >> 42) & 0x7FFF) << ntz + out[53] + out[55] = int64(((in[12] >> 57) | ((in[13] & 0xFF) << 7))) << ntz + out[54] + out[56] = int64((in[13] >> 8) & 0x7FFF) << ntz + out[55] + out[57] = int64((in[13] >> 23) & 0x7FFF) << ntz + out[56] + out[58] = int64((in[13] >> 38) & 0x7FFF) << ntz + out[57] + out[59] = int64(((in[13] >> 53) | ((in[14] & 0xF) << 11))) << ntz + out[58] + out[60] = int64((in[14] >> 4) & 0x7FFF) << ntz + out[59] + out[61] = int64((in[14] >> 19) & 0x7FFF) << ntz + out[60] + out[62] = int64((in[14] >> 34) & 0x7FFF) << ntz + out[61] + out[63] = int64((in[14] >> 49)) << ntz + out[62] +} + +func deltaunpack_int64_16(initoffset int64, in *[16]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 16) & 0xFFFF) << ntz + out[0] + out[2] = int64((in[0] >> 32) & 0xFFFF) << ntz + out[1] + out[3] = int64((in[0] >> 48)) << ntz + out[2] + out[4] = int64((in[1] >> 0) & 0xFFFF) << ntz + out[3] + out[5] = int64((in[1] >> 16) & 0xFFFF) << ntz + out[4] + out[6] = int64((in[1] >> 32) & 0xFFFF) << ntz + out[5] + out[7] = int64((in[1] >> 48)) << ntz + out[6] + out[8] = int64((in[2] >> 0) & 0xFFFF) << ntz + out[7] + out[9] = int64((in[2] >> 16) & 0xFFFF) << ntz + out[8] + out[10] = int64((in[2] >> 32) & 0xFFFF) << ntz + out[9] + out[11] = int64((in[2] >> 48)) << ntz + out[10] + out[12] = int64((in[3] >> 0) & 0xFFFF) << ntz + out[11] + out[13] = int64((in[3] >> 16) & 0xFFFF) << ntz + out[12] + out[14] = int64((in[3] >> 32) & 0xFFFF) << ntz + out[13] + out[15] = int64((in[3] >> 48)) << ntz + out[14] + out[16] = int64((in[4] >> 0) & 0xFFFF) << ntz + out[15] + out[17] = int64((in[4] >> 16) & 0xFFFF) << ntz + out[16] + out[18] = int64((in[4] >> 32) & 0xFFFF) << ntz + out[17] + out[19] = int64((in[4] >> 48)) << ntz + out[18] + out[20] = int64((in[5] >> 0) & 0xFFFF) << ntz + out[19] + out[21] = int64((in[5] >> 16) & 0xFFFF) << ntz + out[20] + out[22] = int64((in[5] >> 32) & 0xFFFF) << ntz + out[21] + out[23] = int64((in[5] >> 48)) << ntz + out[22] + out[24] = int64((in[6] >> 0) & 0xFFFF) << ntz + out[23] + out[25] = int64((in[6] >> 16) & 0xFFFF) << ntz + out[24] + out[26] = int64((in[6] >> 32) & 0xFFFF) << ntz + out[25] + out[27] = int64((in[6] >> 48)) << ntz + out[26] + out[28] = int64((in[7] >> 0) & 0xFFFF) << ntz + out[27] + out[29] = int64((in[7] >> 16) & 0xFFFF) << ntz + out[28] + out[30] = int64((in[7] >> 32) & 0xFFFF) << ntz + out[29] + out[31] = int64((in[7] >> 48)) << ntz + out[30] + out[32] = int64((in[8] >> 0) & 0xFFFF) << ntz + out[31] + out[33] = int64((in[8] >> 16) & 0xFFFF) << ntz + out[32] + out[34] = int64((in[8] >> 32) & 0xFFFF) << ntz + out[33] + out[35] = int64((in[8] >> 48)) << ntz + out[34] + out[36] = int64((in[9] >> 0) & 0xFFFF) << ntz + out[35] + out[37] = int64((in[9] >> 16) & 0xFFFF) << ntz + out[36] + out[38] = int64((in[9] >> 32) & 0xFFFF) << ntz + out[37] + out[39] = int64((in[9] >> 48)) << ntz + out[38] + out[40] = int64((in[10] >> 0) & 0xFFFF) << ntz + out[39] + out[41] = int64((in[10] >> 16) & 0xFFFF) << ntz + out[40] + out[42] = int64((in[10] >> 32) & 0xFFFF) << ntz + out[41] + out[43] = int64((in[10] >> 48)) << ntz + out[42] + out[44] = int64((in[11] >> 0) & 0xFFFF) << ntz + out[43] + out[45] = int64((in[11] >> 16) & 0xFFFF) << ntz + out[44] + out[46] = int64((in[11] >> 32) & 0xFFFF) << ntz + out[45] + out[47] = int64((in[11] >> 48)) << ntz + out[46] + out[48] = int64((in[12] >> 0) & 0xFFFF) << ntz + out[47] + out[49] = int64((in[12] >> 16) & 0xFFFF) << ntz + out[48] + out[50] = int64((in[12] >> 32) & 0xFFFF) << ntz + out[49] + out[51] = int64((in[12] >> 48)) << ntz + out[50] + out[52] = int64((in[13] >> 0) & 0xFFFF) << ntz + out[51] + out[53] = int64((in[13] >> 16) & 0xFFFF) << ntz + out[52] + out[54] = int64((in[13] >> 32) & 0xFFFF) << ntz + out[53] + out[55] = int64((in[13] >> 48)) << ntz + out[54] + out[56] = int64((in[14] >> 0) & 0xFFFF) << ntz + out[55] + out[57] = int64((in[14] >> 16) & 0xFFFF) << ntz + out[56] + out[58] = int64((in[14] >> 32) & 0xFFFF) << ntz + out[57] + out[59] = int64((in[14] >> 48)) << ntz + out[58] + out[60] = int64((in[15] >> 0) & 0xFFFF) << ntz + out[59] + out[61] = int64((in[15] >> 16) & 0xFFFF) << ntz + out[60] + out[62] = int64((in[15] >> 32) & 0xFFFF) << ntz + out[61] + out[63] = int64((in[15] >> 48)) << ntz + out[62] +} + +func deltaunpack_int64_17(initoffset int64, in *[17]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFF) << ntz + initoffset + out[1] = int64((in[0] >> 17) & 0x1FFFF) << ntz + out[0] + out[2] = int64((in[0] >> 34) & 0x1FFFF) << ntz + out[1] + out[3] = int64(((in[0] >> 51) | ((in[1] & 0xF) << 13))) << ntz + out[2] + out[4] = int64((in[1] >> 4) & 0x1FFFF) << ntz + out[3] + out[5] = int64((in[1] >> 21) & 0x1FFFF) << ntz + out[4] + out[6] = int64((in[1] >> 38) & 0x1FFFF) << ntz + out[5] + out[7] = int64(((in[1] >> 55) | ((in[2] & 0xFF) << 9))) << ntz + out[6] + out[8] = int64((in[2] >> 8) & 0x1FFFF) << ntz + out[7] + out[9] = int64((in[2] >> 25) & 0x1FFFF) << ntz + out[8] + out[10] = int64((in[2] >> 42) & 0x1FFFF) << ntz + out[9] + out[11] = int64(((in[2] >> 59) | ((in[3] & 0xFFF) << 5))) << ntz + out[10] + out[12] = int64((in[3] >> 12) & 0x1FFFF) << ntz + out[11] + out[13] = int64((in[3] >> 29) & 0x1FFFF) << ntz + out[12] + out[14] = int64((in[3] >> 46) & 0x1FFFF) << ntz + out[13] + out[15] = int64(((in[3] >> 63) | ((in[4] & 0xFFFF) << 1))) << ntz + out[14] + out[16] = int64((in[4] >> 16) & 0x1FFFF) << ntz + out[15] + out[17] = int64((in[4] >> 33) & 0x1FFFF) << ntz + out[16] + out[18] = int64(((in[4] >> 50) | ((in[5] & 0x7) << 14))) << ntz + out[17] + out[19] = int64((in[5] >> 3) & 0x1FFFF) << ntz + out[18] + out[20] = int64((in[5] >> 20) & 0x1FFFF) << ntz + out[19] + out[21] = int64((in[5] >> 37) & 0x1FFFF) << ntz + out[20] + out[22] = int64(((in[5] >> 54) | ((in[6] & 0x7F) << 10))) << ntz + out[21] + out[23] = int64((in[6] >> 7) & 0x1FFFF) << ntz + out[22] + out[24] = int64((in[6] >> 24) & 0x1FFFF) << ntz + out[23] + out[25] = int64((in[6] >> 41) & 0x1FFFF) << ntz + out[24] + out[26] = int64(((in[6] >> 58) | ((in[7] & 0x7FF) << 6))) << ntz + out[25] + out[27] = int64((in[7] >> 11) & 0x1FFFF) << ntz + out[26] + out[28] = int64((in[7] >> 28) & 0x1FFFF) << ntz + out[27] + out[29] = int64((in[7] >> 45) & 0x1FFFF) << ntz + out[28] + out[30] = int64(((in[7] >> 62) | ((in[8] & 0x7FFF) << 2))) << ntz + out[29] + out[31] = int64((in[8] >> 15) & 0x1FFFF) << ntz + out[30] + out[32] = int64((in[8] >> 32) & 0x1FFFF) << ntz + out[31] + out[33] = int64(((in[8] >> 49) | ((in[9] & 0x3) << 15))) << ntz + out[32] + out[34] = int64((in[9] >> 2) & 0x1FFFF) << ntz + out[33] + out[35] = int64((in[9] >> 19) & 0x1FFFF) << ntz + out[34] + out[36] = int64((in[9] >> 36) & 0x1FFFF) << ntz + out[35] + out[37] = int64(((in[9] >> 53) | ((in[10] & 0x3F) << 11))) << ntz + out[36] + out[38] = int64((in[10] >> 6) & 0x1FFFF) << ntz + out[37] + out[39] = int64((in[10] >> 23) & 0x1FFFF) << ntz + out[38] + out[40] = int64((in[10] >> 40) & 0x1FFFF) << ntz + out[39] + out[41] = int64(((in[10] >> 57) | ((in[11] & 0x3FF) << 7))) << ntz + out[40] + out[42] = int64((in[11] >> 10) & 0x1FFFF) << ntz + out[41] + out[43] = int64((in[11] >> 27) & 0x1FFFF) << ntz + out[42] + out[44] = int64((in[11] >> 44) & 0x1FFFF) << ntz + out[43] + out[45] = int64(((in[11] >> 61) | ((in[12] & 0x3FFF) << 3))) << ntz + out[44] + out[46] = int64((in[12] >> 14) & 0x1FFFF) << ntz + out[45] + out[47] = int64((in[12] >> 31) & 0x1FFFF) << ntz + out[46] + out[48] = int64(((in[12] >> 48) | ((in[13] & 0x1) << 16))) << ntz + out[47] + out[49] = int64((in[13] >> 1) & 0x1FFFF) << ntz + out[48] + out[50] = int64((in[13] >> 18) & 0x1FFFF) << ntz + out[49] + out[51] = int64((in[13] >> 35) & 0x1FFFF) << ntz + out[50] + out[52] = int64(((in[13] >> 52) | ((in[14] & 0x1F) << 12))) << ntz + out[51] + out[53] = int64((in[14] >> 5) & 0x1FFFF) << ntz + out[52] + out[54] = int64((in[14] >> 22) & 0x1FFFF) << ntz + out[53] + out[55] = int64((in[14] >> 39) & 0x1FFFF) << ntz + out[54] + out[56] = int64(((in[14] >> 56) | ((in[15] & 0x1FF) << 8))) << ntz + out[55] + out[57] = int64((in[15] >> 9) & 0x1FFFF) << ntz + out[56] + out[58] = int64((in[15] >> 26) & 0x1FFFF) << ntz + out[57] + out[59] = int64((in[15] >> 43) & 0x1FFFF) << ntz + out[58] + out[60] = int64(((in[15] >> 60) | ((in[16] & 0x1FFF) << 4))) << ntz + out[59] + out[61] = int64((in[16] >> 13) & 0x1FFFF) << ntz + out[60] + out[62] = int64((in[16] >> 30) & 0x1FFFF) << ntz + out[61] + out[63] = int64((in[16] >> 47)) << ntz + out[62] +} + +func deltaunpack_int64_18(initoffset int64, in *[18]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFF) << ntz + initoffset + out[1] = int64((in[0] >> 18) & 0x3FFFF) << ntz + out[0] + out[2] = int64((in[0] >> 36) & 0x3FFFF) << ntz + out[1] + out[3] = int64(((in[0] >> 54) | ((in[1] & 0xFF) << 10))) << ntz + out[2] + out[4] = int64((in[1] >> 8) & 0x3FFFF) << ntz + out[3] + out[5] = int64((in[1] >> 26) & 0x3FFFF) << ntz + out[4] + out[6] = int64((in[1] >> 44) & 0x3FFFF) << ntz + out[5] + out[7] = int64(((in[1] >> 62) | ((in[2] & 0xFFFF) << 2))) << ntz + out[6] + out[8] = int64((in[2] >> 16) & 0x3FFFF) << ntz + out[7] + out[9] = int64((in[2] >> 34) & 0x3FFFF) << ntz + out[8] + out[10] = int64(((in[2] >> 52) | ((in[3] & 0x3F) << 12))) << ntz + out[9] + out[11] = int64((in[3] >> 6) & 0x3FFFF) << ntz + out[10] + out[12] = int64((in[3] >> 24) & 0x3FFFF) << ntz + out[11] + out[13] = int64((in[3] >> 42) & 0x3FFFF) << ntz + out[12] + out[14] = int64(((in[3] >> 60) | ((in[4] & 0x3FFF) << 4))) << ntz + out[13] + out[15] = int64((in[4] >> 14) & 0x3FFFF) << ntz + out[14] + out[16] = int64((in[4] >> 32) & 0x3FFFF) << ntz + out[15] + out[17] = int64(((in[4] >> 50) | ((in[5] & 0xF) << 14))) << ntz + out[16] + out[18] = int64((in[5] >> 4) & 0x3FFFF) << ntz + out[17] + out[19] = int64((in[5] >> 22) & 0x3FFFF) << ntz + out[18] + out[20] = int64((in[5] >> 40) & 0x3FFFF) << ntz + out[19] + out[21] = int64(((in[5] >> 58) | ((in[6] & 0xFFF) << 6))) << ntz + out[20] + out[22] = int64((in[6] >> 12) & 0x3FFFF) << ntz + out[21] + out[23] = int64((in[6] >> 30) & 0x3FFFF) << ntz + out[22] + out[24] = int64(((in[6] >> 48) | ((in[7] & 0x3) << 16))) << ntz + out[23] + out[25] = int64((in[7] >> 2) & 0x3FFFF) << ntz + out[24] + out[26] = int64((in[7] >> 20) & 0x3FFFF) << ntz + out[25] + out[27] = int64((in[7] >> 38) & 0x3FFFF) << ntz + out[26] + out[28] = int64(((in[7] >> 56) | ((in[8] & 0x3FF) << 8))) << ntz + out[27] + out[29] = int64((in[8] >> 10) & 0x3FFFF) << ntz + out[28] + out[30] = int64((in[8] >> 28) & 0x3FFFF) << ntz + out[29] + out[31] = int64((in[8] >> 46)) << ntz + out[30] + out[32] = int64((in[9] >> 0) & 0x3FFFF) << ntz + out[31] + out[33] = int64((in[9] >> 18) & 0x3FFFF) << ntz + out[32] + out[34] = int64((in[9] >> 36) & 0x3FFFF) << ntz + out[33] + out[35] = int64(((in[9] >> 54) | ((in[10] & 0xFF) << 10))) << ntz + out[34] + out[36] = int64((in[10] >> 8) & 0x3FFFF) << ntz + out[35] + out[37] = int64((in[10] >> 26) & 0x3FFFF) << ntz + out[36] + out[38] = int64((in[10] >> 44) & 0x3FFFF) << ntz + out[37] + out[39] = int64(((in[10] >> 62) | ((in[11] & 0xFFFF) << 2))) << ntz + out[38] + out[40] = int64((in[11] >> 16) & 0x3FFFF) << ntz + out[39] + out[41] = int64((in[11] >> 34) & 0x3FFFF) << ntz + out[40] + out[42] = int64(((in[11] >> 52) | ((in[12] & 0x3F) << 12))) << ntz + out[41] + out[43] = int64((in[12] >> 6) & 0x3FFFF) << ntz + out[42] + out[44] = int64((in[12] >> 24) & 0x3FFFF) << ntz + out[43] + out[45] = int64((in[12] >> 42) & 0x3FFFF) << ntz + out[44] + out[46] = int64(((in[12] >> 60) | ((in[13] & 0x3FFF) << 4))) << ntz + out[45] + out[47] = int64((in[13] >> 14) & 0x3FFFF) << ntz + out[46] + out[48] = int64((in[13] >> 32) & 0x3FFFF) << ntz + out[47] + out[49] = int64(((in[13] >> 50) | ((in[14] & 0xF) << 14))) << ntz + out[48] + out[50] = int64((in[14] >> 4) & 0x3FFFF) << ntz + out[49] + out[51] = int64((in[14] >> 22) & 0x3FFFF) << ntz + out[50] + out[52] = int64((in[14] >> 40) & 0x3FFFF) << ntz + out[51] + out[53] = int64(((in[14] >> 58) | ((in[15] & 0xFFF) << 6))) << ntz + out[52] + out[54] = int64((in[15] >> 12) & 0x3FFFF) << ntz + out[53] + out[55] = int64((in[15] >> 30) & 0x3FFFF) << ntz + out[54] + out[56] = int64(((in[15] >> 48) | ((in[16] & 0x3) << 16))) << ntz + out[55] + out[57] = int64((in[16] >> 2) & 0x3FFFF) << ntz + out[56] + out[58] = int64((in[16] >> 20) & 0x3FFFF) << ntz + out[57] + out[59] = int64((in[16] >> 38) & 0x3FFFF) << ntz + out[58] + out[60] = int64(((in[16] >> 56) | ((in[17] & 0x3FF) << 8))) << ntz + out[59] + out[61] = int64((in[17] >> 10) & 0x3FFFF) << ntz + out[60] + out[62] = int64((in[17] >> 28) & 0x3FFFF) << ntz + out[61] + out[63] = int64((in[17] >> 46)) << ntz + out[62] +} + +func deltaunpack_int64_19(initoffset int64, in *[19]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFF) << ntz + initoffset + out[1] = int64((in[0] >> 19) & 0x7FFFF) << ntz + out[0] + out[2] = int64((in[0] >> 38) & 0x7FFFF) << ntz + out[1] + out[3] = int64(((in[0] >> 57) | ((in[1] & 0xFFF) << 7))) << ntz + out[2] + out[4] = int64((in[1] >> 12) & 0x7FFFF) << ntz + out[3] + out[5] = int64((in[1] >> 31) & 0x7FFFF) << ntz + out[4] + out[6] = int64(((in[1] >> 50) | ((in[2] & 0x1F) << 14))) << ntz + out[5] + out[7] = int64((in[2] >> 5) & 0x7FFFF) << ntz + out[6] + out[8] = int64((in[2] >> 24) & 0x7FFFF) << ntz + out[7] + out[9] = int64((in[2] >> 43) & 0x7FFFF) << ntz + out[8] + out[10] = int64(((in[2] >> 62) | ((in[3] & 0x1FFFF) << 2))) << ntz + out[9] + out[11] = int64((in[3] >> 17) & 0x7FFFF) << ntz + out[10] + out[12] = int64((in[3] >> 36) & 0x7FFFF) << ntz + out[11] + out[13] = int64(((in[3] >> 55) | ((in[4] & 0x3FF) << 9))) << ntz + out[12] + out[14] = int64((in[4] >> 10) & 0x7FFFF) << ntz + out[13] + out[15] = int64((in[4] >> 29) & 0x7FFFF) << ntz + out[14] + out[16] = int64(((in[4] >> 48) | ((in[5] & 0x7) << 16))) << ntz + out[15] + out[17] = int64((in[5] >> 3) & 0x7FFFF) << ntz + out[16] + out[18] = int64((in[5] >> 22) & 0x7FFFF) << ntz + out[17] + out[19] = int64((in[5] >> 41) & 0x7FFFF) << ntz + out[18] + out[20] = int64(((in[5] >> 60) | ((in[6] & 0x7FFF) << 4))) << ntz + out[19] + out[21] = int64((in[6] >> 15) & 0x7FFFF) << ntz + out[20] + out[22] = int64((in[6] >> 34) & 0x7FFFF) << ntz + out[21] + out[23] = int64(((in[6] >> 53) | ((in[7] & 0xFF) << 11))) << ntz + out[22] + out[24] = int64((in[7] >> 8) & 0x7FFFF) << ntz + out[23] + out[25] = int64((in[7] >> 27) & 0x7FFFF) << ntz + out[24] + out[26] = int64(((in[7] >> 46) | ((in[8] & 0x1) << 18))) << ntz + out[25] + out[27] = int64((in[8] >> 1) & 0x7FFFF) << ntz + out[26] + out[28] = int64((in[8] >> 20) & 0x7FFFF) << ntz + out[27] + out[29] = int64((in[8] >> 39) & 0x7FFFF) << ntz + out[28] + out[30] = int64(((in[8] >> 58) | ((in[9] & 0x1FFF) << 6))) << ntz + out[29] + out[31] = int64((in[9] >> 13) & 0x7FFFF) << ntz + out[30] + out[32] = int64((in[9] >> 32) & 0x7FFFF) << ntz + out[31] + out[33] = int64(((in[9] >> 51) | ((in[10] & 0x3F) << 13))) << ntz + out[32] + out[34] = int64((in[10] >> 6) & 0x7FFFF) << ntz + out[33] + out[35] = int64((in[10] >> 25) & 0x7FFFF) << ntz + out[34] + out[36] = int64((in[10] >> 44) & 0x7FFFF) << ntz + out[35] + out[37] = int64(((in[10] >> 63) | ((in[11] & 0x3FFFF) << 1))) << ntz + out[36] + out[38] = int64((in[11] >> 18) & 0x7FFFF) << ntz + out[37] + out[39] = int64((in[11] >> 37) & 0x7FFFF) << ntz + out[38] + out[40] = int64(((in[11] >> 56) | ((in[12] & 0x7FF) << 8))) << ntz + out[39] + out[41] = int64((in[12] >> 11) & 0x7FFFF) << ntz + out[40] + out[42] = int64((in[12] >> 30) & 0x7FFFF) << ntz + out[41] + out[43] = int64(((in[12] >> 49) | ((in[13] & 0xF) << 15))) << ntz + out[42] + out[44] = int64((in[13] >> 4) & 0x7FFFF) << ntz + out[43] + out[45] = int64((in[13] >> 23) & 0x7FFFF) << ntz + out[44] + out[46] = int64((in[13] >> 42) & 0x7FFFF) << ntz + out[45] + out[47] = int64(((in[13] >> 61) | ((in[14] & 0xFFFF) << 3))) << ntz + out[46] + out[48] = int64((in[14] >> 16) & 0x7FFFF) << ntz + out[47] + out[49] = int64((in[14] >> 35) & 0x7FFFF) << ntz + out[48] + out[50] = int64(((in[14] >> 54) | ((in[15] & 0x1FF) << 10))) << ntz + out[49] + out[51] = int64((in[15] >> 9) & 0x7FFFF) << ntz + out[50] + out[52] = int64((in[15] >> 28) & 0x7FFFF) << ntz + out[51] + out[53] = int64(((in[15] >> 47) | ((in[16] & 0x3) << 17))) << ntz + out[52] + out[54] = int64((in[16] >> 2) & 0x7FFFF) << ntz + out[53] + out[55] = int64((in[16] >> 21) & 0x7FFFF) << ntz + out[54] + out[56] = int64((in[16] >> 40) & 0x7FFFF) << ntz + out[55] + out[57] = int64(((in[16] >> 59) | ((in[17] & 0x3FFF) << 5))) << ntz + out[56] + out[58] = int64((in[17] >> 14) & 0x7FFFF) << ntz + out[57] + out[59] = int64((in[17] >> 33) & 0x7FFFF) << ntz + out[58] + out[60] = int64(((in[17] >> 52) | ((in[18] & 0x7F) << 12))) << ntz + out[59] + out[61] = int64((in[18] >> 7) & 0x7FFFF) << ntz + out[60] + out[62] = int64((in[18] >> 26) & 0x7FFFF) << ntz + out[61] + out[63] = int64((in[18] >> 45)) << ntz + out[62] +} + +func deltaunpack_int64_20(initoffset int64, in *[20]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 20) & 0xFFFFF) << ntz + out[0] + out[2] = int64((in[0] >> 40) & 0xFFFFF) << ntz + out[1] + out[3] = int64(((in[0] >> 60) | ((in[1] & 0xFFFF) << 4))) << ntz + out[2] + out[4] = int64((in[1] >> 16) & 0xFFFFF) << ntz + out[3] + out[5] = int64((in[1] >> 36) & 0xFFFFF) << ntz + out[4] + out[6] = int64(((in[1] >> 56) | ((in[2] & 0xFFF) << 8))) << ntz + out[5] + out[7] = int64((in[2] >> 12) & 0xFFFFF) << ntz + out[6] + out[8] = int64((in[2] >> 32) & 0xFFFFF) << ntz + out[7] + out[9] = int64(((in[2] >> 52) | ((in[3] & 0xFF) << 12))) << ntz + out[8] + out[10] = int64((in[3] >> 8) & 0xFFFFF) << ntz + out[9] + out[11] = int64((in[3] >> 28) & 0xFFFFF) << ntz + out[10] + out[12] = int64(((in[3] >> 48) | ((in[4] & 0xF) << 16))) << ntz + out[11] + out[13] = int64((in[4] >> 4) & 0xFFFFF) << ntz + out[12] + out[14] = int64((in[4] >> 24) & 0xFFFFF) << ntz + out[13] + out[15] = int64((in[4] >> 44)) << ntz + out[14] + out[16] = int64((in[5] >> 0) & 0xFFFFF) << ntz + out[15] + out[17] = int64((in[5] >> 20) & 0xFFFFF) << ntz + out[16] + out[18] = int64((in[5] >> 40) & 0xFFFFF) << ntz + out[17] + out[19] = int64(((in[5] >> 60) | ((in[6] & 0xFFFF) << 4))) << ntz + out[18] + out[20] = int64((in[6] >> 16) & 0xFFFFF) << ntz + out[19] + out[21] = int64((in[6] >> 36) & 0xFFFFF) << ntz + out[20] + out[22] = int64(((in[6] >> 56) | ((in[7] & 0xFFF) << 8))) << ntz + out[21] + out[23] = int64((in[7] >> 12) & 0xFFFFF) << ntz + out[22] + out[24] = int64((in[7] >> 32) & 0xFFFFF) << ntz + out[23] + out[25] = int64(((in[7] >> 52) | ((in[8] & 0xFF) << 12))) << ntz + out[24] + out[26] = int64((in[8] >> 8) & 0xFFFFF) << ntz + out[25] + out[27] = int64((in[8] >> 28) & 0xFFFFF) << ntz + out[26] + out[28] = int64(((in[8] >> 48) | ((in[9] & 0xF) << 16))) << ntz + out[27] + out[29] = int64((in[9] >> 4) & 0xFFFFF) << ntz + out[28] + out[30] = int64((in[9] >> 24) & 0xFFFFF) << ntz + out[29] + out[31] = int64((in[9] >> 44)) << ntz + out[30] + out[32] = int64((in[10] >> 0) & 0xFFFFF) << ntz + out[31] + out[33] = int64((in[10] >> 20) & 0xFFFFF) << ntz + out[32] + out[34] = int64((in[10] >> 40) & 0xFFFFF) << ntz + out[33] + out[35] = int64(((in[10] >> 60) | ((in[11] & 0xFFFF) << 4))) << ntz + out[34] + out[36] = int64((in[11] >> 16) & 0xFFFFF) << ntz + out[35] + out[37] = int64((in[11] >> 36) & 0xFFFFF) << ntz + out[36] + out[38] = int64(((in[11] >> 56) | ((in[12] & 0xFFF) << 8))) << ntz + out[37] + out[39] = int64((in[12] >> 12) & 0xFFFFF) << ntz + out[38] + out[40] = int64((in[12] >> 32) & 0xFFFFF) << ntz + out[39] + out[41] = int64(((in[12] >> 52) | ((in[13] & 0xFF) << 12))) << ntz + out[40] + out[42] = int64((in[13] >> 8) & 0xFFFFF) << ntz + out[41] + out[43] = int64((in[13] >> 28) & 0xFFFFF) << ntz + out[42] + out[44] = int64(((in[13] >> 48) | ((in[14] & 0xF) << 16))) << ntz + out[43] + out[45] = int64((in[14] >> 4) & 0xFFFFF) << ntz + out[44] + out[46] = int64((in[14] >> 24) & 0xFFFFF) << ntz + out[45] + out[47] = int64((in[14] >> 44)) << ntz + out[46] + out[48] = int64((in[15] >> 0) & 0xFFFFF) << ntz + out[47] + out[49] = int64((in[15] >> 20) & 0xFFFFF) << ntz + out[48] + out[50] = int64((in[15] >> 40) & 0xFFFFF) << ntz + out[49] + out[51] = int64(((in[15] >> 60) | ((in[16] & 0xFFFF) << 4))) << ntz + out[50] + out[52] = int64((in[16] >> 16) & 0xFFFFF) << ntz + out[51] + out[53] = int64((in[16] >> 36) & 0xFFFFF) << ntz + out[52] + out[54] = int64(((in[16] >> 56) | ((in[17] & 0xFFF) << 8))) << ntz + out[53] + out[55] = int64((in[17] >> 12) & 0xFFFFF) << ntz + out[54] + out[56] = int64((in[17] >> 32) & 0xFFFFF) << ntz + out[55] + out[57] = int64(((in[17] >> 52) | ((in[18] & 0xFF) << 12))) << ntz + out[56] + out[58] = int64((in[18] >> 8) & 0xFFFFF) << ntz + out[57] + out[59] = int64((in[18] >> 28) & 0xFFFFF) << ntz + out[58] + out[60] = int64(((in[18] >> 48) | ((in[19] & 0xF) << 16))) << ntz + out[59] + out[61] = int64((in[19] >> 4) & 0xFFFFF) << ntz + out[60] + out[62] = int64((in[19] >> 24) & 0xFFFFF) << ntz + out[61] + out[63] = int64((in[19] >> 44)) << ntz + out[62] +} + +func deltaunpack_int64_21(initoffset int64, in *[21]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 21) & 0x1FFFFF) << ntz + out[0] + out[2] = int64((in[0] >> 42) & 0x1FFFFF) << ntz + out[1] + out[3] = int64(((in[0] >> 63) | ((in[1] & 0xFFFFF) << 1))) << ntz + out[2] + out[4] = int64((in[1] >> 20) & 0x1FFFFF) << ntz + out[3] + out[5] = int64((in[1] >> 41) & 0x1FFFFF) << ntz + out[4] + out[6] = int64(((in[1] >> 62) | ((in[2] & 0x7FFFF) << 2))) << ntz + out[5] + out[7] = int64((in[2] >> 19) & 0x1FFFFF) << ntz + out[6] + out[8] = int64((in[2] >> 40) & 0x1FFFFF) << ntz + out[7] + out[9] = int64(((in[2] >> 61) | ((in[3] & 0x3FFFF) << 3))) << ntz + out[8] + out[10] = int64((in[3] >> 18) & 0x1FFFFF) << ntz + out[9] + out[11] = int64((in[3] >> 39) & 0x1FFFFF) << ntz + out[10] + out[12] = int64(((in[3] >> 60) | ((in[4] & 0x1FFFF) << 4))) << ntz + out[11] + out[13] = int64((in[4] >> 17) & 0x1FFFFF) << ntz + out[12] + out[14] = int64((in[4] >> 38) & 0x1FFFFF) << ntz + out[13] + out[15] = int64(((in[4] >> 59) | ((in[5] & 0xFFFF) << 5))) << ntz + out[14] + out[16] = int64((in[5] >> 16) & 0x1FFFFF) << ntz + out[15] + out[17] = int64((in[5] >> 37) & 0x1FFFFF) << ntz + out[16] + out[18] = int64(((in[5] >> 58) | ((in[6] & 0x7FFF) << 6))) << ntz + out[17] + out[19] = int64((in[6] >> 15) & 0x1FFFFF) << ntz + out[18] + out[20] = int64((in[6] >> 36) & 0x1FFFFF) << ntz + out[19] + out[21] = int64(((in[6] >> 57) | ((in[7] & 0x3FFF) << 7))) << ntz + out[20] + out[22] = int64((in[7] >> 14) & 0x1FFFFF) << ntz + out[21] + out[23] = int64((in[7] >> 35) & 0x1FFFFF) << ntz + out[22] + out[24] = int64(((in[7] >> 56) | ((in[8] & 0x1FFF) << 8))) << ntz + out[23] + out[25] = int64((in[8] >> 13) & 0x1FFFFF) << ntz + out[24] + out[26] = int64((in[8] >> 34) & 0x1FFFFF) << ntz + out[25] + out[27] = int64(((in[8] >> 55) | ((in[9] & 0xFFF) << 9))) << ntz + out[26] + out[28] = int64((in[9] >> 12) & 0x1FFFFF) << ntz + out[27] + out[29] = int64((in[9] >> 33) & 0x1FFFFF) << ntz + out[28] + out[30] = int64(((in[9] >> 54) | ((in[10] & 0x7FF) << 10))) << ntz + out[29] + out[31] = int64((in[10] >> 11) & 0x1FFFFF) << ntz + out[30] + out[32] = int64((in[10] >> 32) & 0x1FFFFF) << ntz + out[31] + out[33] = int64(((in[10] >> 53) | ((in[11] & 0x3FF) << 11))) << ntz + out[32] + out[34] = int64((in[11] >> 10) & 0x1FFFFF) << ntz + out[33] + out[35] = int64((in[11] >> 31) & 0x1FFFFF) << ntz + out[34] + out[36] = int64(((in[11] >> 52) | ((in[12] & 0x1FF) << 12))) << ntz + out[35] + out[37] = int64((in[12] >> 9) & 0x1FFFFF) << ntz + out[36] + out[38] = int64((in[12] >> 30) & 0x1FFFFF) << ntz + out[37] + out[39] = int64(((in[12] >> 51) | ((in[13] & 0xFF) << 13))) << ntz + out[38] + out[40] = int64((in[13] >> 8) & 0x1FFFFF) << ntz + out[39] + out[41] = int64((in[13] >> 29) & 0x1FFFFF) << ntz + out[40] + out[42] = int64(((in[13] >> 50) | ((in[14] & 0x7F) << 14))) << ntz + out[41] + out[43] = int64((in[14] >> 7) & 0x1FFFFF) << ntz + out[42] + out[44] = int64((in[14] >> 28) & 0x1FFFFF) << ntz + out[43] + out[45] = int64(((in[14] >> 49) | ((in[15] & 0x3F) << 15))) << ntz + out[44] + out[46] = int64((in[15] >> 6) & 0x1FFFFF) << ntz + out[45] + out[47] = int64((in[15] >> 27) & 0x1FFFFF) << ntz + out[46] + out[48] = int64(((in[15] >> 48) | ((in[16] & 0x1F) << 16))) << ntz + out[47] + out[49] = int64((in[16] >> 5) & 0x1FFFFF) << ntz + out[48] + out[50] = int64((in[16] >> 26) & 0x1FFFFF) << ntz + out[49] + out[51] = int64(((in[16] >> 47) | ((in[17] & 0xF) << 17))) << ntz + out[50] + out[52] = int64((in[17] >> 4) & 0x1FFFFF) << ntz + out[51] + out[53] = int64((in[17] >> 25) & 0x1FFFFF) << ntz + out[52] + out[54] = int64(((in[17] >> 46) | ((in[18] & 0x7) << 18))) << ntz + out[53] + out[55] = int64((in[18] >> 3) & 0x1FFFFF) << ntz + out[54] + out[56] = int64((in[18] >> 24) & 0x1FFFFF) << ntz + out[55] + out[57] = int64(((in[18] >> 45) | ((in[19] & 0x3) << 19))) << ntz + out[56] + out[58] = int64((in[19] >> 2) & 0x1FFFFF) << ntz + out[57] + out[59] = int64((in[19] >> 23) & 0x1FFFFF) << ntz + out[58] + out[60] = int64(((in[19] >> 44) | ((in[20] & 0x1) << 20))) << ntz + out[59] + out[61] = int64((in[20] >> 1) & 0x1FFFFF) << ntz + out[60] + out[62] = int64((in[20] >> 22) & 0x1FFFFF) << ntz + out[61] + out[63] = int64((in[20] >> 43)) << ntz + out[62] +} + +func deltaunpack_int64_22(initoffset int64, in *[22]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 22) & 0x3FFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 44) | ((in[1] & 0x3) << 20))) << ntz + out[1] + out[3] = int64((in[1] >> 2) & 0x3FFFFF) << ntz + out[2] + out[4] = int64((in[1] >> 24) & 0x3FFFFF) << ntz + out[3] + out[5] = int64(((in[1] >> 46) | ((in[2] & 0xF) << 18))) << ntz + out[4] + out[6] = int64((in[2] >> 4) & 0x3FFFFF) << ntz + out[5] + out[7] = int64((in[2] >> 26) & 0x3FFFFF) << ntz + out[6] + out[8] = int64(((in[2] >> 48) | ((in[3] & 0x3F) << 16))) << ntz + out[7] + out[9] = int64((in[3] >> 6) & 0x3FFFFF) << ntz + out[8] + out[10] = int64((in[3] >> 28) & 0x3FFFFF) << ntz + out[9] + out[11] = int64(((in[3] >> 50) | ((in[4] & 0xFF) << 14))) << ntz + out[10] + out[12] = int64((in[4] >> 8) & 0x3FFFFF) << ntz + out[11] + out[13] = int64((in[4] >> 30) & 0x3FFFFF) << ntz + out[12] + out[14] = int64(((in[4] >> 52) | ((in[5] & 0x3FF) << 12))) << ntz + out[13] + out[15] = int64((in[5] >> 10) & 0x3FFFFF) << ntz + out[14] + out[16] = int64((in[5] >> 32) & 0x3FFFFF) << ntz + out[15] + out[17] = int64(((in[5] >> 54) | ((in[6] & 0xFFF) << 10))) << ntz + out[16] + out[18] = int64((in[6] >> 12) & 0x3FFFFF) << ntz + out[17] + out[19] = int64((in[6] >> 34) & 0x3FFFFF) << ntz + out[18] + out[20] = int64(((in[6] >> 56) | ((in[7] & 0x3FFF) << 8))) << ntz + out[19] + out[21] = int64((in[7] >> 14) & 0x3FFFFF) << ntz + out[20] + out[22] = int64((in[7] >> 36) & 0x3FFFFF) << ntz + out[21] + out[23] = int64(((in[7] >> 58) | ((in[8] & 0xFFFF) << 6))) << ntz + out[22] + out[24] = int64((in[8] >> 16) & 0x3FFFFF) << ntz + out[23] + out[25] = int64((in[8] >> 38) & 0x3FFFFF) << ntz + out[24] + out[26] = int64(((in[8] >> 60) | ((in[9] & 0x3FFFF) << 4))) << ntz + out[25] + out[27] = int64((in[9] >> 18) & 0x3FFFFF) << ntz + out[26] + out[28] = int64((in[9] >> 40) & 0x3FFFFF) << ntz + out[27] + out[29] = int64(((in[9] >> 62) | ((in[10] & 0xFFFFF) << 2))) << ntz + out[28] + out[30] = int64((in[10] >> 20) & 0x3FFFFF) << ntz + out[29] + out[31] = int64((in[10] >> 42)) << ntz + out[30] + out[32] = int64((in[11] >> 0) & 0x3FFFFF) << ntz + out[31] + out[33] = int64((in[11] >> 22) & 0x3FFFFF) << ntz + out[32] + out[34] = int64(((in[11] >> 44) | ((in[12] & 0x3) << 20))) << ntz + out[33] + out[35] = int64((in[12] >> 2) & 0x3FFFFF) << ntz + out[34] + out[36] = int64((in[12] >> 24) & 0x3FFFFF) << ntz + out[35] + out[37] = int64(((in[12] >> 46) | ((in[13] & 0xF) << 18))) << ntz + out[36] + out[38] = int64((in[13] >> 4) & 0x3FFFFF) << ntz + out[37] + out[39] = int64((in[13] >> 26) & 0x3FFFFF) << ntz + out[38] + out[40] = int64(((in[13] >> 48) | ((in[14] & 0x3F) << 16))) << ntz + out[39] + out[41] = int64((in[14] >> 6) & 0x3FFFFF) << ntz + out[40] + out[42] = int64((in[14] >> 28) & 0x3FFFFF) << ntz + out[41] + out[43] = int64(((in[14] >> 50) | ((in[15] & 0xFF) << 14))) << ntz + out[42] + out[44] = int64((in[15] >> 8) & 0x3FFFFF) << ntz + out[43] + out[45] = int64((in[15] >> 30) & 0x3FFFFF) << ntz + out[44] + out[46] = int64(((in[15] >> 52) | ((in[16] & 0x3FF) << 12))) << ntz + out[45] + out[47] = int64((in[16] >> 10) & 0x3FFFFF) << ntz + out[46] + out[48] = int64((in[16] >> 32) & 0x3FFFFF) << ntz + out[47] + out[49] = int64(((in[16] >> 54) | ((in[17] & 0xFFF) << 10))) << ntz + out[48] + out[50] = int64((in[17] >> 12) & 0x3FFFFF) << ntz + out[49] + out[51] = int64((in[17] >> 34) & 0x3FFFFF) << ntz + out[50] + out[52] = int64(((in[17] >> 56) | ((in[18] & 0x3FFF) << 8))) << ntz + out[51] + out[53] = int64((in[18] >> 14) & 0x3FFFFF) << ntz + out[52] + out[54] = int64((in[18] >> 36) & 0x3FFFFF) << ntz + out[53] + out[55] = int64(((in[18] >> 58) | ((in[19] & 0xFFFF) << 6))) << ntz + out[54] + out[56] = int64((in[19] >> 16) & 0x3FFFFF) << ntz + out[55] + out[57] = int64((in[19] >> 38) & 0x3FFFFF) << ntz + out[56] + out[58] = int64(((in[19] >> 60) | ((in[20] & 0x3FFFF) << 4))) << ntz + out[57] + out[59] = int64((in[20] >> 18) & 0x3FFFFF) << ntz + out[58] + out[60] = int64((in[20] >> 40) & 0x3FFFFF) << ntz + out[59] + out[61] = int64(((in[20] >> 62) | ((in[21] & 0xFFFFF) << 2))) << ntz + out[60] + out[62] = int64((in[21] >> 20) & 0x3FFFFF) << ntz + out[61] + out[63] = int64((in[21] >> 42)) << ntz + out[62] +} + +func deltaunpack_int64_23(initoffset int64, in *[23]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 23) & 0x7FFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 46) | ((in[1] & 0x1F) << 18))) << ntz + out[1] + out[3] = int64((in[1] >> 5) & 0x7FFFFF) << ntz + out[2] + out[4] = int64((in[1] >> 28) & 0x7FFFFF) << ntz + out[3] + out[5] = int64(((in[1] >> 51) | ((in[2] & 0x3FF) << 13))) << ntz + out[4] + out[6] = int64((in[2] >> 10) & 0x7FFFFF) << ntz + out[5] + out[7] = int64((in[2] >> 33) & 0x7FFFFF) << ntz + out[6] + out[8] = int64(((in[2] >> 56) | ((in[3] & 0x7FFF) << 8))) << ntz + out[7] + out[9] = int64((in[3] >> 15) & 0x7FFFFF) << ntz + out[8] + out[10] = int64((in[3] >> 38) & 0x7FFFFF) << ntz + out[9] + out[11] = int64(((in[3] >> 61) | ((in[4] & 0xFFFFF) << 3))) << ntz + out[10] + out[12] = int64((in[4] >> 20) & 0x7FFFFF) << ntz + out[11] + out[13] = int64(((in[4] >> 43) | ((in[5] & 0x3) << 21))) << ntz + out[12] + out[14] = int64((in[5] >> 2) & 0x7FFFFF) << ntz + out[13] + out[15] = int64((in[5] >> 25) & 0x7FFFFF) << ntz + out[14] + out[16] = int64(((in[5] >> 48) | ((in[6] & 0x7F) << 16))) << ntz + out[15] + out[17] = int64((in[6] >> 7) & 0x7FFFFF) << ntz + out[16] + out[18] = int64((in[6] >> 30) & 0x7FFFFF) << ntz + out[17] + out[19] = int64(((in[6] >> 53) | ((in[7] & 0xFFF) << 11))) << ntz + out[18] + out[20] = int64((in[7] >> 12) & 0x7FFFFF) << ntz + out[19] + out[21] = int64((in[7] >> 35) & 0x7FFFFF) << ntz + out[20] + out[22] = int64(((in[7] >> 58) | ((in[8] & 0x1FFFF) << 6))) << ntz + out[21] + out[23] = int64((in[8] >> 17) & 0x7FFFFF) << ntz + out[22] + out[24] = int64((in[8] >> 40) & 0x7FFFFF) << ntz + out[23] + out[25] = int64(((in[8] >> 63) | ((in[9] & 0x3FFFFF) << 1))) << ntz + out[24] + out[26] = int64((in[9] >> 22) & 0x7FFFFF) << ntz + out[25] + out[27] = int64(((in[9] >> 45) | ((in[10] & 0xF) << 19))) << ntz + out[26] + out[28] = int64((in[10] >> 4) & 0x7FFFFF) << ntz + out[27] + out[29] = int64((in[10] >> 27) & 0x7FFFFF) << ntz + out[28] + out[30] = int64(((in[10] >> 50) | ((in[11] & 0x1FF) << 14))) << ntz + out[29] + out[31] = int64((in[11] >> 9) & 0x7FFFFF) << ntz + out[30] + out[32] = int64((in[11] >> 32) & 0x7FFFFF) << ntz + out[31] + out[33] = int64(((in[11] >> 55) | ((in[12] & 0x3FFF) << 9))) << ntz + out[32] + out[34] = int64((in[12] >> 14) & 0x7FFFFF) << ntz + out[33] + out[35] = int64((in[12] >> 37) & 0x7FFFFF) << ntz + out[34] + out[36] = int64(((in[12] >> 60) | ((in[13] & 0x7FFFF) << 4))) << ntz + out[35] + out[37] = int64((in[13] >> 19) & 0x7FFFFF) << ntz + out[36] + out[38] = int64(((in[13] >> 42) | ((in[14] & 0x1) << 22))) << ntz + out[37] + out[39] = int64((in[14] >> 1) & 0x7FFFFF) << ntz + out[38] + out[40] = int64((in[14] >> 24) & 0x7FFFFF) << ntz + out[39] + out[41] = int64(((in[14] >> 47) | ((in[15] & 0x3F) << 17))) << ntz + out[40] + out[42] = int64((in[15] >> 6) & 0x7FFFFF) << ntz + out[41] + out[43] = int64((in[15] >> 29) & 0x7FFFFF) << ntz + out[42] + out[44] = int64(((in[15] >> 52) | ((in[16] & 0x7FF) << 12))) << ntz + out[43] + out[45] = int64((in[16] >> 11) & 0x7FFFFF) << ntz + out[44] + out[46] = int64((in[16] >> 34) & 0x7FFFFF) << ntz + out[45] + out[47] = int64(((in[16] >> 57) | ((in[17] & 0xFFFF) << 7))) << ntz + out[46] + out[48] = int64((in[17] >> 16) & 0x7FFFFF) << ntz + out[47] + out[49] = int64((in[17] >> 39) & 0x7FFFFF) << ntz + out[48] + out[50] = int64(((in[17] >> 62) | ((in[18] & 0x1FFFFF) << 2))) << ntz + out[49] + out[51] = int64((in[18] >> 21) & 0x7FFFFF) << ntz + out[50] + out[52] = int64(((in[18] >> 44) | ((in[19] & 0x7) << 20))) << ntz + out[51] + out[53] = int64((in[19] >> 3) & 0x7FFFFF) << ntz + out[52] + out[54] = int64((in[19] >> 26) & 0x7FFFFF) << ntz + out[53] + out[55] = int64(((in[19] >> 49) | ((in[20] & 0xFF) << 15))) << ntz + out[54] + out[56] = int64((in[20] >> 8) & 0x7FFFFF) << ntz + out[55] + out[57] = int64((in[20] >> 31) & 0x7FFFFF) << ntz + out[56] + out[58] = int64(((in[20] >> 54) | ((in[21] & 0x1FFF) << 10))) << ntz + out[57] + out[59] = int64((in[21] >> 13) & 0x7FFFFF) << ntz + out[58] + out[60] = int64((in[21] >> 36) & 0x7FFFFF) << ntz + out[59] + out[61] = int64(((in[21] >> 59) | ((in[22] & 0x3FFFF) << 5))) << ntz + out[60] + out[62] = int64((in[22] >> 18) & 0x7FFFFF) << ntz + out[61] + out[63] = int64((in[22] >> 41)) << ntz + out[62] +} + +func deltaunpack_int64_24(initoffset int64, in *[24]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 24) & 0xFFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 48) | ((in[1] & 0xFF) << 16))) << ntz + out[1] + out[3] = int64((in[1] >> 8) & 0xFFFFFF) << ntz + out[2] + out[4] = int64((in[1] >> 32) & 0xFFFFFF) << ntz + out[3] + out[5] = int64(((in[1] >> 56) | ((in[2] & 0xFFFF) << 8))) << ntz + out[4] + out[6] = int64((in[2] >> 16) & 0xFFFFFF) << ntz + out[5] + out[7] = int64((in[2] >> 40)) << ntz + out[6] + out[8] = int64((in[3] >> 0) & 0xFFFFFF) << ntz + out[7] + out[9] = int64((in[3] >> 24) & 0xFFFFFF) << ntz + out[8] + out[10] = int64(((in[3] >> 48) | ((in[4] & 0xFF) << 16))) << ntz + out[9] + out[11] = int64((in[4] >> 8) & 0xFFFFFF) << ntz + out[10] + out[12] = int64((in[4] >> 32) & 0xFFFFFF) << ntz + out[11] + out[13] = int64(((in[4] >> 56) | ((in[5] & 0xFFFF) << 8))) << ntz + out[12] + out[14] = int64((in[5] >> 16) & 0xFFFFFF) << ntz + out[13] + out[15] = int64((in[5] >> 40)) << ntz + out[14] + out[16] = int64((in[6] >> 0) & 0xFFFFFF) << ntz + out[15] + out[17] = int64((in[6] >> 24) & 0xFFFFFF) << ntz + out[16] + out[18] = int64(((in[6] >> 48) | ((in[7] & 0xFF) << 16))) << ntz + out[17] + out[19] = int64((in[7] >> 8) & 0xFFFFFF) << ntz + out[18] + out[20] = int64((in[7] >> 32) & 0xFFFFFF) << ntz + out[19] + out[21] = int64(((in[7] >> 56) | ((in[8] & 0xFFFF) << 8))) << ntz + out[20] + out[22] = int64((in[8] >> 16) & 0xFFFFFF) << ntz + out[21] + out[23] = int64((in[8] >> 40)) << ntz + out[22] + out[24] = int64((in[9] >> 0) & 0xFFFFFF) << ntz + out[23] + out[25] = int64((in[9] >> 24) & 0xFFFFFF) << ntz + out[24] + out[26] = int64(((in[9] >> 48) | ((in[10] & 0xFF) << 16))) << ntz + out[25] + out[27] = int64((in[10] >> 8) & 0xFFFFFF) << ntz + out[26] + out[28] = int64((in[10] >> 32) & 0xFFFFFF) << ntz + out[27] + out[29] = int64(((in[10] >> 56) | ((in[11] & 0xFFFF) << 8))) << ntz + out[28] + out[30] = int64((in[11] >> 16) & 0xFFFFFF) << ntz + out[29] + out[31] = int64((in[11] >> 40)) << ntz + out[30] + out[32] = int64((in[12] >> 0) & 0xFFFFFF) << ntz + out[31] + out[33] = int64((in[12] >> 24) & 0xFFFFFF) << ntz + out[32] + out[34] = int64(((in[12] >> 48) | ((in[13] & 0xFF) << 16))) << ntz + out[33] + out[35] = int64((in[13] >> 8) & 0xFFFFFF) << ntz + out[34] + out[36] = int64((in[13] >> 32) & 0xFFFFFF) << ntz + out[35] + out[37] = int64(((in[13] >> 56) | ((in[14] & 0xFFFF) << 8))) << ntz + out[36] + out[38] = int64((in[14] >> 16) & 0xFFFFFF) << ntz + out[37] + out[39] = int64((in[14] >> 40)) << ntz + out[38] + out[40] = int64((in[15] >> 0) & 0xFFFFFF) << ntz + out[39] + out[41] = int64((in[15] >> 24) & 0xFFFFFF) << ntz + out[40] + out[42] = int64(((in[15] >> 48) | ((in[16] & 0xFF) << 16))) << ntz + out[41] + out[43] = int64((in[16] >> 8) & 0xFFFFFF) << ntz + out[42] + out[44] = int64((in[16] >> 32) & 0xFFFFFF) << ntz + out[43] + out[45] = int64(((in[16] >> 56) | ((in[17] & 0xFFFF) << 8))) << ntz + out[44] + out[46] = int64((in[17] >> 16) & 0xFFFFFF) << ntz + out[45] + out[47] = int64((in[17] >> 40)) << ntz + out[46] + out[48] = int64((in[18] >> 0) & 0xFFFFFF) << ntz + out[47] + out[49] = int64((in[18] >> 24) & 0xFFFFFF) << ntz + out[48] + out[50] = int64(((in[18] >> 48) | ((in[19] & 0xFF) << 16))) << ntz + out[49] + out[51] = int64((in[19] >> 8) & 0xFFFFFF) << ntz + out[50] + out[52] = int64((in[19] >> 32) & 0xFFFFFF) << ntz + out[51] + out[53] = int64(((in[19] >> 56) | ((in[20] & 0xFFFF) << 8))) << ntz + out[52] + out[54] = int64((in[20] >> 16) & 0xFFFFFF) << ntz + out[53] + out[55] = int64((in[20] >> 40)) << ntz + out[54] + out[56] = int64((in[21] >> 0) & 0xFFFFFF) << ntz + out[55] + out[57] = int64((in[21] >> 24) & 0xFFFFFF) << ntz + out[56] + out[58] = int64(((in[21] >> 48) | ((in[22] & 0xFF) << 16))) << ntz + out[57] + out[59] = int64((in[22] >> 8) & 0xFFFFFF) << ntz + out[58] + out[60] = int64((in[22] >> 32) & 0xFFFFFF) << ntz + out[59] + out[61] = int64(((in[22] >> 56) | ((in[23] & 0xFFFF) << 8))) << ntz + out[60] + out[62] = int64((in[23] >> 16) & 0xFFFFFF) << ntz + out[61] + out[63] = int64((in[23] >> 40)) << ntz + out[62] +} + +func deltaunpack_int64_25(initoffset int64, in *[25]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 25) & 0x1FFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 50) | ((in[1] & 0x7FF) << 14))) << ntz + out[1] + out[3] = int64((in[1] >> 11) & 0x1FFFFFF) << ntz + out[2] + out[4] = int64((in[1] >> 36) & 0x1FFFFFF) << ntz + out[3] + out[5] = int64(((in[1] >> 61) | ((in[2] & 0x3FFFFF) << 3))) << ntz + out[4] + out[6] = int64((in[2] >> 22) & 0x1FFFFFF) << ntz + out[5] + out[7] = int64(((in[2] >> 47) | ((in[3] & 0xFF) << 17))) << ntz + out[6] + out[8] = int64((in[3] >> 8) & 0x1FFFFFF) << ntz + out[7] + out[9] = int64((in[3] >> 33) & 0x1FFFFFF) << ntz + out[8] + out[10] = int64(((in[3] >> 58) | ((in[4] & 0x7FFFF) << 6))) << ntz + out[9] + out[11] = int64((in[4] >> 19) & 0x1FFFFFF) << ntz + out[10] + out[12] = int64(((in[4] >> 44) | ((in[5] & 0x1F) << 20))) << ntz + out[11] + out[13] = int64((in[5] >> 5) & 0x1FFFFFF) << ntz + out[12] + out[14] = int64((in[5] >> 30) & 0x1FFFFFF) << ntz + out[13] + out[15] = int64(((in[5] >> 55) | ((in[6] & 0xFFFF) << 9))) << ntz + out[14] + out[16] = int64((in[6] >> 16) & 0x1FFFFFF) << ntz + out[15] + out[17] = int64(((in[6] >> 41) | ((in[7] & 0x3) << 23))) << ntz + out[16] + out[18] = int64((in[7] >> 2) & 0x1FFFFFF) << ntz + out[17] + out[19] = int64((in[7] >> 27) & 0x1FFFFFF) << ntz + out[18] + out[20] = int64(((in[7] >> 52) | ((in[8] & 0x1FFF) << 12))) << ntz + out[19] + out[21] = int64((in[8] >> 13) & 0x1FFFFFF) << ntz + out[20] + out[22] = int64((in[8] >> 38) & 0x1FFFFFF) << ntz + out[21] + out[23] = int64(((in[8] >> 63) | ((in[9] & 0xFFFFFF) << 1))) << ntz + out[22] + out[24] = int64((in[9] >> 24) & 0x1FFFFFF) << ntz + out[23] + out[25] = int64(((in[9] >> 49) | ((in[10] & 0x3FF) << 15))) << ntz + out[24] + out[26] = int64((in[10] >> 10) & 0x1FFFFFF) << ntz + out[25] + out[27] = int64((in[10] >> 35) & 0x1FFFFFF) << ntz + out[26] + out[28] = int64(((in[10] >> 60) | ((in[11] & 0x1FFFFF) << 4))) << ntz + out[27] + out[29] = int64((in[11] >> 21) & 0x1FFFFFF) << ntz + out[28] + out[30] = int64(((in[11] >> 46) | ((in[12] & 0x7F) << 18))) << ntz + out[29] + out[31] = int64((in[12] >> 7) & 0x1FFFFFF) << ntz + out[30] + out[32] = int64((in[12] >> 32) & 0x1FFFFFF) << ntz + out[31] + out[33] = int64(((in[12] >> 57) | ((in[13] & 0x3FFFF) << 7))) << ntz + out[32] + out[34] = int64((in[13] >> 18) & 0x1FFFFFF) << ntz + out[33] + out[35] = int64(((in[13] >> 43) | ((in[14] & 0xF) << 21))) << ntz + out[34] + out[36] = int64((in[14] >> 4) & 0x1FFFFFF) << ntz + out[35] + out[37] = int64((in[14] >> 29) & 0x1FFFFFF) << ntz + out[36] + out[38] = int64(((in[14] >> 54) | ((in[15] & 0x7FFF) << 10))) << ntz + out[37] + out[39] = int64((in[15] >> 15) & 0x1FFFFFF) << ntz + out[38] + out[40] = int64(((in[15] >> 40) | ((in[16] & 0x1) << 24))) << ntz + out[39] + out[41] = int64((in[16] >> 1) & 0x1FFFFFF) << ntz + out[40] + out[42] = int64((in[16] >> 26) & 0x1FFFFFF) << ntz + out[41] + out[43] = int64(((in[16] >> 51) | ((in[17] & 0xFFF) << 13))) << ntz + out[42] + out[44] = int64((in[17] >> 12) & 0x1FFFFFF) << ntz + out[43] + out[45] = int64((in[17] >> 37) & 0x1FFFFFF) << ntz + out[44] + out[46] = int64(((in[17] >> 62) | ((in[18] & 0x7FFFFF) << 2))) << ntz + out[45] + out[47] = int64((in[18] >> 23) & 0x1FFFFFF) << ntz + out[46] + out[48] = int64(((in[18] >> 48) | ((in[19] & 0x1FF) << 16))) << ntz + out[47] + out[49] = int64((in[19] >> 9) & 0x1FFFFFF) << ntz + out[48] + out[50] = int64((in[19] >> 34) & 0x1FFFFFF) << ntz + out[49] + out[51] = int64(((in[19] >> 59) | ((in[20] & 0xFFFFF) << 5))) << ntz + out[50] + out[52] = int64((in[20] >> 20) & 0x1FFFFFF) << ntz + out[51] + out[53] = int64(((in[20] >> 45) | ((in[21] & 0x3F) << 19))) << ntz + out[52] + out[54] = int64((in[21] >> 6) & 0x1FFFFFF) << ntz + out[53] + out[55] = int64((in[21] >> 31) & 0x1FFFFFF) << ntz + out[54] + out[56] = int64(((in[21] >> 56) | ((in[22] & 0x1FFFF) << 8))) << ntz + out[55] + out[57] = int64((in[22] >> 17) & 0x1FFFFFF) << ntz + out[56] + out[58] = int64(((in[22] >> 42) | ((in[23] & 0x7) << 22))) << ntz + out[57] + out[59] = int64((in[23] >> 3) & 0x1FFFFFF) << ntz + out[58] + out[60] = int64((in[23] >> 28) & 0x1FFFFFF) << ntz + out[59] + out[61] = int64(((in[23] >> 53) | ((in[24] & 0x3FFF) << 11))) << ntz + out[60] + out[62] = int64((in[24] >> 14) & 0x1FFFFFF) << ntz + out[61] + out[63] = int64((in[24] >> 39)) << ntz + out[62] +} + +func deltaunpack_int64_26(initoffset int64, in *[26]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 26) & 0x3FFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 52) | ((in[1] & 0x3FFF) << 12))) << ntz + out[1] + out[3] = int64((in[1] >> 14) & 0x3FFFFFF) << ntz + out[2] + out[4] = int64(((in[1] >> 40) | ((in[2] & 0x3) << 24))) << ntz + out[3] + out[5] = int64((in[2] >> 2) & 0x3FFFFFF) << ntz + out[4] + out[6] = int64((in[2] >> 28) & 0x3FFFFFF) << ntz + out[5] + out[7] = int64(((in[2] >> 54) | ((in[3] & 0xFFFF) << 10))) << ntz + out[6] + out[8] = int64((in[3] >> 16) & 0x3FFFFFF) << ntz + out[7] + out[9] = int64(((in[3] >> 42) | ((in[4] & 0xF) << 22))) << ntz + out[8] + out[10] = int64((in[4] >> 4) & 0x3FFFFFF) << ntz + out[9] + out[11] = int64((in[4] >> 30) & 0x3FFFFFF) << ntz + out[10] + out[12] = int64(((in[4] >> 56) | ((in[5] & 0x3FFFF) << 8))) << ntz + out[11] + out[13] = int64((in[5] >> 18) & 0x3FFFFFF) << ntz + out[12] + out[14] = int64(((in[5] >> 44) | ((in[6] & 0x3F) << 20))) << ntz + out[13] + out[15] = int64((in[6] >> 6) & 0x3FFFFFF) << ntz + out[14] + out[16] = int64((in[6] >> 32) & 0x3FFFFFF) << ntz + out[15] + out[17] = int64(((in[6] >> 58) | ((in[7] & 0xFFFFF) << 6))) << ntz + out[16] + out[18] = int64((in[7] >> 20) & 0x3FFFFFF) << ntz + out[17] + out[19] = int64(((in[7] >> 46) | ((in[8] & 0xFF) << 18))) << ntz + out[18] + out[20] = int64((in[8] >> 8) & 0x3FFFFFF) << ntz + out[19] + out[21] = int64((in[8] >> 34) & 0x3FFFFFF) << ntz + out[20] + out[22] = int64(((in[8] >> 60) | ((in[9] & 0x3FFFFF) << 4))) << ntz + out[21] + out[23] = int64((in[9] >> 22) & 0x3FFFFFF) << ntz + out[22] + out[24] = int64(((in[9] >> 48) | ((in[10] & 0x3FF) << 16))) << ntz + out[23] + out[25] = int64((in[10] >> 10) & 0x3FFFFFF) << ntz + out[24] + out[26] = int64((in[10] >> 36) & 0x3FFFFFF) << ntz + out[25] + out[27] = int64(((in[10] >> 62) | ((in[11] & 0xFFFFFF) << 2))) << ntz + out[26] + out[28] = int64((in[11] >> 24) & 0x3FFFFFF) << ntz + out[27] + out[29] = int64(((in[11] >> 50) | ((in[12] & 0xFFF) << 14))) << ntz + out[28] + out[30] = int64((in[12] >> 12) & 0x3FFFFFF) << ntz + out[29] + out[31] = int64((in[12] >> 38)) << ntz + out[30] + out[32] = int64((in[13] >> 0) & 0x3FFFFFF) << ntz + out[31] + out[33] = int64((in[13] >> 26) & 0x3FFFFFF) << ntz + out[32] + out[34] = int64(((in[13] >> 52) | ((in[14] & 0x3FFF) << 12))) << ntz + out[33] + out[35] = int64((in[14] >> 14) & 0x3FFFFFF) << ntz + out[34] + out[36] = int64(((in[14] >> 40) | ((in[15] & 0x3) << 24))) << ntz + out[35] + out[37] = int64((in[15] >> 2) & 0x3FFFFFF) << ntz + out[36] + out[38] = int64((in[15] >> 28) & 0x3FFFFFF) << ntz + out[37] + out[39] = int64(((in[15] >> 54) | ((in[16] & 0xFFFF) << 10))) << ntz + out[38] + out[40] = int64((in[16] >> 16) & 0x3FFFFFF) << ntz + out[39] + out[41] = int64(((in[16] >> 42) | ((in[17] & 0xF) << 22))) << ntz + out[40] + out[42] = int64((in[17] >> 4) & 0x3FFFFFF) << ntz + out[41] + out[43] = int64((in[17] >> 30) & 0x3FFFFFF) << ntz + out[42] + out[44] = int64(((in[17] >> 56) | ((in[18] & 0x3FFFF) << 8))) << ntz + out[43] + out[45] = int64((in[18] >> 18) & 0x3FFFFFF) << ntz + out[44] + out[46] = int64(((in[18] >> 44) | ((in[19] & 0x3F) << 20))) << ntz + out[45] + out[47] = int64((in[19] >> 6) & 0x3FFFFFF) << ntz + out[46] + out[48] = int64((in[19] >> 32) & 0x3FFFFFF) << ntz + out[47] + out[49] = int64(((in[19] >> 58) | ((in[20] & 0xFFFFF) << 6))) << ntz + out[48] + out[50] = int64((in[20] >> 20) & 0x3FFFFFF) << ntz + out[49] + out[51] = int64(((in[20] >> 46) | ((in[21] & 0xFF) << 18))) << ntz + out[50] + out[52] = int64((in[21] >> 8) & 0x3FFFFFF) << ntz + out[51] + out[53] = int64((in[21] >> 34) & 0x3FFFFFF) << ntz + out[52] + out[54] = int64(((in[21] >> 60) | ((in[22] & 0x3FFFFF) << 4))) << ntz + out[53] + out[55] = int64((in[22] >> 22) & 0x3FFFFFF) << ntz + out[54] + out[56] = int64(((in[22] >> 48) | ((in[23] & 0x3FF) << 16))) << ntz + out[55] + out[57] = int64((in[23] >> 10) & 0x3FFFFFF) << ntz + out[56] + out[58] = int64((in[23] >> 36) & 0x3FFFFFF) << ntz + out[57] + out[59] = int64(((in[23] >> 62) | ((in[24] & 0xFFFFFF) << 2))) << ntz + out[58] + out[60] = int64((in[24] >> 24) & 0x3FFFFFF) << ntz + out[59] + out[61] = int64(((in[24] >> 50) | ((in[25] & 0xFFF) << 14))) << ntz + out[60] + out[62] = int64((in[25] >> 12) & 0x3FFFFFF) << ntz + out[61] + out[63] = int64((in[25] >> 38)) << ntz + out[62] +} + +func deltaunpack_int64_27(initoffset int64, in *[27]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 27) & 0x7FFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 54) | ((in[1] & 0x1FFFF) << 10))) << ntz + out[1] + out[3] = int64((in[1] >> 17) & 0x7FFFFFF) << ntz + out[2] + out[4] = int64(((in[1] >> 44) | ((in[2] & 0x7F) << 20))) << ntz + out[3] + out[5] = int64((in[2] >> 7) & 0x7FFFFFF) << ntz + out[4] + out[6] = int64((in[2] >> 34) & 0x7FFFFFF) << ntz + out[5] + out[7] = int64(((in[2] >> 61) | ((in[3] & 0xFFFFFF) << 3))) << ntz + out[6] + out[8] = int64((in[3] >> 24) & 0x7FFFFFF) << ntz + out[7] + out[9] = int64(((in[3] >> 51) | ((in[4] & 0x3FFF) << 13))) << ntz + out[8] + out[10] = int64((in[4] >> 14) & 0x7FFFFFF) << ntz + out[9] + out[11] = int64(((in[4] >> 41) | ((in[5] & 0xF) << 23))) << ntz + out[10] + out[12] = int64((in[5] >> 4) & 0x7FFFFFF) << ntz + out[11] + out[13] = int64((in[5] >> 31) & 0x7FFFFFF) << ntz + out[12] + out[14] = int64(((in[5] >> 58) | ((in[6] & 0x1FFFFF) << 6))) << ntz + out[13] + out[15] = int64((in[6] >> 21) & 0x7FFFFFF) << ntz + out[14] + out[16] = int64(((in[6] >> 48) | ((in[7] & 0x7FF) << 16))) << ntz + out[15] + out[17] = int64((in[7] >> 11) & 0x7FFFFFF) << ntz + out[16] + out[18] = int64(((in[7] >> 38) | ((in[8] & 0x1) << 26))) << ntz + out[17] + out[19] = int64((in[8] >> 1) & 0x7FFFFFF) << ntz + out[18] + out[20] = int64((in[8] >> 28) & 0x7FFFFFF) << ntz + out[19] + out[21] = int64(((in[8] >> 55) | ((in[9] & 0x3FFFF) << 9))) << ntz + out[20] + out[22] = int64((in[9] >> 18) & 0x7FFFFFF) << ntz + out[21] + out[23] = int64(((in[9] >> 45) | ((in[10] & 0xFF) << 19))) << ntz + out[22] + out[24] = int64((in[10] >> 8) & 0x7FFFFFF) << ntz + out[23] + out[25] = int64((in[10] >> 35) & 0x7FFFFFF) << ntz + out[24] + out[26] = int64(((in[10] >> 62) | ((in[11] & 0x1FFFFFF) << 2))) << ntz + out[25] + out[27] = int64((in[11] >> 25) & 0x7FFFFFF) << ntz + out[26] + out[28] = int64(((in[11] >> 52) | ((in[12] & 0x7FFF) << 12))) << ntz + out[27] + out[29] = int64((in[12] >> 15) & 0x7FFFFFF) << ntz + out[28] + out[30] = int64(((in[12] >> 42) | ((in[13] & 0x1F) << 22))) << ntz + out[29] + out[31] = int64((in[13] >> 5) & 0x7FFFFFF) << ntz + out[30] + out[32] = int64((in[13] >> 32) & 0x7FFFFFF) << ntz + out[31] + out[33] = int64(((in[13] >> 59) | ((in[14] & 0x3FFFFF) << 5))) << ntz + out[32] + out[34] = int64((in[14] >> 22) & 0x7FFFFFF) << ntz + out[33] + out[35] = int64(((in[14] >> 49) | ((in[15] & 0xFFF) << 15))) << ntz + out[34] + out[36] = int64((in[15] >> 12) & 0x7FFFFFF) << ntz + out[35] + out[37] = int64(((in[15] >> 39) | ((in[16] & 0x3) << 25))) << ntz + out[36] + out[38] = int64((in[16] >> 2) & 0x7FFFFFF) << ntz + out[37] + out[39] = int64((in[16] >> 29) & 0x7FFFFFF) << ntz + out[38] + out[40] = int64(((in[16] >> 56) | ((in[17] & 0x7FFFF) << 8))) << ntz + out[39] + out[41] = int64((in[17] >> 19) & 0x7FFFFFF) << ntz + out[40] + out[42] = int64(((in[17] >> 46) | ((in[18] & 0x1FF) << 18))) << ntz + out[41] + out[43] = int64((in[18] >> 9) & 0x7FFFFFF) << ntz + out[42] + out[44] = int64((in[18] >> 36) & 0x7FFFFFF) << ntz + out[43] + out[45] = int64(((in[18] >> 63) | ((in[19] & 0x3FFFFFF) << 1))) << ntz + out[44] + out[46] = int64((in[19] >> 26) & 0x7FFFFFF) << ntz + out[45] + out[47] = int64(((in[19] >> 53) | ((in[20] & 0xFFFF) << 11))) << ntz + out[46] + out[48] = int64((in[20] >> 16) & 0x7FFFFFF) << ntz + out[47] + out[49] = int64(((in[20] >> 43) | ((in[21] & 0x3F) << 21))) << ntz + out[48] + out[50] = int64((in[21] >> 6) & 0x7FFFFFF) << ntz + out[49] + out[51] = int64((in[21] >> 33) & 0x7FFFFFF) << ntz + out[50] + out[52] = int64(((in[21] >> 60) | ((in[22] & 0x7FFFFF) << 4))) << ntz + out[51] + out[53] = int64((in[22] >> 23) & 0x7FFFFFF) << ntz + out[52] + out[54] = int64(((in[22] >> 50) | ((in[23] & 0x1FFF) << 14))) << ntz + out[53] + out[55] = int64((in[23] >> 13) & 0x7FFFFFF) << ntz + out[54] + out[56] = int64(((in[23] >> 40) | ((in[24] & 0x7) << 24))) << ntz + out[55] + out[57] = int64((in[24] >> 3) & 0x7FFFFFF) << ntz + out[56] + out[58] = int64((in[24] >> 30) & 0x7FFFFFF) << ntz + out[57] + out[59] = int64(((in[24] >> 57) | ((in[25] & 0xFFFFF) << 7))) << ntz + out[58] + out[60] = int64((in[25] >> 20) & 0x7FFFFFF) << ntz + out[59] + out[61] = int64(((in[25] >> 47) | ((in[26] & 0x3FF) << 17))) << ntz + out[60] + out[62] = int64((in[26] >> 10) & 0x7FFFFFF) << ntz + out[61] + out[63] = int64((in[26] >> 37)) << ntz + out[62] +} + +func deltaunpack_int64_28(initoffset int64, in *[28]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 28) & 0xFFFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 56) | ((in[1] & 0xFFFFF) << 8))) << ntz + out[1] + out[3] = int64((in[1] >> 20) & 0xFFFFFFF) << ntz + out[2] + out[4] = int64(((in[1] >> 48) | ((in[2] & 0xFFF) << 16))) << ntz + out[3] + out[5] = int64((in[2] >> 12) & 0xFFFFFFF) << ntz + out[4] + out[6] = int64(((in[2] >> 40) | ((in[3] & 0xF) << 24))) << ntz + out[5] + out[7] = int64((in[3] >> 4) & 0xFFFFFFF) << ntz + out[6] + out[8] = int64((in[3] >> 32) & 0xFFFFFFF) << ntz + out[7] + out[9] = int64(((in[3] >> 60) | ((in[4] & 0xFFFFFF) << 4))) << ntz + out[8] + out[10] = int64((in[4] >> 24) & 0xFFFFFFF) << ntz + out[9] + out[11] = int64(((in[4] >> 52) | ((in[5] & 0xFFFF) << 12))) << ntz + out[10] + out[12] = int64((in[5] >> 16) & 0xFFFFFFF) << ntz + out[11] + out[13] = int64(((in[5] >> 44) | ((in[6] & 0xFF) << 20))) << ntz + out[12] + out[14] = int64((in[6] >> 8) & 0xFFFFFFF) << ntz + out[13] + out[15] = int64((in[6] >> 36)) << ntz + out[14] + out[16] = int64((in[7] >> 0) & 0xFFFFFFF) << ntz + out[15] + out[17] = int64((in[7] >> 28) & 0xFFFFFFF) << ntz + out[16] + out[18] = int64(((in[7] >> 56) | ((in[8] & 0xFFFFF) << 8))) << ntz + out[17] + out[19] = int64((in[8] >> 20) & 0xFFFFFFF) << ntz + out[18] + out[20] = int64(((in[8] >> 48) | ((in[9] & 0xFFF) << 16))) << ntz + out[19] + out[21] = int64((in[9] >> 12) & 0xFFFFFFF) << ntz + out[20] + out[22] = int64(((in[9] >> 40) | ((in[10] & 0xF) << 24))) << ntz + out[21] + out[23] = int64((in[10] >> 4) & 0xFFFFFFF) << ntz + out[22] + out[24] = int64((in[10] >> 32) & 0xFFFFFFF) << ntz + out[23] + out[25] = int64(((in[10] >> 60) | ((in[11] & 0xFFFFFF) << 4))) << ntz + out[24] + out[26] = int64((in[11] >> 24) & 0xFFFFFFF) << ntz + out[25] + out[27] = int64(((in[11] >> 52) | ((in[12] & 0xFFFF) << 12))) << ntz + out[26] + out[28] = int64((in[12] >> 16) & 0xFFFFFFF) << ntz + out[27] + out[29] = int64(((in[12] >> 44) | ((in[13] & 0xFF) << 20))) << ntz + out[28] + out[30] = int64((in[13] >> 8) & 0xFFFFFFF) << ntz + out[29] + out[31] = int64((in[13] >> 36)) << ntz + out[30] + out[32] = int64((in[14] >> 0) & 0xFFFFFFF) << ntz + out[31] + out[33] = int64((in[14] >> 28) & 0xFFFFFFF) << ntz + out[32] + out[34] = int64(((in[14] >> 56) | ((in[15] & 0xFFFFF) << 8))) << ntz + out[33] + out[35] = int64((in[15] >> 20) & 0xFFFFFFF) << ntz + out[34] + out[36] = int64(((in[15] >> 48) | ((in[16] & 0xFFF) << 16))) << ntz + out[35] + out[37] = int64((in[16] >> 12) & 0xFFFFFFF) << ntz + out[36] + out[38] = int64(((in[16] >> 40) | ((in[17] & 0xF) << 24))) << ntz + out[37] + out[39] = int64((in[17] >> 4) & 0xFFFFFFF) << ntz + out[38] + out[40] = int64((in[17] >> 32) & 0xFFFFFFF) << ntz + out[39] + out[41] = int64(((in[17] >> 60) | ((in[18] & 0xFFFFFF) << 4))) << ntz + out[40] + out[42] = int64((in[18] >> 24) & 0xFFFFFFF) << ntz + out[41] + out[43] = int64(((in[18] >> 52) | ((in[19] & 0xFFFF) << 12))) << ntz + out[42] + out[44] = int64((in[19] >> 16) & 0xFFFFFFF) << ntz + out[43] + out[45] = int64(((in[19] >> 44) | ((in[20] & 0xFF) << 20))) << ntz + out[44] + out[46] = int64((in[20] >> 8) & 0xFFFFFFF) << ntz + out[45] + out[47] = int64((in[20] >> 36)) << ntz + out[46] + out[48] = int64((in[21] >> 0) & 0xFFFFFFF) << ntz + out[47] + out[49] = int64((in[21] >> 28) & 0xFFFFFFF) << ntz + out[48] + out[50] = int64(((in[21] >> 56) | ((in[22] & 0xFFFFF) << 8))) << ntz + out[49] + out[51] = int64((in[22] >> 20) & 0xFFFFFFF) << ntz + out[50] + out[52] = int64(((in[22] >> 48) | ((in[23] & 0xFFF) << 16))) << ntz + out[51] + out[53] = int64((in[23] >> 12) & 0xFFFFFFF) << ntz + out[52] + out[54] = int64(((in[23] >> 40) | ((in[24] & 0xF) << 24))) << ntz + out[53] + out[55] = int64((in[24] >> 4) & 0xFFFFFFF) << ntz + out[54] + out[56] = int64((in[24] >> 32) & 0xFFFFFFF) << ntz + out[55] + out[57] = int64(((in[24] >> 60) | ((in[25] & 0xFFFFFF) << 4))) << ntz + out[56] + out[58] = int64((in[25] >> 24) & 0xFFFFFFF) << ntz + out[57] + out[59] = int64(((in[25] >> 52) | ((in[26] & 0xFFFF) << 12))) << ntz + out[58] + out[60] = int64((in[26] >> 16) & 0xFFFFFFF) << ntz + out[59] + out[61] = int64(((in[26] >> 44) | ((in[27] & 0xFF) << 20))) << ntz + out[60] + out[62] = int64((in[27] >> 8) & 0xFFFFFFF) << ntz + out[61] + out[63] = int64((in[27] >> 36)) << ntz + out[62] +} + +func deltaunpack_int64_29(initoffset int64, in *[29]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 29) & 0x1FFFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 58) | ((in[1] & 0x7FFFFF) << 6))) << ntz + out[1] + out[3] = int64((in[1] >> 23) & 0x1FFFFFFF) << ntz + out[2] + out[4] = int64(((in[1] >> 52) | ((in[2] & 0x1FFFF) << 12))) << ntz + out[3] + out[5] = int64((in[2] >> 17) & 0x1FFFFFFF) << ntz + out[4] + out[6] = int64(((in[2] >> 46) | ((in[3] & 0x7FF) << 18))) << ntz + out[5] + out[7] = int64((in[3] >> 11) & 0x1FFFFFFF) << ntz + out[6] + out[8] = int64(((in[3] >> 40) | ((in[4] & 0x1F) << 24))) << ntz + out[7] + out[9] = int64((in[4] >> 5) & 0x1FFFFFFF) << ntz + out[8] + out[10] = int64((in[4] >> 34) & 0x1FFFFFFF) << ntz + out[9] + out[11] = int64(((in[4] >> 63) | ((in[5] & 0xFFFFFFF) << 1))) << ntz + out[10] + out[12] = int64((in[5] >> 28) & 0x1FFFFFFF) << ntz + out[11] + out[13] = int64(((in[5] >> 57) | ((in[6] & 0x3FFFFF) << 7))) << ntz + out[12] + out[14] = int64((in[6] >> 22) & 0x1FFFFFFF) << ntz + out[13] + out[15] = int64(((in[6] >> 51) | ((in[7] & 0xFFFF) << 13))) << ntz + out[14] + out[16] = int64((in[7] >> 16) & 0x1FFFFFFF) << ntz + out[15] + out[17] = int64(((in[7] >> 45) | ((in[8] & 0x3FF) << 19))) << ntz + out[16] + out[18] = int64((in[8] >> 10) & 0x1FFFFFFF) << ntz + out[17] + out[19] = int64(((in[8] >> 39) | ((in[9] & 0xF) << 25))) << ntz + out[18] + out[20] = int64((in[9] >> 4) & 0x1FFFFFFF) << ntz + out[19] + out[21] = int64((in[9] >> 33) & 0x1FFFFFFF) << ntz + out[20] + out[22] = int64(((in[9] >> 62) | ((in[10] & 0x7FFFFFF) << 2))) << ntz + out[21] + out[23] = int64((in[10] >> 27) & 0x1FFFFFFF) << ntz + out[22] + out[24] = int64(((in[10] >> 56) | ((in[11] & 0x1FFFFF) << 8))) << ntz + out[23] + out[25] = int64((in[11] >> 21) & 0x1FFFFFFF) << ntz + out[24] + out[26] = int64(((in[11] >> 50) | ((in[12] & 0x7FFF) << 14))) << ntz + out[25] + out[27] = int64((in[12] >> 15) & 0x1FFFFFFF) << ntz + out[26] + out[28] = int64(((in[12] >> 44) | ((in[13] & 0x1FF) << 20))) << ntz + out[27] + out[29] = int64((in[13] >> 9) & 0x1FFFFFFF) << ntz + out[28] + out[30] = int64(((in[13] >> 38) | ((in[14] & 0x7) << 26))) << ntz + out[29] + out[31] = int64((in[14] >> 3) & 0x1FFFFFFF) << ntz + out[30] + out[32] = int64((in[14] >> 32) & 0x1FFFFFFF) << ntz + out[31] + out[33] = int64(((in[14] >> 61) | ((in[15] & 0x3FFFFFF) << 3))) << ntz + out[32] + out[34] = int64((in[15] >> 26) & 0x1FFFFFFF) << ntz + out[33] + out[35] = int64(((in[15] >> 55) | ((in[16] & 0xFFFFF) << 9))) << ntz + out[34] + out[36] = int64((in[16] >> 20) & 0x1FFFFFFF) << ntz + out[35] + out[37] = int64(((in[16] >> 49) | ((in[17] & 0x3FFF) << 15))) << ntz + out[36] + out[38] = int64((in[17] >> 14) & 0x1FFFFFFF) << ntz + out[37] + out[39] = int64(((in[17] >> 43) | ((in[18] & 0xFF) << 21))) << ntz + out[38] + out[40] = int64((in[18] >> 8) & 0x1FFFFFFF) << ntz + out[39] + out[41] = int64(((in[18] >> 37) | ((in[19] & 0x3) << 27))) << ntz + out[40] + out[42] = int64((in[19] >> 2) & 0x1FFFFFFF) << ntz + out[41] + out[43] = int64((in[19] >> 31) & 0x1FFFFFFF) << ntz + out[42] + out[44] = int64(((in[19] >> 60) | ((in[20] & 0x1FFFFFF) << 4))) << ntz + out[43] + out[45] = int64((in[20] >> 25) & 0x1FFFFFFF) << ntz + out[44] + out[46] = int64(((in[20] >> 54) | ((in[21] & 0x7FFFF) << 10))) << ntz + out[45] + out[47] = int64((in[21] >> 19) & 0x1FFFFFFF) << ntz + out[46] + out[48] = int64(((in[21] >> 48) | ((in[22] & 0x1FFF) << 16))) << ntz + out[47] + out[49] = int64((in[22] >> 13) & 0x1FFFFFFF) << ntz + out[48] + out[50] = int64(((in[22] >> 42) | ((in[23] & 0x7F) << 22))) << ntz + out[49] + out[51] = int64((in[23] >> 7) & 0x1FFFFFFF) << ntz + out[50] + out[52] = int64(((in[23] >> 36) | ((in[24] & 0x1) << 28))) << ntz + out[51] + out[53] = int64((in[24] >> 1) & 0x1FFFFFFF) << ntz + out[52] + out[54] = int64((in[24] >> 30) & 0x1FFFFFFF) << ntz + out[53] + out[55] = int64(((in[24] >> 59) | ((in[25] & 0xFFFFFF) << 5))) << ntz + out[54] + out[56] = int64((in[25] >> 24) & 0x1FFFFFFF) << ntz + out[55] + out[57] = int64(((in[25] >> 53) | ((in[26] & 0x3FFFF) << 11))) << ntz + out[56] + out[58] = int64((in[26] >> 18) & 0x1FFFFFFF) << ntz + out[57] + out[59] = int64(((in[26] >> 47) | ((in[27] & 0xFFF) << 17))) << ntz + out[58] + out[60] = int64((in[27] >> 12) & 0x1FFFFFFF) << ntz + out[59] + out[61] = int64(((in[27] >> 41) | ((in[28] & 0x3F) << 23))) << ntz + out[60] + out[62] = int64((in[28] >> 6) & 0x1FFFFFFF) << ntz + out[61] + out[63] = int64((in[28] >> 35)) << ntz + out[62] +} + +func deltaunpack_int64_30(initoffset int64, in *[30]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 30) & 0x3FFFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 60) | ((in[1] & 0x3FFFFFF) << 4))) << ntz + out[1] + out[3] = int64((in[1] >> 26) & 0x3FFFFFFF) << ntz + out[2] + out[4] = int64(((in[1] >> 56) | ((in[2] & 0x3FFFFF) << 8))) << ntz + out[3] + out[5] = int64((in[2] >> 22) & 0x3FFFFFFF) << ntz + out[4] + out[6] = int64(((in[2] >> 52) | ((in[3] & 0x3FFFF) << 12))) << ntz + out[5] + out[7] = int64((in[3] >> 18) & 0x3FFFFFFF) << ntz + out[6] + out[8] = int64(((in[3] >> 48) | ((in[4] & 0x3FFF) << 16))) << ntz + out[7] + out[9] = int64((in[4] >> 14) & 0x3FFFFFFF) << ntz + out[8] + out[10] = int64(((in[4] >> 44) | ((in[5] & 0x3FF) << 20))) << ntz + out[9] + out[11] = int64((in[5] >> 10) & 0x3FFFFFFF) << ntz + out[10] + out[12] = int64(((in[5] >> 40) | ((in[6] & 0x3F) << 24))) << ntz + out[11] + out[13] = int64((in[6] >> 6) & 0x3FFFFFFF) << ntz + out[12] + out[14] = int64(((in[6] >> 36) | ((in[7] & 0x3) << 28))) << ntz + out[13] + out[15] = int64((in[7] >> 2) & 0x3FFFFFFF) << ntz + out[14] + out[16] = int64((in[7] >> 32) & 0x3FFFFFFF) << ntz + out[15] + out[17] = int64(((in[7] >> 62) | ((in[8] & 0xFFFFFFF) << 2))) << ntz + out[16] + out[18] = int64((in[8] >> 28) & 0x3FFFFFFF) << ntz + out[17] + out[19] = int64(((in[8] >> 58) | ((in[9] & 0xFFFFFF) << 6))) << ntz + out[18] + out[20] = int64((in[9] >> 24) & 0x3FFFFFFF) << ntz + out[19] + out[21] = int64(((in[9] >> 54) | ((in[10] & 0xFFFFF) << 10))) << ntz + out[20] + out[22] = int64((in[10] >> 20) & 0x3FFFFFFF) << ntz + out[21] + out[23] = int64(((in[10] >> 50) | ((in[11] & 0xFFFF) << 14))) << ntz + out[22] + out[24] = int64((in[11] >> 16) & 0x3FFFFFFF) << ntz + out[23] + out[25] = int64(((in[11] >> 46) | ((in[12] & 0xFFF) << 18))) << ntz + out[24] + out[26] = int64((in[12] >> 12) & 0x3FFFFFFF) << ntz + out[25] + out[27] = int64(((in[12] >> 42) | ((in[13] & 0xFF) << 22))) << ntz + out[26] + out[28] = int64((in[13] >> 8) & 0x3FFFFFFF) << ntz + out[27] + out[29] = int64(((in[13] >> 38) | ((in[14] & 0xF) << 26))) << ntz + out[28] + out[30] = int64((in[14] >> 4) & 0x3FFFFFFF) << ntz + out[29] + out[31] = int64((in[14] >> 34)) << ntz + out[30] + out[32] = int64((in[15] >> 0) & 0x3FFFFFFF) << ntz + out[31] + out[33] = int64((in[15] >> 30) & 0x3FFFFFFF) << ntz + out[32] + out[34] = int64(((in[15] >> 60) | ((in[16] & 0x3FFFFFF) << 4))) << ntz + out[33] + out[35] = int64((in[16] >> 26) & 0x3FFFFFFF) << ntz + out[34] + out[36] = int64(((in[16] >> 56) | ((in[17] & 0x3FFFFF) << 8))) << ntz + out[35] + out[37] = int64((in[17] >> 22) & 0x3FFFFFFF) << ntz + out[36] + out[38] = int64(((in[17] >> 52) | ((in[18] & 0x3FFFF) << 12))) << ntz + out[37] + out[39] = int64((in[18] >> 18) & 0x3FFFFFFF) << ntz + out[38] + out[40] = int64(((in[18] >> 48) | ((in[19] & 0x3FFF) << 16))) << ntz + out[39] + out[41] = int64((in[19] >> 14) & 0x3FFFFFFF) << ntz + out[40] + out[42] = int64(((in[19] >> 44) | ((in[20] & 0x3FF) << 20))) << ntz + out[41] + out[43] = int64((in[20] >> 10) & 0x3FFFFFFF) << ntz + out[42] + out[44] = int64(((in[20] >> 40) | ((in[21] & 0x3F) << 24))) << ntz + out[43] + out[45] = int64((in[21] >> 6) & 0x3FFFFFFF) << ntz + out[44] + out[46] = int64(((in[21] >> 36) | ((in[22] & 0x3) << 28))) << ntz + out[45] + out[47] = int64((in[22] >> 2) & 0x3FFFFFFF) << ntz + out[46] + out[48] = int64((in[22] >> 32) & 0x3FFFFFFF) << ntz + out[47] + out[49] = int64(((in[22] >> 62) | ((in[23] & 0xFFFFFFF) << 2))) << ntz + out[48] + out[50] = int64((in[23] >> 28) & 0x3FFFFFFF) << ntz + out[49] + out[51] = int64(((in[23] >> 58) | ((in[24] & 0xFFFFFF) << 6))) << ntz + out[50] + out[52] = int64((in[24] >> 24) & 0x3FFFFFFF) << ntz + out[51] + out[53] = int64(((in[24] >> 54) | ((in[25] & 0xFFFFF) << 10))) << ntz + out[52] + out[54] = int64((in[25] >> 20) & 0x3FFFFFFF) << ntz + out[53] + out[55] = int64(((in[25] >> 50) | ((in[26] & 0xFFFF) << 14))) << ntz + out[54] + out[56] = int64((in[26] >> 16) & 0x3FFFFFFF) << ntz + out[55] + out[57] = int64(((in[26] >> 46) | ((in[27] & 0xFFF) << 18))) << ntz + out[56] + out[58] = int64((in[27] >> 12) & 0x3FFFFFFF) << ntz + out[57] + out[59] = int64(((in[27] >> 42) | ((in[28] & 0xFF) << 22))) << ntz + out[58] + out[60] = int64((in[28] >> 8) & 0x3FFFFFFF) << ntz + out[59] + out[61] = int64(((in[28] >> 38) | ((in[29] & 0xF) << 26))) << ntz + out[60] + out[62] = int64((in[29] >> 4) & 0x3FFFFFFF) << ntz + out[61] + out[63] = int64((in[29] >> 34)) << ntz + out[62] +} + +func deltaunpack_int64_31(initoffset int64, in *[31]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 31) & 0x7FFFFFFF) << ntz + out[0] + out[2] = int64(((in[0] >> 62) | ((in[1] & 0x1FFFFFFF) << 2))) << ntz + out[1] + out[3] = int64((in[1] >> 29) & 0x7FFFFFFF) << ntz + out[2] + out[4] = int64(((in[1] >> 60) | ((in[2] & 0x7FFFFFF) << 4))) << ntz + out[3] + out[5] = int64((in[2] >> 27) & 0x7FFFFFFF) << ntz + out[4] + out[6] = int64(((in[2] >> 58) | ((in[3] & 0x1FFFFFF) << 6))) << ntz + out[5] + out[7] = int64((in[3] >> 25) & 0x7FFFFFFF) << ntz + out[6] + out[8] = int64(((in[3] >> 56) | ((in[4] & 0x7FFFFF) << 8))) << ntz + out[7] + out[9] = int64((in[4] >> 23) & 0x7FFFFFFF) << ntz + out[8] + out[10] = int64(((in[4] >> 54) | ((in[5] & 0x1FFFFF) << 10))) << ntz + out[9] + out[11] = int64((in[5] >> 21) & 0x7FFFFFFF) << ntz + out[10] + out[12] = int64(((in[5] >> 52) | ((in[6] & 0x7FFFF) << 12))) << ntz + out[11] + out[13] = int64((in[6] >> 19) & 0x7FFFFFFF) << ntz + out[12] + out[14] = int64(((in[6] >> 50) | ((in[7] & 0x1FFFF) << 14))) << ntz + out[13] + out[15] = int64((in[7] >> 17) & 0x7FFFFFFF) << ntz + out[14] + out[16] = int64(((in[7] >> 48) | ((in[8] & 0x7FFF) << 16))) << ntz + out[15] + out[17] = int64((in[8] >> 15) & 0x7FFFFFFF) << ntz + out[16] + out[18] = int64(((in[8] >> 46) | ((in[9] & 0x1FFF) << 18))) << ntz + out[17] + out[19] = int64((in[9] >> 13) & 0x7FFFFFFF) << ntz + out[18] + out[20] = int64(((in[9] >> 44) | ((in[10] & 0x7FF) << 20))) << ntz + out[19] + out[21] = int64((in[10] >> 11) & 0x7FFFFFFF) << ntz + out[20] + out[22] = int64(((in[10] >> 42) | ((in[11] & 0x1FF) << 22))) << ntz + out[21] + out[23] = int64((in[11] >> 9) & 0x7FFFFFFF) << ntz + out[22] + out[24] = int64(((in[11] >> 40) | ((in[12] & 0x7F) << 24))) << ntz + out[23] + out[25] = int64((in[12] >> 7) & 0x7FFFFFFF) << ntz + out[24] + out[26] = int64(((in[12] >> 38) | ((in[13] & 0x1F) << 26))) << ntz + out[25] + out[27] = int64((in[13] >> 5) & 0x7FFFFFFF) << ntz + out[26] + out[28] = int64(((in[13] >> 36) | ((in[14] & 0x7) << 28))) << ntz + out[27] + out[29] = int64((in[14] >> 3) & 0x7FFFFFFF) << ntz + out[28] + out[30] = int64(((in[14] >> 34) | ((in[15] & 0x1) << 30))) << ntz + out[29] + out[31] = int64((in[15] >> 1) & 0x7FFFFFFF) << ntz + out[30] + out[32] = int64((in[15] >> 32) & 0x7FFFFFFF) << ntz + out[31] + out[33] = int64(((in[15] >> 63) | ((in[16] & 0x3FFFFFFF) << 1))) << ntz + out[32] + out[34] = int64((in[16] >> 30) & 0x7FFFFFFF) << ntz + out[33] + out[35] = int64(((in[16] >> 61) | ((in[17] & 0xFFFFFFF) << 3))) << ntz + out[34] + out[36] = int64((in[17] >> 28) & 0x7FFFFFFF) << ntz + out[35] + out[37] = int64(((in[17] >> 59) | ((in[18] & 0x3FFFFFF) << 5))) << ntz + out[36] + out[38] = int64((in[18] >> 26) & 0x7FFFFFFF) << ntz + out[37] + out[39] = int64(((in[18] >> 57) | ((in[19] & 0xFFFFFF) << 7))) << ntz + out[38] + out[40] = int64((in[19] >> 24) & 0x7FFFFFFF) << ntz + out[39] + out[41] = int64(((in[19] >> 55) | ((in[20] & 0x3FFFFF) << 9))) << ntz + out[40] + out[42] = int64((in[20] >> 22) & 0x7FFFFFFF) << ntz + out[41] + out[43] = int64(((in[20] >> 53) | ((in[21] & 0xFFFFF) << 11))) << ntz + out[42] + out[44] = int64((in[21] >> 20) & 0x7FFFFFFF) << ntz + out[43] + out[45] = int64(((in[21] >> 51) | ((in[22] & 0x3FFFF) << 13))) << ntz + out[44] + out[46] = int64((in[22] >> 18) & 0x7FFFFFFF) << ntz + out[45] + out[47] = int64(((in[22] >> 49) | ((in[23] & 0xFFFF) << 15))) << ntz + out[46] + out[48] = int64((in[23] >> 16) & 0x7FFFFFFF) << ntz + out[47] + out[49] = int64(((in[23] >> 47) | ((in[24] & 0x3FFF) << 17))) << ntz + out[48] + out[50] = int64((in[24] >> 14) & 0x7FFFFFFF) << ntz + out[49] + out[51] = int64(((in[24] >> 45) | ((in[25] & 0xFFF) << 19))) << ntz + out[50] + out[52] = int64((in[25] >> 12) & 0x7FFFFFFF) << ntz + out[51] + out[53] = int64(((in[25] >> 43) | ((in[26] & 0x3FF) << 21))) << ntz + out[52] + out[54] = int64((in[26] >> 10) & 0x7FFFFFFF) << ntz + out[53] + out[55] = int64(((in[26] >> 41) | ((in[27] & 0xFF) << 23))) << ntz + out[54] + out[56] = int64((in[27] >> 8) & 0x7FFFFFFF) << ntz + out[55] + out[57] = int64(((in[27] >> 39) | ((in[28] & 0x3F) << 25))) << ntz + out[56] + out[58] = int64((in[28] >> 6) & 0x7FFFFFFF) << ntz + out[57] + out[59] = int64(((in[28] >> 37) | ((in[29] & 0xF) << 27))) << ntz + out[58] + out[60] = int64((in[29] >> 4) & 0x7FFFFFFF) << ntz + out[59] + out[61] = int64(((in[29] >> 35) | ((in[30] & 0x3) << 29))) << ntz + out[60] + out[62] = int64((in[30] >> 2) & 0x7FFFFFFF) << ntz + out[61] + out[63] = int64((in[30] >> 33)) << ntz + out[62] +} + +func deltaunpack_int64_32(initoffset int64, in *[32]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFF) << ntz + initoffset + out[1] = int64((in[0] >> 32)) << ntz + out[0] + out[2] = int64((in[1] >> 0) & 0xFFFFFFFF) << ntz + out[1] + out[3] = int64((in[1] >> 32)) << ntz + out[2] + out[4] = int64((in[2] >> 0) & 0xFFFFFFFF) << ntz + out[3] + out[5] = int64((in[2] >> 32)) << ntz + out[4] + out[6] = int64((in[3] >> 0) & 0xFFFFFFFF) << ntz + out[5] + out[7] = int64((in[3] >> 32)) << ntz + out[6] + out[8] = int64((in[4] >> 0) & 0xFFFFFFFF) << ntz + out[7] + out[9] = int64((in[4] >> 32)) << ntz + out[8] + out[10] = int64((in[5] >> 0) & 0xFFFFFFFF) << ntz + out[9] + out[11] = int64((in[5] >> 32)) << ntz + out[10] + out[12] = int64((in[6] >> 0) & 0xFFFFFFFF) << ntz + out[11] + out[13] = int64((in[6] >> 32)) << ntz + out[12] + out[14] = int64((in[7] >> 0) & 0xFFFFFFFF) << ntz + out[13] + out[15] = int64((in[7] >> 32)) << ntz + out[14] + out[16] = int64((in[8] >> 0) & 0xFFFFFFFF) << ntz + out[15] + out[17] = int64((in[8] >> 32)) << ntz + out[16] + out[18] = int64((in[9] >> 0) & 0xFFFFFFFF) << ntz + out[17] + out[19] = int64((in[9] >> 32)) << ntz + out[18] + out[20] = int64((in[10] >> 0) & 0xFFFFFFFF) << ntz + out[19] + out[21] = int64((in[10] >> 32)) << ntz + out[20] + out[22] = int64((in[11] >> 0) & 0xFFFFFFFF) << ntz + out[21] + out[23] = int64((in[11] >> 32)) << ntz + out[22] + out[24] = int64((in[12] >> 0) & 0xFFFFFFFF) << ntz + out[23] + out[25] = int64((in[12] >> 32)) << ntz + out[24] + out[26] = int64((in[13] >> 0) & 0xFFFFFFFF) << ntz + out[25] + out[27] = int64((in[13] >> 32)) << ntz + out[26] + out[28] = int64((in[14] >> 0) & 0xFFFFFFFF) << ntz + out[27] + out[29] = int64((in[14] >> 32)) << ntz + out[28] + out[30] = int64((in[15] >> 0) & 0xFFFFFFFF) << ntz + out[29] + out[31] = int64((in[15] >> 32)) << ntz + out[30] + out[32] = int64((in[16] >> 0) & 0xFFFFFFFF) << ntz + out[31] + out[33] = int64((in[16] >> 32)) << ntz + out[32] + out[34] = int64((in[17] >> 0) & 0xFFFFFFFF) << ntz + out[33] + out[35] = int64((in[17] >> 32)) << ntz + out[34] + out[36] = int64((in[18] >> 0) & 0xFFFFFFFF) << ntz + out[35] + out[37] = int64((in[18] >> 32)) << ntz + out[36] + out[38] = int64((in[19] >> 0) & 0xFFFFFFFF) << ntz + out[37] + out[39] = int64((in[19] >> 32)) << ntz + out[38] + out[40] = int64((in[20] >> 0) & 0xFFFFFFFF) << ntz + out[39] + out[41] = int64((in[20] >> 32)) << ntz + out[40] + out[42] = int64((in[21] >> 0) & 0xFFFFFFFF) << ntz + out[41] + out[43] = int64((in[21] >> 32)) << ntz + out[42] + out[44] = int64((in[22] >> 0) & 0xFFFFFFFF) << ntz + out[43] + out[45] = int64((in[22] >> 32)) << ntz + out[44] + out[46] = int64((in[23] >> 0) & 0xFFFFFFFF) << ntz + out[45] + out[47] = int64((in[23] >> 32)) << ntz + out[46] + out[48] = int64((in[24] >> 0) & 0xFFFFFFFF) << ntz + out[47] + out[49] = int64((in[24] >> 32)) << ntz + out[48] + out[50] = int64((in[25] >> 0) & 0xFFFFFFFF) << ntz + out[49] + out[51] = int64((in[25] >> 32)) << ntz + out[50] + out[52] = int64((in[26] >> 0) & 0xFFFFFFFF) << ntz + out[51] + out[53] = int64((in[26] >> 32)) << ntz + out[52] + out[54] = int64((in[27] >> 0) & 0xFFFFFFFF) << ntz + out[53] + out[55] = int64((in[27] >> 32)) << ntz + out[54] + out[56] = int64((in[28] >> 0) & 0xFFFFFFFF) << ntz + out[55] + out[57] = int64((in[28] >> 32)) << ntz + out[56] + out[58] = int64((in[29] >> 0) & 0xFFFFFFFF) << ntz + out[57] + out[59] = int64((in[29] >> 32)) << ntz + out[58] + out[60] = int64((in[30] >> 0) & 0xFFFFFFFF) << ntz + out[59] + out[61] = int64((in[30] >> 32)) << ntz + out[60] + out[62] = int64((in[31] >> 0) & 0xFFFFFFFF) << ntz + out[61] + out[63] = int64((in[31] >> 32)) << ntz + out[62] +} + +func deltaunpack_int64_33(initoffset int64, in *[33]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 33) | ((in[1] & 0x3) << 31))) << ntz + out[0] + out[2] = int64((in[1] >> 2) & 0x1FFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 35) | ((in[2] & 0xF) << 29))) << ntz + out[2] + out[4] = int64((in[2] >> 4) & 0x1FFFFFFFF) << ntz + out[3] + out[5] = int64(((in[2] >> 37) | ((in[3] & 0x3F) << 27))) << ntz + out[4] + out[6] = int64((in[3] >> 6) & 0x1FFFFFFFF) << ntz + out[5] + out[7] = int64(((in[3] >> 39) | ((in[4] & 0xFF) << 25))) << ntz + out[6] + out[8] = int64((in[4] >> 8) & 0x1FFFFFFFF) << ntz + out[7] + out[9] = int64(((in[4] >> 41) | ((in[5] & 0x3FF) << 23))) << ntz + out[8] + out[10] = int64((in[5] >> 10) & 0x1FFFFFFFF) << ntz + out[9] + out[11] = int64(((in[5] >> 43) | ((in[6] & 0xFFF) << 21))) << ntz + out[10] + out[12] = int64((in[6] >> 12) & 0x1FFFFFFFF) << ntz + out[11] + out[13] = int64(((in[6] >> 45) | ((in[7] & 0x3FFF) << 19))) << ntz + out[12] + out[14] = int64((in[7] >> 14) & 0x1FFFFFFFF) << ntz + out[13] + out[15] = int64(((in[7] >> 47) | ((in[8] & 0xFFFF) << 17))) << ntz + out[14] + out[16] = int64((in[8] >> 16) & 0x1FFFFFFFF) << ntz + out[15] + out[17] = int64(((in[8] >> 49) | ((in[9] & 0x3FFFF) << 15))) << ntz + out[16] + out[18] = int64((in[9] >> 18) & 0x1FFFFFFFF) << ntz + out[17] + out[19] = int64(((in[9] >> 51) | ((in[10] & 0xFFFFF) << 13))) << ntz + out[18] + out[20] = int64((in[10] >> 20) & 0x1FFFFFFFF) << ntz + out[19] + out[21] = int64(((in[10] >> 53) | ((in[11] & 0x3FFFFF) << 11))) << ntz + out[20] + out[22] = int64((in[11] >> 22) & 0x1FFFFFFFF) << ntz + out[21] + out[23] = int64(((in[11] >> 55) | ((in[12] & 0xFFFFFF) << 9))) << ntz + out[22] + out[24] = int64((in[12] >> 24) & 0x1FFFFFFFF) << ntz + out[23] + out[25] = int64(((in[12] >> 57) | ((in[13] & 0x3FFFFFF) << 7))) << ntz + out[24] + out[26] = int64((in[13] >> 26) & 0x1FFFFFFFF) << ntz + out[25] + out[27] = int64(((in[13] >> 59) | ((in[14] & 0xFFFFFFF) << 5))) << ntz + out[26] + out[28] = int64((in[14] >> 28) & 0x1FFFFFFFF) << ntz + out[27] + out[29] = int64(((in[14] >> 61) | ((in[15] & 0x3FFFFFFF) << 3))) << ntz + out[28] + out[30] = int64((in[15] >> 30) & 0x1FFFFFFFF) << ntz + out[29] + out[31] = int64(((in[15] >> 63) | ((in[16] & 0xFFFFFFFF) << 1))) << ntz + out[30] + out[32] = int64(((in[16] >> 32) | ((in[17] & 0x1) << 32))) << ntz + out[31] + out[33] = int64((in[17] >> 1) & 0x1FFFFFFFF) << ntz + out[32] + out[34] = int64(((in[17] >> 34) | ((in[18] & 0x7) << 30))) << ntz + out[33] + out[35] = int64((in[18] >> 3) & 0x1FFFFFFFF) << ntz + out[34] + out[36] = int64(((in[18] >> 36) | ((in[19] & 0x1F) << 28))) << ntz + out[35] + out[37] = int64((in[19] >> 5) & 0x1FFFFFFFF) << ntz + out[36] + out[38] = int64(((in[19] >> 38) | ((in[20] & 0x7F) << 26))) << ntz + out[37] + out[39] = int64((in[20] >> 7) & 0x1FFFFFFFF) << ntz + out[38] + out[40] = int64(((in[20] >> 40) | ((in[21] & 0x1FF) << 24))) << ntz + out[39] + out[41] = int64((in[21] >> 9) & 0x1FFFFFFFF) << ntz + out[40] + out[42] = int64(((in[21] >> 42) | ((in[22] & 0x7FF) << 22))) << ntz + out[41] + out[43] = int64((in[22] >> 11) & 0x1FFFFFFFF) << ntz + out[42] + out[44] = int64(((in[22] >> 44) | ((in[23] & 0x1FFF) << 20))) << ntz + out[43] + out[45] = int64((in[23] >> 13) & 0x1FFFFFFFF) << ntz + out[44] + out[46] = int64(((in[23] >> 46) | ((in[24] & 0x7FFF) << 18))) << ntz + out[45] + out[47] = int64((in[24] >> 15) & 0x1FFFFFFFF) << ntz + out[46] + out[48] = int64(((in[24] >> 48) | ((in[25] & 0x1FFFF) << 16))) << ntz + out[47] + out[49] = int64((in[25] >> 17) & 0x1FFFFFFFF) << ntz + out[48] + out[50] = int64(((in[25] >> 50) | ((in[26] & 0x7FFFF) << 14))) << ntz + out[49] + out[51] = int64((in[26] >> 19) & 0x1FFFFFFFF) << ntz + out[50] + out[52] = int64(((in[26] >> 52) | ((in[27] & 0x1FFFFF) << 12))) << ntz + out[51] + out[53] = int64((in[27] >> 21) & 0x1FFFFFFFF) << ntz + out[52] + out[54] = int64(((in[27] >> 54) | ((in[28] & 0x7FFFFF) << 10))) << ntz + out[53] + out[55] = int64((in[28] >> 23) & 0x1FFFFFFFF) << ntz + out[54] + out[56] = int64(((in[28] >> 56) | ((in[29] & 0x1FFFFFF) << 8))) << ntz + out[55] + out[57] = int64((in[29] >> 25) & 0x1FFFFFFFF) << ntz + out[56] + out[58] = int64(((in[29] >> 58) | ((in[30] & 0x7FFFFFF) << 6))) << ntz + out[57] + out[59] = int64((in[30] >> 27) & 0x1FFFFFFFF) << ntz + out[58] + out[60] = int64(((in[30] >> 60) | ((in[31] & 0x1FFFFFFF) << 4))) << ntz + out[59] + out[61] = int64((in[31] >> 29) & 0x1FFFFFFFF) << ntz + out[60] + out[62] = int64(((in[31] >> 62) | ((in[32] & 0x7FFFFFFF) << 2))) << ntz + out[61] + out[63] = int64((in[32] >> 31)) << ntz + out[62] +} + +func deltaunpack_int64_34(initoffset int64, in *[34]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 34) | ((in[1] & 0xF) << 30))) << ntz + out[0] + out[2] = int64((in[1] >> 4) & 0x3FFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 38) | ((in[2] & 0xFF) << 26))) << ntz + out[2] + out[4] = int64((in[2] >> 8) & 0x3FFFFFFFF) << ntz + out[3] + out[5] = int64(((in[2] >> 42) | ((in[3] & 0xFFF) << 22))) << ntz + out[4] + out[6] = int64((in[3] >> 12) & 0x3FFFFFFFF) << ntz + out[5] + out[7] = int64(((in[3] >> 46) | ((in[4] & 0xFFFF) << 18))) << ntz + out[6] + out[8] = int64((in[4] >> 16) & 0x3FFFFFFFF) << ntz + out[7] + out[9] = int64(((in[4] >> 50) | ((in[5] & 0xFFFFF) << 14))) << ntz + out[8] + out[10] = int64((in[5] >> 20) & 0x3FFFFFFFF) << ntz + out[9] + out[11] = int64(((in[5] >> 54) | ((in[6] & 0xFFFFFF) << 10))) << ntz + out[10] + out[12] = int64((in[6] >> 24) & 0x3FFFFFFFF) << ntz + out[11] + out[13] = int64(((in[6] >> 58) | ((in[7] & 0xFFFFFFF) << 6))) << ntz + out[12] + out[14] = int64((in[7] >> 28) & 0x3FFFFFFFF) << ntz + out[13] + out[15] = int64(((in[7] >> 62) | ((in[8] & 0xFFFFFFFF) << 2))) << ntz + out[14] + out[16] = int64(((in[8] >> 32) | ((in[9] & 0x3) << 32))) << ntz + out[15] + out[17] = int64((in[9] >> 2) & 0x3FFFFFFFF) << ntz + out[16] + out[18] = int64(((in[9] >> 36) | ((in[10] & 0x3F) << 28))) << ntz + out[17] + out[19] = int64((in[10] >> 6) & 0x3FFFFFFFF) << ntz + out[18] + out[20] = int64(((in[10] >> 40) | ((in[11] & 0x3FF) << 24))) << ntz + out[19] + out[21] = int64((in[11] >> 10) & 0x3FFFFFFFF) << ntz + out[20] + out[22] = int64(((in[11] >> 44) | ((in[12] & 0x3FFF) << 20))) << ntz + out[21] + out[23] = int64((in[12] >> 14) & 0x3FFFFFFFF) << ntz + out[22] + out[24] = int64(((in[12] >> 48) | ((in[13] & 0x3FFFF) << 16))) << ntz + out[23] + out[25] = int64((in[13] >> 18) & 0x3FFFFFFFF) << ntz + out[24] + out[26] = int64(((in[13] >> 52) | ((in[14] & 0x3FFFFF) << 12))) << ntz + out[25] + out[27] = int64((in[14] >> 22) & 0x3FFFFFFFF) << ntz + out[26] + out[28] = int64(((in[14] >> 56) | ((in[15] & 0x3FFFFFF) << 8))) << ntz + out[27] + out[29] = int64((in[15] >> 26) & 0x3FFFFFFFF) << ntz + out[28] + out[30] = int64(((in[15] >> 60) | ((in[16] & 0x3FFFFFFF) << 4))) << ntz + out[29] + out[31] = int64((in[16] >> 30)) << ntz + out[30] + out[32] = int64((in[17] >> 0) & 0x3FFFFFFFF) << ntz + out[31] + out[33] = int64(((in[17] >> 34) | ((in[18] & 0xF) << 30))) << ntz + out[32] + out[34] = int64((in[18] >> 4) & 0x3FFFFFFFF) << ntz + out[33] + out[35] = int64(((in[18] >> 38) | ((in[19] & 0xFF) << 26))) << ntz + out[34] + out[36] = int64((in[19] >> 8) & 0x3FFFFFFFF) << ntz + out[35] + out[37] = int64(((in[19] >> 42) | ((in[20] & 0xFFF) << 22))) << ntz + out[36] + out[38] = int64((in[20] >> 12) & 0x3FFFFFFFF) << ntz + out[37] + out[39] = int64(((in[20] >> 46) | ((in[21] & 0xFFFF) << 18))) << ntz + out[38] + out[40] = int64((in[21] >> 16) & 0x3FFFFFFFF) << ntz + out[39] + out[41] = int64(((in[21] >> 50) | ((in[22] & 0xFFFFF) << 14))) << ntz + out[40] + out[42] = int64((in[22] >> 20) & 0x3FFFFFFFF) << ntz + out[41] + out[43] = int64(((in[22] >> 54) | ((in[23] & 0xFFFFFF) << 10))) << ntz + out[42] + out[44] = int64((in[23] >> 24) & 0x3FFFFFFFF) << ntz + out[43] + out[45] = int64(((in[23] >> 58) | ((in[24] & 0xFFFFFFF) << 6))) << ntz + out[44] + out[46] = int64((in[24] >> 28) & 0x3FFFFFFFF) << ntz + out[45] + out[47] = int64(((in[24] >> 62) | ((in[25] & 0xFFFFFFFF) << 2))) << ntz + out[46] + out[48] = int64(((in[25] >> 32) | ((in[26] & 0x3) << 32))) << ntz + out[47] + out[49] = int64((in[26] >> 2) & 0x3FFFFFFFF) << ntz + out[48] + out[50] = int64(((in[26] >> 36) | ((in[27] & 0x3F) << 28))) << ntz + out[49] + out[51] = int64((in[27] >> 6) & 0x3FFFFFFFF) << ntz + out[50] + out[52] = int64(((in[27] >> 40) | ((in[28] & 0x3FF) << 24))) << ntz + out[51] + out[53] = int64((in[28] >> 10) & 0x3FFFFFFFF) << ntz + out[52] + out[54] = int64(((in[28] >> 44) | ((in[29] & 0x3FFF) << 20))) << ntz + out[53] + out[55] = int64((in[29] >> 14) & 0x3FFFFFFFF) << ntz + out[54] + out[56] = int64(((in[29] >> 48) | ((in[30] & 0x3FFFF) << 16))) << ntz + out[55] + out[57] = int64((in[30] >> 18) & 0x3FFFFFFFF) << ntz + out[56] + out[58] = int64(((in[30] >> 52) | ((in[31] & 0x3FFFFF) << 12))) << ntz + out[57] + out[59] = int64((in[31] >> 22) & 0x3FFFFFFFF) << ntz + out[58] + out[60] = int64(((in[31] >> 56) | ((in[32] & 0x3FFFFFF) << 8))) << ntz + out[59] + out[61] = int64((in[32] >> 26) & 0x3FFFFFFFF) << ntz + out[60] + out[62] = int64(((in[32] >> 60) | ((in[33] & 0x3FFFFFFF) << 4))) << ntz + out[61] + out[63] = int64((in[33] >> 30)) << ntz + out[62] +} + +func deltaunpack_int64_35(initoffset int64, in *[35]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 35) | ((in[1] & 0x3F) << 29))) << ntz + out[0] + out[2] = int64((in[1] >> 6) & 0x7FFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 41) | ((in[2] & 0xFFF) << 23))) << ntz + out[2] + out[4] = int64((in[2] >> 12) & 0x7FFFFFFFF) << ntz + out[3] + out[5] = int64(((in[2] >> 47) | ((in[3] & 0x3FFFF) << 17))) << ntz + out[4] + out[6] = int64((in[3] >> 18) & 0x7FFFFFFFF) << ntz + out[5] + out[7] = int64(((in[3] >> 53) | ((in[4] & 0xFFFFFF) << 11))) << ntz + out[6] + out[8] = int64((in[4] >> 24) & 0x7FFFFFFFF) << ntz + out[7] + out[9] = int64(((in[4] >> 59) | ((in[5] & 0x3FFFFFFF) << 5))) << ntz + out[8] + out[10] = int64(((in[5] >> 30) | ((in[6] & 0x1) << 34))) << ntz + out[9] + out[11] = int64((in[6] >> 1) & 0x7FFFFFFFF) << ntz + out[10] + out[12] = int64(((in[6] >> 36) | ((in[7] & 0x7F) << 28))) << ntz + out[11] + out[13] = int64((in[7] >> 7) & 0x7FFFFFFFF) << ntz + out[12] + out[14] = int64(((in[7] >> 42) | ((in[8] & 0x1FFF) << 22))) << ntz + out[13] + out[15] = int64((in[8] >> 13) & 0x7FFFFFFFF) << ntz + out[14] + out[16] = int64(((in[8] >> 48) | ((in[9] & 0x7FFFF) << 16))) << ntz + out[15] + out[17] = int64((in[9] >> 19) & 0x7FFFFFFFF) << ntz + out[16] + out[18] = int64(((in[9] >> 54) | ((in[10] & 0x1FFFFFF) << 10))) << ntz + out[17] + out[19] = int64((in[10] >> 25) & 0x7FFFFFFFF) << ntz + out[18] + out[20] = int64(((in[10] >> 60) | ((in[11] & 0x7FFFFFFF) << 4))) << ntz + out[19] + out[21] = int64(((in[11] >> 31) | ((in[12] & 0x3) << 33))) << ntz + out[20] + out[22] = int64((in[12] >> 2) & 0x7FFFFFFFF) << ntz + out[21] + out[23] = int64(((in[12] >> 37) | ((in[13] & 0xFF) << 27))) << ntz + out[22] + out[24] = int64((in[13] >> 8) & 0x7FFFFFFFF) << ntz + out[23] + out[25] = int64(((in[13] >> 43) | ((in[14] & 0x3FFF) << 21))) << ntz + out[24] + out[26] = int64((in[14] >> 14) & 0x7FFFFFFFF) << ntz + out[25] + out[27] = int64(((in[14] >> 49) | ((in[15] & 0xFFFFF) << 15))) << ntz + out[26] + out[28] = int64((in[15] >> 20) & 0x7FFFFFFFF) << ntz + out[27] + out[29] = int64(((in[15] >> 55) | ((in[16] & 0x3FFFFFF) << 9))) << ntz + out[28] + out[30] = int64((in[16] >> 26) & 0x7FFFFFFFF) << ntz + out[29] + out[31] = int64(((in[16] >> 61) | ((in[17] & 0xFFFFFFFF) << 3))) << ntz + out[30] + out[32] = int64(((in[17] >> 32) | ((in[18] & 0x7) << 32))) << ntz + out[31] + out[33] = int64((in[18] >> 3) & 0x7FFFFFFFF) << ntz + out[32] + out[34] = int64(((in[18] >> 38) | ((in[19] & 0x1FF) << 26))) << ntz + out[33] + out[35] = int64((in[19] >> 9) & 0x7FFFFFFFF) << ntz + out[34] + out[36] = int64(((in[19] >> 44) | ((in[20] & 0x7FFF) << 20))) << ntz + out[35] + out[37] = int64((in[20] >> 15) & 0x7FFFFFFFF) << ntz + out[36] + out[38] = int64(((in[20] >> 50) | ((in[21] & 0x1FFFFF) << 14))) << ntz + out[37] + out[39] = int64((in[21] >> 21) & 0x7FFFFFFFF) << ntz + out[38] + out[40] = int64(((in[21] >> 56) | ((in[22] & 0x7FFFFFF) << 8))) << ntz + out[39] + out[41] = int64((in[22] >> 27) & 0x7FFFFFFFF) << ntz + out[40] + out[42] = int64(((in[22] >> 62) | ((in[23] & 0x1FFFFFFFF) << 2))) << ntz + out[41] + out[43] = int64(((in[23] >> 33) | ((in[24] & 0xF) << 31))) << ntz + out[42] + out[44] = int64((in[24] >> 4) & 0x7FFFFFFFF) << ntz + out[43] + out[45] = int64(((in[24] >> 39) | ((in[25] & 0x3FF) << 25))) << ntz + out[44] + out[46] = int64((in[25] >> 10) & 0x7FFFFFFFF) << ntz + out[45] + out[47] = int64(((in[25] >> 45) | ((in[26] & 0xFFFF) << 19))) << ntz + out[46] + out[48] = int64((in[26] >> 16) & 0x7FFFFFFFF) << ntz + out[47] + out[49] = int64(((in[26] >> 51) | ((in[27] & 0x3FFFFF) << 13))) << ntz + out[48] + out[50] = int64((in[27] >> 22) & 0x7FFFFFFFF) << ntz + out[49] + out[51] = int64(((in[27] >> 57) | ((in[28] & 0xFFFFFFF) << 7))) << ntz + out[50] + out[52] = int64((in[28] >> 28) & 0x7FFFFFFFF) << ntz + out[51] + out[53] = int64(((in[28] >> 63) | ((in[29] & 0x3FFFFFFFF) << 1))) << ntz + out[52] + out[54] = int64(((in[29] >> 34) | ((in[30] & 0x1F) << 30))) << ntz + out[53] + out[55] = int64((in[30] >> 5) & 0x7FFFFFFFF) << ntz + out[54] + out[56] = int64(((in[30] >> 40) | ((in[31] & 0x7FF) << 24))) << ntz + out[55] + out[57] = int64((in[31] >> 11) & 0x7FFFFFFFF) << ntz + out[56] + out[58] = int64(((in[31] >> 46) | ((in[32] & 0x1FFFF) << 18))) << ntz + out[57] + out[59] = int64((in[32] >> 17) & 0x7FFFFFFFF) << ntz + out[58] + out[60] = int64(((in[32] >> 52) | ((in[33] & 0x7FFFFF) << 12))) << ntz + out[59] + out[61] = int64((in[33] >> 23) & 0x7FFFFFFFF) << ntz + out[60] + out[62] = int64(((in[33] >> 58) | ((in[34] & 0x1FFFFFFF) << 6))) << ntz + out[61] + out[63] = int64((in[34] >> 29)) << ntz + out[62] +} + +func deltaunpack_int64_36(initoffset int64, in *[36]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 36) | ((in[1] & 0xFF) << 28))) << ntz + out[0] + out[2] = int64((in[1] >> 8) & 0xFFFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 44) | ((in[2] & 0xFFFF) << 20))) << ntz + out[2] + out[4] = int64((in[2] >> 16) & 0xFFFFFFFFF) << ntz + out[3] + out[5] = int64(((in[2] >> 52) | ((in[3] & 0xFFFFFF) << 12))) << ntz + out[4] + out[6] = int64((in[3] >> 24) & 0xFFFFFFFFF) << ntz + out[5] + out[7] = int64(((in[3] >> 60) | ((in[4] & 0xFFFFFFFF) << 4))) << ntz + out[6] + out[8] = int64(((in[4] >> 32) | ((in[5] & 0xF) << 32))) << ntz + out[7] + out[9] = int64((in[5] >> 4) & 0xFFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[5] >> 40) | ((in[6] & 0xFFF) << 24))) << ntz + out[9] + out[11] = int64((in[6] >> 12) & 0xFFFFFFFFF) << ntz + out[10] + out[12] = int64(((in[6] >> 48) | ((in[7] & 0xFFFFF) << 16))) << ntz + out[11] + out[13] = int64((in[7] >> 20) & 0xFFFFFFFFF) << ntz + out[12] + out[14] = int64(((in[7] >> 56) | ((in[8] & 0xFFFFFFF) << 8))) << ntz + out[13] + out[15] = int64((in[8] >> 28)) << ntz + out[14] + out[16] = int64((in[9] >> 0) & 0xFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[9] >> 36) | ((in[10] & 0xFF) << 28))) << ntz + out[16] + out[18] = int64((in[10] >> 8) & 0xFFFFFFFFF) << ntz + out[17] + out[19] = int64(((in[10] >> 44) | ((in[11] & 0xFFFF) << 20))) << ntz + out[18] + out[20] = int64((in[11] >> 16) & 0xFFFFFFFFF) << ntz + out[19] + out[21] = int64(((in[11] >> 52) | ((in[12] & 0xFFFFFF) << 12))) << ntz + out[20] + out[22] = int64((in[12] >> 24) & 0xFFFFFFFFF) << ntz + out[21] + out[23] = int64(((in[12] >> 60) | ((in[13] & 0xFFFFFFFF) << 4))) << ntz + out[22] + out[24] = int64(((in[13] >> 32) | ((in[14] & 0xF) << 32))) << ntz + out[23] + out[25] = int64((in[14] >> 4) & 0xFFFFFFFFF) << ntz + out[24] + out[26] = int64(((in[14] >> 40) | ((in[15] & 0xFFF) << 24))) << ntz + out[25] + out[27] = int64((in[15] >> 12) & 0xFFFFFFFFF) << ntz + out[26] + out[28] = int64(((in[15] >> 48) | ((in[16] & 0xFFFFF) << 16))) << ntz + out[27] + out[29] = int64((in[16] >> 20) & 0xFFFFFFFFF) << ntz + out[28] + out[30] = int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFF) << 8))) << ntz + out[29] + out[31] = int64((in[17] >> 28)) << ntz + out[30] + out[32] = int64((in[18] >> 0) & 0xFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[18] >> 36) | ((in[19] & 0xFF) << 28))) << ntz + out[32] + out[34] = int64((in[19] >> 8) & 0xFFFFFFFFF) << ntz + out[33] + out[35] = int64(((in[19] >> 44) | ((in[20] & 0xFFFF) << 20))) << ntz + out[34] + out[36] = int64((in[20] >> 16) & 0xFFFFFFFFF) << ntz + out[35] + out[37] = int64(((in[20] >> 52) | ((in[21] & 0xFFFFFF) << 12))) << ntz + out[36] + out[38] = int64((in[21] >> 24) & 0xFFFFFFFFF) << ntz + out[37] + out[39] = int64(((in[21] >> 60) | ((in[22] & 0xFFFFFFFF) << 4))) << ntz + out[38] + out[40] = int64(((in[22] >> 32) | ((in[23] & 0xF) << 32))) << ntz + out[39] + out[41] = int64((in[23] >> 4) & 0xFFFFFFFFF) << ntz + out[40] + out[42] = int64(((in[23] >> 40) | ((in[24] & 0xFFF) << 24))) << ntz + out[41] + out[43] = int64((in[24] >> 12) & 0xFFFFFFFFF) << ntz + out[42] + out[44] = int64(((in[24] >> 48) | ((in[25] & 0xFFFFF) << 16))) << ntz + out[43] + out[45] = int64((in[25] >> 20) & 0xFFFFFFFFF) << ntz + out[44] + out[46] = int64(((in[25] >> 56) | ((in[26] & 0xFFFFFFF) << 8))) << ntz + out[45] + out[47] = int64((in[26] >> 28)) << ntz + out[46] + out[48] = int64((in[27] >> 0) & 0xFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[27] >> 36) | ((in[28] & 0xFF) << 28))) << ntz + out[48] + out[50] = int64((in[28] >> 8) & 0xFFFFFFFFF) << ntz + out[49] + out[51] = int64(((in[28] >> 44) | ((in[29] & 0xFFFF) << 20))) << ntz + out[50] + out[52] = int64((in[29] >> 16) & 0xFFFFFFFFF) << ntz + out[51] + out[53] = int64(((in[29] >> 52) | ((in[30] & 0xFFFFFF) << 12))) << ntz + out[52] + out[54] = int64((in[30] >> 24) & 0xFFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFF) << 4))) << ntz + out[54] + out[56] = int64(((in[31] >> 32) | ((in[32] & 0xF) << 32))) << ntz + out[55] + out[57] = int64((in[32] >> 4) & 0xFFFFFFFFF) << ntz + out[56] + out[58] = int64(((in[32] >> 40) | ((in[33] & 0xFFF) << 24))) << ntz + out[57] + out[59] = int64((in[33] >> 12) & 0xFFFFFFFFF) << ntz + out[58] + out[60] = int64(((in[33] >> 48) | ((in[34] & 0xFFFFF) << 16))) << ntz + out[59] + out[61] = int64((in[34] >> 20) & 0xFFFFFFFFF) << ntz + out[60] + out[62] = int64(((in[34] >> 56) | ((in[35] & 0xFFFFFFF) << 8))) << ntz + out[61] + out[63] = int64((in[35] >> 28)) << ntz + out[62] +} + +func deltaunpack_int64_37(initoffset int64, in *[37]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 37) | ((in[1] & 0x3FF) << 27))) << ntz + out[0] + out[2] = int64((in[1] >> 10) & 0x1FFFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 47) | ((in[2] & 0xFFFFF) << 17))) << ntz + out[2] + out[4] = int64((in[2] >> 20) & 0x1FFFFFFFFF) << ntz + out[3] + out[5] = int64(((in[2] >> 57) | ((in[3] & 0x3FFFFFFF) << 7))) << ntz + out[4] + out[6] = int64(((in[3] >> 30) | ((in[4] & 0x7) << 34))) << ntz + out[5] + out[7] = int64((in[4] >> 3) & 0x1FFFFFFFFF) << ntz + out[6] + out[8] = int64(((in[4] >> 40) | ((in[5] & 0x1FFF) << 24))) << ntz + out[7] + out[9] = int64((in[5] >> 13) & 0x1FFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[5] >> 50) | ((in[6] & 0x7FFFFF) << 14))) << ntz + out[9] + out[11] = int64((in[6] >> 23) & 0x1FFFFFFFFF) << ntz + out[10] + out[12] = int64(((in[6] >> 60) | ((in[7] & 0x1FFFFFFFF) << 4))) << ntz + out[11] + out[13] = int64(((in[7] >> 33) | ((in[8] & 0x3F) << 31))) << ntz + out[12] + out[14] = int64((in[8] >> 6) & 0x1FFFFFFFFF) << ntz + out[13] + out[15] = int64(((in[8] >> 43) | ((in[9] & 0xFFFF) << 21))) << ntz + out[14] + out[16] = int64((in[9] >> 16) & 0x1FFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[9] >> 53) | ((in[10] & 0x3FFFFFF) << 11))) << ntz + out[16] + out[18] = int64((in[10] >> 26) & 0x1FFFFFFFFF) << ntz + out[17] + out[19] = int64(((in[10] >> 63) | ((in[11] & 0xFFFFFFFFF) << 1))) << ntz + out[18] + out[20] = int64(((in[11] >> 36) | ((in[12] & 0x1FF) << 28))) << ntz + out[19] + out[21] = int64((in[12] >> 9) & 0x1FFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[12] >> 46) | ((in[13] & 0x7FFFF) << 18))) << ntz + out[21] + out[23] = int64((in[13] >> 19) & 0x1FFFFFFFFF) << ntz + out[22] + out[24] = int64(((in[13] >> 56) | ((in[14] & 0x1FFFFFFF) << 8))) << ntz + out[23] + out[25] = int64(((in[14] >> 29) | ((in[15] & 0x3) << 35))) << ntz + out[24] + out[26] = int64((in[15] >> 2) & 0x1FFFFFFFFF) << ntz + out[25] + out[27] = int64(((in[15] >> 39) | ((in[16] & 0xFFF) << 25))) << ntz + out[26] + out[28] = int64((in[16] >> 12) & 0x1FFFFFFFFF) << ntz + out[27] + out[29] = int64(((in[16] >> 49) | ((in[17] & 0x3FFFFF) << 15))) << ntz + out[28] + out[30] = int64((in[17] >> 22) & 0x1FFFFFFFFF) << ntz + out[29] + out[31] = int64(((in[17] >> 59) | ((in[18] & 0xFFFFFFFF) << 5))) << ntz + out[30] + out[32] = int64(((in[18] >> 32) | ((in[19] & 0x1F) << 32))) << ntz + out[31] + out[33] = int64((in[19] >> 5) & 0x1FFFFFFFFF) << ntz + out[32] + out[34] = int64(((in[19] >> 42) | ((in[20] & 0x7FFF) << 22))) << ntz + out[33] + out[35] = int64((in[20] >> 15) & 0x1FFFFFFFFF) << ntz + out[34] + out[36] = int64(((in[20] >> 52) | ((in[21] & 0x1FFFFFF) << 12))) << ntz + out[35] + out[37] = int64((in[21] >> 25) & 0x1FFFFFFFFF) << ntz + out[36] + out[38] = int64(((in[21] >> 62) | ((in[22] & 0x7FFFFFFFF) << 2))) << ntz + out[37] + out[39] = int64(((in[22] >> 35) | ((in[23] & 0xFF) << 29))) << ntz + out[38] + out[40] = int64((in[23] >> 8) & 0x1FFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[23] >> 45) | ((in[24] & 0x3FFFF) << 19))) << ntz + out[40] + out[42] = int64((in[24] >> 18) & 0x1FFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[24] >> 55) | ((in[25] & 0xFFFFFFF) << 9))) << ntz + out[42] + out[44] = int64(((in[25] >> 28) | ((in[26] & 0x1) << 36))) << ntz + out[43] + out[45] = int64((in[26] >> 1) & 0x1FFFFFFFFF) << ntz + out[44] + out[46] = int64(((in[26] >> 38) | ((in[27] & 0x7FF) << 26))) << ntz + out[45] + out[47] = int64((in[27] >> 11) & 0x1FFFFFFFFF) << ntz + out[46] + out[48] = int64(((in[27] >> 48) | ((in[28] & 0x1FFFFF) << 16))) << ntz + out[47] + out[49] = int64((in[28] >> 21) & 0x1FFFFFFFFF) << ntz + out[48] + out[50] = int64(((in[28] >> 58) | ((in[29] & 0x7FFFFFFF) << 6))) << ntz + out[49] + out[51] = int64(((in[29] >> 31) | ((in[30] & 0xF) << 33))) << ntz + out[50] + out[52] = int64((in[30] >> 4) & 0x1FFFFFFFFF) << ntz + out[51] + out[53] = int64(((in[30] >> 41) | ((in[31] & 0x3FFF) << 23))) << ntz + out[52] + out[54] = int64((in[31] >> 14) & 0x1FFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[31] >> 51) | ((in[32] & 0xFFFFFF) << 13))) << ntz + out[54] + out[56] = int64((in[32] >> 24) & 0x1FFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[32] >> 61) | ((in[33] & 0x3FFFFFFFF) << 3))) << ntz + out[56] + out[58] = int64(((in[33] >> 34) | ((in[34] & 0x7F) << 30))) << ntz + out[57] + out[59] = int64((in[34] >> 7) & 0x1FFFFFFFFF) << ntz + out[58] + out[60] = int64(((in[34] >> 44) | ((in[35] & 0x1FFFF) << 20))) << ntz + out[59] + out[61] = int64((in[35] >> 17) & 0x1FFFFFFFFF) << ntz + out[60] + out[62] = int64(((in[35] >> 54) | ((in[36] & 0x7FFFFFF) << 10))) << ntz + out[61] + out[63] = int64((in[36] >> 27)) << ntz + out[62] +} + +func deltaunpack_int64_38(initoffset int64, in *[38]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 38) | ((in[1] & 0xFFF) << 26))) << ntz + out[0] + out[2] = int64((in[1] >> 12) & 0x3FFFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 50) | ((in[2] & 0xFFFFFF) << 14))) << ntz + out[2] + out[4] = int64((in[2] >> 24) & 0x3FFFFFFFFF) << ntz + out[3] + out[5] = int64(((in[2] >> 62) | ((in[3] & 0xFFFFFFFFF) << 2))) << ntz + out[4] + out[6] = int64(((in[3] >> 36) | ((in[4] & 0x3FF) << 28))) << ntz + out[5] + out[7] = int64((in[4] >> 10) & 0x3FFFFFFFFF) << ntz + out[6] + out[8] = int64(((in[4] >> 48) | ((in[5] & 0x3FFFFF) << 16))) << ntz + out[7] + out[9] = int64((in[5] >> 22) & 0x3FFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[5] >> 60) | ((in[6] & 0x3FFFFFFFF) << 4))) << ntz + out[9] + out[11] = int64(((in[6] >> 34) | ((in[7] & 0xFF) << 30))) << ntz + out[10] + out[12] = int64((in[7] >> 8) & 0x3FFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[7] >> 46) | ((in[8] & 0xFFFFF) << 18))) << ntz + out[12] + out[14] = int64((in[8] >> 20) & 0x3FFFFFFFFF) << ntz + out[13] + out[15] = int64(((in[8] >> 58) | ((in[9] & 0xFFFFFFFF) << 6))) << ntz + out[14] + out[16] = int64(((in[9] >> 32) | ((in[10] & 0x3F) << 32))) << ntz + out[15] + out[17] = int64((in[10] >> 6) & 0x3FFFFFFFFF) << ntz + out[16] + out[18] = int64(((in[10] >> 44) | ((in[11] & 0x3FFFF) << 20))) << ntz + out[17] + out[19] = int64((in[11] >> 18) & 0x3FFFFFFFFF) << ntz + out[18] + out[20] = int64(((in[11] >> 56) | ((in[12] & 0x3FFFFFFF) << 8))) << ntz + out[19] + out[21] = int64(((in[12] >> 30) | ((in[13] & 0xF) << 34))) << ntz + out[20] + out[22] = int64((in[13] >> 4) & 0x3FFFFFFFFF) << ntz + out[21] + out[23] = int64(((in[13] >> 42) | ((in[14] & 0xFFFF) << 22))) << ntz + out[22] + out[24] = int64((in[14] >> 16) & 0x3FFFFFFFFF) << ntz + out[23] + out[25] = int64(((in[14] >> 54) | ((in[15] & 0xFFFFFFF) << 10))) << ntz + out[24] + out[26] = int64(((in[15] >> 28) | ((in[16] & 0x3) << 36))) << ntz + out[25] + out[27] = int64((in[16] >> 2) & 0x3FFFFFFFFF) << ntz + out[26] + out[28] = int64(((in[16] >> 40) | ((in[17] & 0x3FFF) << 24))) << ntz + out[27] + out[29] = int64((in[17] >> 14) & 0x3FFFFFFFFF) << ntz + out[28] + out[30] = int64(((in[17] >> 52) | ((in[18] & 0x3FFFFFF) << 12))) << ntz + out[29] + out[31] = int64((in[18] >> 26)) << ntz + out[30] + out[32] = int64((in[19] >> 0) & 0x3FFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[19] >> 38) | ((in[20] & 0xFFF) << 26))) << ntz + out[32] + out[34] = int64((in[20] >> 12) & 0x3FFFFFFFFF) << ntz + out[33] + out[35] = int64(((in[20] >> 50) | ((in[21] & 0xFFFFFF) << 14))) << ntz + out[34] + out[36] = int64((in[21] >> 24) & 0x3FFFFFFFFF) << ntz + out[35] + out[37] = int64(((in[21] >> 62) | ((in[22] & 0xFFFFFFFFF) << 2))) << ntz + out[36] + out[38] = int64(((in[22] >> 36) | ((in[23] & 0x3FF) << 28))) << ntz + out[37] + out[39] = int64((in[23] >> 10) & 0x3FFFFFFFFF) << ntz + out[38] + out[40] = int64(((in[23] >> 48) | ((in[24] & 0x3FFFFF) << 16))) << ntz + out[39] + out[41] = int64((in[24] >> 22) & 0x3FFFFFFFFF) << ntz + out[40] + out[42] = int64(((in[24] >> 60) | ((in[25] & 0x3FFFFFFFF) << 4))) << ntz + out[41] + out[43] = int64(((in[25] >> 34) | ((in[26] & 0xFF) << 30))) << ntz + out[42] + out[44] = int64((in[26] >> 8) & 0x3FFFFFFFFF) << ntz + out[43] + out[45] = int64(((in[26] >> 46) | ((in[27] & 0xFFFFF) << 18))) << ntz + out[44] + out[46] = int64((in[27] >> 20) & 0x3FFFFFFFFF) << ntz + out[45] + out[47] = int64(((in[27] >> 58) | ((in[28] & 0xFFFFFFFF) << 6))) << ntz + out[46] + out[48] = int64(((in[28] >> 32) | ((in[29] & 0x3F) << 32))) << ntz + out[47] + out[49] = int64((in[29] >> 6) & 0x3FFFFFFFFF) << ntz + out[48] + out[50] = int64(((in[29] >> 44) | ((in[30] & 0x3FFFF) << 20))) << ntz + out[49] + out[51] = int64((in[30] >> 18) & 0x3FFFFFFFFF) << ntz + out[50] + out[52] = int64(((in[30] >> 56) | ((in[31] & 0x3FFFFFFF) << 8))) << ntz + out[51] + out[53] = int64(((in[31] >> 30) | ((in[32] & 0xF) << 34))) << ntz + out[52] + out[54] = int64((in[32] >> 4) & 0x3FFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[32] >> 42) | ((in[33] & 0xFFFF) << 22))) << ntz + out[54] + out[56] = int64((in[33] >> 16) & 0x3FFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[33] >> 54) | ((in[34] & 0xFFFFFFF) << 10))) << ntz + out[56] + out[58] = int64(((in[34] >> 28) | ((in[35] & 0x3) << 36))) << ntz + out[57] + out[59] = int64((in[35] >> 2) & 0x3FFFFFFFFF) << ntz + out[58] + out[60] = int64(((in[35] >> 40) | ((in[36] & 0x3FFF) << 24))) << ntz + out[59] + out[61] = int64((in[36] >> 14) & 0x3FFFFFFFFF) << ntz + out[60] + out[62] = int64(((in[36] >> 52) | ((in[37] & 0x3FFFFFF) << 12))) << ntz + out[61] + out[63] = int64((in[37] >> 26)) << ntz + out[62] +} + +func deltaunpack_int64_39(initoffset int64, in *[39]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 39) | ((in[1] & 0x3FFF) << 25))) << ntz + out[0] + out[2] = int64((in[1] >> 14) & 0x7FFFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 53) | ((in[2] & 0xFFFFFFF) << 11))) << ntz + out[2] + out[4] = int64(((in[2] >> 28) | ((in[3] & 0x7) << 36))) << ntz + out[3] + out[5] = int64((in[3] >> 3) & 0x7FFFFFFFFF) << ntz + out[4] + out[6] = int64(((in[3] >> 42) | ((in[4] & 0x1FFFF) << 22))) << ntz + out[5] + out[7] = int64((in[4] >> 17) & 0x7FFFFFFFFF) << ntz + out[6] + out[8] = int64(((in[4] >> 56) | ((in[5] & 0x7FFFFFFF) << 8))) << ntz + out[7] + out[9] = int64(((in[5] >> 31) | ((in[6] & 0x3F) << 33))) << ntz + out[8] + out[10] = int64((in[6] >> 6) & 0x7FFFFFFFFF) << ntz + out[9] + out[11] = int64(((in[6] >> 45) | ((in[7] & 0xFFFFF) << 19))) << ntz + out[10] + out[12] = int64((in[7] >> 20) & 0x7FFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[7] >> 59) | ((in[8] & 0x3FFFFFFFF) << 5))) << ntz + out[12] + out[14] = int64(((in[8] >> 34) | ((in[9] & 0x1FF) << 30))) << ntz + out[13] + out[15] = int64((in[9] >> 9) & 0x7FFFFFFFFF) << ntz + out[14] + out[16] = int64(((in[9] >> 48) | ((in[10] & 0x7FFFFF) << 16))) << ntz + out[15] + out[17] = int64((in[10] >> 23) & 0x7FFFFFFFFF) << ntz + out[16] + out[18] = int64(((in[10] >> 62) | ((in[11] & 0x1FFFFFFFFF) << 2))) << ntz + out[17] + out[19] = int64(((in[11] >> 37) | ((in[12] & 0xFFF) << 27))) << ntz + out[18] + out[20] = int64((in[12] >> 12) & 0x7FFFFFFFFF) << ntz + out[19] + out[21] = int64(((in[12] >> 51) | ((in[13] & 0x3FFFFFF) << 13))) << ntz + out[20] + out[22] = int64(((in[13] >> 26) | ((in[14] & 0x1) << 38))) << ntz + out[21] + out[23] = int64((in[14] >> 1) & 0x7FFFFFFFFF) << ntz + out[22] + out[24] = int64(((in[14] >> 40) | ((in[15] & 0x7FFF) << 24))) << ntz + out[23] + out[25] = int64((in[15] >> 15) & 0x7FFFFFFFFF) << ntz + out[24] + out[26] = int64(((in[15] >> 54) | ((in[16] & 0x1FFFFFFF) << 10))) << ntz + out[25] + out[27] = int64(((in[16] >> 29) | ((in[17] & 0xF) << 35))) << ntz + out[26] + out[28] = int64((in[17] >> 4) & 0x7FFFFFFFFF) << ntz + out[27] + out[29] = int64(((in[17] >> 43) | ((in[18] & 0x3FFFF) << 21))) << ntz + out[28] + out[30] = int64((in[18] >> 18) & 0x7FFFFFFFFF) << ntz + out[29] + out[31] = int64(((in[18] >> 57) | ((in[19] & 0xFFFFFFFF) << 7))) << ntz + out[30] + out[32] = int64(((in[19] >> 32) | ((in[20] & 0x7F) << 32))) << ntz + out[31] + out[33] = int64((in[20] >> 7) & 0x7FFFFFFFFF) << ntz + out[32] + out[34] = int64(((in[20] >> 46) | ((in[21] & 0x1FFFFF) << 18))) << ntz + out[33] + out[35] = int64((in[21] >> 21) & 0x7FFFFFFFFF) << ntz + out[34] + out[36] = int64(((in[21] >> 60) | ((in[22] & 0x7FFFFFFFF) << 4))) << ntz + out[35] + out[37] = int64(((in[22] >> 35) | ((in[23] & 0x3FF) << 29))) << ntz + out[36] + out[38] = int64((in[23] >> 10) & 0x7FFFFFFFFF) << ntz + out[37] + out[39] = int64(((in[23] >> 49) | ((in[24] & 0xFFFFFF) << 15))) << ntz + out[38] + out[40] = int64((in[24] >> 24) & 0x7FFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[24] >> 63) | ((in[25] & 0x3FFFFFFFFF) << 1))) << ntz + out[40] + out[42] = int64(((in[25] >> 38) | ((in[26] & 0x1FFF) << 26))) << ntz + out[41] + out[43] = int64((in[26] >> 13) & 0x7FFFFFFFFF) << ntz + out[42] + out[44] = int64(((in[26] >> 52) | ((in[27] & 0x7FFFFFF) << 12))) << ntz + out[43] + out[45] = int64(((in[27] >> 27) | ((in[28] & 0x3) << 37))) << ntz + out[44] + out[46] = int64((in[28] >> 2) & 0x7FFFFFFFFF) << ntz + out[45] + out[47] = int64(((in[28] >> 41) | ((in[29] & 0xFFFF) << 23))) << ntz + out[46] + out[48] = int64((in[29] >> 16) & 0x7FFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[29] >> 55) | ((in[30] & 0x3FFFFFFF) << 9))) << ntz + out[48] + out[50] = int64(((in[30] >> 30) | ((in[31] & 0x1F) << 34))) << ntz + out[49] + out[51] = int64((in[31] >> 5) & 0x7FFFFFFFFF) << ntz + out[50] + out[52] = int64(((in[31] >> 44) | ((in[32] & 0x7FFFF) << 20))) << ntz + out[51] + out[53] = int64((in[32] >> 19) & 0x7FFFFFFFFF) << ntz + out[52] + out[54] = int64(((in[32] >> 58) | ((in[33] & 0x1FFFFFFFF) << 6))) << ntz + out[53] + out[55] = int64(((in[33] >> 33) | ((in[34] & 0xFF) << 31))) << ntz + out[54] + out[56] = int64((in[34] >> 8) & 0x7FFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[34] >> 47) | ((in[35] & 0x3FFFFF) << 17))) << ntz + out[56] + out[58] = int64((in[35] >> 22) & 0x7FFFFFFFFF) << ntz + out[57] + out[59] = int64(((in[35] >> 61) | ((in[36] & 0xFFFFFFFFF) << 3))) << ntz + out[58] + out[60] = int64(((in[36] >> 36) | ((in[37] & 0x7FF) << 28))) << ntz + out[59] + out[61] = int64((in[37] >> 11) & 0x7FFFFFFFFF) << ntz + out[60] + out[62] = int64(((in[37] >> 50) | ((in[38] & 0x1FFFFFF) << 14))) << ntz + out[61] + out[63] = int64((in[38] >> 25)) << ntz + out[62] +} + +func deltaunpack_int64_40(initoffset int64, in *[40]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 40) | ((in[1] & 0xFFFF) << 24))) << ntz + out[0] + out[2] = int64((in[1] >> 16) & 0xFFFFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 56) | ((in[2] & 0xFFFFFFFF) << 8))) << ntz + out[2] + out[4] = int64(((in[2] >> 32) | ((in[3] & 0xFF) << 32))) << ntz + out[3] + out[5] = int64((in[3] >> 8) & 0xFFFFFFFFFF) << ntz + out[4] + out[6] = int64(((in[3] >> 48) | ((in[4] & 0xFFFFFF) << 16))) << ntz + out[5] + out[7] = int64((in[4] >> 24)) << ntz + out[6] + out[8] = int64((in[5] >> 0) & 0xFFFFFFFFFF) << ntz + out[7] + out[9] = int64(((in[5] >> 40) | ((in[6] & 0xFFFF) << 24))) << ntz + out[8] + out[10] = int64((in[6] >> 16) & 0xFFFFFFFFFF) << ntz + out[9] + out[11] = int64(((in[6] >> 56) | ((in[7] & 0xFFFFFFFF) << 8))) << ntz + out[10] + out[12] = int64(((in[7] >> 32) | ((in[8] & 0xFF) << 32))) << ntz + out[11] + out[13] = int64((in[8] >> 8) & 0xFFFFFFFFFF) << ntz + out[12] + out[14] = int64(((in[8] >> 48) | ((in[9] & 0xFFFFFF) << 16))) << ntz + out[13] + out[15] = int64((in[9] >> 24)) << ntz + out[14] + out[16] = int64((in[10] >> 0) & 0xFFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[10] >> 40) | ((in[11] & 0xFFFF) << 24))) << ntz + out[16] + out[18] = int64((in[11] >> 16) & 0xFFFFFFFFFF) << ntz + out[17] + out[19] = int64(((in[11] >> 56) | ((in[12] & 0xFFFFFFFF) << 8))) << ntz + out[18] + out[20] = int64(((in[12] >> 32) | ((in[13] & 0xFF) << 32))) << ntz + out[19] + out[21] = int64((in[13] >> 8) & 0xFFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[13] >> 48) | ((in[14] & 0xFFFFFF) << 16))) << ntz + out[21] + out[23] = int64((in[14] >> 24)) << ntz + out[22] + out[24] = int64((in[15] >> 0) & 0xFFFFFFFFFF) << ntz + out[23] + out[25] = int64(((in[15] >> 40) | ((in[16] & 0xFFFF) << 24))) << ntz + out[24] + out[26] = int64((in[16] >> 16) & 0xFFFFFFFFFF) << ntz + out[25] + out[27] = int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFFF) << 8))) << ntz + out[26] + out[28] = int64(((in[17] >> 32) | ((in[18] & 0xFF) << 32))) << ntz + out[27] + out[29] = int64((in[18] >> 8) & 0xFFFFFFFFFF) << ntz + out[28] + out[30] = int64(((in[18] >> 48) | ((in[19] & 0xFFFFFF) << 16))) << ntz + out[29] + out[31] = int64((in[19] >> 24)) << ntz + out[30] + out[32] = int64((in[20] >> 0) & 0xFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[20] >> 40) | ((in[21] & 0xFFFF) << 24))) << ntz + out[32] + out[34] = int64((in[21] >> 16) & 0xFFFFFFFFFF) << ntz + out[33] + out[35] = int64(((in[21] >> 56) | ((in[22] & 0xFFFFFFFF) << 8))) << ntz + out[34] + out[36] = int64(((in[22] >> 32) | ((in[23] & 0xFF) << 32))) << ntz + out[35] + out[37] = int64((in[23] >> 8) & 0xFFFFFFFFFF) << ntz + out[36] + out[38] = int64(((in[23] >> 48) | ((in[24] & 0xFFFFFF) << 16))) << ntz + out[37] + out[39] = int64((in[24] >> 24)) << ntz + out[38] + out[40] = int64((in[25] >> 0) & 0xFFFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[25] >> 40) | ((in[26] & 0xFFFF) << 24))) << ntz + out[40] + out[42] = int64((in[26] >> 16) & 0xFFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[26] >> 56) | ((in[27] & 0xFFFFFFFF) << 8))) << ntz + out[42] + out[44] = int64(((in[27] >> 32) | ((in[28] & 0xFF) << 32))) << ntz + out[43] + out[45] = int64((in[28] >> 8) & 0xFFFFFFFFFF) << ntz + out[44] + out[46] = int64(((in[28] >> 48) | ((in[29] & 0xFFFFFF) << 16))) << ntz + out[45] + out[47] = int64((in[29] >> 24)) << ntz + out[46] + out[48] = int64((in[30] >> 0) & 0xFFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[30] >> 40) | ((in[31] & 0xFFFF) << 24))) << ntz + out[48] + out[50] = int64((in[31] >> 16) & 0xFFFFFFFFFF) << ntz + out[49] + out[51] = int64(((in[31] >> 56) | ((in[32] & 0xFFFFFFFF) << 8))) << ntz + out[50] + out[52] = int64(((in[32] >> 32) | ((in[33] & 0xFF) << 32))) << ntz + out[51] + out[53] = int64((in[33] >> 8) & 0xFFFFFFFFFF) << ntz + out[52] + out[54] = int64(((in[33] >> 48) | ((in[34] & 0xFFFFFF) << 16))) << ntz + out[53] + out[55] = int64((in[34] >> 24)) << ntz + out[54] + out[56] = int64((in[35] >> 0) & 0xFFFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[35] >> 40) | ((in[36] & 0xFFFF) << 24))) << ntz + out[56] + out[58] = int64((in[36] >> 16) & 0xFFFFFFFFFF) << ntz + out[57] + out[59] = int64(((in[36] >> 56) | ((in[37] & 0xFFFFFFFF) << 8))) << ntz + out[58] + out[60] = int64(((in[37] >> 32) | ((in[38] & 0xFF) << 32))) << ntz + out[59] + out[61] = int64((in[38] >> 8) & 0xFFFFFFFFFF) << ntz + out[60] + out[62] = int64(((in[38] >> 48) | ((in[39] & 0xFFFFFF) << 16))) << ntz + out[61] + out[63] = int64((in[39] >> 24)) << ntz + out[62] +} + +func deltaunpack_int64_41(initoffset int64, in *[41]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 41) | ((in[1] & 0x3FFFF) << 23))) << ntz + out[0] + out[2] = int64((in[1] >> 18) & 0x1FFFFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 59) | ((in[2] & 0xFFFFFFFFF) << 5))) << ntz + out[2] + out[4] = int64(((in[2] >> 36) | ((in[3] & 0x1FFF) << 28))) << ntz + out[3] + out[5] = int64((in[3] >> 13) & 0x1FFFFFFFFFF) << ntz + out[4] + out[6] = int64(((in[3] >> 54) | ((in[4] & 0x7FFFFFFF) << 10))) << ntz + out[5] + out[7] = int64(((in[4] >> 31) | ((in[5] & 0xFF) << 33))) << ntz + out[6] + out[8] = int64((in[5] >> 8) & 0x1FFFFFFFFFF) << ntz + out[7] + out[9] = int64(((in[5] >> 49) | ((in[6] & 0x3FFFFFF) << 15))) << ntz + out[8] + out[10] = int64(((in[6] >> 26) | ((in[7] & 0x7) << 38))) << ntz + out[9] + out[11] = int64((in[7] >> 3) & 0x1FFFFFFFFFF) << ntz + out[10] + out[12] = int64(((in[7] >> 44) | ((in[8] & 0x1FFFFF) << 20))) << ntz + out[11] + out[13] = int64((in[8] >> 21) & 0x1FFFFFFFFFF) << ntz + out[12] + out[14] = int64(((in[8] >> 62) | ((in[9] & 0x7FFFFFFFFF) << 2))) << ntz + out[13] + out[15] = int64(((in[9] >> 39) | ((in[10] & 0xFFFF) << 25))) << ntz + out[14] + out[16] = int64((in[10] >> 16) & 0x1FFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[10] >> 57) | ((in[11] & 0x3FFFFFFFF) << 7))) << ntz + out[16] + out[18] = int64(((in[11] >> 34) | ((in[12] & 0x7FF) << 30))) << ntz + out[17] + out[19] = int64((in[12] >> 11) & 0x1FFFFFFFFFF) << ntz + out[18] + out[20] = int64(((in[12] >> 52) | ((in[13] & 0x1FFFFFFF) << 12))) << ntz + out[19] + out[21] = int64(((in[13] >> 29) | ((in[14] & 0x3F) << 35))) << ntz + out[20] + out[22] = int64((in[14] >> 6) & 0x1FFFFFFFFFF) << ntz + out[21] + out[23] = int64(((in[14] >> 47) | ((in[15] & 0xFFFFFF) << 17))) << ntz + out[22] + out[24] = int64(((in[15] >> 24) | ((in[16] & 0x1) << 40))) << ntz + out[23] + out[25] = int64((in[16] >> 1) & 0x1FFFFFFFFFF) << ntz + out[24] + out[26] = int64(((in[16] >> 42) | ((in[17] & 0x7FFFF) << 22))) << ntz + out[25] + out[27] = int64((in[17] >> 19) & 0x1FFFFFFFFFF) << ntz + out[26] + out[28] = int64(((in[17] >> 60) | ((in[18] & 0x1FFFFFFFFF) << 4))) << ntz + out[27] + out[29] = int64(((in[18] >> 37) | ((in[19] & 0x3FFF) << 27))) << ntz + out[28] + out[30] = int64((in[19] >> 14) & 0x1FFFFFFFFFF) << ntz + out[29] + out[31] = int64(((in[19] >> 55) | ((in[20] & 0xFFFFFFFF) << 9))) << ntz + out[30] + out[32] = int64(((in[20] >> 32) | ((in[21] & 0x1FF) << 32))) << ntz + out[31] + out[33] = int64((in[21] >> 9) & 0x1FFFFFFFFFF) << ntz + out[32] + out[34] = int64(((in[21] >> 50) | ((in[22] & 0x7FFFFFF) << 14))) << ntz + out[33] + out[35] = int64(((in[22] >> 27) | ((in[23] & 0xF) << 37))) << ntz + out[34] + out[36] = int64((in[23] >> 4) & 0x1FFFFFFFFFF) << ntz + out[35] + out[37] = int64(((in[23] >> 45) | ((in[24] & 0x3FFFFF) << 19))) << ntz + out[36] + out[38] = int64((in[24] >> 22) & 0x1FFFFFFFFFF) << ntz + out[37] + out[39] = int64(((in[24] >> 63) | ((in[25] & 0xFFFFFFFFFF) << 1))) << ntz + out[38] + out[40] = int64(((in[25] >> 40) | ((in[26] & 0x1FFFF) << 24))) << ntz + out[39] + out[41] = int64((in[26] >> 17) & 0x1FFFFFFFFFF) << ntz + out[40] + out[42] = int64(((in[26] >> 58) | ((in[27] & 0x7FFFFFFFF) << 6))) << ntz + out[41] + out[43] = int64(((in[27] >> 35) | ((in[28] & 0xFFF) << 29))) << ntz + out[42] + out[44] = int64((in[28] >> 12) & 0x1FFFFFFFFFF) << ntz + out[43] + out[45] = int64(((in[28] >> 53) | ((in[29] & 0x3FFFFFFF) << 11))) << ntz + out[44] + out[46] = int64(((in[29] >> 30) | ((in[30] & 0x7F) << 34))) << ntz + out[45] + out[47] = int64((in[30] >> 7) & 0x1FFFFFFFFFF) << ntz + out[46] + out[48] = int64(((in[30] >> 48) | ((in[31] & 0x1FFFFFF) << 16))) << ntz + out[47] + out[49] = int64(((in[31] >> 25) | ((in[32] & 0x3) << 39))) << ntz + out[48] + out[50] = int64((in[32] >> 2) & 0x1FFFFFFFFFF) << ntz + out[49] + out[51] = int64(((in[32] >> 43) | ((in[33] & 0xFFFFF) << 21))) << ntz + out[50] + out[52] = int64((in[33] >> 20) & 0x1FFFFFFFFFF) << ntz + out[51] + out[53] = int64(((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFF) << 3))) << ntz + out[52] + out[54] = int64(((in[34] >> 38) | ((in[35] & 0x7FFF) << 26))) << ntz + out[53] + out[55] = int64((in[35] >> 15) & 0x1FFFFFFFFFF) << ntz + out[54] + out[56] = int64(((in[35] >> 56) | ((in[36] & 0x1FFFFFFFF) << 8))) << ntz + out[55] + out[57] = int64(((in[36] >> 33) | ((in[37] & 0x3FF) << 31))) << ntz + out[56] + out[58] = int64((in[37] >> 10) & 0x1FFFFFFFFFF) << ntz + out[57] + out[59] = int64(((in[37] >> 51) | ((in[38] & 0xFFFFFFF) << 13))) << ntz + out[58] + out[60] = int64(((in[38] >> 28) | ((in[39] & 0x1F) << 36))) << ntz + out[59] + out[61] = int64((in[39] >> 5) & 0x1FFFFFFFFFF) << ntz + out[60] + out[62] = int64(((in[39] >> 46) | ((in[40] & 0x7FFFFF) << 18))) << ntz + out[61] + out[63] = int64((in[40] >> 23)) << ntz + out[62] +} + +func deltaunpack_int64_42(initoffset int64, in *[42]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 42) | ((in[1] & 0xFFFFF) << 22))) << ntz + out[0] + out[2] = int64((in[1] >> 20) & 0x3FFFFFFFFFF) << ntz + out[1] + out[3] = int64(((in[1] >> 62) | ((in[2] & 0xFFFFFFFFFF) << 2))) << ntz + out[2] + out[4] = int64(((in[2] >> 40) | ((in[3] & 0x3FFFF) << 24))) << ntz + out[3] + out[5] = int64((in[3] >> 18) & 0x3FFFFFFFFFF) << ntz + out[4] + out[6] = int64(((in[3] >> 60) | ((in[4] & 0x3FFFFFFFFF) << 4))) << ntz + out[5] + out[7] = int64(((in[4] >> 38) | ((in[5] & 0xFFFF) << 26))) << ntz + out[6] + out[8] = int64((in[5] >> 16) & 0x3FFFFFFFFFF) << ntz + out[7] + out[9] = int64(((in[5] >> 58) | ((in[6] & 0xFFFFFFFFF) << 6))) << ntz + out[8] + out[10] = int64(((in[6] >> 36) | ((in[7] & 0x3FFF) << 28))) << ntz + out[9] + out[11] = int64((in[7] >> 14) & 0x3FFFFFFFFFF) << ntz + out[10] + out[12] = int64(((in[7] >> 56) | ((in[8] & 0x3FFFFFFFF) << 8))) << ntz + out[11] + out[13] = int64(((in[8] >> 34) | ((in[9] & 0xFFF) << 30))) << ntz + out[12] + out[14] = int64((in[9] >> 12) & 0x3FFFFFFFFFF) << ntz + out[13] + out[15] = int64(((in[9] >> 54) | ((in[10] & 0xFFFFFFFF) << 10))) << ntz + out[14] + out[16] = int64(((in[10] >> 32) | ((in[11] & 0x3FF) << 32))) << ntz + out[15] + out[17] = int64((in[11] >> 10) & 0x3FFFFFFFFFF) << ntz + out[16] + out[18] = int64(((in[11] >> 52) | ((in[12] & 0x3FFFFFFF) << 12))) << ntz + out[17] + out[19] = int64(((in[12] >> 30) | ((in[13] & 0xFF) << 34))) << ntz + out[18] + out[20] = int64((in[13] >> 8) & 0x3FFFFFFFFFF) << ntz + out[19] + out[21] = int64(((in[13] >> 50) | ((in[14] & 0xFFFFFFF) << 14))) << ntz + out[20] + out[22] = int64(((in[14] >> 28) | ((in[15] & 0x3F) << 36))) << ntz + out[21] + out[23] = int64((in[15] >> 6) & 0x3FFFFFFFFFF) << ntz + out[22] + out[24] = int64(((in[15] >> 48) | ((in[16] & 0x3FFFFFF) << 16))) << ntz + out[23] + out[25] = int64(((in[16] >> 26) | ((in[17] & 0xF) << 38))) << ntz + out[24] + out[26] = int64((in[17] >> 4) & 0x3FFFFFFFFFF) << ntz + out[25] + out[27] = int64(((in[17] >> 46) | ((in[18] & 0xFFFFFF) << 18))) << ntz + out[26] + out[28] = int64(((in[18] >> 24) | ((in[19] & 0x3) << 40))) << ntz + out[27] + out[29] = int64((in[19] >> 2) & 0x3FFFFFFFFFF) << ntz + out[28] + out[30] = int64(((in[19] >> 44) | ((in[20] & 0x3FFFFF) << 20))) << ntz + out[29] + out[31] = int64((in[20] >> 22)) << ntz + out[30] + out[32] = int64((in[21] >> 0) & 0x3FFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[21] >> 42) | ((in[22] & 0xFFFFF) << 22))) << ntz + out[32] + out[34] = int64((in[22] >> 20) & 0x3FFFFFFFFFF) << ntz + out[33] + out[35] = int64(((in[22] >> 62) | ((in[23] & 0xFFFFFFFFFF) << 2))) << ntz + out[34] + out[36] = int64(((in[23] >> 40) | ((in[24] & 0x3FFFF) << 24))) << ntz + out[35] + out[37] = int64((in[24] >> 18) & 0x3FFFFFFFFFF) << ntz + out[36] + out[38] = int64(((in[24] >> 60) | ((in[25] & 0x3FFFFFFFFF) << 4))) << ntz + out[37] + out[39] = int64(((in[25] >> 38) | ((in[26] & 0xFFFF) << 26))) << ntz + out[38] + out[40] = int64((in[26] >> 16) & 0x3FFFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[26] >> 58) | ((in[27] & 0xFFFFFFFFF) << 6))) << ntz + out[40] + out[42] = int64(((in[27] >> 36) | ((in[28] & 0x3FFF) << 28))) << ntz + out[41] + out[43] = int64((in[28] >> 14) & 0x3FFFFFFFFFF) << ntz + out[42] + out[44] = int64(((in[28] >> 56) | ((in[29] & 0x3FFFFFFFF) << 8))) << ntz + out[43] + out[45] = int64(((in[29] >> 34) | ((in[30] & 0xFFF) << 30))) << ntz + out[44] + out[46] = int64((in[30] >> 12) & 0x3FFFFFFFFFF) << ntz + out[45] + out[47] = int64(((in[30] >> 54) | ((in[31] & 0xFFFFFFFF) << 10))) << ntz + out[46] + out[48] = int64(((in[31] >> 32) | ((in[32] & 0x3FF) << 32))) << ntz + out[47] + out[49] = int64((in[32] >> 10) & 0x3FFFFFFFFFF) << ntz + out[48] + out[50] = int64(((in[32] >> 52) | ((in[33] & 0x3FFFFFFF) << 12))) << ntz + out[49] + out[51] = int64(((in[33] >> 30) | ((in[34] & 0xFF) << 34))) << ntz + out[50] + out[52] = int64((in[34] >> 8) & 0x3FFFFFFFFFF) << ntz + out[51] + out[53] = int64(((in[34] >> 50) | ((in[35] & 0xFFFFFFF) << 14))) << ntz + out[52] + out[54] = int64(((in[35] >> 28) | ((in[36] & 0x3F) << 36))) << ntz + out[53] + out[55] = int64((in[36] >> 6) & 0x3FFFFFFFFFF) << ntz + out[54] + out[56] = int64(((in[36] >> 48) | ((in[37] & 0x3FFFFFF) << 16))) << ntz + out[55] + out[57] = int64(((in[37] >> 26) | ((in[38] & 0xF) << 38))) << ntz + out[56] + out[58] = int64((in[38] >> 4) & 0x3FFFFFFFFFF) << ntz + out[57] + out[59] = int64(((in[38] >> 46) | ((in[39] & 0xFFFFFF) << 18))) << ntz + out[58] + out[60] = int64(((in[39] >> 24) | ((in[40] & 0x3) << 40))) << ntz + out[59] + out[61] = int64((in[40] >> 2) & 0x3FFFFFFFFFF) << ntz + out[60] + out[62] = int64(((in[40] >> 44) | ((in[41] & 0x3FFFFF) << 20))) << ntz + out[61] + out[63] = int64((in[41] >> 22)) << ntz + out[62] +} + +func deltaunpack_int64_43(initoffset int64, in *[43]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 43) | ((in[1] & 0x3FFFFF) << 21))) << ntz + out[0] + out[2] = int64(((in[1] >> 22) | ((in[2] & 0x1) << 42))) << ntz + out[1] + out[3] = int64((in[2] >> 1) & 0x7FFFFFFFFFF) << ntz + out[2] + out[4] = int64(((in[2] >> 44) | ((in[3] & 0x7FFFFF) << 20))) << ntz + out[3] + out[5] = int64(((in[3] >> 23) | ((in[4] & 0x3) << 41))) << ntz + out[4] + out[6] = int64((in[4] >> 2) & 0x7FFFFFFFFFF) << ntz + out[5] + out[7] = int64(((in[4] >> 45) | ((in[5] & 0xFFFFFF) << 19))) << ntz + out[6] + out[8] = int64(((in[5] >> 24) | ((in[6] & 0x7) << 40))) << ntz + out[7] + out[9] = int64((in[6] >> 3) & 0x7FFFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[6] >> 46) | ((in[7] & 0x1FFFFFF) << 18))) << ntz + out[9] + out[11] = int64(((in[7] >> 25) | ((in[8] & 0xF) << 39))) << ntz + out[10] + out[12] = int64((in[8] >> 4) & 0x7FFFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[8] >> 47) | ((in[9] & 0x3FFFFFF) << 17))) << ntz + out[12] + out[14] = int64(((in[9] >> 26) | ((in[10] & 0x1F) << 38))) << ntz + out[13] + out[15] = int64((in[10] >> 5) & 0x7FFFFFFFFFF) << ntz + out[14] + out[16] = int64(((in[10] >> 48) | ((in[11] & 0x7FFFFFF) << 16))) << ntz + out[15] + out[17] = int64(((in[11] >> 27) | ((in[12] & 0x3F) << 37))) << ntz + out[16] + out[18] = int64((in[12] >> 6) & 0x7FFFFFFFFFF) << ntz + out[17] + out[19] = int64(((in[12] >> 49) | ((in[13] & 0xFFFFFFF) << 15))) << ntz + out[18] + out[20] = int64(((in[13] >> 28) | ((in[14] & 0x7F) << 36))) << ntz + out[19] + out[21] = int64((in[14] >> 7) & 0x7FFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[14] >> 50) | ((in[15] & 0x1FFFFFFF) << 14))) << ntz + out[21] + out[23] = int64(((in[15] >> 29) | ((in[16] & 0xFF) << 35))) << ntz + out[22] + out[24] = int64((in[16] >> 8) & 0x7FFFFFFFFFF) << ntz + out[23] + out[25] = int64(((in[16] >> 51) | ((in[17] & 0x3FFFFFFF) << 13))) << ntz + out[24] + out[26] = int64(((in[17] >> 30) | ((in[18] & 0x1FF) << 34))) << ntz + out[25] + out[27] = int64((in[18] >> 9) & 0x7FFFFFFFFFF) << ntz + out[26] + out[28] = int64(((in[18] >> 52) | ((in[19] & 0x7FFFFFFF) << 12))) << ntz + out[27] + out[29] = int64(((in[19] >> 31) | ((in[20] & 0x3FF) << 33))) << ntz + out[28] + out[30] = int64((in[20] >> 10) & 0x7FFFFFFFFFF) << ntz + out[29] + out[31] = int64(((in[20] >> 53) | ((in[21] & 0xFFFFFFFF) << 11))) << ntz + out[30] + out[32] = int64(((in[21] >> 32) | ((in[22] & 0x7FF) << 32))) << ntz + out[31] + out[33] = int64((in[22] >> 11) & 0x7FFFFFFFFFF) << ntz + out[32] + out[34] = int64(((in[22] >> 54) | ((in[23] & 0x1FFFFFFFF) << 10))) << ntz + out[33] + out[35] = int64(((in[23] >> 33) | ((in[24] & 0xFFF) << 31))) << ntz + out[34] + out[36] = int64((in[24] >> 12) & 0x7FFFFFFFFFF) << ntz + out[35] + out[37] = int64(((in[24] >> 55) | ((in[25] & 0x3FFFFFFFF) << 9))) << ntz + out[36] + out[38] = int64(((in[25] >> 34) | ((in[26] & 0x1FFF) << 30))) << ntz + out[37] + out[39] = int64((in[26] >> 13) & 0x7FFFFFFFFFF) << ntz + out[38] + out[40] = int64(((in[26] >> 56) | ((in[27] & 0x7FFFFFFFF) << 8))) << ntz + out[39] + out[41] = int64(((in[27] >> 35) | ((in[28] & 0x3FFF) << 29))) << ntz + out[40] + out[42] = int64((in[28] >> 14) & 0x7FFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[28] >> 57) | ((in[29] & 0xFFFFFFFFF) << 7))) << ntz + out[42] + out[44] = int64(((in[29] >> 36) | ((in[30] & 0x7FFF) << 28))) << ntz + out[43] + out[45] = int64((in[30] >> 15) & 0x7FFFFFFFFFF) << ntz + out[44] + out[46] = int64(((in[30] >> 58) | ((in[31] & 0x1FFFFFFFFF) << 6))) << ntz + out[45] + out[47] = int64(((in[31] >> 37) | ((in[32] & 0xFFFF) << 27))) << ntz + out[46] + out[48] = int64((in[32] >> 16) & 0x7FFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[32] >> 59) | ((in[33] & 0x3FFFFFFFFF) << 5))) << ntz + out[48] + out[50] = int64(((in[33] >> 38) | ((in[34] & 0x1FFFF) << 26))) << ntz + out[49] + out[51] = int64((in[34] >> 17) & 0x7FFFFFFFFFF) << ntz + out[50] + out[52] = int64(((in[34] >> 60) | ((in[35] & 0x7FFFFFFFFF) << 4))) << ntz + out[51] + out[53] = int64(((in[35] >> 39) | ((in[36] & 0x3FFFF) << 25))) << ntz + out[52] + out[54] = int64((in[36] >> 18) & 0x7FFFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFF) << 3))) << ntz + out[54] + out[56] = int64(((in[37] >> 40) | ((in[38] & 0x7FFFF) << 24))) << ntz + out[55] + out[57] = int64((in[38] >> 19) & 0x7FFFFFFFFFF) << ntz + out[56] + out[58] = int64(((in[38] >> 62) | ((in[39] & 0x1FFFFFFFFFF) << 2))) << ntz + out[57] + out[59] = int64(((in[39] >> 41) | ((in[40] & 0xFFFFF) << 23))) << ntz + out[58] + out[60] = int64((in[40] >> 20) & 0x7FFFFFFFFFF) << ntz + out[59] + out[61] = int64(((in[40] >> 63) | ((in[41] & 0x3FFFFFFFFFF) << 1))) << ntz + out[60] + out[62] = int64(((in[41] >> 42) | ((in[42] & 0x1FFFFF) << 22))) << ntz + out[61] + out[63] = int64((in[42] >> 21)) << ntz + out[62] +} + +func deltaunpack_int64_44(initoffset int64, in *[44]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 44) | ((in[1] & 0xFFFFFF) << 20))) << ntz + out[0] + out[2] = int64(((in[1] >> 24) | ((in[2] & 0xF) << 40))) << ntz + out[1] + out[3] = int64((in[2] >> 4) & 0xFFFFFFFFFFF) << ntz + out[2] + out[4] = int64(((in[2] >> 48) | ((in[3] & 0xFFFFFFF) << 16))) << ntz + out[3] + out[5] = int64(((in[3] >> 28) | ((in[4] & 0xFF) << 36))) << ntz + out[4] + out[6] = int64((in[4] >> 8) & 0xFFFFFFFFFFF) << ntz + out[5] + out[7] = int64(((in[4] >> 52) | ((in[5] & 0xFFFFFFFF) << 12))) << ntz + out[6] + out[8] = int64(((in[5] >> 32) | ((in[6] & 0xFFF) << 32))) << ntz + out[7] + out[9] = int64((in[6] >> 12) & 0xFFFFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[6] >> 56) | ((in[7] & 0xFFFFFFFFF) << 8))) << ntz + out[9] + out[11] = int64(((in[7] >> 36) | ((in[8] & 0xFFFF) << 28))) << ntz + out[10] + out[12] = int64((in[8] >> 16) & 0xFFFFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFF) << 4))) << ntz + out[12] + out[14] = int64(((in[9] >> 40) | ((in[10] & 0xFFFFF) << 24))) << ntz + out[13] + out[15] = int64((in[10] >> 20)) << ntz + out[14] + out[16] = int64((in[11] >> 0) & 0xFFFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[11] >> 44) | ((in[12] & 0xFFFFFF) << 20))) << ntz + out[16] + out[18] = int64(((in[12] >> 24) | ((in[13] & 0xF) << 40))) << ntz + out[17] + out[19] = int64((in[13] >> 4) & 0xFFFFFFFFFFF) << ntz + out[18] + out[20] = int64(((in[13] >> 48) | ((in[14] & 0xFFFFFFF) << 16))) << ntz + out[19] + out[21] = int64(((in[14] >> 28) | ((in[15] & 0xFF) << 36))) << ntz + out[20] + out[22] = int64((in[15] >> 8) & 0xFFFFFFFFFFF) << ntz + out[21] + out[23] = int64(((in[15] >> 52) | ((in[16] & 0xFFFFFFFF) << 12))) << ntz + out[22] + out[24] = int64(((in[16] >> 32) | ((in[17] & 0xFFF) << 32))) << ntz + out[23] + out[25] = int64((in[17] >> 12) & 0xFFFFFFFFFFF) << ntz + out[24] + out[26] = int64(((in[17] >> 56) | ((in[18] & 0xFFFFFFFFF) << 8))) << ntz + out[25] + out[27] = int64(((in[18] >> 36) | ((in[19] & 0xFFFF) << 28))) << ntz + out[26] + out[28] = int64((in[19] >> 16) & 0xFFFFFFFFFFF) << ntz + out[27] + out[29] = int64(((in[19] >> 60) | ((in[20] & 0xFFFFFFFFFF) << 4))) << ntz + out[28] + out[30] = int64(((in[20] >> 40) | ((in[21] & 0xFFFFF) << 24))) << ntz + out[29] + out[31] = int64((in[21] >> 20)) << ntz + out[30] + out[32] = int64((in[22] >> 0) & 0xFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[22] >> 44) | ((in[23] & 0xFFFFFF) << 20))) << ntz + out[32] + out[34] = int64(((in[23] >> 24) | ((in[24] & 0xF) << 40))) << ntz + out[33] + out[35] = int64((in[24] >> 4) & 0xFFFFFFFFFFF) << ntz + out[34] + out[36] = int64(((in[24] >> 48) | ((in[25] & 0xFFFFFFF) << 16))) << ntz + out[35] + out[37] = int64(((in[25] >> 28) | ((in[26] & 0xFF) << 36))) << ntz + out[36] + out[38] = int64((in[26] >> 8) & 0xFFFFFFFFFFF) << ntz + out[37] + out[39] = int64(((in[26] >> 52) | ((in[27] & 0xFFFFFFFF) << 12))) << ntz + out[38] + out[40] = int64(((in[27] >> 32) | ((in[28] & 0xFFF) << 32))) << ntz + out[39] + out[41] = int64((in[28] >> 12) & 0xFFFFFFFFFFF) << ntz + out[40] + out[42] = int64(((in[28] >> 56) | ((in[29] & 0xFFFFFFFFF) << 8))) << ntz + out[41] + out[43] = int64(((in[29] >> 36) | ((in[30] & 0xFFFF) << 28))) << ntz + out[42] + out[44] = int64((in[30] >> 16) & 0xFFFFFFFFFFF) << ntz + out[43] + out[45] = int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFF) << 4))) << ntz + out[44] + out[46] = int64(((in[31] >> 40) | ((in[32] & 0xFFFFF) << 24))) << ntz + out[45] + out[47] = int64((in[32] >> 20)) << ntz + out[46] + out[48] = int64((in[33] >> 0) & 0xFFFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[33] >> 44) | ((in[34] & 0xFFFFFF) << 20))) << ntz + out[48] + out[50] = int64(((in[34] >> 24) | ((in[35] & 0xF) << 40))) << ntz + out[49] + out[51] = int64((in[35] >> 4) & 0xFFFFFFFFFFF) << ntz + out[50] + out[52] = int64(((in[35] >> 48) | ((in[36] & 0xFFFFFFF) << 16))) << ntz + out[51] + out[53] = int64(((in[36] >> 28) | ((in[37] & 0xFF) << 36))) << ntz + out[52] + out[54] = int64((in[37] >> 8) & 0xFFFFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[37] >> 52) | ((in[38] & 0xFFFFFFFF) << 12))) << ntz + out[54] + out[56] = int64(((in[38] >> 32) | ((in[39] & 0xFFF) << 32))) << ntz + out[55] + out[57] = int64((in[39] >> 12) & 0xFFFFFFFFFFF) << ntz + out[56] + out[58] = int64(((in[39] >> 56) | ((in[40] & 0xFFFFFFFFF) << 8))) << ntz + out[57] + out[59] = int64(((in[40] >> 36) | ((in[41] & 0xFFFF) << 28))) << ntz + out[58] + out[60] = int64((in[41] >> 16) & 0xFFFFFFFFFFF) << ntz + out[59] + out[61] = int64(((in[41] >> 60) | ((in[42] & 0xFFFFFFFFFF) << 4))) << ntz + out[60] + out[62] = int64(((in[42] >> 40) | ((in[43] & 0xFFFFF) << 24))) << ntz + out[61] + out[63] = int64((in[43] >> 20)) << ntz + out[62] +} + +func deltaunpack_int64_45(initoffset int64, in *[45]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 45) | ((in[1] & 0x3FFFFFF) << 19))) << ntz + out[0] + out[2] = int64(((in[1] >> 26) | ((in[2] & 0x7F) << 38))) << ntz + out[1] + out[3] = int64((in[2] >> 7) & 0x1FFFFFFFFFFF) << ntz + out[2] + out[4] = int64(((in[2] >> 52) | ((in[3] & 0x1FFFFFFFF) << 12))) << ntz + out[3] + out[5] = int64(((in[3] >> 33) | ((in[4] & 0x3FFF) << 31))) << ntz + out[4] + out[6] = int64((in[4] >> 14) & 0x1FFFFFFFFFFF) << ntz + out[5] + out[7] = int64(((in[4] >> 59) | ((in[5] & 0xFFFFFFFFFF) << 5))) << ntz + out[6] + out[8] = int64(((in[5] >> 40) | ((in[6] & 0x1FFFFF) << 24))) << ntz + out[7] + out[9] = int64(((in[6] >> 21) | ((in[7] & 0x3) << 43))) << ntz + out[8] + out[10] = int64((in[7] >> 2) & 0x1FFFFFFFFFFF) << ntz + out[9] + out[11] = int64(((in[7] >> 47) | ((in[8] & 0xFFFFFFF) << 17))) << ntz + out[10] + out[12] = int64(((in[8] >> 28) | ((in[9] & 0x1FF) << 36))) << ntz + out[11] + out[13] = int64((in[9] >> 9) & 0x1FFFFFFFFFFF) << ntz + out[12] + out[14] = int64(((in[9] >> 54) | ((in[10] & 0x7FFFFFFFF) << 10))) << ntz + out[13] + out[15] = int64(((in[10] >> 35) | ((in[11] & 0xFFFF) << 29))) << ntz + out[14] + out[16] = int64((in[11] >> 16) & 0x1FFFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[11] >> 61) | ((in[12] & 0x3FFFFFFFFFF) << 3))) << ntz + out[16] + out[18] = int64(((in[12] >> 42) | ((in[13] & 0x7FFFFF) << 22))) << ntz + out[17] + out[19] = int64(((in[13] >> 23) | ((in[14] & 0xF) << 41))) << ntz + out[18] + out[20] = int64((in[14] >> 4) & 0x1FFFFFFFFFFF) << ntz + out[19] + out[21] = int64(((in[14] >> 49) | ((in[15] & 0x3FFFFFFF) << 15))) << ntz + out[20] + out[22] = int64(((in[15] >> 30) | ((in[16] & 0x7FF) << 34))) << ntz + out[21] + out[23] = int64((in[16] >> 11) & 0x1FFFFFFFFFFF) << ntz + out[22] + out[24] = int64(((in[16] >> 56) | ((in[17] & 0x1FFFFFFFFF) << 8))) << ntz + out[23] + out[25] = int64(((in[17] >> 37) | ((in[18] & 0x3FFFF) << 27))) << ntz + out[24] + out[26] = int64((in[18] >> 18) & 0x1FFFFFFFFFFF) << ntz + out[25] + out[27] = int64(((in[18] >> 63) | ((in[19] & 0xFFFFFFFFFFF) << 1))) << ntz + out[26] + out[28] = int64(((in[19] >> 44) | ((in[20] & 0x1FFFFFF) << 20))) << ntz + out[27] + out[29] = int64(((in[20] >> 25) | ((in[21] & 0x3F) << 39))) << ntz + out[28] + out[30] = int64((in[21] >> 6) & 0x1FFFFFFFFFFF) << ntz + out[29] + out[31] = int64(((in[21] >> 51) | ((in[22] & 0xFFFFFFFF) << 13))) << ntz + out[30] + out[32] = int64(((in[22] >> 32) | ((in[23] & 0x1FFF) << 32))) << ntz + out[31] + out[33] = int64((in[23] >> 13) & 0x1FFFFFFFFFFF) << ntz + out[32] + out[34] = int64(((in[23] >> 58) | ((in[24] & 0x7FFFFFFFFF) << 6))) << ntz + out[33] + out[35] = int64(((in[24] >> 39) | ((in[25] & 0xFFFFF) << 25))) << ntz + out[34] + out[36] = int64(((in[25] >> 20) | ((in[26] & 0x1) << 44))) << ntz + out[35] + out[37] = int64((in[26] >> 1) & 0x1FFFFFFFFFFF) << ntz + out[36] + out[38] = int64(((in[26] >> 46) | ((in[27] & 0x7FFFFFF) << 18))) << ntz + out[37] + out[39] = int64(((in[27] >> 27) | ((in[28] & 0xFF) << 37))) << ntz + out[38] + out[40] = int64((in[28] >> 8) & 0x1FFFFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[28] >> 53) | ((in[29] & 0x3FFFFFFFF) << 11))) << ntz + out[40] + out[42] = int64(((in[29] >> 34) | ((in[30] & 0x7FFF) << 30))) << ntz + out[41] + out[43] = int64((in[30] >> 15) & 0x1FFFFFFFFFFF) << ntz + out[42] + out[44] = int64(((in[30] >> 60) | ((in[31] & 0x1FFFFFFFFFF) << 4))) << ntz + out[43] + out[45] = int64(((in[31] >> 41) | ((in[32] & 0x3FFFFF) << 23))) << ntz + out[44] + out[46] = int64(((in[32] >> 22) | ((in[33] & 0x7) << 42))) << ntz + out[45] + out[47] = int64((in[33] >> 3) & 0x1FFFFFFFFFFF) << ntz + out[46] + out[48] = int64(((in[33] >> 48) | ((in[34] & 0x1FFFFFFF) << 16))) << ntz + out[47] + out[49] = int64(((in[34] >> 29) | ((in[35] & 0x3FF) << 35))) << ntz + out[48] + out[50] = int64((in[35] >> 10) & 0x1FFFFFFFFFFF) << ntz + out[49] + out[51] = int64(((in[35] >> 55) | ((in[36] & 0xFFFFFFFFF) << 9))) << ntz + out[50] + out[52] = int64(((in[36] >> 36) | ((in[37] & 0x1FFFF) << 28))) << ntz + out[51] + out[53] = int64((in[37] >> 17) & 0x1FFFFFFFFFFF) << ntz + out[52] + out[54] = int64(((in[37] >> 62) | ((in[38] & 0x7FFFFFFFFFF) << 2))) << ntz + out[53] + out[55] = int64(((in[38] >> 43) | ((in[39] & 0xFFFFFF) << 21))) << ntz + out[54] + out[56] = int64(((in[39] >> 24) | ((in[40] & 0x1F) << 40))) << ntz + out[55] + out[57] = int64((in[40] >> 5) & 0x1FFFFFFFFFFF) << ntz + out[56] + out[58] = int64(((in[40] >> 50) | ((in[41] & 0x7FFFFFFF) << 14))) << ntz + out[57] + out[59] = int64(((in[41] >> 31) | ((in[42] & 0xFFF) << 33))) << ntz + out[58] + out[60] = int64((in[42] >> 12) & 0x1FFFFFFFFFFF) << ntz + out[59] + out[61] = int64(((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFF) << 7))) << ntz + out[60] + out[62] = int64(((in[43] >> 38) | ((in[44] & 0x7FFFF) << 26))) << ntz + out[61] + out[63] = int64((in[44] >> 19)) << ntz + out[62] +} + +func deltaunpack_int64_46(initoffset int64, in *[46]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 46) | ((in[1] & 0xFFFFFFF) << 18))) << ntz + out[0] + out[2] = int64(((in[1] >> 28) | ((in[2] & 0x3FF) << 36))) << ntz + out[1] + out[3] = int64((in[2] >> 10) & 0x3FFFFFFFFFFF) << ntz + out[2] + out[4] = int64(((in[2] >> 56) | ((in[3] & 0x3FFFFFFFFF) << 8))) << ntz + out[3] + out[5] = int64(((in[3] >> 38) | ((in[4] & 0xFFFFF) << 26))) << ntz + out[4] + out[6] = int64(((in[4] >> 20) | ((in[5] & 0x3) << 44))) << ntz + out[5] + out[7] = int64((in[5] >> 2) & 0x3FFFFFFFFFFF) << ntz + out[6] + out[8] = int64(((in[5] >> 48) | ((in[6] & 0x3FFFFFFF) << 16))) << ntz + out[7] + out[9] = int64(((in[6] >> 30) | ((in[7] & 0xFFF) << 34))) << ntz + out[8] + out[10] = int64((in[7] >> 12) & 0x3FFFFFFFFFFF) << ntz + out[9] + out[11] = int64(((in[7] >> 58) | ((in[8] & 0xFFFFFFFFFF) << 6))) << ntz + out[10] + out[12] = int64(((in[8] >> 40) | ((in[9] & 0x3FFFFF) << 24))) << ntz + out[11] + out[13] = int64(((in[9] >> 22) | ((in[10] & 0xF) << 42))) << ntz + out[12] + out[14] = int64((in[10] >> 4) & 0x3FFFFFFFFFFF) << ntz + out[13] + out[15] = int64(((in[10] >> 50) | ((in[11] & 0xFFFFFFFF) << 14))) << ntz + out[14] + out[16] = int64(((in[11] >> 32) | ((in[12] & 0x3FFF) << 32))) << ntz + out[15] + out[17] = int64((in[12] >> 14) & 0x3FFFFFFFFFFF) << ntz + out[16] + out[18] = int64(((in[12] >> 60) | ((in[13] & 0x3FFFFFFFFFF) << 4))) << ntz + out[17] + out[19] = int64(((in[13] >> 42) | ((in[14] & 0xFFFFFF) << 22))) << ntz + out[18] + out[20] = int64(((in[14] >> 24) | ((in[15] & 0x3F) << 40))) << ntz + out[19] + out[21] = int64((in[15] >> 6) & 0x3FFFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[15] >> 52) | ((in[16] & 0x3FFFFFFFF) << 12))) << ntz + out[21] + out[23] = int64(((in[16] >> 34) | ((in[17] & 0xFFFF) << 30))) << ntz + out[22] + out[24] = int64((in[17] >> 16) & 0x3FFFFFFFFFFF) << ntz + out[23] + out[25] = int64(((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFF) << 2))) << ntz + out[24] + out[26] = int64(((in[18] >> 44) | ((in[19] & 0x3FFFFFF) << 20))) << ntz + out[25] + out[27] = int64(((in[19] >> 26) | ((in[20] & 0xFF) << 38))) << ntz + out[26] + out[28] = int64((in[20] >> 8) & 0x3FFFFFFFFFFF) << ntz + out[27] + out[29] = int64(((in[20] >> 54) | ((in[21] & 0xFFFFFFFFF) << 10))) << ntz + out[28] + out[30] = int64(((in[21] >> 36) | ((in[22] & 0x3FFFF) << 28))) << ntz + out[29] + out[31] = int64((in[22] >> 18)) << ntz + out[30] + out[32] = int64((in[23] >> 0) & 0x3FFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[23] >> 46) | ((in[24] & 0xFFFFFFF) << 18))) << ntz + out[32] + out[34] = int64(((in[24] >> 28) | ((in[25] & 0x3FF) << 36))) << ntz + out[33] + out[35] = int64((in[25] >> 10) & 0x3FFFFFFFFFFF) << ntz + out[34] + out[36] = int64(((in[25] >> 56) | ((in[26] & 0x3FFFFFFFFF) << 8))) << ntz + out[35] + out[37] = int64(((in[26] >> 38) | ((in[27] & 0xFFFFF) << 26))) << ntz + out[36] + out[38] = int64(((in[27] >> 20) | ((in[28] & 0x3) << 44))) << ntz + out[37] + out[39] = int64((in[28] >> 2) & 0x3FFFFFFFFFFF) << ntz + out[38] + out[40] = int64(((in[28] >> 48) | ((in[29] & 0x3FFFFFFF) << 16))) << ntz + out[39] + out[41] = int64(((in[29] >> 30) | ((in[30] & 0xFFF) << 34))) << ntz + out[40] + out[42] = int64((in[30] >> 12) & 0x3FFFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[30] >> 58) | ((in[31] & 0xFFFFFFFFFF) << 6))) << ntz + out[42] + out[44] = int64(((in[31] >> 40) | ((in[32] & 0x3FFFFF) << 24))) << ntz + out[43] + out[45] = int64(((in[32] >> 22) | ((in[33] & 0xF) << 42))) << ntz + out[44] + out[46] = int64((in[33] >> 4) & 0x3FFFFFFFFFFF) << ntz + out[45] + out[47] = int64(((in[33] >> 50) | ((in[34] & 0xFFFFFFFF) << 14))) << ntz + out[46] + out[48] = int64(((in[34] >> 32) | ((in[35] & 0x3FFF) << 32))) << ntz + out[47] + out[49] = int64((in[35] >> 14) & 0x3FFFFFFFFFFF) << ntz + out[48] + out[50] = int64(((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFF) << 4))) << ntz + out[49] + out[51] = int64(((in[36] >> 42) | ((in[37] & 0xFFFFFF) << 22))) << ntz + out[50] + out[52] = int64(((in[37] >> 24) | ((in[38] & 0x3F) << 40))) << ntz + out[51] + out[53] = int64((in[38] >> 6) & 0x3FFFFFFFFFFF) << ntz + out[52] + out[54] = int64(((in[38] >> 52) | ((in[39] & 0x3FFFFFFFF) << 12))) << ntz + out[53] + out[55] = int64(((in[39] >> 34) | ((in[40] & 0xFFFF) << 30))) << ntz + out[54] + out[56] = int64((in[40] >> 16) & 0x3FFFFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[40] >> 62) | ((in[41] & 0xFFFFFFFFFFF) << 2))) << ntz + out[56] + out[58] = int64(((in[41] >> 44) | ((in[42] & 0x3FFFFFF) << 20))) << ntz + out[57] + out[59] = int64(((in[42] >> 26) | ((in[43] & 0xFF) << 38))) << ntz + out[58] + out[60] = int64((in[43] >> 8) & 0x3FFFFFFFFFFF) << ntz + out[59] + out[61] = int64(((in[43] >> 54) | ((in[44] & 0xFFFFFFFFF) << 10))) << ntz + out[60] + out[62] = int64(((in[44] >> 36) | ((in[45] & 0x3FFFF) << 28))) << ntz + out[61] + out[63] = int64((in[45] >> 18)) << ntz + out[62] +} + +func deltaunpack_int64_47(initoffset int64, in *[47]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 47) | ((in[1] & 0x3FFFFFFF) << 17))) << ntz + out[0] + out[2] = int64(((in[1] >> 30) | ((in[2] & 0x1FFF) << 34))) << ntz + out[1] + out[3] = int64((in[2] >> 13) & 0x7FFFFFFFFFFF) << ntz + out[2] + out[4] = int64(((in[2] >> 60) | ((in[3] & 0x7FFFFFFFFFF) << 4))) << ntz + out[3] + out[5] = int64(((in[3] >> 43) | ((in[4] & 0x3FFFFFF) << 21))) << ntz + out[4] + out[6] = int64(((in[4] >> 26) | ((in[5] & 0x1FF) << 38))) << ntz + out[5] + out[7] = int64((in[5] >> 9) & 0x7FFFFFFFFFFF) << ntz + out[6] + out[8] = int64(((in[5] >> 56) | ((in[6] & 0x7FFFFFFFFF) << 8))) << ntz + out[7] + out[9] = int64(((in[6] >> 39) | ((in[7] & 0x3FFFFF) << 25))) << ntz + out[8] + out[10] = int64(((in[7] >> 22) | ((in[8] & 0x1F) << 42))) << ntz + out[9] + out[11] = int64((in[8] >> 5) & 0x7FFFFFFFFFFF) << ntz + out[10] + out[12] = int64(((in[8] >> 52) | ((in[9] & 0x7FFFFFFFF) << 12))) << ntz + out[11] + out[13] = int64(((in[9] >> 35) | ((in[10] & 0x3FFFF) << 29))) << ntz + out[12] + out[14] = int64(((in[10] >> 18) | ((in[11] & 0x1) << 46))) << ntz + out[13] + out[15] = int64((in[11] >> 1) & 0x7FFFFFFFFFFF) << ntz + out[14] + out[16] = int64(((in[11] >> 48) | ((in[12] & 0x7FFFFFFF) << 16))) << ntz + out[15] + out[17] = int64(((in[12] >> 31) | ((in[13] & 0x3FFF) << 33))) << ntz + out[16] + out[18] = int64((in[13] >> 14) & 0x7FFFFFFFFFFF) << ntz + out[17] + out[19] = int64(((in[13] >> 61) | ((in[14] & 0xFFFFFFFFFFF) << 3))) << ntz + out[18] + out[20] = int64(((in[14] >> 44) | ((in[15] & 0x7FFFFFF) << 20))) << ntz + out[19] + out[21] = int64(((in[15] >> 27) | ((in[16] & 0x3FF) << 37))) << ntz + out[20] + out[22] = int64((in[16] >> 10) & 0x7FFFFFFFFFFF) << ntz + out[21] + out[23] = int64(((in[16] >> 57) | ((in[17] & 0xFFFFFFFFFF) << 7))) << ntz + out[22] + out[24] = int64(((in[17] >> 40) | ((in[18] & 0x7FFFFF) << 24))) << ntz + out[23] + out[25] = int64(((in[18] >> 23) | ((in[19] & 0x3F) << 41))) << ntz + out[24] + out[26] = int64((in[19] >> 6) & 0x7FFFFFFFFFFF) << ntz + out[25] + out[27] = int64(((in[19] >> 53) | ((in[20] & 0xFFFFFFFFF) << 11))) << ntz + out[26] + out[28] = int64(((in[20] >> 36) | ((in[21] & 0x7FFFF) << 28))) << ntz + out[27] + out[29] = int64(((in[21] >> 19) | ((in[22] & 0x3) << 45))) << ntz + out[28] + out[30] = int64((in[22] >> 2) & 0x7FFFFFFFFFFF) << ntz + out[29] + out[31] = int64(((in[22] >> 49) | ((in[23] & 0xFFFFFFFF) << 15))) << ntz + out[30] + out[32] = int64(((in[23] >> 32) | ((in[24] & 0x7FFF) << 32))) << ntz + out[31] + out[33] = int64((in[24] >> 15) & 0x7FFFFFFFFFFF) << ntz + out[32] + out[34] = int64(((in[24] >> 62) | ((in[25] & 0x1FFFFFFFFFFF) << 2))) << ntz + out[33] + out[35] = int64(((in[25] >> 45) | ((in[26] & 0xFFFFFFF) << 19))) << ntz + out[34] + out[36] = int64(((in[26] >> 28) | ((in[27] & 0x7FF) << 36))) << ntz + out[35] + out[37] = int64((in[27] >> 11) & 0x7FFFFFFFFFFF) << ntz + out[36] + out[38] = int64(((in[27] >> 58) | ((in[28] & 0x1FFFFFFFFFF) << 6))) << ntz + out[37] + out[39] = int64(((in[28] >> 41) | ((in[29] & 0xFFFFFF) << 23))) << ntz + out[38] + out[40] = int64(((in[29] >> 24) | ((in[30] & 0x7F) << 40))) << ntz + out[39] + out[41] = int64((in[30] >> 7) & 0x7FFFFFFFFFFF) << ntz + out[40] + out[42] = int64(((in[30] >> 54) | ((in[31] & 0x1FFFFFFFFF) << 10))) << ntz + out[41] + out[43] = int64(((in[31] >> 37) | ((in[32] & 0xFFFFF) << 27))) << ntz + out[42] + out[44] = int64(((in[32] >> 20) | ((in[33] & 0x7) << 44))) << ntz + out[43] + out[45] = int64((in[33] >> 3) & 0x7FFFFFFFFFFF) << ntz + out[44] + out[46] = int64(((in[33] >> 50) | ((in[34] & 0x1FFFFFFFF) << 14))) << ntz + out[45] + out[47] = int64(((in[34] >> 33) | ((in[35] & 0xFFFF) << 31))) << ntz + out[46] + out[48] = int64((in[35] >> 16) & 0x7FFFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[35] >> 63) | ((in[36] & 0x3FFFFFFFFFFF) << 1))) << ntz + out[48] + out[50] = int64(((in[36] >> 46) | ((in[37] & 0x1FFFFFFF) << 18))) << ntz + out[49] + out[51] = int64(((in[37] >> 29) | ((in[38] & 0xFFF) << 35))) << ntz + out[50] + out[52] = int64((in[38] >> 12) & 0x7FFFFFFFFFFF) << ntz + out[51] + out[53] = int64(((in[38] >> 59) | ((in[39] & 0x3FFFFFFFFFF) << 5))) << ntz + out[52] + out[54] = int64(((in[39] >> 42) | ((in[40] & 0x1FFFFFF) << 22))) << ntz + out[53] + out[55] = int64(((in[40] >> 25) | ((in[41] & 0xFF) << 39))) << ntz + out[54] + out[56] = int64((in[41] >> 8) & 0x7FFFFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[41] >> 55) | ((in[42] & 0x3FFFFFFFFF) << 9))) << ntz + out[56] + out[58] = int64(((in[42] >> 38) | ((in[43] & 0x1FFFFF) << 26))) << ntz + out[57] + out[59] = int64(((in[43] >> 21) | ((in[44] & 0xF) << 43))) << ntz + out[58] + out[60] = int64((in[44] >> 4) & 0x7FFFFFFFFFFF) << ntz + out[59] + out[61] = int64(((in[44] >> 51) | ((in[45] & 0x3FFFFFFFF) << 13))) << ntz + out[60] + out[62] = int64(((in[45] >> 34) | ((in[46] & 0x1FFFF) << 30))) << ntz + out[61] + out[63] = int64((in[46] >> 17)) << ntz + out[62] +} + +func deltaunpack_int64_48(initoffset int64, in *[48]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 48) | ((in[1] & 0xFFFFFFFF) << 16))) << ntz + out[0] + out[2] = int64(((in[1] >> 32) | ((in[2] & 0xFFFF) << 32))) << ntz + out[1] + out[3] = int64((in[2] >> 16)) << ntz + out[2] + out[4] = int64((in[3] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[3] + out[5] = int64(((in[3] >> 48) | ((in[4] & 0xFFFFFFFF) << 16))) << ntz + out[4] + out[6] = int64(((in[4] >> 32) | ((in[5] & 0xFFFF) << 32))) << ntz + out[5] + out[7] = int64((in[5] >> 16)) << ntz + out[6] + out[8] = int64((in[6] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[7] + out[9] = int64(((in[6] >> 48) | ((in[7] & 0xFFFFFFFF) << 16))) << ntz + out[8] + out[10] = int64(((in[7] >> 32) | ((in[8] & 0xFFFF) << 32))) << ntz + out[9] + out[11] = int64((in[8] >> 16)) << ntz + out[10] + out[12] = int64((in[9] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[9] >> 48) | ((in[10] & 0xFFFFFFFF) << 16))) << ntz + out[12] + out[14] = int64(((in[10] >> 32) | ((in[11] & 0xFFFF) << 32))) << ntz + out[13] + out[15] = int64((in[11] >> 16)) << ntz + out[14] + out[16] = int64((in[12] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[12] >> 48) | ((in[13] & 0xFFFFFFFF) << 16))) << ntz + out[16] + out[18] = int64(((in[13] >> 32) | ((in[14] & 0xFFFF) << 32))) << ntz + out[17] + out[19] = int64((in[14] >> 16)) << ntz + out[18] + out[20] = int64((in[15] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[19] + out[21] = int64(((in[15] >> 48) | ((in[16] & 0xFFFFFFFF) << 16))) << ntz + out[20] + out[22] = int64(((in[16] >> 32) | ((in[17] & 0xFFFF) << 32))) << ntz + out[21] + out[23] = int64((in[17] >> 16)) << ntz + out[22] + out[24] = int64((in[18] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[23] + out[25] = int64(((in[18] >> 48) | ((in[19] & 0xFFFFFFFF) << 16))) << ntz + out[24] + out[26] = int64(((in[19] >> 32) | ((in[20] & 0xFFFF) << 32))) << ntz + out[25] + out[27] = int64((in[20] >> 16)) << ntz + out[26] + out[28] = int64((in[21] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[27] + out[29] = int64(((in[21] >> 48) | ((in[22] & 0xFFFFFFFF) << 16))) << ntz + out[28] + out[30] = int64(((in[22] >> 32) | ((in[23] & 0xFFFF) << 32))) << ntz + out[29] + out[31] = int64((in[23] >> 16)) << ntz + out[30] + out[32] = int64((in[24] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[24] >> 48) | ((in[25] & 0xFFFFFFFF) << 16))) << ntz + out[32] + out[34] = int64(((in[25] >> 32) | ((in[26] & 0xFFFF) << 32))) << ntz + out[33] + out[35] = int64((in[26] >> 16)) << ntz + out[34] + out[36] = int64((in[27] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[35] + out[37] = int64(((in[27] >> 48) | ((in[28] & 0xFFFFFFFF) << 16))) << ntz + out[36] + out[38] = int64(((in[28] >> 32) | ((in[29] & 0xFFFF) << 32))) << ntz + out[37] + out[39] = int64((in[29] >> 16)) << ntz + out[38] + out[40] = int64((in[30] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[30] >> 48) | ((in[31] & 0xFFFFFFFF) << 16))) << ntz + out[40] + out[42] = int64(((in[31] >> 32) | ((in[32] & 0xFFFF) << 32))) << ntz + out[41] + out[43] = int64((in[32] >> 16)) << ntz + out[42] + out[44] = int64((in[33] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[43] + out[45] = int64(((in[33] >> 48) | ((in[34] & 0xFFFFFFFF) << 16))) << ntz + out[44] + out[46] = int64(((in[34] >> 32) | ((in[35] & 0xFFFF) << 32))) << ntz + out[45] + out[47] = int64((in[35] >> 16)) << ntz + out[46] + out[48] = int64((in[36] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[36] >> 48) | ((in[37] & 0xFFFFFFFF) << 16))) << ntz + out[48] + out[50] = int64(((in[37] >> 32) | ((in[38] & 0xFFFF) << 32))) << ntz + out[49] + out[51] = int64((in[38] >> 16)) << ntz + out[50] + out[52] = int64((in[39] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[51] + out[53] = int64(((in[39] >> 48) | ((in[40] & 0xFFFFFFFF) << 16))) << ntz + out[52] + out[54] = int64(((in[40] >> 32) | ((in[41] & 0xFFFF) << 32))) << ntz + out[53] + out[55] = int64((in[41] >> 16)) << ntz + out[54] + out[56] = int64((in[42] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[42] >> 48) | ((in[43] & 0xFFFFFFFF) << 16))) << ntz + out[56] + out[58] = int64(((in[43] >> 32) | ((in[44] & 0xFFFF) << 32))) << ntz + out[57] + out[59] = int64((in[44] >> 16)) << ntz + out[58] + out[60] = int64((in[45] >> 0) & 0xFFFFFFFFFFFF) << ntz + out[59] + out[61] = int64(((in[45] >> 48) | ((in[46] & 0xFFFFFFFF) << 16))) << ntz + out[60] + out[62] = int64(((in[46] >> 32) | ((in[47] & 0xFFFF) << 32))) << ntz + out[61] + out[63] = int64((in[47] >> 16)) << ntz + out[62] +} + +func deltaunpack_int64_49(initoffset int64, in *[49]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 49) | ((in[1] & 0x3FFFFFFFF) << 15))) << ntz + out[0] + out[2] = int64(((in[1] >> 34) | ((in[2] & 0x7FFFF) << 30))) << ntz + out[1] + out[3] = int64(((in[2] >> 19) | ((in[3] & 0xF) << 45))) << ntz + out[2] + out[4] = int64((in[3] >> 4) & 0x1FFFFFFFFFFFF) << ntz + out[3] + out[5] = int64(((in[3] >> 53) | ((in[4] & 0x3FFFFFFFFF) << 11))) << ntz + out[4] + out[6] = int64(((in[4] >> 38) | ((in[5] & 0x7FFFFF) << 26))) << ntz + out[5] + out[7] = int64(((in[5] >> 23) | ((in[6] & 0xFF) << 41))) << ntz + out[6] + out[8] = int64((in[6] >> 8) & 0x1FFFFFFFFFFFF) << ntz + out[7] + out[9] = int64(((in[6] >> 57) | ((in[7] & 0x3FFFFFFFFFF) << 7))) << ntz + out[8] + out[10] = int64(((in[7] >> 42) | ((in[8] & 0x7FFFFFF) << 22))) << ntz + out[9] + out[11] = int64(((in[8] >> 27) | ((in[9] & 0xFFF) << 37))) << ntz + out[10] + out[12] = int64((in[9] >> 12) & 0x1FFFFFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[9] >> 61) | ((in[10] & 0x3FFFFFFFFFFF) << 3))) << ntz + out[12] + out[14] = int64(((in[10] >> 46) | ((in[11] & 0x7FFFFFFF) << 18))) << ntz + out[13] + out[15] = int64(((in[11] >> 31) | ((in[12] & 0xFFFF) << 33))) << ntz + out[14] + out[16] = int64(((in[12] >> 16) | ((in[13] & 0x1) << 48))) << ntz + out[15] + out[17] = int64((in[13] >> 1) & 0x1FFFFFFFFFFFF) << ntz + out[16] + out[18] = int64(((in[13] >> 50) | ((in[14] & 0x7FFFFFFFF) << 14))) << ntz + out[17] + out[19] = int64(((in[14] >> 35) | ((in[15] & 0xFFFFF) << 29))) << ntz + out[18] + out[20] = int64(((in[15] >> 20) | ((in[16] & 0x1F) << 44))) << ntz + out[19] + out[21] = int64((in[16] >> 5) & 0x1FFFFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[16] >> 54) | ((in[17] & 0x7FFFFFFFFF) << 10))) << ntz + out[21] + out[23] = int64(((in[17] >> 39) | ((in[18] & 0xFFFFFF) << 25))) << ntz + out[22] + out[24] = int64(((in[18] >> 24) | ((in[19] & 0x1FF) << 40))) << ntz + out[23] + out[25] = int64((in[19] >> 9) & 0x1FFFFFFFFFFFF) << ntz + out[24] + out[26] = int64(((in[19] >> 58) | ((in[20] & 0x7FFFFFFFFFF) << 6))) << ntz + out[25] + out[27] = int64(((in[20] >> 43) | ((in[21] & 0xFFFFFFF) << 21))) << ntz + out[26] + out[28] = int64(((in[21] >> 28) | ((in[22] & 0x1FFF) << 36))) << ntz + out[27] + out[29] = int64((in[22] >> 13) & 0x1FFFFFFFFFFFF) << ntz + out[28] + out[30] = int64(((in[22] >> 62) | ((in[23] & 0x7FFFFFFFFFFF) << 2))) << ntz + out[29] + out[31] = int64(((in[23] >> 47) | ((in[24] & 0xFFFFFFFF) << 17))) << ntz + out[30] + out[32] = int64(((in[24] >> 32) | ((in[25] & 0x1FFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[25] >> 17) | ((in[26] & 0x3) << 47))) << ntz + out[32] + out[34] = int64((in[26] >> 2) & 0x1FFFFFFFFFFFF) << ntz + out[33] + out[35] = int64(((in[26] >> 51) | ((in[27] & 0xFFFFFFFFF) << 13))) << ntz + out[34] + out[36] = int64(((in[27] >> 36) | ((in[28] & 0x1FFFFF) << 28))) << ntz + out[35] + out[37] = int64(((in[28] >> 21) | ((in[29] & 0x3F) << 43))) << ntz + out[36] + out[38] = int64((in[29] >> 6) & 0x1FFFFFFFFFFFF) << ntz + out[37] + out[39] = int64(((in[29] >> 55) | ((in[30] & 0xFFFFFFFFFF) << 9))) << ntz + out[38] + out[40] = int64(((in[30] >> 40) | ((in[31] & 0x1FFFFFF) << 24))) << ntz + out[39] + out[41] = int64(((in[31] >> 25) | ((in[32] & 0x3FF) << 39))) << ntz + out[40] + out[42] = int64((in[32] >> 10) & 0x1FFFFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[32] >> 59) | ((in[33] & 0xFFFFFFFFFFF) << 5))) << ntz + out[42] + out[44] = int64(((in[33] >> 44) | ((in[34] & 0x1FFFFFFF) << 20))) << ntz + out[43] + out[45] = int64(((in[34] >> 29) | ((in[35] & 0x3FFF) << 35))) << ntz + out[44] + out[46] = int64((in[35] >> 14) & 0x1FFFFFFFFFFFF) << ntz + out[45] + out[47] = int64(((in[35] >> 63) | ((in[36] & 0xFFFFFFFFFFFF) << 1))) << ntz + out[46] + out[48] = int64(((in[36] >> 48) | ((in[37] & 0x1FFFFFFFF) << 16))) << ntz + out[47] + out[49] = int64(((in[37] >> 33) | ((in[38] & 0x3FFFF) << 31))) << ntz + out[48] + out[50] = int64(((in[38] >> 18) | ((in[39] & 0x7) << 46))) << ntz + out[49] + out[51] = int64((in[39] >> 3) & 0x1FFFFFFFFFFFF) << ntz + out[50] + out[52] = int64(((in[39] >> 52) | ((in[40] & 0x1FFFFFFFFF) << 12))) << ntz + out[51] + out[53] = int64(((in[40] >> 37) | ((in[41] & 0x3FFFFF) << 27))) << ntz + out[52] + out[54] = int64(((in[41] >> 22) | ((in[42] & 0x7F) << 42))) << ntz + out[53] + out[55] = int64((in[42] >> 7) & 0x1FFFFFFFFFFFF) << ntz + out[54] + out[56] = int64(((in[42] >> 56) | ((in[43] & 0x1FFFFFFFFFF) << 8))) << ntz + out[55] + out[57] = int64(((in[43] >> 41) | ((in[44] & 0x3FFFFFF) << 23))) << ntz + out[56] + out[58] = int64(((in[44] >> 26) | ((in[45] & 0x7FF) << 38))) << ntz + out[57] + out[59] = int64((in[45] >> 11) & 0x1FFFFFFFFFFFF) << ntz + out[58] + out[60] = int64(((in[45] >> 60) | ((in[46] & 0x1FFFFFFFFFFF) << 4))) << ntz + out[59] + out[61] = int64(((in[46] >> 45) | ((in[47] & 0x3FFFFFFF) << 19))) << ntz + out[60] + out[62] = int64(((in[47] >> 30) | ((in[48] & 0x7FFF) << 34))) << ntz + out[61] + out[63] = int64((in[48] >> 15)) << ntz + out[62] +} + +func deltaunpack_int64_50(initoffset int64, in *[50]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 50) | ((in[1] & 0xFFFFFFFFF) << 14))) << ntz + out[0] + out[2] = int64(((in[1] >> 36) | ((in[2] & 0x3FFFFF) << 28))) << ntz + out[1] + out[3] = int64(((in[2] >> 22) | ((in[3] & 0xFF) << 42))) << ntz + out[2] + out[4] = int64((in[3] >> 8) & 0x3FFFFFFFFFFFF) << ntz + out[3] + out[5] = int64(((in[3] >> 58) | ((in[4] & 0xFFFFFFFFFFF) << 6))) << ntz + out[4] + out[6] = int64(((in[4] >> 44) | ((in[5] & 0x3FFFFFFF) << 20))) << ntz + out[5] + out[7] = int64(((in[5] >> 30) | ((in[6] & 0xFFFF) << 34))) << ntz + out[6] + out[8] = int64(((in[6] >> 16) | ((in[7] & 0x3) << 48))) << ntz + out[7] + out[9] = int64((in[7] >> 2) & 0x3FFFFFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[7] >> 52) | ((in[8] & 0x3FFFFFFFFF) << 12))) << ntz + out[9] + out[11] = int64(((in[8] >> 38) | ((in[9] & 0xFFFFFF) << 26))) << ntz + out[10] + out[12] = int64(((in[9] >> 24) | ((in[10] & 0x3FF) << 40))) << ntz + out[11] + out[13] = int64((in[10] >> 10) & 0x3FFFFFFFFFFFF) << ntz + out[12] + out[14] = int64(((in[10] >> 60) | ((in[11] & 0x3FFFFFFFFFFF) << 4))) << ntz + out[13] + out[15] = int64(((in[11] >> 46) | ((in[12] & 0xFFFFFFFF) << 18))) << ntz + out[14] + out[16] = int64(((in[12] >> 32) | ((in[13] & 0x3FFFF) << 32))) << ntz + out[15] + out[17] = int64(((in[13] >> 18) | ((in[14] & 0xF) << 46))) << ntz + out[16] + out[18] = int64((in[14] >> 4) & 0x3FFFFFFFFFFFF) << ntz + out[17] + out[19] = int64(((in[14] >> 54) | ((in[15] & 0xFFFFFFFFFF) << 10))) << ntz + out[18] + out[20] = int64(((in[15] >> 40) | ((in[16] & 0x3FFFFFF) << 24))) << ntz + out[19] + out[21] = int64(((in[16] >> 26) | ((in[17] & 0xFFF) << 38))) << ntz + out[20] + out[22] = int64((in[17] >> 12) & 0x3FFFFFFFFFFFF) << ntz + out[21] + out[23] = int64(((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFFF) << 2))) << ntz + out[22] + out[24] = int64(((in[18] >> 48) | ((in[19] & 0x3FFFFFFFF) << 16))) << ntz + out[23] + out[25] = int64(((in[19] >> 34) | ((in[20] & 0xFFFFF) << 30))) << ntz + out[24] + out[26] = int64(((in[20] >> 20) | ((in[21] & 0x3F) << 44))) << ntz + out[25] + out[27] = int64((in[21] >> 6) & 0x3FFFFFFFFFFFF) << ntz + out[26] + out[28] = int64(((in[21] >> 56) | ((in[22] & 0x3FFFFFFFFFF) << 8))) << ntz + out[27] + out[29] = int64(((in[22] >> 42) | ((in[23] & 0xFFFFFFF) << 22))) << ntz + out[28] + out[30] = int64(((in[23] >> 28) | ((in[24] & 0x3FFF) << 36))) << ntz + out[29] + out[31] = int64((in[24] >> 14)) << ntz + out[30] + out[32] = int64((in[25] >> 0) & 0x3FFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[25] >> 50) | ((in[26] & 0xFFFFFFFFF) << 14))) << ntz + out[32] + out[34] = int64(((in[26] >> 36) | ((in[27] & 0x3FFFFF) << 28))) << ntz + out[33] + out[35] = int64(((in[27] >> 22) | ((in[28] & 0xFF) << 42))) << ntz + out[34] + out[36] = int64((in[28] >> 8) & 0x3FFFFFFFFFFFF) << ntz + out[35] + out[37] = int64(((in[28] >> 58) | ((in[29] & 0xFFFFFFFFFFF) << 6))) << ntz + out[36] + out[38] = int64(((in[29] >> 44) | ((in[30] & 0x3FFFFFFF) << 20))) << ntz + out[37] + out[39] = int64(((in[30] >> 30) | ((in[31] & 0xFFFF) << 34))) << ntz + out[38] + out[40] = int64(((in[31] >> 16) | ((in[32] & 0x3) << 48))) << ntz + out[39] + out[41] = int64((in[32] >> 2) & 0x3FFFFFFFFFFFF) << ntz + out[40] + out[42] = int64(((in[32] >> 52) | ((in[33] & 0x3FFFFFFFFF) << 12))) << ntz + out[41] + out[43] = int64(((in[33] >> 38) | ((in[34] & 0xFFFFFF) << 26))) << ntz + out[42] + out[44] = int64(((in[34] >> 24) | ((in[35] & 0x3FF) << 40))) << ntz + out[43] + out[45] = int64((in[35] >> 10) & 0x3FFFFFFFFFFFF) << ntz + out[44] + out[46] = int64(((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFFF) << 4))) << ntz + out[45] + out[47] = int64(((in[36] >> 46) | ((in[37] & 0xFFFFFFFF) << 18))) << ntz + out[46] + out[48] = int64(((in[37] >> 32) | ((in[38] & 0x3FFFF) << 32))) << ntz + out[47] + out[49] = int64(((in[38] >> 18) | ((in[39] & 0xF) << 46))) << ntz + out[48] + out[50] = int64((in[39] >> 4) & 0x3FFFFFFFFFFFF) << ntz + out[49] + out[51] = int64(((in[39] >> 54) | ((in[40] & 0xFFFFFFFFFF) << 10))) << ntz + out[50] + out[52] = int64(((in[40] >> 40) | ((in[41] & 0x3FFFFFF) << 24))) << ntz + out[51] + out[53] = int64(((in[41] >> 26) | ((in[42] & 0xFFF) << 38))) << ntz + out[52] + out[54] = int64((in[42] >> 12) & 0x3FFFFFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[42] >> 62) | ((in[43] & 0xFFFFFFFFFFFF) << 2))) << ntz + out[54] + out[56] = int64(((in[43] >> 48) | ((in[44] & 0x3FFFFFFFF) << 16))) << ntz + out[55] + out[57] = int64(((in[44] >> 34) | ((in[45] & 0xFFFFF) << 30))) << ntz + out[56] + out[58] = int64(((in[45] >> 20) | ((in[46] & 0x3F) << 44))) << ntz + out[57] + out[59] = int64((in[46] >> 6) & 0x3FFFFFFFFFFFF) << ntz + out[58] + out[60] = int64(((in[46] >> 56) | ((in[47] & 0x3FFFFFFFFFF) << 8))) << ntz + out[59] + out[61] = int64(((in[47] >> 42) | ((in[48] & 0xFFFFFFF) << 22))) << ntz + out[60] + out[62] = int64(((in[48] >> 28) | ((in[49] & 0x3FFF) << 36))) << ntz + out[61] + out[63] = int64((in[49] >> 14)) << ntz + out[62] +} + +func deltaunpack_int64_51(initoffset int64, in *[51]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 51) | ((in[1] & 0x3FFFFFFFFF) << 13))) << ntz + out[0] + out[2] = int64(((in[1] >> 38) | ((in[2] & 0x1FFFFFF) << 26))) << ntz + out[1] + out[3] = int64(((in[2] >> 25) | ((in[3] & 0xFFF) << 39))) << ntz + out[2] + out[4] = int64((in[3] >> 12) & 0x7FFFFFFFFFFFF) << ntz + out[3] + out[5] = int64(((in[3] >> 63) | ((in[4] & 0x3FFFFFFFFFFFF) << 1))) << ntz + out[4] + out[6] = int64(((in[4] >> 50) | ((in[5] & 0x1FFFFFFFFF) << 14))) << ntz + out[5] + out[7] = int64(((in[5] >> 37) | ((in[6] & 0xFFFFFF) << 27))) << ntz + out[6] + out[8] = int64(((in[6] >> 24) | ((in[7] & 0x7FF) << 40))) << ntz + out[7] + out[9] = int64((in[7] >> 11) & 0x7FFFFFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[7] >> 62) | ((in[8] & 0x1FFFFFFFFFFFF) << 2))) << ntz + out[9] + out[11] = int64(((in[8] >> 49) | ((in[9] & 0xFFFFFFFFF) << 15))) << ntz + out[10] + out[12] = int64(((in[9] >> 36) | ((in[10] & 0x7FFFFF) << 28))) << ntz + out[11] + out[13] = int64(((in[10] >> 23) | ((in[11] & 0x3FF) << 41))) << ntz + out[12] + out[14] = int64((in[11] >> 10) & 0x7FFFFFFFFFFFF) << ntz + out[13] + out[15] = int64(((in[11] >> 61) | ((in[12] & 0xFFFFFFFFFFFF) << 3))) << ntz + out[14] + out[16] = int64(((in[12] >> 48) | ((in[13] & 0x7FFFFFFFF) << 16))) << ntz + out[15] + out[17] = int64(((in[13] >> 35) | ((in[14] & 0x3FFFFF) << 29))) << ntz + out[16] + out[18] = int64(((in[14] >> 22) | ((in[15] & 0x1FF) << 42))) << ntz + out[17] + out[19] = int64((in[15] >> 9) & 0x7FFFFFFFFFFFF) << ntz + out[18] + out[20] = int64(((in[15] >> 60) | ((in[16] & 0x7FFFFFFFFFFF) << 4))) << ntz + out[19] + out[21] = int64(((in[16] >> 47) | ((in[17] & 0x3FFFFFFFF) << 17))) << ntz + out[20] + out[22] = int64(((in[17] >> 34) | ((in[18] & 0x1FFFFF) << 30))) << ntz + out[21] + out[23] = int64(((in[18] >> 21) | ((in[19] & 0xFF) << 43))) << ntz + out[22] + out[24] = int64((in[19] >> 8) & 0x7FFFFFFFFFFFF) << ntz + out[23] + out[25] = int64(((in[19] >> 59) | ((in[20] & 0x3FFFFFFFFFFF) << 5))) << ntz + out[24] + out[26] = int64(((in[20] >> 46) | ((in[21] & 0x1FFFFFFFF) << 18))) << ntz + out[25] + out[27] = int64(((in[21] >> 33) | ((in[22] & 0xFFFFF) << 31))) << ntz + out[26] + out[28] = int64(((in[22] >> 20) | ((in[23] & 0x7F) << 44))) << ntz + out[27] + out[29] = int64((in[23] >> 7) & 0x7FFFFFFFFFFFF) << ntz + out[28] + out[30] = int64(((in[23] >> 58) | ((in[24] & 0x1FFFFFFFFFFF) << 6))) << ntz + out[29] + out[31] = int64(((in[24] >> 45) | ((in[25] & 0xFFFFFFFF) << 19))) << ntz + out[30] + out[32] = int64(((in[25] >> 32) | ((in[26] & 0x7FFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[26] >> 19) | ((in[27] & 0x3F) << 45))) << ntz + out[32] + out[34] = int64((in[27] >> 6) & 0x7FFFFFFFFFFFF) << ntz + out[33] + out[35] = int64(((in[27] >> 57) | ((in[28] & 0xFFFFFFFFFFF) << 7))) << ntz + out[34] + out[36] = int64(((in[28] >> 44) | ((in[29] & 0x7FFFFFFF) << 20))) << ntz + out[35] + out[37] = int64(((in[29] >> 31) | ((in[30] & 0x3FFFF) << 33))) << ntz + out[36] + out[38] = int64(((in[30] >> 18) | ((in[31] & 0x1F) << 46))) << ntz + out[37] + out[39] = int64((in[31] >> 5) & 0x7FFFFFFFFFFFF) << ntz + out[38] + out[40] = int64(((in[31] >> 56) | ((in[32] & 0x7FFFFFFFFFF) << 8))) << ntz + out[39] + out[41] = int64(((in[32] >> 43) | ((in[33] & 0x3FFFFFFF) << 21))) << ntz + out[40] + out[42] = int64(((in[33] >> 30) | ((in[34] & 0x1FFFF) << 34))) << ntz + out[41] + out[43] = int64(((in[34] >> 17) | ((in[35] & 0xF) << 47))) << ntz + out[42] + out[44] = int64((in[35] >> 4) & 0x7FFFFFFFFFFFF) << ntz + out[43] + out[45] = int64(((in[35] >> 55) | ((in[36] & 0x3FFFFFFFFFF) << 9))) << ntz + out[44] + out[46] = int64(((in[36] >> 42) | ((in[37] & 0x1FFFFFFF) << 22))) << ntz + out[45] + out[47] = int64(((in[37] >> 29) | ((in[38] & 0xFFFF) << 35))) << ntz + out[46] + out[48] = int64(((in[38] >> 16) | ((in[39] & 0x7) << 48))) << ntz + out[47] + out[49] = int64((in[39] >> 3) & 0x7FFFFFFFFFFFF) << ntz + out[48] + out[50] = int64(((in[39] >> 54) | ((in[40] & 0x1FFFFFFFFFF) << 10))) << ntz + out[49] + out[51] = int64(((in[40] >> 41) | ((in[41] & 0xFFFFFFF) << 23))) << ntz + out[50] + out[52] = int64(((in[41] >> 28) | ((in[42] & 0x7FFF) << 36))) << ntz + out[51] + out[53] = int64(((in[42] >> 15) | ((in[43] & 0x3) << 49))) << ntz + out[52] + out[54] = int64((in[43] >> 2) & 0x7FFFFFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFF) << 11))) << ntz + out[54] + out[56] = int64(((in[44] >> 40) | ((in[45] & 0x7FFFFFF) << 24))) << ntz + out[55] + out[57] = int64(((in[45] >> 27) | ((in[46] & 0x3FFF) << 37))) << ntz + out[56] + out[58] = int64(((in[46] >> 14) | ((in[47] & 0x1) << 50))) << ntz + out[57] + out[59] = int64((in[47] >> 1) & 0x7FFFFFFFFFFFF) << ntz + out[58] + out[60] = int64(((in[47] >> 52) | ((in[48] & 0x7FFFFFFFFF) << 12))) << ntz + out[59] + out[61] = int64(((in[48] >> 39) | ((in[49] & 0x3FFFFFF) << 25))) << ntz + out[60] + out[62] = int64(((in[49] >> 26) | ((in[50] & 0x1FFF) << 38))) << ntz + out[61] + out[63] = int64((in[50] >> 13)) << ntz + out[62] +} + +func deltaunpack_int64_52(initoffset int64, in *[52]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 52) | ((in[1] & 0xFFFFFFFFFF) << 12))) << ntz + out[0] + out[2] = int64(((in[1] >> 40) | ((in[2] & 0xFFFFFFF) << 24))) << ntz + out[1] + out[3] = int64(((in[2] >> 28) | ((in[3] & 0xFFFF) << 36))) << ntz + out[2] + out[4] = int64(((in[3] >> 16) | ((in[4] & 0xF) << 48))) << ntz + out[3] + out[5] = int64((in[4] >> 4) & 0xFFFFFFFFFFFFF) << ntz + out[4] + out[6] = int64(((in[4] >> 56) | ((in[5] & 0xFFFFFFFFFFF) << 8))) << ntz + out[5] + out[7] = int64(((in[5] >> 44) | ((in[6] & 0xFFFFFFFF) << 20))) << ntz + out[6] + out[8] = int64(((in[6] >> 32) | ((in[7] & 0xFFFFF) << 32))) << ntz + out[7] + out[9] = int64(((in[7] >> 20) | ((in[8] & 0xFF) << 44))) << ntz + out[8] + out[10] = int64((in[8] >> 8) & 0xFFFFFFFFFFFFF) << ntz + out[9] + out[11] = int64(((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFFFF) << 4))) << ntz + out[10] + out[12] = int64(((in[9] >> 48) | ((in[10] & 0xFFFFFFFFF) << 16))) << ntz + out[11] + out[13] = int64(((in[10] >> 36) | ((in[11] & 0xFFFFFF) << 28))) << ntz + out[12] + out[14] = int64(((in[11] >> 24) | ((in[12] & 0xFFF) << 40))) << ntz + out[13] + out[15] = int64((in[12] >> 12)) << ntz + out[14] + out[16] = int64((in[13] >> 0) & 0xFFFFFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[13] >> 52) | ((in[14] & 0xFFFFFFFFFF) << 12))) << ntz + out[16] + out[18] = int64(((in[14] >> 40) | ((in[15] & 0xFFFFFFF) << 24))) << ntz + out[17] + out[19] = int64(((in[15] >> 28) | ((in[16] & 0xFFFF) << 36))) << ntz + out[18] + out[20] = int64(((in[16] >> 16) | ((in[17] & 0xF) << 48))) << ntz + out[19] + out[21] = int64((in[17] >> 4) & 0xFFFFFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[17] >> 56) | ((in[18] & 0xFFFFFFFFFFF) << 8))) << ntz + out[21] + out[23] = int64(((in[18] >> 44) | ((in[19] & 0xFFFFFFFF) << 20))) << ntz + out[22] + out[24] = int64(((in[19] >> 32) | ((in[20] & 0xFFFFF) << 32))) << ntz + out[23] + out[25] = int64(((in[20] >> 20) | ((in[21] & 0xFF) << 44))) << ntz + out[24] + out[26] = int64((in[21] >> 8) & 0xFFFFFFFFFFFFF) << ntz + out[25] + out[27] = int64(((in[21] >> 60) | ((in[22] & 0xFFFFFFFFFFFF) << 4))) << ntz + out[26] + out[28] = int64(((in[22] >> 48) | ((in[23] & 0xFFFFFFFFF) << 16))) << ntz + out[27] + out[29] = int64(((in[23] >> 36) | ((in[24] & 0xFFFFFF) << 28))) << ntz + out[28] + out[30] = int64(((in[24] >> 24) | ((in[25] & 0xFFF) << 40))) << ntz + out[29] + out[31] = int64((in[25] >> 12)) << ntz + out[30] + out[32] = int64((in[26] >> 0) & 0xFFFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[26] >> 52) | ((in[27] & 0xFFFFFFFFFF) << 12))) << ntz + out[32] + out[34] = int64(((in[27] >> 40) | ((in[28] & 0xFFFFFFF) << 24))) << ntz + out[33] + out[35] = int64(((in[28] >> 28) | ((in[29] & 0xFFFF) << 36))) << ntz + out[34] + out[36] = int64(((in[29] >> 16) | ((in[30] & 0xF) << 48))) << ntz + out[35] + out[37] = int64((in[30] >> 4) & 0xFFFFFFFFFFFFF) << ntz + out[36] + out[38] = int64(((in[30] >> 56) | ((in[31] & 0xFFFFFFFFFFF) << 8))) << ntz + out[37] + out[39] = int64(((in[31] >> 44) | ((in[32] & 0xFFFFFFFF) << 20))) << ntz + out[38] + out[40] = int64(((in[32] >> 32) | ((in[33] & 0xFFFFF) << 32))) << ntz + out[39] + out[41] = int64(((in[33] >> 20) | ((in[34] & 0xFF) << 44))) << ntz + out[40] + out[42] = int64((in[34] >> 8) & 0xFFFFFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[34] >> 60) | ((in[35] & 0xFFFFFFFFFFFF) << 4))) << ntz + out[42] + out[44] = int64(((in[35] >> 48) | ((in[36] & 0xFFFFFFFFF) << 16))) << ntz + out[43] + out[45] = int64(((in[36] >> 36) | ((in[37] & 0xFFFFFF) << 28))) << ntz + out[44] + out[46] = int64(((in[37] >> 24) | ((in[38] & 0xFFF) << 40))) << ntz + out[45] + out[47] = int64((in[38] >> 12)) << ntz + out[46] + out[48] = int64((in[39] >> 0) & 0xFFFFFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[39] >> 52) | ((in[40] & 0xFFFFFFFFFF) << 12))) << ntz + out[48] + out[50] = int64(((in[40] >> 40) | ((in[41] & 0xFFFFFFF) << 24))) << ntz + out[49] + out[51] = int64(((in[41] >> 28) | ((in[42] & 0xFFFF) << 36))) << ntz + out[50] + out[52] = int64(((in[42] >> 16) | ((in[43] & 0xF) << 48))) << ntz + out[51] + out[53] = int64((in[43] >> 4) & 0xFFFFFFFFFFFFF) << ntz + out[52] + out[54] = int64(((in[43] >> 56) | ((in[44] & 0xFFFFFFFFFFF) << 8))) << ntz + out[53] + out[55] = int64(((in[44] >> 44) | ((in[45] & 0xFFFFFFFF) << 20))) << ntz + out[54] + out[56] = int64(((in[45] >> 32) | ((in[46] & 0xFFFFF) << 32))) << ntz + out[55] + out[57] = int64(((in[46] >> 20) | ((in[47] & 0xFF) << 44))) << ntz + out[56] + out[58] = int64((in[47] >> 8) & 0xFFFFFFFFFFFFF) << ntz + out[57] + out[59] = int64(((in[47] >> 60) | ((in[48] & 0xFFFFFFFFFFFF) << 4))) << ntz + out[58] + out[60] = int64(((in[48] >> 48) | ((in[49] & 0xFFFFFFFFF) << 16))) << ntz + out[59] + out[61] = int64(((in[49] >> 36) | ((in[50] & 0xFFFFFF) << 28))) << ntz + out[60] + out[62] = int64(((in[50] >> 24) | ((in[51] & 0xFFF) << 40))) << ntz + out[61] + out[63] = int64((in[51] >> 12)) << ntz + out[62] +} + +func deltaunpack_int64_53(initoffset int64, in *[53]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 53) | ((in[1] & 0x3FFFFFFFFFF) << 11))) << ntz + out[0] + out[2] = int64(((in[1] >> 42) | ((in[2] & 0x7FFFFFFF) << 22))) << ntz + out[1] + out[3] = int64(((in[2] >> 31) | ((in[3] & 0xFFFFF) << 33))) << ntz + out[2] + out[4] = int64(((in[3] >> 20) | ((in[4] & 0x1FF) << 44))) << ntz + out[3] + out[5] = int64((in[4] >> 9) & 0x1FFFFFFFFFFFFF) << ntz + out[4] + out[6] = int64(((in[4] >> 62) | ((in[5] & 0x7FFFFFFFFFFFF) << 2))) << ntz + out[5] + out[7] = int64(((in[5] >> 51) | ((in[6] & 0xFFFFFFFFFF) << 13))) << ntz + out[6] + out[8] = int64(((in[6] >> 40) | ((in[7] & 0x1FFFFFFF) << 24))) << ntz + out[7] + out[9] = int64(((in[7] >> 29) | ((in[8] & 0x3FFFF) << 35))) << ntz + out[8] + out[10] = int64(((in[8] >> 18) | ((in[9] & 0x7F) << 46))) << ntz + out[9] + out[11] = int64((in[9] >> 7) & 0x1FFFFFFFFFFFFF) << ntz + out[10] + out[12] = int64(((in[9] >> 60) | ((in[10] & 0x1FFFFFFFFFFFF) << 4))) << ntz + out[11] + out[13] = int64(((in[10] >> 49) | ((in[11] & 0x3FFFFFFFFF) << 15))) << ntz + out[12] + out[14] = int64(((in[11] >> 38) | ((in[12] & 0x7FFFFFF) << 26))) << ntz + out[13] + out[15] = int64(((in[12] >> 27) | ((in[13] & 0xFFFF) << 37))) << ntz + out[14] + out[16] = int64(((in[13] >> 16) | ((in[14] & 0x1F) << 48))) << ntz + out[15] + out[17] = int64((in[14] >> 5) & 0x1FFFFFFFFFFFFF) << ntz + out[16] + out[18] = int64(((in[14] >> 58) | ((in[15] & 0x7FFFFFFFFFFF) << 6))) << ntz + out[17] + out[19] = int64(((in[15] >> 47) | ((in[16] & 0xFFFFFFFFF) << 17))) << ntz + out[18] + out[20] = int64(((in[16] >> 36) | ((in[17] & 0x1FFFFFF) << 28))) << ntz + out[19] + out[21] = int64(((in[17] >> 25) | ((in[18] & 0x3FFF) << 39))) << ntz + out[20] + out[22] = int64(((in[18] >> 14) | ((in[19] & 0x7) << 50))) << ntz + out[21] + out[23] = int64((in[19] >> 3) & 0x1FFFFFFFFFFFFF) << ntz + out[22] + out[24] = int64(((in[19] >> 56) | ((in[20] & 0x1FFFFFFFFFFF) << 8))) << ntz + out[23] + out[25] = int64(((in[20] >> 45) | ((in[21] & 0x3FFFFFFFF) << 19))) << ntz + out[24] + out[26] = int64(((in[21] >> 34) | ((in[22] & 0x7FFFFF) << 30))) << ntz + out[25] + out[27] = int64(((in[22] >> 23) | ((in[23] & 0xFFF) << 41))) << ntz + out[26] + out[28] = int64(((in[23] >> 12) | ((in[24] & 0x1) << 52))) << ntz + out[27] + out[29] = int64((in[24] >> 1) & 0x1FFFFFFFFFFFFF) << ntz + out[28] + out[30] = int64(((in[24] >> 54) | ((in[25] & 0x7FFFFFFFFFF) << 10))) << ntz + out[29] + out[31] = int64(((in[25] >> 43) | ((in[26] & 0xFFFFFFFF) << 21))) << ntz + out[30] + out[32] = int64(((in[26] >> 32) | ((in[27] & 0x1FFFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[27] >> 21) | ((in[28] & 0x3FF) << 43))) << ntz + out[32] + out[34] = int64((in[28] >> 10) & 0x1FFFFFFFFFFFFF) << ntz + out[33] + out[35] = int64(((in[28] >> 63) | ((in[29] & 0xFFFFFFFFFFFFF) << 1))) << ntz + out[34] + out[36] = int64(((in[29] >> 52) | ((in[30] & 0x1FFFFFFFFFF) << 12))) << ntz + out[35] + out[37] = int64(((in[30] >> 41) | ((in[31] & 0x3FFFFFFF) << 23))) << ntz + out[36] + out[38] = int64(((in[31] >> 30) | ((in[32] & 0x7FFFF) << 34))) << ntz + out[37] + out[39] = int64(((in[32] >> 19) | ((in[33] & 0xFF) << 45))) << ntz + out[38] + out[40] = int64((in[33] >> 8) & 0x1FFFFFFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFFFFF) << 3))) << ntz + out[40] + out[42] = int64(((in[34] >> 50) | ((in[35] & 0x7FFFFFFFFF) << 14))) << ntz + out[41] + out[43] = int64(((in[35] >> 39) | ((in[36] & 0xFFFFFFF) << 25))) << ntz + out[42] + out[44] = int64(((in[36] >> 28) | ((in[37] & 0x1FFFF) << 36))) << ntz + out[43] + out[45] = int64(((in[37] >> 17) | ((in[38] & 0x3F) << 47))) << ntz + out[44] + out[46] = int64((in[38] >> 6) & 0x1FFFFFFFFFFFFF) << ntz + out[45] + out[47] = int64(((in[38] >> 59) | ((in[39] & 0xFFFFFFFFFFFF) << 5))) << ntz + out[46] + out[48] = int64(((in[39] >> 48) | ((in[40] & 0x1FFFFFFFFF) << 16))) << ntz + out[47] + out[49] = int64(((in[40] >> 37) | ((in[41] & 0x3FFFFFF) << 27))) << ntz + out[48] + out[50] = int64(((in[41] >> 26) | ((in[42] & 0x7FFF) << 38))) << ntz + out[49] + out[51] = int64(((in[42] >> 15) | ((in[43] & 0xF) << 49))) << ntz + out[50] + out[52] = int64((in[43] >> 4) & 0x1FFFFFFFFFFFFF) << ntz + out[51] + out[53] = int64(((in[43] >> 57) | ((in[44] & 0x3FFFFFFFFFFF) << 7))) << ntz + out[52] + out[54] = int64(((in[44] >> 46) | ((in[45] & 0x7FFFFFFFF) << 18))) << ntz + out[53] + out[55] = int64(((in[45] >> 35) | ((in[46] & 0xFFFFFF) << 29))) << ntz + out[54] + out[56] = int64(((in[46] >> 24) | ((in[47] & 0x1FFF) << 40))) << ntz + out[55] + out[57] = int64(((in[47] >> 13) | ((in[48] & 0x3) << 51))) << ntz + out[56] + out[58] = int64((in[48] >> 2) & 0x1FFFFFFFFFFFFF) << ntz + out[57] + out[59] = int64(((in[48] >> 55) | ((in[49] & 0xFFFFFFFFFFF) << 9))) << ntz + out[58] + out[60] = int64(((in[49] >> 44) | ((in[50] & 0x1FFFFFFFF) << 20))) << ntz + out[59] + out[61] = int64(((in[50] >> 33) | ((in[51] & 0x3FFFFF) << 31))) << ntz + out[60] + out[62] = int64(((in[51] >> 22) | ((in[52] & 0x7FF) << 42))) << ntz + out[61] + out[63] = int64((in[52] >> 11)) << ntz + out[62] +} + +func deltaunpack_int64_54(initoffset int64, in *[54]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 54) | ((in[1] & 0xFFFFFFFFFFF) << 10))) << ntz + out[0] + out[2] = int64(((in[1] >> 44) | ((in[2] & 0x3FFFFFFFF) << 20))) << ntz + out[1] + out[3] = int64(((in[2] >> 34) | ((in[3] & 0xFFFFFF) << 30))) << ntz + out[2] + out[4] = int64(((in[3] >> 24) | ((in[4] & 0x3FFF) << 40))) << ntz + out[3] + out[5] = int64(((in[4] >> 14) | ((in[5] & 0xF) << 50))) << ntz + out[4] + out[6] = int64((in[5] >> 4) & 0x3FFFFFFFFFFFFF) << ntz + out[5] + out[7] = int64(((in[5] >> 58) | ((in[6] & 0xFFFFFFFFFFFF) << 6))) << ntz + out[6] + out[8] = int64(((in[6] >> 48) | ((in[7] & 0x3FFFFFFFFF) << 16))) << ntz + out[7] + out[9] = int64(((in[7] >> 38) | ((in[8] & 0xFFFFFFF) << 26))) << ntz + out[8] + out[10] = int64(((in[8] >> 28) | ((in[9] & 0x3FFFF) << 36))) << ntz + out[9] + out[11] = int64(((in[9] >> 18) | ((in[10] & 0xFF) << 46))) << ntz + out[10] + out[12] = int64((in[10] >> 8) & 0x3FFFFFFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[10] >> 62) | ((in[11] & 0xFFFFFFFFFFFFF) << 2))) << ntz + out[12] + out[14] = int64(((in[11] >> 52) | ((in[12] & 0x3FFFFFFFFFF) << 12))) << ntz + out[13] + out[15] = int64(((in[12] >> 42) | ((in[13] & 0xFFFFFFFF) << 22))) << ntz + out[14] + out[16] = int64(((in[13] >> 32) | ((in[14] & 0x3FFFFF) << 32))) << ntz + out[15] + out[17] = int64(((in[14] >> 22) | ((in[15] & 0xFFF) << 42))) << ntz + out[16] + out[18] = int64(((in[15] >> 12) | ((in[16] & 0x3) << 52))) << ntz + out[17] + out[19] = int64((in[16] >> 2) & 0x3FFFFFFFFFFFFF) << ntz + out[18] + out[20] = int64(((in[16] >> 56) | ((in[17] & 0x3FFFFFFFFFFF) << 8))) << ntz + out[19] + out[21] = int64(((in[17] >> 46) | ((in[18] & 0xFFFFFFFFF) << 18))) << ntz + out[20] + out[22] = int64(((in[18] >> 36) | ((in[19] & 0x3FFFFFF) << 28))) << ntz + out[21] + out[23] = int64(((in[19] >> 26) | ((in[20] & 0xFFFF) << 38))) << ntz + out[22] + out[24] = int64(((in[20] >> 16) | ((in[21] & 0x3F) << 48))) << ntz + out[23] + out[25] = int64((in[21] >> 6) & 0x3FFFFFFFFFFFFF) << ntz + out[24] + out[26] = int64(((in[21] >> 60) | ((in[22] & 0x3FFFFFFFFFFFF) << 4))) << ntz + out[25] + out[27] = int64(((in[22] >> 50) | ((in[23] & 0xFFFFFFFFFF) << 14))) << ntz + out[26] + out[28] = int64(((in[23] >> 40) | ((in[24] & 0x3FFFFFFF) << 24))) << ntz + out[27] + out[29] = int64(((in[24] >> 30) | ((in[25] & 0xFFFFF) << 34))) << ntz + out[28] + out[30] = int64(((in[25] >> 20) | ((in[26] & 0x3FF) << 44))) << ntz + out[29] + out[31] = int64((in[26] >> 10)) << ntz + out[30] + out[32] = int64((in[27] >> 0) & 0x3FFFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[27] >> 54) | ((in[28] & 0xFFFFFFFFFFF) << 10))) << ntz + out[32] + out[34] = int64(((in[28] >> 44) | ((in[29] & 0x3FFFFFFFF) << 20))) << ntz + out[33] + out[35] = int64(((in[29] >> 34) | ((in[30] & 0xFFFFFF) << 30))) << ntz + out[34] + out[36] = int64(((in[30] >> 24) | ((in[31] & 0x3FFF) << 40))) << ntz + out[35] + out[37] = int64(((in[31] >> 14) | ((in[32] & 0xF) << 50))) << ntz + out[36] + out[38] = int64((in[32] >> 4) & 0x3FFFFFFFFFFFFF) << ntz + out[37] + out[39] = int64(((in[32] >> 58) | ((in[33] & 0xFFFFFFFFFFFF) << 6))) << ntz + out[38] + out[40] = int64(((in[33] >> 48) | ((in[34] & 0x3FFFFFFFFF) << 16))) << ntz + out[39] + out[41] = int64(((in[34] >> 38) | ((in[35] & 0xFFFFFFF) << 26))) << ntz + out[40] + out[42] = int64(((in[35] >> 28) | ((in[36] & 0x3FFFF) << 36))) << ntz + out[41] + out[43] = int64(((in[36] >> 18) | ((in[37] & 0xFF) << 46))) << ntz + out[42] + out[44] = int64((in[37] >> 8) & 0x3FFFFFFFFFFFFF) << ntz + out[43] + out[45] = int64(((in[37] >> 62) | ((in[38] & 0xFFFFFFFFFFFFF) << 2))) << ntz + out[44] + out[46] = int64(((in[38] >> 52) | ((in[39] & 0x3FFFFFFFFFF) << 12))) << ntz + out[45] + out[47] = int64(((in[39] >> 42) | ((in[40] & 0xFFFFFFFF) << 22))) << ntz + out[46] + out[48] = int64(((in[40] >> 32) | ((in[41] & 0x3FFFFF) << 32))) << ntz + out[47] + out[49] = int64(((in[41] >> 22) | ((in[42] & 0xFFF) << 42))) << ntz + out[48] + out[50] = int64(((in[42] >> 12) | ((in[43] & 0x3) << 52))) << ntz + out[49] + out[51] = int64((in[43] >> 2) & 0x3FFFFFFFFFFFFF) << ntz + out[50] + out[52] = int64(((in[43] >> 56) | ((in[44] & 0x3FFFFFFFFFFF) << 8))) << ntz + out[51] + out[53] = int64(((in[44] >> 46) | ((in[45] & 0xFFFFFFFFF) << 18))) << ntz + out[52] + out[54] = int64(((in[45] >> 36) | ((in[46] & 0x3FFFFFF) << 28))) << ntz + out[53] + out[55] = int64(((in[46] >> 26) | ((in[47] & 0xFFFF) << 38))) << ntz + out[54] + out[56] = int64(((in[47] >> 16) | ((in[48] & 0x3F) << 48))) << ntz + out[55] + out[57] = int64((in[48] >> 6) & 0x3FFFFFFFFFFFFF) << ntz + out[56] + out[58] = int64(((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFF) << 4))) << ntz + out[57] + out[59] = int64(((in[49] >> 50) | ((in[50] & 0xFFFFFFFFFF) << 14))) << ntz + out[58] + out[60] = int64(((in[50] >> 40) | ((in[51] & 0x3FFFFFFF) << 24))) << ntz + out[59] + out[61] = int64(((in[51] >> 30) | ((in[52] & 0xFFFFF) << 34))) << ntz + out[60] + out[62] = int64(((in[52] >> 20) | ((in[53] & 0x3FF) << 44))) << ntz + out[61] + out[63] = int64((in[53] >> 10)) << ntz + out[62] +} + +func deltaunpack_int64_55(initoffset int64, in *[55]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 55) | ((in[1] & 0x3FFFFFFFFFFF) << 9))) << ntz + out[0] + out[2] = int64(((in[1] >> 46) | ((in[2] & 0x1FFFFFFFFF) << 18))) << ntz + out[1] + out[3] = int64(((in[2] >> 37) | ((in[3] & 0xFFFFFFF) << 27))) << ntz + out[2] + out[4] = int64(((in[3] >> 28) | ((in[4] & 0x7FFFF) << 36))) << ntz + out[3] + out[5] = int64(((in[4] >> 19) | ((in[5] & 0x3FF) << 45))) << ntz + out[4] + out[6] = int64(((in[5] >> 10) | ((in[6] & 0x1) << 54))) << ntz + out[5] + out[7] = int64((in[6] >> 1) & 0x7FFFFFFFFFFFFF) << ntz + out[6] + out[8] = int64(((in[6] >> 56) | ((in[7] & 0x7FFFFFFFFFFF) << 8))) << ntz + out[7] + out[9] = int64(((in[7] >> 47) | ((in[8] & 0x3FFFFFFFFF) << 17))) << ntz + out[8] + out[10] = int64(((in[8] >> 38) | ((in[9] & 0x1FFFFFFF) << 26))) << ntz + out[9] + out[11] = int64(((in[9] >> 29) | ((in[10] & 0xFFFFF) << 35))) << ntz + out[10] + out[12] = int64(((in[10] >> 20) | ((in[11] & 0x7FF) << 44))) << ntz + out[11] + out[13] = int64(((in[11] >> 11) | ((in[12] & 0x3) << 53))) << ntz + out[12] + out[14] = int64((in[12] >> 2) & 0x7FFFFFFFFFFFFF) << ntz + out[13] + out[15] = int64(((in[12] >> 57) | ((in[13] & 0xFFFFFFFFFFFF) << 7))) << ntz + out[14] + out[16] = int64(((in[13] >> 48) | ((in[14] & 0x7FFFFFFFFF) << 16))) << ntz + out[15] + out[17] = int64(((in[14] >> 39) | ((in[15] & 0x3FFFFFFF) << 25))) << ntz + out[16] + out[18] = int64(((in[15] >> 30) | ((in[16] & 0x1FFFFF) << 34))) << ntz + out[17] + out[19] = int64(((in[16] >> 21) | ((in[17] & 0xFFF) << 43))) << ntz + out[18] + out[20] = int64(((in[17] >> 12) | ((in[18] & 0x7) << 52))) << ntz + out[19] + out[21] = int64((in[18] >> 3) & 0x7FFFFFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[18] >> 58) | ((in[19] & 0x1FFFFFFFFFFFF) << 6))) << ntz + out[21] + out[23] = int64(((in[19] >> 49) | ((in[20] & 0xFFFFFFFFFF) << 15))) << ntz + out[22] + out[24] = int64(((in[20] >> 40) | ((in[21] & 0x7FFFFFFF) << 24))) << ntz + out[23] + out[25] = int64(((in[21] >> 31) | ((in[22] & 0x3FFFFF) << 33))) << ntz + out[24] + out[26] = int64(((in[22] >> 22) | ((in[23] & 0x1FFF) << 42))) << ntz + out[25] + out[27] = int64(((in[23] >> 13) | ((in[24] & 0xF) << 51))) << ntz + out[26] + out[28] = int64((in[24] >> 4) & 0x7FFFFFFFFFFFFF) << ntz + out[27] + out[29] = int64(((in[24] >> 59) | ((in[25] & 0x3FFFFFFFFFFFF) << 5))) << ntz + out[28] + out[30] = int64(((in[25] >> 50) | ((in[26] & 0x1FFFFFFFFFF) << 14))) << ntz + out[29] + out[31] = int64(((in[26] >> 41) | ((in[27] & 0xFFFFFFFF) << 23))) << ntz + out[30] + out[32] = int64(((in[27] >> 32) | ((in[28] & 0x7FFFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[28] >> 23) | ((in[29] & 0x3FFF) << 41))) << ntz + out[32] + out[34] = int64(((in[29] >> 14) | ((in[30] & 0x1F) << 50))) << ntz + out[33] + out[35] = int64((in[30] >> 5) & 0x7FFFFFFFFFFFFF) << ntz + out[34] + out[36] = int64(((in[30] >> 60) | ((in[31] & 0x7FFFFFFFFFFFF) << 4))) << ntz + out[35] + out[37] = int64(((in[31] >> 51) | ((in[32] & 0x3FFFFFFFFFF) << 13))) << ntz + out[36] + out[38] = int64(((in[32] >> 42) | ((in[33] & 0x1FFFFFFFF) << 22))) << ntz + out[37] + out[39] = int64(((in[33] >> 33) | ((in[34] & 0xFFFFFF) << 31))) << ntz + out[38] + out[40] = int64(((in[34] >> 24) | ((in[35] & 0x7FFF) << 40))) << ntz + out[39] + out[41] = int64(((in[35] >> 15) | ((in[36] & 0x3F) << 49))) << ntz + out[40] + out[42] = int64((in[36] >> 6) & 0x7FFFFFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFFFFF) << 3))) << ntz + out[42] + out[44] = int64(((in[37] >> 52) | ((in[38] & 0x7FFFFFFFFFF) << 12))) << ntz + out[43] + out[45] = int64(((in[38] >> 43) | ((in[39] & 0x3FFFFFFFF) << 21))) << ntz + out[44] + out[46] = int64(((in[39] >> 34) | ((in[40] & 0x1FFFFFF) << 30))) << ntz + out[45] + out[47] = int64(((in[40] >> 25) | ((in[41] & 0xFFFF) << 39))) << ntz + out[46] + out[48] = int64(((in[41] >> 16) | ((in[42] & 0x7F) << 48))) << ntz + out[47] + out[49] = int64((in[42] >> 7) & 0x7FFFFFFFFFFFFF) << ntz + out[48] + out[50] = int64(((in[42] >> 62) | ((in[43] & 0x1FFFFFFFFFFFFF) << 2))) << ntz + out[49] + out[51] = int64(((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFFF) << 11))) << ntz + out[50] + out[52] = int64(((in[44] >> 44) | ((in[45] & 0x7FFFFFFFF) << 20))) << ntz + out[51] + out[53] = int64(((in[45] >> 35) | ((in[46] & 0x3FFFFFF) << 29))) << ntz + out[52] + out[54] = int64(((in[46] >> 26) | ((in[47] & 0x1FFFF) << 38))) << ntz + out[53] + out[55] = int64(((in[47] >> 17) | ((in[48] & 0xFF) << 47))) << ntz + out[54] + out[56] = int64((in[48] >> 8) & 0x7FFFFFFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[48] >> 63) | ((in[49] & 0x3FFFFFFFFFFFFF) << 1))) << ntz + out[56] + out[58] = int64(((in[49] >> 54) | ((in[50] & 0x1FFFFFFFFFFF) << 10))) << ntz + out[57] + out[59] = int64(((in[50] >> 45) | ((in[51] & 0xFFFFFFFFF) << 19))) << ntz + out[58] + out[60] = int64(((in[51] >> 36) | ((in[52] & 0x7FFFFFF) << 28))) << ntz + out[59] + out[61] = int64(((in[52] >> 27) | ((in[53] & 0x3FFFF) << 37))) << ntz + out[60] + out[62] = int64(((in[53] >> 18) | ((in[54] & 0x1FF) << 46))) << ntz + out[61] + out[63] = int64((in[54] >> 9)) << ntz + out[62] +} + +func deltaunpack_int64_56(initoffset int64, in *[56]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 56) | ((in[1] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[0] + out[2] = int64(((in[1] >> 48) | ((in[2] & 0xFFFFFFFFFF) << 16))) << ntz + out[1] + out[3] = int64(((in[2] >> 40) | ((in[3] & 0xFFFFFFFF) << 24))) << ntz + out[2] + out[4] = int64(((in[3] >> 32) | ((in[4] & 0xFFFFFF) << 32))) << ntz + out[3] + out[5] = int64(((in[4] >> 24) | ((in[5] & 0xFFFF) << 40))) << ntz + out[4] + out[6] = int64(((in[5] >> 16) | ((in[6] & 0xFF) << 48))) << ntz + out[5] + out[7] = int64((in[6] >> 8)) << ntz + out[6] + out[8] = int64((in[7] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + out[7] + out[9] = int64(((in[7] >> 56) | ((in[8] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[8] + out[10] = int64(((in[8] >> 48) | ((in[9] & 0xFFFFFFFFFF) << 16))) << ntz + out[9] + out[11] = int64(((in[9] >> 40) | ((in[10] & 0xFFFFFFFF) << 24))) << ntz + out[10] + out[12] = int64(((in[10] >> 32) | ((in[11] & 0xFFFFFF) << 32))) << ntz + out[11] + out[13] = int64(((in[11] >> 24) | ((in[12] & 0xFFFF) << 40))) << ntz + out[12] + out[14] = int64(((in[12] >> 16) | ((in[13] & 0xFF) << 48))) << ntz + out[13] + out[15] = int64((in[13] >> 8)) << ntz + out[14] + out[16] = int64((in[14] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[14] >> 56) | ((in[15] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[16] + out[18] = int64(((in[15] >> 48) | ((in[16] & 0xFFFFFFFFFF) << 16))) << ntz + out[17] + out[19] = int64(((in[16] >> 40) | ((in[17] & 0xFFFFFFFF) << 24))) << ntz + out[18] + out[20] = int64(((in[17] >> 32) | ((in[18] & 0xFFFFFF) << 32))) << ntz + out[19] + out[21] = int64(((in[18] >> 24) | ((in[19] & 0xFFFF) << 40))) << ntz + out[20] + out[22] = int64(((in[19] >> 16) | ((in[20] & 0xFF) << 48))) << ntz + out[21] + out[23] = int64((in[20] >> 8)) << ntz + out[22] + out[24] = int64((in[21] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + out[23] + out[25] = int64(((in[21] >> 56) | ((in[22] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[24] + out[26] = int64(((in[22] >> 48) | ((in[23] & 0xFFFFFFFFFF) << 16))) << ntz + out[25] + out[27] = int64(((in[23] >> 40) | ((in[24] & 0xFFFFFFFF) << 24))) << ntz + out[26] + out[28] = int64(((in[24] >> 32) | ((in[25] & 0xFFFFFF) << 32))) << ntz + out[27] + out[29] = int64(((in[25] >> 24) | ((in[26] & 0xFFFF) << 40))) << ntz + out[28] + out[30] = int64(((in[26] >> 16) | ((in[27] & 0xFF) << 48))) << ntz + out[29] + out[31] = int64((in[27] >> 8)) << ntz + out[30] + out[32] = int64((in[28] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[28] >> 56) | ((in[29] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[32] + out[34] = int64(((in[29] >> 48) | ((in[30] & 0xFFFFFFFFFF) << 16))) << ntz + out[33] + out[35] = int64(((in[30] >> 40) | ((in[31] & 0xFFFFFFFF) << 24))) << ntz + out[34] + out[36] = int64(((in[31] >> 32) | ((in[32] & 0xFFFFFF) << 32))) << ntz + out[35] + out[37] = int64(((in[32] >> 24) | ((in[33] & 0xFFFF) << 40))) << ntz + out[36] + out[38] = int64(((in[33] >> 16) | ((in[34] & 0xFF) << 48))) << ntz + out[37] + out[39] = int64((in[34] >> 8)) << ntz + out[38] + out[40] = int64((in[35] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + out[39] + out[41] = int64(((in[35] >> 56) | ((in[36] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[40] + out[42] = int64(((in[36] >> 48) | ((in[37] & 0xFFFFFFFFFF) << 16))) << ntz + out[41] + out[43] = int64(((in[37] >> 40) | ((in[38] & 0xFFFFFFFF) << 24))) << ntz + out[42] + out[44] = int64(((in[38] >> 32) | ((in[39] & 0xFFFFFF) << 32))) << ntz + out[43] + out[45] = int64(((in[39] >> 24) | ((in[40] & 0xFFFF) << 40))) << ntz + out[44] + out[46] = int64(((in[40] >> 16) | ((in[41] & 0xFF) << 48))) << ntz + out[45] + out[47] = int64((in[41] >> 8)) << ntz + out[46] + out[48] = int64((in[42] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[42] >> 56) | ((in[43] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[48] + out[50] = int64(((in[43] >> 48) | ((in[44] & 0xFFFFFFFFFF) << 16))) << ntz + out[49] + out[51] = int64(((in[44] >> 40) | ((in[45] & 0xFFFFFFFF) << 24))) << ntz + out[50] + out[52] = int64(((in[45] >> 32) | ((in[46] & 0xFFFFFF) << 32))) << ntz + out[51] + out[53] = int64(((in[46] >> 24) | ((in[47] & 0xFFFF) << 40))) << ntz + out[52] + out[54] = int64(((in[47] >> 16) | ((in[48] & 0xFF) << 48))) << ntz + out[53] + out[55] = int64((in[48] >> 8)) << ntz + out[54] + out[56] = int64((in[49] >> 0) & 0xFFFFFFFFFFFFFF) << ntz + out[55] + out[57] = int64(((in[49] >> 56) | ((in[50] & 0xFFFFFFFFFFFF) << 8))) << ntz + out[56] + out[58] = int64(((in[50] >> 48) | ((in[51] & 0xFFFFFFFFFF) << 16))) << ntz + out[57] + out[59] = int64(((in[51] >> 40) | ((in[52] & 0xFFFFFFFF) << 24))) << ntz + out[58] + out[60] = int64(((in[52] >> 32) | ((in[53] & 0xFFFFFF) << 32))) << ntz + out[59] + out[61] = int64(((in[53] >> 24) | ((in[54] & 0xFFFF) << 40))) << ntz + out[60] + out[62] = int64(((in[54] >> 16) | ((in[55] & 0xFF) << 48))) << ntz + out[61] + out[63] = int64((in[55] >> 8)) << ntz + out[62] +} + +func deltaunpack_int64_57(initoffset int64, in *[57]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 57) | ((in[1] & 0x3FFFFFFFFFFFF) << 7))) << ntz + out[0] + out[2] = int64(((in[1] >> 50) | ((in[2] & 0x7FFFFFFFFFF) << 14))) << ntz + out[1] + out[3] = int64(((in[2] >> 43) | ((in[3] & 0xFFFFFFFFF) << 21))) << ntz + out[2] + out[4] = int64(((in[3] >> 36) | ((in[4] & 0x1FFFFFFF) << 28))) << ntz + out[3] + out[5] = int64(((in[4] >> 29) | ((in[5] & 0x3FFFFF) << 35))) << ntz + out[4] + out[6] = int64(((in[5] >> 22) | ((in[6] & 0x7FFF) << 42))) << ntz + out[5] + out[7] = int64(((in[6] >> 15) | ((in[7] & 0xFF) << 49))) << ntz + out[6] + out[8] = int64(((in[7] >> 8) | ((in[8] & 0x1) << 56))) << ntz + out[7] + out[9] = int64((in[8] >> 1) & 0x1FFFFFFFFFFFFFF) << ntz + out[8] + out[10] = int64(((in[8] >> 58) | ((in[9] & 0x7FFFFFFFFFFFF) << 6))) << ntz + out[9] + out[11] = int64(((in[9] >> 51) | ((in[10] & 0xFFFFFFFFFFF) << 13))) << ntz + out[10] + out[12] = int64(((in[10] >> 44) | ((in[11] & 0x1FFFFFFFFF) << 20))) << ntz + out[11] + out[13] = int64(((in[11] >> 37) | ((in[12] & 0x3FFFFFFF) << 27))) << ntz + out[12] + out[14] = int64(((in[12] >> 30) | ((in[13] & 0x7FFFFF) << 34))) << ntz + out[13] + out[15] = int64(((in[13] >> 23) | ((in[14] & 0xFFFF) << 41))) << ntz + out[14] + out[16] = int64(((in[14] >> 16) | ((in[15] & 0x1FF) << 48))) << ntz + out[15] + out[17] = int64(((in[15] >> 9) | ((in[16] & 0x3) << 55))) << ntz + out[16] + out[18] = int64((in[16] >> 2) & 0x1FFFFFFFFFFFFFF) << ntz + out[17] + out[19] = int64(((in[16] >> 59) | ((in[17] & 0xFFFFFFFFFFFFF) << 5))) << ntz + out[18] + out[20] = int64(((in[17] >> 52) | ((in[18] & 0x1FFFFFFFFFFF) << 12))) << ntz + out[19] + out[21] = int64(((in[18] >> 45) | ((in[19] & 0x3FFFFFFFFF) << 19))) << ntz + out[20] + out[22] = int64(((in[19] >> 38) | ((in[20] & 0x7FFFFFFF) << 26))) << ntz + out[21] + out[23] = int64(((in[20] >> 31) | ((in[21] & 0xFFFFFF) << 33))) << ntz + out[22] + out[24] = int64(((in[21] >> 24) | ((in[22] & 0x1FFFF) << 40))) << ntz + out[23] + out[25] = int64(((in[22] >> 17) | ((in[23] & 0x3FF) << 47))) << ntz + out[24] + out[26] = int64(((in[23] >> 10) | ((in[24] & 0x7) << 54))) << ntz + out[25] + out[27] = int64((in[24] >> 3) & 0x1FFFFFFFFFFFFFF) << ntz + out[26] + out[28] = int64(((in[24] >> 60) | ((in[25] & 0x1FFFFFFFFFFFFF) << 4))) << ntz + out[27] + out[29] = int64(((in[25] >> 53) | ((in[26] & 0x3FFFFFFFFFFF) << 11))) << ntz + out[28] + out[30] = int64(((in[26] >> 46) | ((in[27] & 0x7FFFFFFFFF) << 18))) << ntz + out[29] + out[31] = int64(((in[27] >> 39) | ((in[28] & 0xFFFFFFFF) << 25))) << ntz + out[30] + out[32] = int64(((in[28] >> 32) | ((in[29] & 0x1FFFFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[29] >> 25) | ((in[30] & 0x3FFFF) << 39))) << ntz + out[32] + out[34] = int64(((in[30] >> 18) | ((in[31] & 0x7FF) << 46))) << ntz + out[33] + out[35] = int64(((in[31] >> 11) | ((in[32] & 0xF) << 53))) << ntz + out[34] + out[36] = int64((in[32] >> 4) & 0x1FFFFFFFFFFFFFF) << ntz + out[35] + out[37] = int64(((in[32] >> 61) | ((in[33] & 0x3FFFFFFFFFFFFF) << 3))) << ntz + out[36] + out[38] = int64(((in[33] >> 54) | ((in[34] & 0x7FFFFFFFFFFF) << 10))) << ntz + out[37] + out[39] = int64(((in[34] >> 47) | ((in[35] & 0xFFFFFFFFFF) << 17))) << ntz + out[38] + out[40] = int64(((in[35] >> 40) | ((in[36] & 0x1FFFFFFFF) << 24))) << ntz + out[39] + out[41] = int64(((in[36] >> 33) | ((in[37] & 0x3FFFFFF) << 31))) << ntz + out[40] + out[42] = int64(((in[37] >> 26) | ((in[38] & 0x7FFFF) << 38))) << ntz + out[41] + out[43] = int64(((in[38] >> 19) | ((in[39] & 0xFFF) << 45))) << ntz + out[42] + out[44] = int64(((in[39] >> 12) | ((in[40] & 0x1F) << 52))) << ntz + out[43] + out[45] = int64((in[40] >> 5) & 0x1FFFFFFFFFFFFFF) << ntz + out[44] + out[46] = int64(((in[40] >> 62) | ((in[41] & 0x7FFFFFFFFFFFFF) << 2))) << ntz + out[45] + out[47] = int64(((in[41] >> 55) | ((in[42] & 0xFFFFFFFFFFFF) << 9))) << ntz + out[46] + out[48] = int64(((in[42] >> 48) | ((in[43] & 0x1FFFFFFFFFF) << 16))) << ntz + out[47] + out[49] = int64(((in[43] >> 41) | ((in[44] & 0x3FFFFFFFF) << 23))) << ntz + out[48] + out[50] = int64(((in[44] >> 34) | ((in[45] & 0x7FFFFFF) << 30))) << ntz + out[49] + out[51] = int64(((in[45] >> 27) | ((in[46] & 0xFFFFF) << 37))) << ntz + out[50] + out[52] = int64(((in[46] >> 20) | ((in[47] & 0x1FFF) << 44))) << ntz + out[51] + out[53] = int64(((in[47] >> 13) | ((in[48] & 0x3F) << 51))) << ntz + out[52] + out[54] = int64((in[48] >> 6) & 0x1FFFFFFFFFFFFFF) << ntz + out[53] + out[55] = int64(((in[48] >> 63) | ((in[49] & 0xFFFFFFFFFFFFFF) << 1))) << ntz + out[54] + out[56] = int64(((in[49] >> 56) | ((in[50] & 0x1FFFFFFFFFFFF) << 8))) << ntz + out[55] + out[57] = int64(((in[50] >> 49) | ((in[51] & 0x3FFFFFFFFFF) << 15))) << ntz + out[56] + out[58] = int64(((in[51] >> 42) | ((in[52] & 0x7FFFFFFFF) << 22))) << ntz + out[57] + out[59] = int64(((in[52] >> 35) | ((in[53] & 0xFFFFFFF) << 29))) << ntz + out[58] + out[60] = int64(((in[53] >> 28) | ((in[54] & 0x1FFFFF) << 36))) << ntz + out[59] + out[61] = int64(((in[54] >> 21) | ((in[55] & 0x3FFF) << 43))) << ntz + out[60] + out[62] = int64(((in[55] >> 14) | ((in[56] & 0x7F) << 50))) << ntz + out[61] + out[63] = int64((in[56] >> 7)) << ntz + out[62] +} + +func deltaunpack_int64_58(initoffset int64, in *[58]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 58) | ((in[1] & 0xFFFFFFFFFFFFF) << 6))) << ntz + out[0] + out[2] = int64(((in[1] >> 52) | ((in[2] & 0x3FFFFFFFFFFF) << 12))) << ntz + out[1] + out[3] = int64(((in[2] >> 46) | ((in[3] & 0xFFFFFFFFFF) << 18))) << ntz + out[2] + out[4] = int64(((in[3] >> 40) | ((in[4] & 0x3FFFFFFFF) << 24))) << ntz + out[3] + out[5] = int64(((in[4] >> 34) | ((in[5] & 0xFFFFFFF) << 30))) << ntz + out[4] + out[6] = int64(((in[5] >> 28) | ((in[6] & 0x3FFFFF) << 36))) << ntz + out[5] + out[7] = int64(((in[6] >> 22) | ((in[7] & 0xFFFF) << 42))) << ntz + out[6] + out[8] = int64(((in[7] >> 16) | ((in[8] & 0x3FF) << 48))) << ntz + out[7] + out[9] = int64(((in[8] >> 10) | ((in[9] & 0xF) << 54))) << ntz + out[8] + out[10] = int64((in[9] >> 4) & 0x3FFFFFFFFFFFFFF) << ntz + out[9] + out[11] = int64(((in[9] >> 62) | ((in[10] & 0xFFFFFFFFFFFFFF) << 2))) << ntz + out[10] + out[12] = int64(((in[10] >> 56) | ((in[11] & 0x3FFFFFFFFFFFF) << 8))) << ntz + out[11] + out[13] = int64(((in[11] >> 50) | ((in[12] & 0xFFFFFFFFFFF) << 14))) << ntz + out[12] + out[14] = int64(((in[12] >> 44) | ((in[13] & 0x3FFFFFFFFF) << 20))) << ntz + out[13] + out[15] = int64(((in[13] >> 38) | ((in[14] & 0xFFFFFFFF) << 26))) << ntz + out[14] + out[16] = int64(((in[14] >> 32) | ((in[15] & 0x3FFFFFF) << 32))) << ntz + out[15] + out[17] = int64(((in[15] >> 26) | ((in[16] & 0xFFFFF) << 38))) << ntz + out[16] + out[18] = int64(((in[16] >> 20) | ((in[17] & 0x3FFF) << 44))) << ntz + out[17] + out[19] = int64(((in[17] >> 14) | ((in[18] & 0xFF) << 50))) << ntz + out[18] + out[20] = int64(((in[18] >> 8) | ((in[19] & 0x3) << 56))) << ntz + out[19] + out[21] = int64((in[19] >> 2) & 0x3FFFFFFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[19] >> 60) | ((in[20] & 0x3FFFFFFFFFFFFF) << 4))) << ntz + out[21] + out[23] = int64(((in[20] >> 54) | ((in[21] & 0xFFFFFFFFFFFF) << 10))) << ntz + out[22] + out[24] = int64(((in[21] >> 48) | ((in[22] & 0x3FFFFFFFFFF) << 16))) << ntz + out[23] + out[25] = int64(((in[22] >> 42) | ((in[23] & 0xFFFFFFFFF) << 22))) << ntz + out[24] + out[26] = int64(((in[23] >> 36) | ((in[24] & 0x3FFFFFFF) << 28))) << ntz + out[25] + out[27] = int64(((in[24] >> 30) | ((in[25] & 0xFFFFFF) << 34))) << ntz + out[26] + out[28] = int64(((in[25] >> 24) | ((in[26] & 0x3FFFF) << 40))) << ntz + out[27] + out[29] = int64(((in[26] >> 18) | ((in[27] & 0xFFF) << 46))) << ntz + out[28] + out[30] = int64(((in[27] >> 12) | ((in[28] & 0x3F) << 52))) << ntz + out[29] + out[31] = int64((in[28] >> 6)) << ntz + out[30] + out[32] = int64((in[29] >> 0) & 0x3FFFFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[29] >> 58) | ((in[30] & 0xFFFFFFFFFFFFF) << 6))) << ntz + out[32] + out[34] = int64(((in[30] >> 52) | ((in[31] & 0x3FFFFFFFFFFF) << 12))) << ntz + out[33] + out[35] = int64(((in[31] >> 46) | ((in[32] & 0xFFFFFFFFFF) << 18))) << ntz + out[34] + out[36] = int64(((in[32] >> 40) | ((in[33] & 0x3FFFFFFFF) << 24))) << ntz + out[35] + out[37] = int64(((in[33] >> 34) | ((in[34] & 0xFFFFFFF) << 30))) << ntz + out[36] + out[38] = int64(((in[34] >> 28) | ((in[35] & 0x3FFFFF) << 36))) << ntz + out[37] + out[39] = int64(((in[35] >> 22) | ((in[36] & 0xFFFF) << 42))) << ntz + out[38] + out[40] = int64(((in[36] >> 16) | ((in[37] & 0x3FF) << 48))) << ntz + out[39] + out[41] = int64(((in[37] >> 10) | ((in[38] & 0xF) << 54))) << ntz + out[40] + out[42] = int64((in[38] >> 4) & 0x3FFFFFFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[38] >> 62) | ((in[39] & 0xFFFFFFFFFFFFFF) << 2))) << ntz + out[42] + out[44] = int64(((in[39] >> 56) | ((in[40] & 0x3FFFFFFFFFFFF) << 8))) << ntz + out[43] + out[45] = int64(((in[40] >> 50) | ((in[41] & 0xFFFFFFFFFFF) << 14))) << ntz + out[44] + out[46] = int64(((in[41] >> 44) | ((in[42] & 0x3FFFFFFFFF) << 20))) << ntz + out[45] + out[47] = int64(((in[42] >> 38) | ((in[43] & 0xFFFFFFFF) << 26))) << ntz + out[46] + out[48] = int64(((in[43] >> 32) | ((in[44] & 0x3FFFFFF) << 32))) << ntz + out[47] + out[49] = int64(((in[44] >> 26) | ((in[45] & 0xFFFFF) << 38))) << ntz + out[48] + out[50] = int64(((in[45] >> 20) | ((in[46] & 0x3FFF) << 44))) << ntz + out[49] + out[51] = int64(((in[46] >> 14) | ((in[47] & 0xFF) << 50))) << ntz + out[50] + out[52] = int64(((in[47] >> 8) | ((in[48] & 0x3) << 56))) << ntz + out[51] + out[53] = int64((in[48] >> 2) & 0x3FFFFFFFFFFFFFF) << ntz + out[52] + out[54] = int64(((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFFF) << 4))) << ntz + out[53] + out[55] = int64(((in[49] >> 54) | ((in[50] & 0xFFFFFFFFFFFF) << 10))) << ntz + out[54] + out[56] = int64(((in[50] >> 48) | ((in[51] & 0x3FFFFFFFFFF) << 16))) << ntz + out[55] + out[57] = int64(((in[51] >> 42) | ((in[52] & 0xFFFFFFFFF) << 22))) << ntz + out[56] + out[58] = int64(((in[52] >> 36) | ((in[53] & 0x3FFFFFFF) << 28))) << ntz + out[57] + out[59] = int64(((in[53] >> 30) | ((in[54] & 0xFFFFFF) << 34))) << ntz + out[58] + out[60] = int64(((in[54] >> 24) | ((in[55] & 0x3FFFF) << 40))) << ntz + out[59] + out[61] = int64(((in[55] >> 18) | ((in[56] & 0xFFF) << 46))) << ntz + out[60] + out[62] = int64(((in[56] >> 12) | ((in[57] & 0x3F) << 52))) << ntz + out[61] + out[63] = int64((in[57] >> 6)) << ntz + out[62] +} + +func deltaunpack_int64_59(initoffset int64, in *[59]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 59) | ((in[1] & 0x3FFFFFFFFFFFFF) << 5))) << ntz + out[0] + out[2] = int64(((in[1] >> 54) | ((in[2] & 0x1FFFFFFFFFFFF) << 10))) << ntz + out[1] + out[3] = int64(((in[2] >> 49) | ((in[3] & 0xFFFFFFFFFFF) << 15))) << ntz + out[2] + out[4] = int64(((in[3] >> 44) | ((in[4] & 0x7FFFFFFFFF) << 20))) << ntz + out[3] + out[5] = int64(((in[4] >> 39) | ((in[5] & 0x3FFFFFFFF) << 25))) << ntz + out[4] + out[6] = int64(((in[5] >> 34) | ((in[6] & 0x1FFFFFFF) << 30))) << ntz + out[5] + out[7] = int64(((in[6] >> 29) | ((in[7] & 0xFFFFFF) << 35))) << ntz + out[6] + out[8] = int64(((in[7] >> 24) | ((in[8] & 0x7FFFF) << 40))) << ntz + out[7] + out[9] = int64(((in[8] >> 19) | ((in[9] & 0x3FFF) << 45))) << ntz + out[8] + out[10] = int64(((in[9] >> 14) | ((in[10] & 0x1FF) << 50))) << ntz + out[9] + out[11] = int64(((in[10] >> 9) | ((in[11] & 0xF) << 55))) << ntz + out[10] + out[12] = int64((in[11] >> 4) & 0x7FFFFFFFFFFFFFF) << ntz + out[11] + out[13] = int64(((in[11] >> 63) | ((in[12] & 0x3FFFFFFFFFFFFFF) << 1))) << ntz + out[12] + out[14] = int64(((in[12] >> 58) | ((in[13] & 0x1FFFFFFFFFFFFF) << 6))) << ntz + out[13] + out[15] = int64(((in[13] >> 53) | ((in[14] & 0xFFFFFFFFFFFF) << 11))) << ntz + out[14] + out[16] = int64(((in[14] >> 48) | ((in[15] & 0x7FFFFFFFFFF) << 16))) << ntz + out[15] + out[17] = int64(((in[15] >> 43) | ((in[16] & 0x3FFFFFFFFF) << 21))) << ntz + out[16] + out[18] = int64(((in[16] >> 38) | ((in[17] & 0x1FFFFFFFF) << 26))) << ntz + out[17] + out[19] = int64(((in[17] >> 33) | ((in[18] & 0xFFFFFFF) << 31))) << ntz + out[18] + out[20] = int64(((in[18] >> 28) | ((in[19] & 0x7FFFFF) << 36))) << ntz + out[19] + out[21] = int64(((in[19] >> 23) | ((in[20] & 0x3FFFF) << 41))) << ntz + out[20] + out[22] = int64(((in[20] >> 18) | ((in[21] & 0x1FFF) << 46))) << ntz + out[21] + out[23] = int64(((in[21] >> 13) | ((in[22] & 0xFF) << 51))) << ntz + out[22] + out[24] = int64(((in[22] >> 8) | ((in[23] & 0x7) << 56))) << ntz + out[23] + out[25] = int64((in[23] >> 3) & 0x7FFFFFFFFFFFFFF) << ntz + out[24] + out[26] = int64(((in[23] >> 62) | ((in[24] & 0x1FFFFFFFFFFFFFF) << 2))) << ntz + out[25] + out[27] = int64(((in[24] >> 57) | ((in[25] & 0xFFFFFFFFFFFFF) << 7))) << ntz + out[26] + out[28] = int64(((in[25] >> 52) | ((in[26] & 0x7FFFFFFFFFFF) << 12))) << ntz + out[27] + out[29] = int64(((in[26] >> 47) | ((in[27] & 0x3FFFFFFFFFF) << 17))) << ntz + out[28] + out[30] = int64(((in[27] >> 42) | ((in[28] & 0x1FFFFFFFFF) << 22))) << ntz + out[29] + out[31] = int64(((in[28] >> 37) | ((in[29] & 0xFFFFFFFF) << 27))) << ntz + out[30] + out[32] = int64(((in[29] >> 32) | ((in[30] & 0x7FFFFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[30] >> 27) | ((in[31] & 0x3FFFFF) << 37))) << ntz + out[32] + out[34] = int64(((in[31] >> 22) | ((in[32] & 0x1FFFF) << 42))) << ntz + out[33] + out[35] = int64(((in[32] >> 17) | ((in[33] & 0xFFF) << 47))) << ntz + out[34] + out[36] = int64(((in[33] >> 12) | ((in[34] & 0x7F) << 52))) << ntz + out[35] + out[37] = int64(((in[34] >> 7) | ((in[35] & 0x3) << 57))) << ntz + out[36] + out[38] = int64((in[35] >> 2) & 0x7FFFFFFFFFFFFFF) << ntz + out[37] + out[39] = int64(((in[35] >> 61) | ((in[36] & 0xFFFFFFFFFFFFFF) << 3))) << ntz + out[38] + out[40] = int64(((in[36] >> 56) | ((in[37] & 0x7FFFFFFFFFFFF) << 8))) << ntz + out[39] + out[41] = int64(((in[37] >> 51) | ((in[38] & 0x3FFFFFFFFFFF) << 13))) << ntz + out[40] + out[42] = int64(((in[38] >> 46) | ((in[39] & 0x1FFFFFFFFFF) << 18))) << ntz + out[41] + out[43] = int64(((in[39] >> 41) | ((in[40] & 0xFFFFFFFFF) << 23))) << ntz + out[42] + out[44] = int64(((in[40] >> 36) | ((in[41] & 0x7FFFFFFF) << 28))) << ntz + out[43] + out[45] = int64(((in[41] >> 31) | ((in[42] & 0x3FFFFFF) << 33))) << ntz + out[44] + out[46] = int64(((in[42] >> 26) | ((in[43] & 0x1FFFFF) << 38))) << ntz + out[45] + out[47] = int64(((in[43] >> 21) | ((in[44] & 0xFFFF) << 43))) << ntz + out[46] + out[48] = int64(((in[44] >> 16) | ((in[45] & 0x7FF) << 48))) << ntz + out[47] + out[49] = int64(((in[45] >> 11) | ((in[46] & 0x3F) << 53))) << ntz + out[48] + out[50] = int64(((in[46] >> 6) | ((in[47] & 0x1) << 58))) << ntz + out[49] + out[51] = int64((in[47] >> 1) & 0x7FFFFFFFFFFFFFF) << ntz + out[50] + out[52] = int64(((in[47] >> 60) | ((in[48] & 0x7FFFFFFFFFFFFF) << 4))) << ntz + out[51] + out[53] = int64(((in[48] >> 55) | ((in[49] & 0x3FFFFFFFFFFFF) << 9))) << ntz + out[52] + out[54] = int64(((in[49] >> 50) | ((in[50] & 0x1FFFFFFFFFFF) << 14))) << ntz + out[53] + out[55] = int64(((in[50] >> 45) | ((in[51] & 0xFFFFFFFFFF) << 19))) << ntz + out[54] + out[56] = int64(((in[51] >> 40) | ((in[52] & 0x7FFFFFFFF) << 24))) << ntz + out[55] + out[57] = int64(((in[52] >> 35) | ((in[53] & 0x3FFFFFFF) << 29))) << ntz + out[56] + out[58] = int64(((in[53] >> 30) | ((in[54] & 0x1FFFFFF) << 34))) << ntz + out[57] + out[59] = int64(((in[54] >> 25) | ((in[55] & 0xFFFFF) << 39))) << ntz + out[58] + out[60] = int64(((in[55] >> 20) | ((in[56] & 0x7FFF) << 44))) << ntz + out[59] + out[61] = int64(((in[56] >> 15) | ((in[57] & 0x3FF) << 49))) << ntz + out[60] + out[62] = int64(((in[57] >> 10) | ((in[58] & 0x1F) << 54))) << ntz + out[61] + out[63] = int64((in[58] >> 5)) << ntz + out[62] +} + +func deltaunpack_int64_60(initoffset int64, in *[60]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0xFFFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 60) | ((in[1] & 0xFFFFFFFFFFFFFF) << 4))) << ntz + out[0] + out[2] = int64(((in[1] >> 56) | ((in[2] & 0xFFFFFFFFFFFFF) << 8))) << ntz + out[1] + out[3] = int64(((in[2] >> 52) | ((in[3] & 0xFFFFFFFFFFFF) << 12))) << ntz + out[2] + out[4] = int64(((in[3] >> 48) | ((in[4] & 0xFFFFFFFFFFF) << 16))) << ntz + out[3] + out[5] = int64(((in[4] >> 44) | ((in[5] & 0xFFFFFFFFFF) << 20))) << ntz + out[4] + out[6] = int64(((in[5] >> 40) | ((in[6] & 0xFFFFFFFFF) << 24))) << ntz + out[5] + out[7] = int64(((in[6] >> 36) | ((in[7] & 0xFFFFFFFF) << 28))) << ntz + out[6] + out[8] = int64(((in[7] >> 32) | ((in[8] & 0xFFFFFFF) << 32))) << ntz + out[7] + out[9] = int64(((in[8] >> 28) | ((in[9] & 0xFFFFFF) << 36))) << ntz + out[8] + out[10] = int64(((in[9] >> 24) | ((in[10] & 0xFFFFF) << 40))) << ntz + out[9] + out[11] = int64(((in[10] >> 20) | ((in[11] & 0xFFFF) << 44))) << ntz + out[10] + out[12] = int64(((in[11] >> 16) | ((in[12] & 0xFFF) << 48))) << ntz + out[11] + out[13] = int64(((in[12] >> 12) | ((in[13] & 0xFF) << 52))) << ntz + out[12] + out[14] = int64(((in[13] >> 8) | ((in[14] & 0xF) << 56))) << ntz + out[13] + out[15] = int64((in[14] >> 4)) << ntz + out[14] + out[16] = int64((in[15] >> 0) & 0xFFFFFFFFFFFFFFF) << ntz + out[15] + out[17] = int64(((in[15] >> 60) | ((in[16] & 0xFFFFFFFFFFFFFF) << 4))) << ntz + out[16] + out[18] = int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFFFFFFFF) << 8))) << ntz + out[17] + out[19] = int64(((in[17] >> 52) | ((in[18] & 0xFFFFFFFFFFFF) << 12))) << ntz + out[18] + out[20] = int64(((in[18] >> 48) | ((in[19] & 0xFFFFFFFFFFF) << 16))) << ntz + out[19] + out[21] = int64(((in[19] >> 44) | ((in[20] & 0xFFFFFFFFFF) << 20))) << ntz + out[20] + out[22] = int64(((in[20] >> 40) | ((in[21] & 0xFFFFFFFFF) << 24))) << ntz + out[21] + out[23] = int64(((in[21] >> 36) | ((in[22] & 0xFFFFFFFF) << 28))) << ntz + out[22] + out[24] = int64(((in[22] >> 32) | ((in[23] & 0xFFFFFFF) << 32))) << ntz + out[23] + out[25] = int64(((in[23] >> 28) | ((in[24] & 0xFFFFFF) << 36))) << ntz + out[24] + out[26] = int64(((in[24] >> 24) | ((in[25] & 0xFFFFF) << 40))) << ntz + out[25] + out[27] = int64(((in[25] >> 20) | ((in[26] & 0xFFFF) << 44))) << ntz + out[26] + out[28] = int64(((in[26] >> 16) | ((in[27] & 0xFFF) << 48))) << ntz + out[27] + out[29] = int64(((in[27] >> 12) | ((in[28] & 0xFF) << 52))) << ntz + out[28] + out[30] = int64(((in[28] >> 8) | ((in[29] & 0xF) << 56))) << ntz + out[29] + out[31] = int64((in[29] >> 4)) << ntz + out[30] + out[32] = int64((in[30] >> 0) & 0xFFFFFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFFFFFF) << 4))) << ntz + out[32] + out[34] = int64(((in[31] >> 56) | ((in[32] & 0xFFFFFFFFFFFFF) << 8))) << ntz + out[33] + out[35] = int64(((in[32] >> 52) | ((in[33] & 0xFFFFFFFFFFFF) << 12))) << ntz + out[34] + out[36] = int64(((in[33] >> 48) | ((in[34] & 0xFFFFFFFFFFF) << 16))) << ntz + out[35] + out[37] = int64(((in[34] >> 44) | ((in[35] & 0xFFFFFFFFFF) << 20))) << ntz + out[36] + out[38] = int64(((in[35] >> 40) | ((in[36] & 0xFFFFFFFFF) << 24))) << ntz + out[37] + out[39] = int64(((in[36] >> 36) | ((in[37] & 0xFFFFFFFF) << 28))) << ntz + out[38] + out[40] = int64(((in[37] >> 32) | ((in[38] & 0xFFFFFFF) << 32))) << ntz + out[39] + out[41] = int64(((in[38] >> 28) | ((in[39] & 0xFFFFFF) << 36))) << ntz + out[40] + out[42] = int64(((in[39] >> 24) | ((in[40] & 0xFFFFF) << 40))) << ntz + out[41] + out[43] = int64(((in[40] >> 20) | ((in[41] & 0xFFFF) << 44))) << ntz + out[42] + out[44] = int64(((in[41] >> 16) | ((in[42] & 0xFFF) << 48))) << ntz + out[43] + out[45] = int64(((in[42] >> 12) | ((in[43] & 0xFF) << 52))) << ntz + out[44] + out[46] = int64(((in[43] >> 8) | ((in[44] & 0xF) << 56))) << ntz + out[45] + out[47] = int64((in[44] >> 4)) << ntz + out[46] + out[48] = int64((in[45] >> 0) & 0xFFFFFFFFFFFFFFF) << ntz + out[47] + out[49] = int64(((in[45] >> 60) | ((in[46] & 0xFFFFFFFFFFFFFF) << 4))) << ntz + out[48] + out[50] = int64(((in[46] >> 56) | ((in[47] & 0xFFFFFFFFFFFFF) << 8))) << ntz + out[49] + out[51] = int64(((in[47] >> 52) | ((in[48] & 0xFFFFFFFFFFFF) << 12))) << ntz + out[50] + out[52] = int64(((in[48] >> 48) | ((in[49] & 0xFFFFFFFFFFF) << 16))) << ntz + out[51] + out[53] = int64(((in[49] >> 44) | ((in[50] & 0xFFFFFFFFFF) << 20))) << ntz + out[52] + out[54] = int64(((in[50] >> 40) | ((in[51] & 0xFFFFFFFFF) << 24))) << ntz + out[53] + out[55] = int64(((in[51] >> 36) | ((in[52] & 0xFFFFFFFF) << 28))) << ntz + out[54] + out[56] = int64(((in[52] >> 32) | ((in[53] & 0xFFFFFFF) << 32))) << ntz + out[55] + out[57] = int64(((in[53] >> 28) | ((in[54] & 0xFFFFFF) << 36))) << ntz + out[56] + out[58] = int64(((in[54] >> 24) | ((in[55] & 0xFFFFF) << 40))) << ntz + out[57] + out[59] = int64(((in[55] >> 20) | ((in[56] & 0xFFFF) << 44))) << ntz + out[58] + out[60] = int64(((in[56] >> 16) | ((in[57] & 0xFFF) << 48))) << ntz + out[59] + out[61] = int64(((in[57] >> 12) | ((in[58] & 0xFF) << 52))) << ntz + out[60] + out[62] = int64(((in[58] >> 8) | ((in[59] & 0xF) << 56))) << ntz + out[61] + out[63] = int64((in[59] >> 4)) << ntz + out[62] +} + +func deltaunpack_int64_61(initoffset int64, in *[61]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x1FFFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 61) | ((in[1] & 0x3FFFFFFFFFFFFFF) << 3))) << ntz + out[0] + out[2] = int64(((in[1] >> 58) | ((in[2] & 0x7FFFFFFFFFFFFF) << 6))) << ntz + out[1] + out[3] = int64(((in[2] >> 55) | ((in[3] & 0xFFFFFFFFFFFFF) << 9))) << ntz + out[2] + out[4] = int64(((in[3] >> 52) | ((in[4] & 0x1FFFFFFFFFFFF) << 12))) << ntz + out[3] + out[5] = int64(((in[4] >> 49) | ((in[5] & 0x3FFFFFFFFFFF) << 15))) << ntz + out[4] + out[6] = int64(((in[5] >> 46) | ((in[6] & 0x7FFFFFFFFFF) << 18))) << ntz + out[5] + out[7] = int64(((in[6] >> 43) | ((in[7] & 0xFFFFFFFFFF) << 21))) << ntz + out[6] + out[8] = int64(((in[7] >> 40) | ((in[8] & 0x1FFFFFFFFF) << 24))) << ntz + out[7] + out[9] = int64(((in[8] >> 37) | ((in[9] & 0x3FFFFFFFF) << 27))) << ntz + out[8] + out[10] = int64(((in[9] >> 34) | ((in[10] & 0x7FFFFFFF) << 30))) << ntz + out[9] + out[11] = int64(((in[10] >> 31) | ((in[11] & 0xFFFFFFF) << 33))) << ntz + out[10] + out[12] = int64(((in[11] >> 28) | ((in[12] & 0x1FFFFFF) << 36))) << ntz + out[11] + out[13] = int64(((in[12] >> 25) | ((in[13] & 0x3FFFFF) << 39))) << ntz + out[12] + out[14] = int64(((in[13] >> 22) | ((in[14] & 0x7FFFF) << 42))) << ntz + out[13] + out[15] = int64(((in[14] >> 19) | ((in[15] & 0xFFFF) << 45))) << ntz + out[14] + out[16] = int64(((in[15] >> 16) | ((in[16] & 0x1FFF) << 48))) << ntz + out[15] + out[17] = int64(((in[16] >> 13) | ((in[17] & 0x3FF) << 51))) << ntz + out[16] + out[18] = int64(((in[17] >> 10) | ((in[18] & 0x7F) << 54))) << ntz + out[17] + out[19] = int64(((in[18] >> 7) | ((in[19] & 0xF) << 57))) << ntz + out[18] + out[20] = int64(((in[19] >> 4) | ((in[20] & 0x1) << 60))) << ntz + out[19] + out[21] = int64((in[20] >> 1) & 0x1FFFFFFFFFFFFFFF) << ntz + out[20] + out[22] = int64(((in[20] >> 62) | ((in[21] & 0x7FFFFFFFFFFFFFF) << 2))) << ntz + out[21] + out[23] = int64(((in[21] >> 59) | ((in[22] & 0xFFFFFFFFFFFFFF) << 5))) << ntz + out[22] + out[24] = int64(((in[22] >> 56) | ((in[23] & 0x1FFFFFFFFFFFFF) << 8))) << ntz + out[23] + out[25] = int64(((in[23] >> 53) | ((in[24] & 0x3FFFFFFFFFFFF) << 11))) << ntz + out[24] + out[26] = int64(((in[24] >> 50) | ((in[25] & 0x7FFFFFFFFFFF) << 14))) << ntz + out[25] + out[27] = int64(((in[25] >> 47) | ((in[26] & 0xFFFFFFFFFFF) << 17))) << ntz + out[26] + out[28] = int64(((in[26] >> 44) | ((in[27] & 0x1FFFFFFFFFF) << 20))) << ntz + out[27] + out[29] = int64(((in[27] >> 41) | ((in[28] & 0x3FFFFFFFFF) << 23))) << ntz + out[28] + out[30] = int64(((in[28] >> 38) | ((in[29] & 0x7FFFFFFFF) << 26))) << ntz + out[29] + out[31] = int64(((in[29] >> 35) | ((in[30] & 0xFFFFFFFF) << 29))) << ntz + out[30] + out[32] = int64(((in[30] >> 32) | ((in[31] & 0x1FFFFFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[31] >> 29) | ((in[32] & 0x3FFFFFF) << 35))) << ntz + out[32] + out[34] = int64(((in[32] >> 26) | ((in[33] & 0x7FFFFF) << 38))) << ntz + out[33] + out[35] = int64(((in[33] >> 23) | ((in[34] & 0xFFFFF) << 41))) << ntz + out[34] + out[36] = int64(((in[34] >> 20) | ((in[35] & 0x1FFFF) << 44))) << ntz + out[35] + out[37] = int64(((in[35] >> 17) | ((in[36] & 0x3FFF) << 47))) << ntz + out[36] + out[38] = int64(((in[36] >> 14) | ((in[37] & 0x7FF) << 50))) << ntz + out[37] + out[39] = int64(((in[37] >> 11) | ((in[38] & 0xFF) << 53))) << ntz + out[38] + out[40] = int64(((in[38] >> 8) | ((in[39] & 0x1F) << 56))) << ntz + out[39] + out[41] = int64(((in[39] >> 5) | ((in[40] & 0x3) << 59))) << ntz + out[40] + out[42] = int64((in[40] >> 2) & 0x1FFFFFFFFFFFFFFF) << ntz + out[41] + out[43] = int64(((in[40] >> 63) | ((in[41] & 0xFFFFFFFFFFFFFFF) << 1))) << ntz + out[42] + out[44] = int64(((in[41] >> 60) | ((in[42] & 0x1FFFFFFFFFFFFFF) << 4))) << ntz + out[43] + out[45] = int64(((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFFFFFF) << 7))) << ntz + out[44] + out[46] = int64(((in[43] >> 54) | ((in[44] & 0x7FFFFFFFFFFFF) << 10))) << ntz + out[45] + out[47] = int64(((in[44] >> 51) | ((in[45] & 0xFFFFFFFFFFFF) << 13))) << ntz + out[46] + out[48] = int64(((in[45] >> 48) | ((in[46] & 0x1FFFFFFFFFFF) << 16))) << ntz + out[47] + out[49] = int64(((in[46] >> 45) | ((in[47] & 0x3FFFFFFFFFF) << 19))) << ntz + out[48] + out[50] = int64(((in[47] >> 42) | ((in[48] & 0x7FFFFFFFFF) << 22))) << ntz + out[49] + out[51] = int64(((in[48] >> 39) | ((in[49] & 0xFFFFFFFFF) << 25))) << ntz + out[50] + out[52] = int64(((in[49] >> 36) | ((in[50] & 0x1FFFFFFFF) << 28))) << ntz + out[51] + out[53] = int64(((in[50] >> 33) | ((in[51] & 0x3FFFFFFF) << 31))) << ntz + out[52] + out[54] = int64(((in[51] >> 30) | ((in[52] & 0x7FFFFFF) << 34))) << ntz + out[53] + out[55] = int64(((in[52] >> 27) | ((in[53] & 0xFFFFFF) << 37))) << ntz + out[54] + out[56] = int64(((in[53] >> 24) | ((in[54] & 0x1FFFFF) << 40))) << ntz + out[55] + out[57] = int64(((in[54] >> 21) | ((in[55] & 0x3FFFF) << 43))) << ntz + out[56] + out[58] = int64(((in[55] >> 18) | ((in[56] & 0x7FFF) << 46))) << ntz + out[57] + out[59] = int64(((in[56] >> 15) | ((in[57] & 0xFFF) << 49))) << ntz + out[58] + out[60] = int64(((in[57] >> 12) | ((in[58] & 0x1FF) << 52))) << ntz + out[59] + out[61] = int64(((in[58] >> 9) | ((in[59] & 0x3F) << 55))) << ntz + out[60] + out[62] = int64(((in[59] >> 6) | ((in[60] & 0x7) << 58))) << ntz + out[61] + out[63] = int64((in[60] >> 3)) << ntz + out[62] +} + +func deltaunpack_int64_62(initoffset int64, in *[62]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x3FFFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 62) | ((in[1] & 0xFFFFFFFFFFFFFFF) << 2))) << ntz + out[0] + out[2] = int64(((in[1] >> 60) | ((in[2] & 0x3FFFFFFFFFFFFFF) << 4))) << ntz + out[1] + out[3] = int64(((in[2] >> 58) | ((in[3] & 0xFFFFFFFFFFFFFF) << 6))) << ntz + out[2] + out[4] = int64(((in[3] >> 56) | ((in[4] & 0x3FFFFFFFFFFFFF) << 8))) << ntz + out[3] + out[5] = int64(((in[4] >> 54) | ((in[5] & 0xFFFFFFFFFFFFF) << 10))) << ntz + out[4] + out[6] = int64(((in[5] >> 52) | ((in[6] & 0x3FFFFFFFFFFFF) << 12))) << ntz + out[5] + out[7] = int64(((in[6] >> 50) | ((in[7] & 0xFFFFFFFFFFFF) << 14))) << ntz + out[6] + out[8] = int64(((in[7] >> 48) | ((in[8] & 0x3FFFFFFFFFFF) << 16))) << ntz + out[7] + out[9] = int64(((in[8] >> 46) | ((in[9] & 0xFFFFFFFFFFF) << 18))) << ntz + out[8] + out[10] = int64(((in[9] >> 44) | ((in[10] & 0x3FFFFFFFFFF) << 20))) << ntz + out[9] + out[11] = int64(((in[10] >> 42) | ((in[11] & 0xFFFFFFFFFF) << 22))) << ntz + out[10] + out[12] = int64(((in[11] >> 40) | ((in[12] & 0x3FFFFFFFFF) << 24))) << ntz + out[11] + out[13] = int64(((in[12] >> 38) | ((in[13] & 0xFFFFFFFFF) << 26))) << ntz + out[12] + out[14] = int64(((in[13] >> 36) | ((in[14] & 0x3FFFFFFFF) << 28))) << ntz + out[13] + out[15] = int64(((in[14] >> 34) | ((in[15] & 0xFFFFFFFF) << 30))) << ntz + out[14] + out[16] = int64(((in[15] >> 32) | ((in[16] & 0x3FFFFFFF) << 32))) << ntz + out[15] + out[17] = int64(((in[16] >> 30) | ((in[17] & 0xFFFFFFF) << 34))) << ntz + out[16] + out[18] = int64(((in[17] >> 28) | ((in[18] & 0x3FFFFFF) << 36))) << ntz + out[17] + out[19] = int64(((in[18] >> 26) | ((in[19] & 0xFFFFFF) << 38))) << ntz + out[18] + out[20] = int64(((in[19] >> 24) | ((in[20] & 0x3FFFFF) << 40))) << ntz + out[19] + out[21] = int64(((in[20] >> 22) | ((in[21] & 0xFFFFF) << 42))) << ntz + out[20] + out[22] = int64(((in[21] >> 20) | ((in[22] & 0x3FFFF) << 44))) << ntz + out[21] + out[23] = int64(((in[22] >> 18) | ((in[23] & 0xFFFF) << 46))) << ntz + out[22] + out[24] = int64(((in[23] >> 16) | ((in[24] & 0x3FFF) << 48))) << ntz + out[23] + out[25] = int64(((in[24] >> 14) | ((in[25] & 0xFFF) << 50))) << ntz + out[24] + out[26] = int64(((in[25] >> 12) | ((in[26] & 0x3FF) << 52))) << ntz + out[25] + out[27] = int64(((in[26] >> 10) | ((in[27] & 0xFF) << 54))) << ntz + out[26] + out[28] = int64(((in[27] >> 8) | ((in[28] & 0x3F) << 56))) << ntz + out[27] + out[29] = int64(((in[28] >> 6) | ((in[29] & 0xF) << 58))) << ntz + out[28] + out[30] = int64(((in[29] >> 4) | ((in[30] & 0x3) << 60))) << ntz + out[29] + out[31] = int64((in[30] >> 2)) << ntz + out[30] + out[32] = int64((in[31] >> 0) & 0x3FFFFFFFFFFFFFFF) << ntz + out[31] + out[33] = int64(((in[31] >> 62) | ((in[32] & 0xFFFFFFFFFFFFFFF) << 2))) << ntz + out[32] + out[34] = int64(((in[32] >> 60) | ((in[33] & 0x3FFFFFFFFFFFFFF) << 4))) << ntz + out[33] + out[35] = int64(((in[33] >> 58) | ((in[34] & 0xFFFFFFFFFFFFFF) << 6))) << ntz + out[34] + out[36] = int64(((in[34] >> 56) | ((in[35] & 0x3FFFFFFFFFFFFF) << 8))) << ntz + out[35] + out[37] = int64(((in[35] >> 54) | ((in[36] & 0xFFFFFFFFFFFFF) << 10))) << ntz + out[36] + out[38] = int64(((in[36] >> 52) | ((in[37] & 0x3FFFFFFFFFFFF) << 12))) << ntz + out[37] + out[39] = int64(((in[37] >> 50) | ((in[38] & 0xFFFFFFFFFFFF) << 14))) << ntz + out[38] + out[40] = int64(((in[38] >> 48) | ((in[39] & 0x3FFFFFFFFFFF) << 16))) << ntz + out[39] + out[41] = int64(((in[39] >> 46) | ((in[40] & 0xFFFFFFFFFFF) << 18))) << ntz + out[40] + out[42] = int64(((in[40] >> 44) | ((in[41] & 0x3FFFFFFFFFF) << 20))) << ntz + out[41] + out[43] = int64(((in[41] >> 42) | ((in[42] & 0xFFFFFFFFFF) << 22))) << ntz + out[42] + out[44] = int64(((in[42] >> 40) | ((in[43] & 0x3FFFFFFFFF) << 24))) << ntz + out[43] + out[45] = int64(((in[43] >> 38) | ((in[44] & 0xFFFFFFFFF) << 26))) << ntz + out[44] + out[46] = int64(((in[44] >> 36) | ((in[45] & 0x3FFFFFFFF) << 28))) << ntz + out[45] + out[47] = int64(((in[45] >> 34) | ((in[46] & 0xFFFFFFFF) << 30))) << ntz + out[46] + out[48] = int64(((in[46] >> 32) | ((in[47] & 0x3FFFFFFF) << 32))) << ntz + out[47] + out[49] = int64(((in[47] >> 30) | ((in[48] & 0xFFFFFFF) << 34))) << ntz + out[48] + out[50] = int64(((in[48] >> 28) | ((in[49] & 0x3FFFFFF) << 36))) << ntz + out[49] + out[51] = int64(((in[49] >> 26) | ((in[50] & 0xFFFFFF) << 38))) << ntz + out[50] + out[52] = int64(((in[50] >> 24) | ((in[51] & 0x3FFFFF) << 40))) << ntz + out[51] + out[53] = int64(((in[51] >> 22) | ((in[52] & 0xFFFFF) << 42))) << ntz + out[52] + out[54] = int64(((in[52] >> 20) | ((in[53] & 0x3FFFF) << 44))) << ntz + out[53] + out[55] = int64(((in[53] >> 18) | ((in[54] & 0xFFFF) << 46))) << ntz + out[54] + out[56] = int64(((in[54] >> 16) | ((in[55] & 0x3FFF) << 48))) << ntz + out[55] + out[57] = int64(((in[55] >> 14) | ((in[56] & 0xFFF) << 50))) << ntz + out[56] + out[58] = int64(((in[56] >> 12) | ((in[57] & 0x3FF) << 52))) << ntz + out[57] + out[59] = int64(((in[57] >> 10) | ((in[58] & 0xFF) << 54))) << ntz + out[58] + out[60] = int64(((in[58] >> 8) | ((in[59] & 0x3F) << 56))) << ntz + out[59] + out[61] = int64(((in[59] >> 6) | ((in[60] & 0xF) << 58))) << ntz + out[60] + out[62] = int64(((in[60] >> 4) | ((in[61] & 0x3) << 60))) << ntz + out[61] + out[63] = int64((in[61] >> 2)) << ntz + out[62] +} + +func deltaunpack_int64_63(initoffset int64, in *[63]uint64, out *[64]int64, ntz int) { + out[0] = int64((in[0] >> 0) & 0x7FFFFFFFFFFFFFFF) << ntz + initoffset + out[1] = int64(((in[0] >> 63) | ((in[1] & 0x3FFFFFFFFFFFFFFF) << 1))) << ntz + out[0] + out[2] = int64(((in[1] >> 62) | ((in[2] & 0x1FFFFFFFFFFFFFFF) << 2))) << ntz + out[1] + out[3] = int64(((in[2] >> 61) | ((in[3] & 0xFFFFFFFFFFFFFFF) << 3))) << ntz + out[2] + out[4] = int64(((in[3] >> 60) | ((in[4] & 0x7FFFFFFFFFFFFFF) << 4))) << ntz + out[3] + out[5] = int64(((in[4] >> 59) | ((in[5] & 0x3FFFFFFFFFFFFFF) << 5))) << ntz + out[4] + out[6] = int64(((in[5] >> 58) | ((in[6] & 0x1FFFFFFFFFFFFFF) << 6))) << ntz + out[5] + out[7] = int64(((in[6] >> 57) | ((in[7] & 0xFFFFFFFFFFFFFF) << 7))) << ntz + out[6] + out[8] = int64(((in[7] >> 56) | ((in[8] & 0x7FFFFFFFFFFFFF) << 8))) << ntz + out[7] + out[9] = int64(((in[8] >> 55) | ((in[9] & 0x3FFFFFFFFFFFFF) << 9))) << ntz + out[8] + out[10] = int64(((in[9] >> 54) | ((in[10] & 0x1FFFFFFFFFFFFF) << 10))) << ntz + out[9] + out[11] = int64(((in[10] >> 53) | ((in[11] & 0xFFFFFFFFFFFFF) << 11))) << ntz + out[10] + out[12] = int64(((in[11] >> 52) | ((in[12] & 0x7FFFFFFFFFFFF) << 12))) << ntz + out[11] + out[13] = int64(((in[12] >> 51) | ((in[13] & 0x3FFFFFFFFFFFF) << 13))) << ntz + out[12] + out[14] = int64(((in[13] >> 50) | ((in[14] & 0x1FFFFFFFFFFFF) << 14))) << ntz + out[13] + out[15] = int64(((in[14] >> 49) | ((in[15] & 0xFFFFFFFFFFFF) << 15))) << ntz + out[14] + out[16] = int64(((in[15] >> 48) | ((in[16] & 0x7FFFFFFFFFFF) << 16))) << ntz + out[15] + out[17] = int64(((in[16] >> 47) | ((in[17] & 0x3FFFFFFFFFFF) << 17))) << ntz + out[16] + out[18] = int64(((in[17] >> 46) | ((in[18] & 0x1FFFFFFFFFFF) << 18))) << ntz + out[17] + out[19] = int64(((in[18] >> 45) | ((in[19] & 0xFFFFFFFFFFF) << 19))) << ntz + out[18] + out[20] = int64(((in[19] >> 44) | ((in[20] & 0x7FFFFFFFFFF) << 20))) << ntz + out[19] + out[21] = int64(((in[20] >> 43) | ((in[21] & 0x3FFFFFFFFFF) << 21))) << ntz + out[20] + out[22] = int64(((in[21] >> 42) | ((in[22] & 0x1FFFFFFFFFF) << 22))) << ntz + out[21] + out[23] = int64(((in[22] >> 41) | ((in[23] & 0xFFFFFFFFFF) << 23))) << ntz + out[22] + out[24] = int64(((in[23] >> 40) | ((in[24] & 0x7FFFFFFFFF) << 24))) << ntz + out[23] + out[25] = int64(((in[24] >> 39) | ((in[25] & 0x3FFFFFFFFF) << 25))) << ntz + out[24] + out[26] = int64(((in[25] >> 38) | ((in[26] & 0x1FFFFFFFFF) << 26))) << ntz + out[25] + out[27] = int64(((in[26] >> 37) | ((in[27] & 0xFFFFFFFFF) << 27))) << ntz + out[26] + out[28] = int64(((in[27] >> 36) | ((in[28] & 0x7FFFFFFFF) << 28))) << ntz + out[27] + out[29] = int64(((in[28] >> 35) | ((in[29] & 0x3FFFFFFFF) << 29))) << ntz + out[28] + out[30] = int64(((in[29] >> 34) | ((in[30] & 0x1FFFFFFFF) << 30))) << ntz + out[29] + out[31] = int64(((in[30] >> 33) | ((in[31] & 0xFFFFFFFF) << 31))) << ntz + out[30] + out[32] = int64(((in[31] >> 32) | ((in[32] & 0x7FFFFFFF) << 32))) << ntz + out[31] + out[33] = int64(((in[32] >> 31) | ((in[33] & 0x3FFFFFFF) << 33))) << ntz + out[32] + out[34] = int64(((in[33] >> 30) | ((in[34] & 0x1FFFFFFF) << 34))) << ntz + out[33] + out[35] = int64(((in[34] >> 29) | ((in[35] & 0xFFFFFFF) << 35))) << ntz + out[34] + out[36] = int64(((in[35] >> 28) | ((in[36] & 0x7FFFFFF) << 36))) << ntz + out[35] + out[37] = int64(((in[36] >> 27) | ((in[37] & 0x3FFFFFF) << 37))) << ntz + out[36] + out[38] = int64(((in[37] >> 26) | ((in[38] & 0x1FFFFFF) << 38))) << ntz + out[37] + out[39] = int64(((in[38] >> 25) | ((in[39] & 0xFFFFFF) << 39))) << ntz + out[38] + out[40] = int64(((in[39] >> 24) | ((in[40] & 0x7FFFFF) << 40))) << ntz + out[39] + out[41] = int64(((in[40] >> 23) | ((in[41] & 0x3FFFFF) << 41))) << ntz + out[40] + out[42] = int64(((in[41] >> 22) | ((in[42] & 0x1FFFFF) << 42))) << ntz + out[41] + out[43] = int64(((in[42] >> 21) | ((in[43] & 0xFFFFF) << 43))) << ntz + out[42] + out[44] = int64(((in[43] >> 20) | ((in[44] & 0x7FFFF) << 44))) << ntz + out[43] + out[45] = int64(((in[44] >> 19) | ((in[45] & 0x3FFFF) << 45))) << ntz + out[44] + out[46] = int64(((in[45] >> 18) | ((in[46] & 0x1FFFF) << 46))) << ntz + out[45] + out[47] = int64(((in[46] >> 17) | ((in[47] & 0xFFFF) << 47))) << ntz + out[46] + out[48] = int64(((in[47] >> 16) | ((in[48] & 0x7FFF) << 48))) << ntz + out[47] + out[49] = int64(((in[48] >> 15) | ((in[49] & 0x3FFF) << 49))) << ntz + out[48] + out[50] = int64(((in[49] >> 14) | ((in[50] & 0x1FFF) << 50))) << ntz + out[49] + out[51] = int64(((in[50] >> 13) | ((in[51] & 0xFFF) << 51))) << ntz + out[50] + out[52] = int64(((in[51] >> 12) | ((in[52] & 0x7FF) << 52))) << ntz + out[51] + out[53] = int64(((in[52] >> 11) | ((in[53] & 0x3FF) << 53))) << ntz + out[52] + out[54] = int64(((in[53] >> 10) | ((in[54] & 0x1FF) << 54))) << ntz + out[53] + out[55] = int64(((in[54] >> 9) | ((in[55] & 0xFF) << 55))) << ntz + out[54] + out[56] = int64(((in[55] >> 8) | ((in[56] & 0x7F) << 56))) << ntz + out[55] + out[57] = int64(((in[56] >> 7) | ((in[57] & 0x3F) << 57))) << ntz + out[56] + out[58] = int64(((in[57] >> 6) | ((in[58] & 0x1F) << 58))) << ntz + out[57] + out[59] = int64(((in[58] >> 5) | ((in[59] & 0xF) << 59))) << ntz + out[58] + out[60] = int64(((in[59] >> 4) | ((in[60] & 0x7) << 60))) << ntz + out[59] + out[61] = int64(((in[60] >> 3) | ((in[61] & 0x3) << 61))) << ntz + out[60] + out[62] = int64(((in[61] >> 2) | ((in[62] & 0x1) << 62))) << ntz + out[61] + out[63] = int64((in[62] >> 1)) << ntz + out[62] +} + +// --- zigzag + +// deltaPackZigzag_int64 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first, the difference is zigzag encoded. +// Caller must give the proper `bitlen` of the block +func deltaPackZigzag_int64(initoffset int64, in []int64, out []uint64, ntz, bitlen int) { + switch bitlen - ntz { + case 0: + deltapackzigzag_int64_0(initoffset, (*[64]int64)(in), (*[0]uint64)(out), ntz) + case 1: + deltapackzigzag_int64_1(initoffset, (*[64]int64)(in), (*[1]uint64)(out), ntz) + case 2: + deltapackzigzag_int64_2(initoffset, (*[64]int64)(in), (*[2]uint64)(out), ntz) + case 3: + deltapackzigzag_int64_3(initoffset, (*[64]int64)(in), (*[3]uint64)(out), ntz) + case 4: + deltapackzigzag_int64_4(initoffset, (*[64]int64)(in), (*[4]uint64)(out), ntz) + case 5: + deltapackzigzag_int64_5(initoffset, (*[64]int64)(in), (*[5]uint64)(out), ntz) + case 6: + deltapackzigzag_int64_6(initoffset, (*[64]int64)(in), (*[6]uint64)(out), ntz) + case 7: + deltapackzigzag_int64_7(initoffset, (*[64]int64)(in), (*[7]uint64)(out), ntz) + case 8: + deltapackzigzag_int64_8(initoffset, (*[64]int64)(in), (*[8]uint64)(out), ntz) + case 9: + deltapackzigzag_int64_9(initoffset, (*[64]int64)(in), (*[9]uint64)(out), ntz) + case 10: + deltapackzigzag_int64_10(initoffset, (*[64]int64)(in), (*[10]uint64)(out), ntz) + case 11: + deltapackzigzag_int64_11(initoffset, (*[64]int64)(in), (*[11]uint64)(out), ntz) + case 12: + deltapackzigzag_int64_12(initoffset, (*[64]int64)(in), (*[12]uint64)(out), ntz) + case 13: + deltapackzigzag_int64_13(initoffset, (*[64]int64)(in), (*[13]uint64)(out), ntz) + case 14: + deltapackzigzag_int64_14(initoffset, (*[64]int64)(in), (*[14]uint64)(out), ntz) + case 15: + deltapackzigzag_int64_15(initoffset, (*[64]int64)(in), (*[15]uint64)(out), ntz) + case 16: + deltapackzigzag_int64_16(initoffset, (*[64]int64)(in), (*[16]uint64)(out), ntz) + case 17: + deltapackzigzag_int64_17(initoffset, (*[64]int64)(in), (*[17]uint64)(out), ntz) + case 18: + deltapackzigzag_int64_18(initoffset, (*[64]int64)(in), (*[18]uint64)(out), ntz) + case 19: + deltapackzigzag_int64_19(initoffset, (*[64]int64)(in), (*[19]uint64)(out), ntz) + case 20: + deltapackzigzag_int64_20(initoffset, (*[64]int64)(in), (*[20]uint64)(out), ntz) + case 21: + deltapackzigzag_int64_21(initoffset, (*[64]int64)(in), (*[21]uint64)(out), ntz) + case 22: + deltapackzigzag_int64_22(initoffset, (*[64]int64)(in), (*[22]uint64)(out), ntz) + case 23: + deltapackzigzag_int64_23(initoffset, (*[64]int64)(in), (*[23]uint64)(out), ntz) + case 24: + deltapackzigzag_int64_24(initoffset, (*[64]int64)(in), (*[24]uint64)(out), ntz) + case 25: + deltapackzigzag_int64_25(initoffset, (*[64]int64)(in), (*[25]uint64)(out), ntz) + case 26: + deltapackzigzag_int64_26(initoffset, (*[64]int64)(in), (*[26]uint64)(out), ntz) + case 27: + deltapackzigzag_int64_27(initoffset, (*[64]int64)(in), (*[27]uint64)(out), ntz) + case 28: + deltapackzigzag_int64_28(initoffset, (*[64]int64)(in), (*[28]uint64)(out), ntz) + case 29: + deltapackzigzag_int64_29(initoffset, (*[64]int64)(in), (*[29]uint64)(out), ntz) + case 30: + deltapackzigzag_int64_30(initoffset, (*[64]int64)(in), (*[30]uint64)(out), ntz) + case 31: + deltapackzigzag_int64_31(initoffset, (*[64]int64)(in), (*[31]uint64)(out), ntz) + case 32: + deltapackzigzag_int64_32(initoffset, (*[64]int64)(in), (*[32]uint64)(out), ntz) + case 33: + deltapackzigzag_int64_33(initoffset, (*[64]int64)(in), (*[33]uint64)(out), ntz) + case 34: + deltapackzigzag_int64_34(initoffset, (*[64]int64)(in), (*[34]uint64)(out), ntz) + case 35: + deltapackzigzag_int64_35(initoffset, (*[64]int64)(in), (*[35]uint64)(out), ntz) + case 36: + deltapackzigzag_int64_36(initoffset, (*[64]int64)(in), (*[36]uint64)(out), ntz) + case 37: + deltapackzigzag_int64_37(initoffset, (*[64]int64)(in), (*[37]uint64)(out), ntz) + case 38: + deltapackzigzag_int64_38(initoffset, (*[64]int64)(in), (*[38]uint64)(out), ntz) + case 39: + deltapackzigzag_int64_39(initoffset, (*[64]int64)(in), (*[39]uint64)(out), ntz) + case 40: + deltapackzigzag_int64_40(initoffset, (*[64]int64)(in), (*[40]uint64)(out), ntz) + case 41: + deltapackzigzag_int64_41(initoffset, (*[64]int64)(in), (*[41]uint64)(out), ntz) + case 42: + deltapackzigzag_int64_42(initoffset, (*[64]int64)(in), (*[42]uint64)(out), ntz) + case 43: + deltapackzigzag_int64_43(initoffset, (*[64]int64)(in), (*[43]uint64)(out), ntz) + case 44: + deltapackzigzag_int64_44(initoffset, (*[64]int64)(in), (*[44]uint64)(out), ntz) + case 45: + deltapackzigzag_int64_45(initoffset, (*[64]int64)(in), (*[45]uint64)(out), ntz) + case 46: + deltapackzigzag_int64_46(initoffset, (*[64]int64)(in), (*[46]uint64)(out), ntz) + case 47: + deltapackzigzag_int64_47(initoffset, (*[64]int64)(in), (*[47]uint64)(out), ntz) + case 48: + deltapackzigzag_int64_48(initoffset, (*[64]int64)(in), (*[48]uint64)(out), ntz) + case 49: + deltapackzigzag_int64_49(initoffset, (*[64]int64)(in), (*[49]uint64)(out), ntz) + case 50: + deltapackzigzag_int64_50(initoffset, (*[64]int64)(in), (*[50]uint64)(out), ntz) + case 51: + deltapackzigzag_int64_51(initoffset, (*[64]int64)(in), (*[51]uint64)(out), ntz) + case 52: + deltapackzigzag_int64_52(initoffset, (*[64]int64)(in), (*[52]uint64)(out), ntz) + case 53: + deltapackzigzag_int64_53(initoffset, (*[64]int64)(in), (*[53]uint64)(out), ntz) + case 54: + deltapackzigzag_int64_54(initoffset, (*[64]int64)(in), (*[54]uint64)(out), ntz) + case 55: + deltapackzigzag_int64_55(initoffset, (*[64]int64)(in), (*[55]uint64)(out), ntz) + case 56: + deltapackzigzag_int64_56(initoffset, (*[64]int64)(in), (*[56]uint64)(out), ntz) + case 57: + deltapackzigzag_int64_57(initoffset, (*[64]int64)(in), (*[57]uint64)(out), ntz) + case 58: + deltapackzigzag_int64_58(initoffset, (*[64]int64)(in), (*[58]uint64)(out), ntz) + case 59: + deltapackzigzag_int64_59(initoffset, (*[64]int64)(in), (*[59]uint64)(out), ntz) + case 60: + deltapackzigzag_int64_60(initoffset, (*[64]int64)(in), (*[60]uint64)(out), ntz) + case 61: + deltapackzigzag_int64_61(initoffset, (*[64]int64)(in), (*[61]uint64)(out), ntz) + case 62: + deltapackzigzag_int64_62(initoffset, (*[64]int64)(in), (*[62]uint64)(out), ntz) + case 63: + deltapackzigzag_int64_63(initoffset, (*[64]int64)(in), (*[63]uint64)(out), ntz) + case 64: + *(*[64]uint64)(out) = *((*[64]uint64)(unsafe.Pointer((*[64]int64)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpackZigzag_int64 Decoding operation for DeltaPackZigzag_int64 +func deltaUnpackZigzag_int64(initoffset int64, in []uint64, out []int64, ntz, bitlen int) { + switch bitlen - ntz { + case 0: + deltaunpackzigzag_int64_0(initoffset, (*[0]uint64)(in), (*[64]int64)(out), ntz) + case 1: + deltaunpackzigzag_int64_1(initoffset, (*[1]uint64)(in), (*[64]int64)(out), ntz) + case 2: + deltaunpackzigzag_int64_2(initoffset, (*[2]uint64)(in), (*[64]int64)(out), ntz) + case 3: + deltaunpackzigzag_int64_3(initoffset, (*[3]uint64)(in), (*[64]int64)(out), ntz) + case 4: + deltaunpackzigzag_int64_4(initoffset, (*[4]uint64)(in), (*[64]int64)(out), ntz) + case 5: + deltaunpackzigzag_int64_5(initoffset, (*[5]uint64)(in), (*[64]int64)(out), ntz) + case 6: + deltaunpackzigzag_int64_6(initoffset, (*[6]uint64)(in), (*[64]int64)(out), ntz) + case 7: + deltaunpackzigzag_int64_7(initoffset, (*[7]uint64)(in), (*[64]int64)(out), ntz) + case 8: + deltaunpackzigzag_int64_8(initoffset, (*[8]uint64)(in), (*[64]int64)(out), ntz) + case 9: + deltaunpackzigzag_int64_9(initoffset, (*[9]uint64)(in), (*[64]int64)(out), ntz) + case 10: + deltaunpackzigzag_int64_10(initoffset, (*[10]uint64)(in), (*[64]int64)(out), ntz) + case 11: + deltaunpackzigzag_int64_11(initoffset, (*[11]uint64)(in), (*[64]int64)(out), ntz) + case 12: + deltaunpackzigzag_int64_12(initoffset, (*[12]uint64)(in), (*[64]int64)(out), ntz) + case 13: + deltaunpackzigzag_int64_13(initoffset, (*[13]uint64)(in), (*[64]int64)(out), ntz) + case 14: + deltaunpackzigzag_int64_14(initoffset, (*[14]uint64)(in), (*[64]int64)(out), ntz) + case 15: + deltaunpackzigzag_int64_15(initoffset, (*[15]uint64)(in), (*[64]int64)(out), ntz) + case 16: + deltaunpackzigzag_int64_16(initoffset, (*[16]uint64)(in), (*[64]int64)(out), ntz) + case 17: + deltaunpackzigzag_int64_17(initoffset, (*[17]uint64)(in), (*[64]int64)(out), ntz) + case 18: + deltaunpackzigzag_int64_18(initoffset, (*[18]uint64)(in), (*[64]int64)(out), ntz) + case 19: + deltaunpackzigzag_int64_19(initoffset, (*[19]uint64)(in), (*[64]int64)(out), ntz) + case 20: + deltaunpackzigzag_int64_20(initoffset, (*[20]uint64)(in), (*[64]int64)(out), ntz) + case 21: + deltaunpackzigzag_int64_21(initoffset, (*[21]uint64)(in), (*[64]int64)(out), ntz) + case 22: + deltaunpackzigzag_int64_22(initoffset, (*[22]uint64)(in), (*[64]int64)(out), ntz) + case 23: + deltaunpackzigzag_int64_23(initoffset, (*[23]uint64)(in), (*[64]int64)(out), ntz) + case 24: + deltaunpackzigzag_int64_24(initoffset, (*[24]uint64)(in), (*[64]int64)(out), ntz) + case 25: + deltaunpackzigzag_int64_25(initoffset, (*[25]uint64)(in), (*[64]int64)(out), ntz) + case 26: + deltaunpackzigzag_int64_26(initoffset, (*[26]uint64)(in), (*[64]int64)(out), ntz) + case 27: + deltaunpackzigzag_int64_27(initoffset, (*[27]uint64)(in), (*[64]int64)(out), ntz) + case 28: + deltaunpackzigzag_int64_28(initoffset, (*[28]uint64)(in), (*[64]int64)(out), ntz) + case 29: + deltaunpackzigzag_int64_29(initoffset, (*[29]uint64)(in), (*[64]int64)(out), ntz) + case 30: + deltaunpackzigzag_int64_30(initoffset, (*[30]uint64)(in), (*[64]int64)(out), ntz) + case 31: + deltaunpackzigzag_int64_31(initoffset, (*[31]uint64)(in), (*[64]int64)(out), ntz) + case 32: + deltaunpackzigzag_int64_32(initoffset, (*[32]uint64)(in), (*[64]int64)(out), ntz) + case 33: + deltaunpackzigzag_int64_33(initoffset, (*[33]uint64)(in), (*[64]int64)(out), ntz) + case 34: + deltaunpackzigzag_int64_34(initoffset, (*[34]uint64)(in), (*[64]int64)(out), ntz) + case 35: + deltaunpackzigzag_int64_35(initoffset, (*[35]uint64)(in), (*[64]int64)(out), ntz) + case 36: + deltaunpackzigzag_int64_36(initoffset, (*[36]uint64)(in), (*[64]int64)(out), ntz) + case 37: + deltaunpackzigzag_int64_37(initoffset, (*[37]uint64)(in), (*[64]int64)(out), ntz) + case 38: + deltaunpackzigzag_int64_38(initoffset, (*[38]uint64)(in), (*[64]int64)(out), ntz) + case 39: + deltaunpackzigzag_int64_39(initoffset, (*[39]uint64)(in), (*[64]int64)(out), ntz) + case 40: + deltaunpackzigzag_int64_40(initoffset, (*[40]uint64)(in), (*[64]int64)(out), ntz) + case 41: + deltaunpackzigzag_int64_41(initoffset, (*[41]uint64)(in), (*[64]int64)(out), ntz) + case 42: + deltaunpackzigzag_int64_42(initoffset, (*[42]uint64)(in), (*[64]int64)(out), ntz) + case 43: + deltaunpackzigzag_int64_43(initoffset, (*[43]uint64)(in), (*[64]int64)(out), ntz) + case 44: + deltaunpackzigzag_int64_44(initoffset, (*[44]uint64)(in), (*[64]int64)(out), ntz) + case 45: + deltaunpackzigzag_int64_45(initoffset, (*[45]uint64)(in), (*[64]int64)(out), ntz) + case 46: + deltaunpackzigzag_int64_46(initoffset, (*[46]uint64)(in), (*[64]int64)(out), ntz) + case 47: + deltaunpackzigzag_int64_47(initoffset, (*[47]uint64)(in), (*[64]int64)(out), ntz) + case 48: + deltaunpackzigzag_int64_48(initoffset, (*[48]uint64)(in), (*[64]int64)(out), ntz) + case 49: + deltaunpackzigzag_int64_49(initoffset, (*[49]uint64)(in), (*[64]int64)(out), ntz) + case 50: + deltaunpackzigzag_int64_50(initoffset, (*[50]uint64)(in), (*[64]int64)(out), ntz) + case 51: + deltaunpackzigzag_int64_51(initoffset, (*[51]uint64)(in), (*[64]int64)(out), ntz) + case 52: + deltaunpackzigzag_int64_52(initoffset, (*[52]uint64)(in), (*[64]int64)(out), ntz) + case 53: + deltaunpackzigzag_int64_53(initoffset, (*[53]uint64)(in), (*[64]int64)(out), ntz) + case 54: + deltaunpackzigzag_int64_54(initoffset, (*[54]uint64)(in), (*[64]int64)(out), ntz) + case 55: + deltaunpackzigzag_int64_55(initoffset, (*[55]uint64)(in), (*[64]int64)(out), ntz) + case 56: + deltaunpackzigzag_int64_56(initoffset, (*[56]uint64)(in), (*[64]int64)(out), ntz) + case 57: + deltaunpackzigzag_int64_57(initoffset, (*[57]uint64)(in), (*[64]int64)(out), ntz) + case 58: + deltaunpackzigzag_int64_58(initoffset, (*[58]uint64)(in), (*[64]int64)(out), ntz) + case 59: + deltaunpackzigzag_int64_59(initoffset, (*[59]uint64)(in), (*[64]int64)(out), ntz) + case 60: + deltaunpackzigzag_int64_60(initoffset, (*[60]uint64)(in), (*[64]int64)(out), ntz) + case 61: + deltaunpackzigzag_int64_61(initoffset, (*[61]uint64)(in), (*[64]int64)(out), ntz) + case 62: + deltaunpackzigzag_int64_62(initoffset, (*[62]uint64)(in), (*[64]int64)(out), ntz) + case 63: + deltaunpackzigzag_int64_63(initoffset, (*[63]uint64)(in), (*[64]int64)(out), ntz) + case 64: + *(*[64]int64)(out) = *(*[64]int64)(unsafe.Pointer((*[64]uint64)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapackzigzag_int64_0(initoffset int64, in *[64]int64, out *[0]uint64, ntz int) { +} + +func deltapackzigzag_int64_1(initoffset int64, in *[64]int64, out *[1]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 1) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 2) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 3) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 4) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 5) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 6) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 7) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 9) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 10) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 11) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 12) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 13) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 14) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 15) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 17) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 18) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 19) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 20) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 21) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 22) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 23) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 25) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 26) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 27) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 28) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 29) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 30) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 31) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 33) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 34) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 35) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 36) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 37) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 38) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 39) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 41) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 42) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 43) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 44) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 45) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 46) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 47) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 49) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 50) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 51) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 52) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 53) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 54) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 55) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 57) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 58) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 59) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 60) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 61) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 62) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 63) +} + +func deltapackzigzag_int64_2(initoffset int64, in *[64]int64, out *[2]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 2) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 4) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 6) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 8) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 10) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 12) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 14) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 18) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 20) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 22) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 24) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 26) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 28) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 30) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 34) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 36) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 38) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 40) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 42) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 44) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 46) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 50) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 52) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 54) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 56) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 58) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 60) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 62) + out[1] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 2) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 4) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 6) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 8) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 10) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 12) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 14) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 18) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 20) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 22) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 24) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 26) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 28) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 30) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 34) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 36) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 38) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 40) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 42) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 44) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 46) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 50) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 52) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 54) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 56) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 58) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 60) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 62) +} + +func deltapackzigzag_int64_3(initoffset int64, in *[64]int64, out *[3]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 3) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 6) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 9) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 12) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 15) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 18) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 21) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 27) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 30) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 33) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 36) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 39) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 42) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 45) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 51) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 54) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 57) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 60) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 63) + out[1] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (1+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 2) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 5) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 11) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 14) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 17) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 20) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 23) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 26) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 29) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 35) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 38) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 41) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 44) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 47) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 50) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 53) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 59) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (2+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 1) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 4) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 7) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 10) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 13) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 19) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 22) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 25) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 28) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 31) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 34) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 37) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 43) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 46) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 49) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 52) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 55) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 58) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 61) +} + +func deltapackzigzag_int64_4(initoffset int64, in *[64]int64, out *[4]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 4) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 8) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 12) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 16) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 20) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 24) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 28) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 36) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 40) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 44) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 48) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 52) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 56) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 4) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 8) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 12) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 16) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 20) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 24) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 28) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 36) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 40) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 44) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 48) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 52) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 56) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 60) + out[2] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 4) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 8) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 12) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 16) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 20) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 24) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 28) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 36) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 40) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 44) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 48) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 52) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 56) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 60) + out[3] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 4) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 8) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 12) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 16) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 20) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 24) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 28) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 36) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 40) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 44) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 48) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 52) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 56) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 60) +} + +func deltapackzigzag_int64_5(initoffset int64, in *[64]int64, out *[5]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 5) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 10) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 15) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 20) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 25) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 30) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 35) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 45) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 50) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 55) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (4+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 1) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 6) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 11) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 21) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 26) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 31) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 36) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 41) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 46) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 51) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 61) + out[2] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (3+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 2) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 7) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 12) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 17) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 22) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 27) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 37) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 42) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 47) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 52) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 57) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 62) + out[3] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (2+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 3) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 13) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 18) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 23) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 28) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 33) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 38) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 43) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 53) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 58) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 63) + out[4] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (1+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 4) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 9) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 14) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 19) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 29) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 34) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 39) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 44) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 49) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 54) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 59) +} + +func deltapackzigzag_int64_6(initoffset int64, in *[64]int64, out *[6]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 6) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 12) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 18) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 24) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 30) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 36) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 42) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 54) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (4+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 2) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 8) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 14) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 20) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 26) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 38) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 44) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 50) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 56) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (2+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 4) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 10) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 22) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 28) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 34) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 40) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 46) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 52) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 58) + out[3] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 6) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 12) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 18) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 24) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 30) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 36) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 42) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 54) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (4+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 2) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 8) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 14) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 20) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 26) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 38) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 44) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 50) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 56) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 62) + out[5] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (2+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 4) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 10) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 22) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 28) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 34) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 40) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 46) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 52) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 58) +} + +func deltapackzigzag_int64_7(initoffset int64, in *[64]int64, out *[7]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 7) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 14) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 21) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 28) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 35) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 42) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 49) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 63) + out[1] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (1+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 6) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 13) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 20) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 27) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 34) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 41) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 55) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (2+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 5) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 12) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 19) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 26) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 33) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 47) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 54) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 61) + out[3] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (3+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 4) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 11) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 18) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 25) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 39) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 46) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 53) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (4+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 3) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 10) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 17) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 31) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 38) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 45) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 52) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 59) + out[5] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (5+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 2) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 9) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 23) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 30) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 37) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 44) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 51) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (6+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 1) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 15) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 22) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 29) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 36) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 43) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 50) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 57) +} + +func deltapackzigzag_int64_8(initoffset int64, in *[64]int64, out *[8]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 8) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 16) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 24) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 32) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 40) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 48) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 56) + out[1] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 8) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 16) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 24) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 32) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 40) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 48) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 8) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 16) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 24) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 32) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 40) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 48) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 56) + out[3] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 8) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 16) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 24) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 32) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 40) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 48) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 56) + out[4] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 8) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 16) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 24) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 32) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 40) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 48) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 56) + out[5] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 8) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 16) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 24) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 32) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 40) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 48) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 56) + out[6] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 8) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 16) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 24) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 32) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 40) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 48) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 8) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 16) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 24) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 32) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 40) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 48) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 56) +} + +func deltapackzigzag_int64_9(initoffset int64, in *[64]int64, out *[9]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 9) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 18) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 27) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 36) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 45) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 54) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 63) + out[1] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (1+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 17) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 26) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 35) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 44) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 53) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (2+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 7) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 25) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 34) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 43) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 52) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 61) + out[3] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (3+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 6) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 15) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 33) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 42) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 51) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (4+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 5) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 14) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 23) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 41) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 50) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 59) + out[5] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (5+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 4) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 13) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 22) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 31) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 49) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (6+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 3) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 12) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 21) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 30) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 39) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 57) + out[7] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (7+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 2) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 11) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 20) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 29) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 38) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 47) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (8+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 1) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 10) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 19) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 28) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 37) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 46) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 55) +} + +func deltapackzigzag_int64_10(initoffset int64, in *[64]int64, out *[10]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 10) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 20) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 30) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 40) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 50) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (4+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 6) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 26) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 36) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 46) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (8+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 2) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 12) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 22) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 42) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 52) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 62) + out[3] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (2+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 8) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 18) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 28) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 38) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 58) + out[4] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (6+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 4) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 14) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 24) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 34) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 44) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 54) + out[5] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 10) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 20) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 30) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 40) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 50) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 60) + out[6] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (4+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 6) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 26) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 36) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 46) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (8+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 2) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 12) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 22) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 42) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 52) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 62) + out[8] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (2+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 8) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 18) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 28) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 38) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 58) + out[9] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (6+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 4) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 14) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 24) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 34) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 44) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 54) +} + +func deltapackzigzag_int64_11(initoffset int64, in *[64]int64, out *[11]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 11) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 22) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 33) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 44) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 55) + out[1] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (9+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 2) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 13) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 35) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 46) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 57) + out[2] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (7+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 4) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 15) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 26) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 37) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 59) + out[3] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (5+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 6) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 17) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 28) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 39) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 50) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 61) + out[4] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (3+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 19) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 30) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 41) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 52) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 63) + out[5] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (1+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 10) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 21) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 43) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 54) + out[6] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (10+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 1) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 12) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 23) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 34) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 45) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (8+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 3) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 14) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 25) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 36) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 47) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 58) + out[8] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (6+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 5) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 27) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 38) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 49) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 60) + out[9] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (4+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 7) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 18) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 29) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 51) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 62) + out[10] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (2+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 9) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 20) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 31) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 42) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 53) +} + +func deltapackzigzag_int64_12(initoffset int64, in *[64]int64, out *[12]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 12) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 24) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 36) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 48) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (4+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 8) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 20) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 44) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (8+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 4) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 16) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 28) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 40) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 12) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 24) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 36) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 48) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (4+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 8) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 20) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 44) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 56) + out[5] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (8+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 4) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 16) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 28) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 40) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 52) + out[6] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 12) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 24) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 36) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 48) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 60) + out[7] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (4+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 8) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 20) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 44) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (8+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 4) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 16) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 28) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 40) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 52) + out[9] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 12) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 24) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 36) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 48) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 60) + out[10] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (4+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 8) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 20) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 44) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 56) + out[11] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (8+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 4) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 16) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 28) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 40) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 52) +} + +func deltapackzigzag_int64_13(initoffset int64, in *[64]int64, out *[13]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 13) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 26) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 39) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 52) + out[1] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (12+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 1) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 14) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 27) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 53) + out[2] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (11+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 2) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 15) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 28) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 41) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 54) + out[3] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (10+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 3) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 29) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 42) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 55) + out[4] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (9+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 4) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 17) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 30) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 43) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) + out[5] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (8+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 5) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 18) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 31) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 44) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 57) + out[6] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (7+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 6) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 19) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 45) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 58) + out[7] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (6+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 7) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 20) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 33) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 46) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 59) + out[8] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (5+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 21) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 34) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 47) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 60) + out[9] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (4+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 9) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 22) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 35) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 61) + out[10] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (3+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 10) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 23) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 36) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 49) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 62) + out[11] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (2+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 11) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 37) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 50) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 63) + out[12] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (1+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 12) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 25) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 38) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 51) +} + +func deltapackzigzag_int64_14(initoffset int64, in *[64]int64, out *[14]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 14) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 28) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 42) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 56) + out[1] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (8+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 6) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 20) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 34) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (2+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 12) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 26) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 40) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 54) + out[3] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (10+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 4) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 18) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 46) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (4+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 10) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 24) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 38) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 52) + out[5] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (12+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 2) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 30) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 44) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (6+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 8) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 22) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 36) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 50) + out[7] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 14) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 28) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 42) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (8+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 6) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 20) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 34) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 62) + out[9] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (2+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 12) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 26) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 40) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (10+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 4) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 18) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 46) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 60) + out[11] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (4+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 10) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 24) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 38) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (12+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 2) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 30) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 44) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 58) + out[13] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (6+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 8) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 22) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 36) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 50) +} + +func deltapackzigzag_int64_15(initoffset int64, in *[64]int64, out *[15]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 15) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 30) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 45) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (4+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 11) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 26) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 41) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (8+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 7) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 22) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 37) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (12+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 3) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 18) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 33) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 63) + out[4] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (1+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 14) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 29) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 44) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 59) + out[5] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (5+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 10) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 25) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 55) + out[6] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (9+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 6) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 21) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 36) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 51) + out[7] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (13+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 2) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 17) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 47) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 62) + out[8] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (2+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 13) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 28) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 43) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 58) + out[9] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (6+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 9) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 39) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (10+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 5) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 20) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 35) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 50) + out[11] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (14+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 1) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 31) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 46) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 61) + out[12] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (3+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 12) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 27) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 42) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 57) + out[13] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (7+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 23) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 38) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 53) + out[14] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (11+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 4) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 19) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 34) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 49) +} + +func deltapackzigzag_int64_16(initoffset int64, in *[64]int64, out *[16]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 16) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 32) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 48) + out[1] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 16) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 32) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 48) + out[2] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 16) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 32) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 48) + out[3] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 16) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 32) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 48) + out[4] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 16) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 32) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 48) + out[5] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 16) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 32) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 48) + out[6] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 16) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 32) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 48) + out[7] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 16) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 32) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 48) + out[8] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 16) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 32) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 48) + out[9] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 16) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 32) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 48) + out[10] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 16) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 32) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 48) + out[11] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 16) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 32) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 48) + out[12] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 16) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 32) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 48) + out[13] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 16) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 32) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 48) + out[14] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 16) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 32) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 48) + out[15] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 16) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 32) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 48) +} + +func deltapackzigzag_int64_17(initoffset int64, in *[64]int64, out *[17]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 17) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 34) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 51) + out[1] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (13+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 4) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 21) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 38) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 55) + out[2] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (9+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 25) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 42) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 59) + out[3] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (5+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 12) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 29) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 46) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 63) + out[4] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (1+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 33) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 50) + out[5] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (14+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 3) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 20) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 37) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 54) + out[6] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (10+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 7) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 41) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 58) + out[7] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (6+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 11) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 28) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 45) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 62) + out[8] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (2+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 15) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 49) + out[9] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (15+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 2) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 19) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 36) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 53) + out[10] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (11+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 6) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 23) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 57) + out[11] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (7+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 10) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 27) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 44) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 61) + out[12] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (3+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 14) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 31) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[13] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 1) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 18) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 35) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 52) + out[14] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (12+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 5) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 22) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 39) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) + out[15] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (8+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 9) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 26) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 43) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 60) + out[16] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (4+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 13) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 30) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 47) +} + +func deltapackzigzag_int64_18(initoffset int64, in *[64]int64, out *[18]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 18) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 36) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 54) + out[1] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (10+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 8) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 26) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 44) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (2+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 34) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (12+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 6) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 24) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 42) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (4+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 14) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 50) + out[5] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (14+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 4) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 22) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 40) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (6+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 12) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 30) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) + out[7] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (16+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 2) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 20) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 38) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (8+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 10) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 28) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 46) + out[9] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 18) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 36) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (10+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 8) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 26) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 44) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 62) + out[11] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (2+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 34) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (12+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 6) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 24) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 42) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 60) + out[13] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (4+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 14) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 50) + out[14] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (14+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 4) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 22) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 40) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 58) + out[15] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (6+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 12) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 30) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (16+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 2) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 20) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 38) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (8+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 10) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 28) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 46) +} + +func deltapackzigzag_int64_19(initoffset int64, in *[64]int64, out *[19]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 19) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 38) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 57) + out[1] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (7+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 12) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 31) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 50) + out[2] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (14+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 5) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 43) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 62) + out[3] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (2+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 17) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 36) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 55) + out[4] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (9+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 10) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 29) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[5] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 3) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 22) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 41) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 60) + out[6] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (4+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 15) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 34) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 53) + out[7] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (11+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 27) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 46) + out[8] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (18+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 1) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 20) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 39) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 58) + out[9] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (6+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 13) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 51) + out[10] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (13+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 6) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 25) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 44) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 63) + out[11] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (1+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 18) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 37) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) + out[12] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (8+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 11) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 30) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 49) + out[13] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (15+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 4) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 23) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 42) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 61) + out[14] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (3+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 35) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 54) + out[15] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (10+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 9) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 28) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 47) + out[16] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (17+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 2) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 21) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 59) + out[17] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (5+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 14) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 33) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 52) + out[18] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (12+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 7) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 26) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 45) +} + +func deltapackzigzag_int64_20(initoffset int64, in *[64]int64, out *[20]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 20) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 40) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (4+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 16) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 36) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (8+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 12) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (12+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 8) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 28) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 48) + out[4] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (16+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 4) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 24) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 44) + out[5] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 20) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 40) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 60) + out[6] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (4+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 16) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 36) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (8+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 12) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 52) + out[8] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (12+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 8) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 28) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 48) + out[9] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (16+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 4) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 24) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 44) + out[10] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 20) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 40) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 60) + out[11] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (4+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 16) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 36) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 56) + out[12] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (8+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 12) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 52) + out[13] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (12+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 8) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 28) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 48) + out[14] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (16+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 4) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 24) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 44) + out[15] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 20) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 40) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 60) + out[16] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (4+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 16) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 36) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (8+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 12) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 52) + out[18] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (12+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 8) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 28) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (16+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 4) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 24) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 44) +} + +func deltapackzigzag_int64_21(initoffset int64, in *[64]int64, out *[21]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 21) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 42) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 63) + out[1] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (1+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 20) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 41) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (2+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 19) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 61) + out[3] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (3+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 18) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 39) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (4+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 17) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 38) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 59) + out[5] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (5+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 37) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (6+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 15) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 36) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 57) + out[7] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (7+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 14) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 35) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (8+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 13) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 34) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 55) + out[9] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (9+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 12) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 33) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (10+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 11) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 53) + out[11] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (11+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 10) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 31) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (12+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 9) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 30) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 51) + out[13] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (13+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 29) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 50) + out[14] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (14+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 7) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 28) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 49) + out[15] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (15+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 6) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 27) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 5) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 26) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 47) + out[17] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (17+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 4) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 25) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 46) + out[18] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (18+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 3) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 45) + out[19] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (19+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 2) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 23) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (20+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 1) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 22) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 43) +} + +func deltapackzigzag_int64_22(initoffset int64, in *[64]int64, out *[22]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 22) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 44) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (20+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 2) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 24) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 46) + out[2] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (18+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 4) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 26) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) + out[3] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (16+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 6) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 28) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 50) + out[4] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (14+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 8) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 30) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 52) + out[5] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (12+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 10) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 54) + out[6] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (10+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 12) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 34) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (8+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 14) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 36) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 58) + out[8] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (6+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 38) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 60) + out[9] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (4+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 18) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 40) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 62) + out[10] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (2+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 20) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 42) + out[11] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 22) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 44) + out[12] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (20+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 2) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 24) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 46) + out[13] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (18+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 4) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 26) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) + out[14] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (16+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 6) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 28) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 50) + out[15] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (14+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 8) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 30) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 52) + out[16] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (12+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 10) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 54) + out[17] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (10+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 12) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 34) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 56) + out[18] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (8+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 14) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 36) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 58) + out[19] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (6+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 38) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 60) + out[20] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (4+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 18) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 40) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 62) + out[21] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (2+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 20) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 42) +} + +func deltapackzigzag_int64_23(initoffset int64, in *[64]int64, out *[23]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 23) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 46) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (18+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 5) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 28) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 51) + out[2] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (13+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 10) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 33) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) + out[3] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (8+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 15) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 38) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 61) + out[4] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (3+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 20) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 43) + out[5] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (21+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 2) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 25) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[6] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 7) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 30) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 53) + out[7] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (11+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 12) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 35) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 58) + out[8] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (6+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 17) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 63) + out[9] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (1+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 22) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 45) + out[10] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (19+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 4) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 27) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 50) + out[11] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (14+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 9) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 55) + out[12] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (9+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 14) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 37) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 60) + out[13] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (4+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 19) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 42) + out[14] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (22+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 1) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 47) + out[15] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (17+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 6) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 29) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 52) + out[16] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (12+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 11) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 34) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 57) + out[17] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (7+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 39) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 62) + out[18] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (2+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 21) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 44) + out[19] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (20+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 3) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 26) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 49) + out[20] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (15+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 31) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 54) + out[21] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (10+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 13) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 36) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 59) + out[22] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (5+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 18) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 41) +} + +func deltapackzigzag_int64_24(initoffset int64, in *[64]int64, out *[24]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 24) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 48) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (16+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 8) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 32) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (8+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 16) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 40) + out[3] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 24) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 48) + out[4] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (16+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 8) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 32) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 56) + out[5] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (8+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 16) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 40) + out[6] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 24) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 48) + out[7] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (16+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 8) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 32) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (8+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 16) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 40) + out[9] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 24) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 48) + out[10] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (16+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 8) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 32) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 56) + out[11] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (8+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 16) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 40) + out[12] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 24) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 48) + out[13] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (16+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 8) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 32) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 56) + out[14] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (8+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 16) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 40) + out[15] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 24) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (16+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 8) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 32) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (8+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 16) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 40) + out[18] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 24) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (16+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 8) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 32) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 56) + out[20] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (8+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 16) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 40) + out[21] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 24) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 48) + out[22] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (16+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 8) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 32) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 56) + out[23] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (8+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 16) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 40) +} + +func deltapackzigzag_int64_25(initoffset int64, in *[64]int64, out *[25]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 25) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 50) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (14+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 11) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 36) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 61) + out[2] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (3+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 22) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 47) + out[3] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (17+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 33) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 58) + out[4] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (6+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 19) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 44) + out[5] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (20+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 5) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 30) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 55) + out[6] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (9+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 41) + out[7] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (23+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 2) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 27) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 52) + out[8] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (12+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 13) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 38) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 63) + out[9] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (1+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 49) + out[10] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (15+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 10) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 35) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 60) + out[11] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (4+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 21) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 46) + out[12] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (18+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 7) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 57) + out[13] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (7+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 18) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 43) + out[14] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (21+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 4) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 29) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 54) + out[15] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (10+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 15) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) + out[16] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (24+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 1) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 26) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 51) + out[17] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (13+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 12) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 37) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 62) + out[18] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (2+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 23) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 9) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 34) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 59) + out[20] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (5+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 20) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 45) + out[21] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (19+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 6) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 31) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) + out[22] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (8+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 17) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 42) + out[23] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (22+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 3) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 28) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 53) + out[24] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (11+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 14) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 39) +} + +func deltapackzigzag_int64_26(initoffset int64, in *[64]int64, out *[26]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 26) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 52) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (12+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 14) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 40) + out[2] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (24+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 2) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 28) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 54) + out[3] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (10+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 42) + out[4] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (22+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 4) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 30) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 56) + out[5] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (8+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 18) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 44) + out[6] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (20+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 6) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 58) + out[7] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (6+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 20) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 46) + out[8] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (18+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 8) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 34) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 60) + out[9] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (4+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 22) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) + out[10] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (16+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 10) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 36) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 62) + out[11] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (2+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 24) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 50) + out[12] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (14+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 12) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 38) + out[13] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 26) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 52) + out[14] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (12+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 14) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 40) + out[15] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (24+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 2) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 28) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 54) + out[16] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (10+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 42) + out[17] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (22+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 4) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 30) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 56) + out[18] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (8+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 18) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 44) + out[19] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (20+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 6) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 58) + out[20] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (6+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 20) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 46) + out[21] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (18+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 8) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 34) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 60) + out[22] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (4+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 22) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) + out[23] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (16+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 10) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 36) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 62) + out[24] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (2+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 24) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 50) + out[25] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (14+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 12) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 38) +} + +func deltapackzigzag_int64_27(initoffset int64, in *[64]int64, out *[27]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 27) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 54) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (10+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 17) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 44) + out[2] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (20+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 7) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 34) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 61) + out[3] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (3+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 51) + out[4] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (13+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 14) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 41) + out[5] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (23+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 4) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 31) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (6+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 21) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[7] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 11) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 38) + out[8] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (26+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 1) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 28) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 55) + out[9] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (9+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 18) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 45) + out[10] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (19+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 35) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 62) + out[11] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (2+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 25) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (12+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 15) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 42) + out[13] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (22+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 5) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 59) + out[14] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (5+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 22) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 49) + out[15] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (15+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 12) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 39) + out[16] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (25+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 2) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 29) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (8+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 19) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 46) + out[18] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (18+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 9) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 36) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 63) + out[19] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (1+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 26) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 53) + out[20] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (11+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 43) + out[21] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (21+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 6) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 33) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 60) + out[22] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (4+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 23) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 50) + out[23] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (14+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 13) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) + out[24] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (24+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 3) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 30) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 57) + out[25] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (7+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 20) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 47) + out[26] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (17+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 10) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 37) +} + +func deltapackzigzag_int64_28(initoffset int64, in *[64]int64, out *[28]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 28) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 56) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (8+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 20) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 48) + out[2] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (16+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 12) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 40) + out[3] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (24+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 4) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (4+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 24) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 52) + out[5] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (12+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 16) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 44) + out[6] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (20+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 8) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 36) + out[7] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 28) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (8+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 20) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 48) + out[9] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (16+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 12) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 40) + out[10] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (24+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 4) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 60) + out[11] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (4+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 24) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (12+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 16) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 44) + out[13] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (20+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 8) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 36) + out[14] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 28) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 56) + out[15] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (8+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 20) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (16+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 12) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 40) + out[17] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (24+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 4) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 60) + out[18] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (4+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 24) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 52) + out[19] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (12+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 16) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (20+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 8) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 36) + out[21] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 28) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 56) + out[22] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (8+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 20) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 48) + out[23] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (16+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 12) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 40) + out[24] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (24+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 4) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 60) + out[25] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (4+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 24) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 52) + out[26] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (12+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 16) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 44) + out[27] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (20+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 8) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 36) +} + +func deltapackzigzag_int64_29(initoffset int64, in *[64]int64, out *[29]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 29) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 58) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (6+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 23) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 52) + out[2] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (12+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 17) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 46) + out[3] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (18+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 11) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) + out[4] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (24+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 5) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 34) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 63) + out[5] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (1+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 28) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 57) + out[6] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (7+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 22) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 51) + out[7] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (13+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 45) + out[8] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (19+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 10) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 39) + out[9] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (25+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 4) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 33) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 62) + out[10] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (2+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 27) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) + out[11] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (8+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 21) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 50) + out[12] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (14+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 15) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 44) + out[13] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (20+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 9) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 38) + out[14] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (26+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 3) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 61) + out[15] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (3+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 26) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 55) + out[16] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (9+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 20) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 49) + out[17] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (15+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 14) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 43) + out[18] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (21+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 37) + out[19] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (27+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 2) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 31) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 60) + out[20] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (4+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 25) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 54) + out[21] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (10+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 19) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[22] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 13) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 42) + out[23] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (22+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 7) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 36) + out[24] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (28+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 1) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 30) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 59) + out[25] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (5+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 53) + out[26] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (11+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 18) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 47) + out[27] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (17+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 12) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 41) + out[28] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (23+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 6) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 35) +} + +func deltapackzigzag_int64_30(initoffset int64, in *[64]int64, out *[30]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 30) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (4+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 26) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (8+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 22) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (12+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 18) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) + out[4] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (16+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 14) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 44) + out[5] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (20+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 10) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 40) + out[6] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (24+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 6) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 36) + out[7] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (28+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 2) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 62) + out[8] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (2+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 28) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 58) + out[9] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (6+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 24) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (10+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 20) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 50) + out[11] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (14+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 46) + out[12] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (18+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 12) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 42) + out[13] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (22+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 8) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 38) + out[14] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (26+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 4) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 34) + out[15] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 30) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 60) + out[16] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (4+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 26) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (8+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 22) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 52) + out[18] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (12+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 18) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (16+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 14) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (20+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 10) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 40) + out[21] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (24+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 6) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 36) + out[22] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (28+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 2) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 62) + out[23] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (2+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 28) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 58) + out[24] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (6+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 24) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 54) + out[25] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (10+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 20) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 50) + out[26] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (14+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 46) + out[27] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (18+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 12) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 42) + out[28] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (22+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 8) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 38) + out[29] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (26+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 4) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 34) +} + +func deltapackzigzag_int64_31(initoffset int64, in *[64]int64, out *[31]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 31) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 62) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (2+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 29) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 60) + out[2] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (4+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 27) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 58) + out[3] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (6+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 25) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) + out[4] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (8+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 23) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 54) + out[5] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (10+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 21) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 52) + out[6] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (12+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 19) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 50) + out[7] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (14+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 17) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[8] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 15) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 46) + out[9] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (18+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 13) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 44) + out[10] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (20+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 11) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 42) + out[11] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (22+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 9) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) + out[12] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (24+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 7) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 38) + out[13] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (26+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 5) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 36) + out[14] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (28+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 3) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 34) + out[15] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (30+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 1) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 63) + out[16] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (1+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 30) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 61) + out[17] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (3+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 28) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 59) + out[18] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (5+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 26) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 57) + out[19] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (7+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 55) + out[20] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (9+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 22) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 53) + out[21] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (11+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 20) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 51) + out[22] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (13+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 18) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 49) + out[23] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (15+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 47) + out[24] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (17+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 14) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 45) + out[25] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (19+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 12) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 43) + out[26] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (21+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 10) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 41) + out[27] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (23+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 39) + out[28] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (25+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 6) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 37) + out[29] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (27+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 4) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 35) + out[30] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (29+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 2) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 33) +} + +func deltapackzigzag_int64_32(initoffset int64, in *[64]int64, out *[32]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 32) + out[1] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 32) + out[2] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 32) + out[3] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 32) + out[4] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 32) + out[5] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 32) + out[6] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 32) + out[7] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 32) + out[8] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 32) + out[9] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 32) + out[10] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 32) + out[11] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 32) + out[12] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 32) + out[13] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 32) + out[14] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 32) + out[15] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 32) + out[16] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 32) + out[17] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 32) + out[18] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 32) + out[19] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 32) + out[20] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 32) + out[21] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 32) + out[22] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 32) + out[23] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 32) + out[24] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 32) + out[25] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 32) + out[26] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 32) + out[27] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 32) + out[28] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 32) + out[29] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 32) + out[30] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 32) + out[31] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 32) +} + +func deltapackzigzag_int64_33(initoffset int64, in *[64]int64, out *[33]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 33) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (31+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 2) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 35) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (29+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 4) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 37) + out[3] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (27+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 6) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 39) + out[4] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (25+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 41) + out[5] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (23+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 10) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 43) + out[6] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (21+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 12) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 45) + out[7] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (19+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 14) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 47) + out[8] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (17+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 49) + out[9] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (15+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 18) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 51) + out[10] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (13+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 20) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 53) + out[11] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (11+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 22) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 55) + out[12] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (9+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 57) + out[13] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (7+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 26) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 59) + out[14] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (5+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 28) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 61) + out[15] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (3+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 30) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 63) + out[16] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (1+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[17] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 1) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 34) + out[18] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (30+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 3) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 36) + out[19] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (28+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 5) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 38) + out[20] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (26+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 7) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) + out[21] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (24+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 9) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 42) + out[22] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (22+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 11) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 44) + out[23] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (20+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 13) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 46) + out[24] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (18+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 15) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[25] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 17) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 50) + out[26] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (14+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 19) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 52) + out[27] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (12+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 21) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 54) + out[28] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (10+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 23) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) + out[29] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (8+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 25) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 58) + out[30] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (6+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 27) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 60) + out[31] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (4+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 29) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 62) + out[32] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (2+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 31) +} + +func deltapackzigzag_int64_34(initoffset int64, in *[64]int64, out *[34]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 34) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (30+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 4) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 38) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (26+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 8) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 42) + out[3] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (22+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 12) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 46) + out[4] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (18+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 50) + out[5] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (14+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 20) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 54) + out[6] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (10+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 24) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 58) + out[7] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (6+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 28) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 62) + out[8] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (2+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[9] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 2) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 36) + out[10] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (28+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 6) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 40) + out[11] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (24+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 10) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 44) + out[12] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (20+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 14) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) + out[13] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (16+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 18) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 52) + out[14] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (12+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 22) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 56) + out[15] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (8+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 26) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 60) + out[16] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (4+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 30) + out[17] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 34) + out[18] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (30+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 4) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 38) + out[19] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (26+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 8) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 42) + out[20] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (22+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 12) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 46) + out[21] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (18+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 50) + out[22] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (14+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 20) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 54) + out[23] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (10+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 24) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 58) + out[24] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (6+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 28) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 62) + out[25] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (2+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[26] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 2) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 36) + out[27] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (28+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 6) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 40) + out[28] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (24+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 10) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 44) + out[29] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (20+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 14) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) + out[30] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (16+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 18) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 52) + out[31] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (12+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 22) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 56) + out[32] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (8+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 26) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 60) + out[33] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (4+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 30) +} + +func deltapackzigzag_int64_35(initoffset int64, in *[64]int64, out *[35]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 35) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (29+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 6) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 41) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (23+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 12) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 47) + out[3] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (17+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 18) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 53) + out[4] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (11+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 59) + out[5] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (5+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 30) + out[6] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (34+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 1) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 36) + out[7] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (28+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 7) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 42) + out[8] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (22+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 13) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[9] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 19) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (10+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 25) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 60) + out[11] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (4+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 31) + out[12] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (33+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 2) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 37) + out[13] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (27+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 43) + out[14] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (21+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 14) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 49) + out[15] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (15+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 20) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 55) + out[16] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (9+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 26) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 61) + out[17] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (3+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[18] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 3) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 38) + out[19] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (26+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 9) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (20+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 15) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 50) + out[21] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (14+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 21) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) + out[22] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (8+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 27) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 62) + out[23] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (2+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 33) + out[24] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (31+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 4) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 39) + out[25] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (25+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 10) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 45) + out[26] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (19+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 51) + out[27] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (13+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 22) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 57) + out[28] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (7+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 28) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 63) + out[29] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (1+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 34) + out[30] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (30+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 5) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) + out[31] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (24+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 11) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 46) + out[32] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (18+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 17) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 52) + out[33] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (12+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 23) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 58) + out[34] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (6+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 29) +} + +func deltapackzigzag_int64_36(initoffset int64, in *[64]int64, out *[36]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 36) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (28+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 8) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 44) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (20+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 16) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (12+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 24) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (4+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) + out[5] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (32+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 4) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 40) + out[6] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (24+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 12) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 48) + out[7] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (16+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 20) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (8+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 28) + out[9] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 36) + out[10] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (28+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 8) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 44) + out[11] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (20+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 16) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (12+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 24) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 60) + out[13] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (4+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) + out[14] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (32+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 4) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 40) + out[15] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (24+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 12) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (16+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 20) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (8+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 28) + out[18] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 36) + out[19] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (28+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 8) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (20+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 16) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 52) + out[21] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (12+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 24) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 60) + out[22] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (4+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) + out[23] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (32+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 4) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 40) + out[24] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (24+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 12) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 48) + out[25] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (16+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 20) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 56) + out[26] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (8+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 28) + out[27] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 36) + out[28] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (28+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 8) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 44) + out[29] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (20+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 16) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 52) + out[30] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (12+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 24) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 60) + out[31] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (4+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) + out[32] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (32+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 4) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 40) + out[33] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (24+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 12) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 48) + out[34] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (16+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 20) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 56) + out[35] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (8+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 28) +} + +func deltapackzigzag_int64_37(initoffset int64, in *[64]int64, out *[37]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 37) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (27+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 10) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 47) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (17+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 20) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 57) + out[3] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (7+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 30) + out[4] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (34+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 3) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) + out[5] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (24+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 13) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 50) + out[6] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (14+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 23) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 60) + out[7] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (4+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 33) + out[8] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (31+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 6) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 43) + out[9] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (21+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 53) + out[10] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (11+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 26) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 63) + out[11] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (1+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 36) + out[12] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (28+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 9) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 46) + out[13] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (18+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 19) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) + out[14] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (8+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 29) + out[15] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (35+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 2) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 39) + out[16] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (25+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 12) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 49) + out[17] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (15+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 22) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 59) + out[18] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (5+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[19] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 5) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 42) + out[20] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (22+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 15) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 52) + out[21] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (12+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 25) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 62) + out[22] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (2+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 35) + out[23] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (29+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 45) + out[24] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (19+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 18) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 55) + out[25] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (9+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 28) + out[26] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (36+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 1) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 38) + out[27] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (26+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 11) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[28] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 21) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 58) + out[29] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (6+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 31) + out[30] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (33+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 4) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 41) + out[31] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (23+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 14) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 51) + out[32] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (13+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 61) + out[33] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (3+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 34) + out[34] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (30+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 7) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 44) + out[35] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (20+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 17) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 54) + out[36] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (10+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 27) +} + +func deltapackzigzag_int64_38(initoffset int64, in *[64]int64, out *[38]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 38) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (26+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 12) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 50) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (14+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 24) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 62) + out[3] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (2+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 36) + out[4] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (28+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 10) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) + out[5] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (16+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 22) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 60) + out[6] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (4+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 34) + out[7] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (30+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 8) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 46) + out[8] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (18+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 20) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 58) + out[9] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (6+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[10] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 6) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 44) + out[11] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (20+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 18) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 56) + out[12] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (8+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 30) + out[13] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (34+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 4) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 42) + out[14] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (22+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 54) + out[15] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (10+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 28) + out[16] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (36+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 2) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 40) + out[17] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (24+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 14) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 52) + out[18] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (12+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 26) + out[19] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 38) + out[20] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (26+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 12) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 50) + out[21] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (14+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 24) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 62) + out[22] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (2+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 36) + out[23] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (28+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 10) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) + out[24] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (16+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 22) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 60) + out[25] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (4+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 34) + out[26] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (30+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 8) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 46) + out[27] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (18+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 20) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 58) + out[28] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (6+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[29] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 6) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 44) + out[30] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (20+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 18) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 56) + out[31] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (8+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 30) + out[32] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (34+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 4) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 42) + out[33] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (22+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 54) + out[34] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (10+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 28) + out[35] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (36+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 2) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 40) + out[36] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (24+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 14) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 52) + out[37] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (12+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 26) +} + +func deltapackzigzag_int64_39(initoffset int64, in *[64]int64, out *[39]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 39) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (25+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 14) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 53) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (11+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 28) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (36+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 3) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 42) + out[4] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (22+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 17) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) + out[5] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (8+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 31) + out[6] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (33+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 6) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 45) + out[7] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (19+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 20) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 59) + out[8] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (5+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 34) + out[9] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (30+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 9) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[10] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 23) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 62) + out[11] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (2+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 37) + out[12] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (27+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 12) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 51) + out[13] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (13+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 26) + out[14] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (38+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 1) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) + out[15] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (24+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 15) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 54) + out[16] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (10+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 29) + out[17] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (35+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 4) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 43) + out[18] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (21+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 18) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 57) + out[19] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (7+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[20] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 7) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 46) + out[21] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (18+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 21) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 60) + out[22] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (4+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 35) + out[23] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (29+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 10) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 49) + out[24] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (15+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 63) + out[25] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (1+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 38) + out[26] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (26+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 13) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 52) + out[27] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (12+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 27) + out[28] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (37+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 2) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 41) + out[29] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (23+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 55) + out[30] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (9+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 30) + out[31] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (34+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 5) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 44) + out[32] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (20+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 19) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 58) + out[33] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (6+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 33) + out[34] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (31+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 47) + out[35] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (17+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 22) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 61) + out[36] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (3+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 36) + out[37] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (28+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 11) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 50) + out[38] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (14+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 25) +} + +func deltapackzigzag_int64_40(initoffset int64, in *[64]int64, out *[40]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 40) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (24+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 16) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (8+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 32) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (32+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 8) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 48) + out[4] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (16+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 24) + out[5] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 40) + out[6] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (24+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 16) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (8+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 32) + out[8] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (32+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 8) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 48) + out[9] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (16+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 24) + out[10] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 40) + out[11] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (24+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 16) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 56) + out[12] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (8+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 32) + out[13] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (32+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 8) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 48) + out[14] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (16+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 24) + out[15] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 40) + out[16] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (24+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 16) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (8+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 32) + out[18] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (32+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 8) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (16+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 24) + out[20] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 40) + out[21] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (24+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 16) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 56) + out[22] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (8+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 32) + out[23] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (32+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 8) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 48) + out[24] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (16+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 24) + out[25] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 40) + out[26] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (24+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 16) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 56) + out[27] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (8+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 32) + out[28] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (32+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 8) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 48) + out[29] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (16+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 24) + out[30] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 40) + out[31] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (24+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 16) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 56) + out[32] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (8+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 32) + out[33] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (32+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 8) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 48) + out[34] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (16+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 24) + out[35] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 40) + out[36] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (24+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 16) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 56) + out[37] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (8+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 32) + out[38] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (32+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 8) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 48) + out[39] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (16+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 24) +} + +func deltapackzigzag_int64_41(initoffset int64, in *[64]int64, out *[41]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 41) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (23+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 18) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 59) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (5+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 36) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (28+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 13) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 54) + out[4] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (10+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 31) + out[5] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (33+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 49) + out[6] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (15+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 26) + out[7] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (38+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 3) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 44) + out[8] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (20+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 21) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 62) + out[9] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (2+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 39) + out[10] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (25+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 57) + out[11] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (7+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 34) + out[12] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (30+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 11) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 52) + out[13] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (12+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 29) + out[14] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (35+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 6) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 47) + out[15] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (17+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) + out[16] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (40+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 1) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 42) + out[17] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (22+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 19) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 60) + out[18] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (4+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 37) + out[19] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (27+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 14) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 55) + out[20] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (9+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[21] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 9) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 50) + out[22] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (14+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 27) + out[23] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (37+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 4) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 45) + out[24] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (19+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 22) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 63) + out[25] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (1+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) + out[26] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (24+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 17) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 58) + out[27] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (6+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 35) + out[28] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (29+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 12) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 53) + out[29] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (11+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 30) + out[30] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (34+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 7) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[31] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 25) + out[32] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (39+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 2) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 43) + out[33] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (21+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 20) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 61) + out[34] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (3+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 38) + out[35] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (26+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 15) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) + out[36] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (8+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 33) + out[37] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (31+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 10) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 51) + out[38] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (13+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 28) + out[39] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (36+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 5) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 46) + out[40] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (18+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 23) +} + +func deltapackzigzag_int64_42(initoffset int64, in *[64]int64, out *[42]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 42) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (22+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 20) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (2+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 40) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (24+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 18) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (4+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 38) + out[5] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (26+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (6+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 36) + out[7] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (28+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 14) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (8+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 34) + out[9] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (30+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 12) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (10+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[11] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 10) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (12+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 30) + out[13] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (34+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 8) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 50) + out[14] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (14+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 28) + out[15] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (36+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 6) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (16+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 26) + out[17] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (38+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 4) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 46) + out[18] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (18+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 24) + out[19] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (40+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 2) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (20+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 22) + out[21] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 42) + out[22] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (22+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 20) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 62) + out[23] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (2+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 40) + out[24] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (24+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 18) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 60) + out[25] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (4+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 38) + out[26] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (26+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 58) + out[27] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (6+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 36) + out[28] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (28+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 14) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 56) + out[29] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (8+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 34) + out[30] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (30+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 12) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 54) + out[31] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (10+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[32] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 10) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 52) + out[33] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (12+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 30) + out[34] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (34+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 8) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 50) + out[35] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (14+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 28) + out[36] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (36+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 6) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) + out[37] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (16+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 26) + out[38] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (38+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 4) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 46) + out[39] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (18+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 24) + out[40] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (40+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 2) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 44) + out[41] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (20+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 22) +} + +func deltapackzigzag_int64_43(initoffset int64, in *[64]int64, out *[43]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 43) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (21+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 22) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (42+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 1) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 44) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (20+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 23) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (41+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 2) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 45) + out[5] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (19+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) + out[6] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (40+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 3) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 46) + out[7] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (18+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 25) + out[8] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (39+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 4) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 47) + out[9] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (17+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 26) + out[10] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (38+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 5) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[11] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 27) + out[12] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (37+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 6) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 49) + out[13] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (15+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 28) + out[14] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (36+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 7) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 50) + out[15] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (14+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 29) + out[16] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (35+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 51) + out[17] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (13+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 30) + out[18] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (34+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 9) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 52) + out[19] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (12+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 31) + out[20] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (33+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 10) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 53) + out[21] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (11+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[22] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 11) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 54) + out[23] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (10+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 33) + out[24] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (31+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 12) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 55) + out[25] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (9+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 34) + out[26] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (30+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 13) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) + out[27] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (8+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 35) + out[28] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (29+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 14) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 57) + out[29] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (7+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 36) + out[30] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (28+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 15) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 58) + out[31] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (6+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 37) + out[32] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (27+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 59) + out[33] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (5+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 38) + out[34] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (26+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 17) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 60) + out[35] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (4+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 39) + out[36] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (25+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 18) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 61) + out[37] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (3+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) + out[38] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (24+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 19) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 62) + out[39] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (2+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 41) + out[40] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (23+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 20) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 63) + out[41] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (1+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 42) + out[42] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (22+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 21) +} + +func deltapackzigzag_int64_44(initoffset int64, in *[64]int64, out *[44]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 44) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (20+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 24) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (40+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 4) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 48) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (16+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 28) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (36+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 8) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 52) + out[5] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (12+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) + out[6] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (32+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 12) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (8+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 36) + out[8] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (28+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 16) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 60) + out[9] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (4+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 40) + out[10] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (24+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 20) + out[11] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 44) + out[12] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (20+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 24) + out[13] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (40+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 4) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 48) + out[14] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (16+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 28) + out[15] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (36+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 8) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 52) + out[16] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (12+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) + out[17] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (32+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 12) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 56) + out[18] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (8+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 36) + out[19] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (28+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 16) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 60) + out[20] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (4+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 40) + out[21] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (24+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 20) + out[22] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 44) + out[23] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (20+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 24) + out[24] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (40+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 4) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 48) + out[25] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (16+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 28) + out[26] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (36+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 8) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 52) + out[27] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (12+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) + out[28] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (32+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 12) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 56) + out[29] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (8+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 36) + out[30] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (28+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 16) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 60) + out[31] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (4+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 40) + out[32] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (24+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 20) + out[33] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 44) + out[34] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (20+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 24) + out[35] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (40+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 4) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 48) + out[36] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (16+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 28) + out[37] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (36+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 8) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 52) + out[38] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (12+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) + out[39] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (32+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 12) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 56) + out[40] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (8+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 36) + out[41] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (28+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 16) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 60) + out[42] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (4+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 40) + out[43] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (24+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 20) +} + +func deltapackzigzag_int64_45(initoffset int64, in *[64]int64, out *[45]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 45) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (19+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 26) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (38+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 7) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (12+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 33) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (31+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 14) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 59) + out[5] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (5+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) + out[6] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (24+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 21) + out[7] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (43+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 2) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 47) + out[8] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (17+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 28) + out[9] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (36+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 9) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (10+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 35) + out[11] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (29+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 61) + out[12] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (3+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 42) + out[13] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (22+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 23) + out[14] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (41+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 4) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 49) + out[15] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (15+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 30) + out[16] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (34+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 11) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (8+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 37) + out[18] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (27+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 18) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 63) + out[19] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (1+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (20+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 25) + out[21] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (39+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 6) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 51) + out[22] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (13+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[23] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 13) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 58) + out[24] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (6+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 39) + out[25] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (25+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 20) + out[26] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (44+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 1) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 46) + out[27] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (18+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 27) + out[28] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (37+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 53) + out[29] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (11+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 34) + out[30] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (30+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 15) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 60) + out[31] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (4+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 41) + out[32] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (23+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 22) + out[33] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (42+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 3) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[34] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 29) + out[35] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (35+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 10) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 55) + out[36] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (9+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 36) + out[37] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (28+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 17) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 62) + out[38] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (2+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 43) + out[39] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (21+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) + out[40] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (40+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 5) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 50) + out[41] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (14+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 31) + out[42] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (33+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 12) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 57) + out[43] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (7+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 38) + out[44] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (26+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 19) +} + +func deltapackzigzag_int64_46(initoffset int64, in *[64]int64, out *[46]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 46) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (18+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 28) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (36+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 10) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 56) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (8+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 38) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (26+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 20) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (44+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 2) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) + out[6] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (16+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 30) + out[7] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (34+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 12) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 58) + out[8] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (6+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 40) + out[9] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (24+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 22) + out[10] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (42+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 4) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 50) + out[11] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (14+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[12] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 14) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 60) + out[13] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (4+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 42) + out[14] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (22+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 24) + out[15] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (40+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 6) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 52) + out[16] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (12+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 34) + out[17] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (30+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 62) + out[18] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (2+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 44) + out[19] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (20+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 26) + out[20] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (38+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 8) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 54) + out[21] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (10+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 36) + out[22] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (28+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 18) + out[23] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 46) + out[24] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (18+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 28) + out[25] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (36+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 10) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 56) + out[26] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (8+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 38) + out[27] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (26+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 20) + out[28] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (44+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 2) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) + out[29] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (16+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 30) + out[30] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (34+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 12) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 58) + out[31] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (6+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 40) + out[32] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (24+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 22) + out[33] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (42+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 4) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 50) + out[34] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (14+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[35] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 14) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 60) + out[36] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (4+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 42) + out[37] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (22+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 24) + out[38] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (40+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 6) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 52) + out[39] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (12+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 34) + out[40] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (30+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 62) + out[41] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (2+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 44) + out[42] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (20+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 26) + out[43] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (38+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 8) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 54) + out[44] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (10+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 36) + out[45] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (28+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 18) +} + +func deltapackzigzag_int64_47(initoffset int64, in *[64]int64, out *[47]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 47) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (17+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 30) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (34+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 13) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 60) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (4+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 43) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (21+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 26) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (38+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 9) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) + out[6] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (8+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 39) + out[7] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (25+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 22) + out[8] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (42+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 5) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 52) + out[9] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (12+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 35) + out[10] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (29+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 18) + out[11] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (46+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 1) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[12] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 31) + out[13] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (33+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 14) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 61) + out[14] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (3+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 44) + out[15] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (20+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 27) + out[16] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (37+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 10) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 57) + out[17] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (7+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) + out[18] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (24+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 23) + out[19] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (41+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 6) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 53) + out[20] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (11+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 36) + out[21] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (28+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 19) + out[22] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (45+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 2) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 49) + out[23] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (15+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[24] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 15) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 62) + out[25] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (2+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 45) + out[26] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (19+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 28) + out[27] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (36+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 11) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 58) + out[28] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (6+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 41) + out[29] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (23+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) + out[30] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (40+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 7) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 54) + out[31] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (10+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 37) + out[32] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (27+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 20) + out[33] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (44+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 3) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 50) + out[34] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (14+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 33) + out[35] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (31+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 63) + out[36] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (1+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 46) + out[37] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (18+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 29) + out[38] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (35+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 12) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 59) + out[39] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (5+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 42) + out[40] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (22+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 25) + out[41] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (39+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 55) + out[42] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (9+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 38) + out[43] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (26+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 21) + out[44] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (43+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 4) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 51) + out[45] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (13+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 34) + out[46] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (30+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 17) +} + +func deltapackzigzag_int64_48(initoffset int64, in *[64]int64, out *[48]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 48) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (16+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 32) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (32+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 16) + out[3] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 48) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (16+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 32) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (32+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 16) + out[6] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 48) + out[7] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (16+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 32) + out[8] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (32+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 16) + out[9] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 48) + out[10] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (16+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 32) + out[11] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (32+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 16) + out[12] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 48) + out[13] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (16+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 32) + out[14] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (32+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 16) + out[15] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (16+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 32) + out[17] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (32+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 16) + out[18] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (16+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 32) + out[20] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (32+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 16) + out[21] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 48) + out[22] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (16+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 32) + out[23] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (32+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 16) + out[24] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 48) + out[25] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (16+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 32) + out[26] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (32+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 16) + out[27] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 48) + out[28] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (16+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 32) + out[29] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (32+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 16) + out[30] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 48) + out[31] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (16+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 32) + out[32] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (32+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 16) + out[33] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 48) + out[34] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (16+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 32) + out[35] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (32+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 16) + out[36] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 48) + out[37] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (16+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 32) + out[38] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (32+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 16) + out[39] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 48) + out[40] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (16+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 32) + out[41] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (32+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 16) + out[42] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 48) + out[43] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (16+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 32) + out[44] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (32+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 16) + out[45] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 48) + out[46] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (16+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 32) + out[47] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (32+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 16) +} + +func deltapackzigzag_int64_49(initoffset int64, in *[64]int64, out *[49]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 49) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (15+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 34) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (30+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 19) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (45+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 4) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 53) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (11+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 38) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (26+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 23) + out[6] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (41+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 57) + out[7] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (7+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 42) + out[8] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (22+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 27) + out[9] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (37+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 12) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 61) + out[10] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (3+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 46) + out[11] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (18+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 31) + out[12] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (33+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) + out[13] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (48+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 1) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 50) + out[14] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (14+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 35) + out[15] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (29+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 20) + out[16] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (44+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 5) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 54) + out[17] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (10+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 39) + out[18] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (25+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) + out[19] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (40+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 9) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 58) + out[20] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (6+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 43) + out[21] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (21+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 28) + out[22] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (36+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 13) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 62) + out[23] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (2+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 47) + out[24] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (17+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[25] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 17) + out[26] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (47+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 2) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 51) + out[27] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (13+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 36) + out[28] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (28+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 21) + out[29] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (43+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 6) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 55) + out[30] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (9+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) + out[31] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (24+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 25) + out[32] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (39+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 10) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 59) + out[33] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (5+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 44) + out[34] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (20+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 29) + out[35] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (35+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 14) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 63) + out[36] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (1+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[37] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 33) + out[38] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (31+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 18) + out[39] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (46+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 3) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 52) + out[40] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (12+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 37) + out[41] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (27+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 22) + out[42] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (42+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 7) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) + out[43] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (8+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 41) + out[44] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (23+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 26) + out[45] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (38+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 11) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 60) + out[46] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (4+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 45) + out[47] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (19+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 30) + out[48] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (34+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 15) +} + +func deltapackzigzag_int64_50(initoffset int64, in *[64]int64, out *[50]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 50) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (14+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 36) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (28+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 22) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (42+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 8) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 58) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (6+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 44) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (20+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 30) + out[6] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (34+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) + out[7] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (48+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 2) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 52) + out[8] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (12+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 38) + out[9] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (26+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 24) + out[10] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (40+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 10) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 60) + out[11] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (4+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 46) + out[12] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (18+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[13] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 18) + out[14] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (46+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 4) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 54) + out[15] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (10+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 40) + out[16] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (24+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 26) + out[17] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (38+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 12) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 62) + out[18] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (2+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (16+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 34) + out[20] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (30+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 20) + out[21] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (44+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 6) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 56) + out[22] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (8+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 42) + out[23] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (22+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 28) + out[24] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (36+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 14) + out[25] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 50) + out[26] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (14+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 36) + out[27] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (28+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 22) + out[28] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (42+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 8) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 58) + out[29] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (6+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 44) + out[30] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (20+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 30) + out[31] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (34+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) + out[32] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (48+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 2) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 52) + out[33] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (12+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 38) + out[34] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (26+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 24) + out[35] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (40+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 10) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 60) + out[36] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (4+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 46) + out[37] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (18+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[38] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 18) + out[39] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (46+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 4) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 54) + out[40] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (10+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 40) + out[41] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (24+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 26) + out[42] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (38+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 12) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 62) + out[43] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (2+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) + out[44] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (16+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 34) + out[45] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (30+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 20) + out[46] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (44+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 6) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 56) + out[47] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (8+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 42) + out[48] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (22+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 28) + out[49] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (36+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 14) +} + +func deltapackzigzag_int64_51(initoffset int64, in *[64]int64, out *[51]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 51) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (13+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 38) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (26+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 25) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (39+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 12) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 63) + out[4] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (1+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 50) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (14+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 37) + out[6] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (27+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) + out[7] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (40+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 11) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 62) + out[8] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (2+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 49) + out[9] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (15+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 36) + out[10] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (28+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 23) + out[11] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (41+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 10) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 61) + out[12] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (3+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[13] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 35) + out[14] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (29+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 22) + out[15] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (42+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 9) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 60) + out[16] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (4+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 47) + out[17] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (17+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 34) + out[18] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (30+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 21) + out[19] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (43+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 59) + out[20] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (5+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 46) + out[21] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (18+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 33) + out[22] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (31+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 20) + out[23] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (44+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 7) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 58) + out[24] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (6+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 45) + out[25] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (19+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[26] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 19) + out[27] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (45+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 6) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 57) + out[28] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (7+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 44) + out[29] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (20+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 31) + out[30] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (33+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 18) + out[31] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (46+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 5) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) + out[32] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (8+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 43) + out[33] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (21+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 30) + out[34] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (34+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 17) + out[35] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (47+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 4) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 55) + out[36] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (9+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 42) + out[37] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (22+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 29) + out[38] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (35+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) + out[39] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (48+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 3) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 54) + out[40] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (10+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 41) + out[41] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (23+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 28) + out[42] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (36+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 15) + out[43] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (49+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 2) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 53) + out[44] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (11+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) + out[45] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (24+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 27) + out[46] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (37+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 14) + out[47] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (50+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 1) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 52) + out[48] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (12+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 39) + out[49] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (25+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 26) + out[50] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (38+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 13) +} + +func deltapackzigzag_int64_52(initoffset int64, in *[64]int64, out *[52]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 52) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (12+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 40) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (24+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 28) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (36+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 16) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (48+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 4) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 56) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (8+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 44) + out[6] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (20+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) + out[7] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (32+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 20) + out[8] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (44+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 8) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 60) + out[9] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (4+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 48) + out[10] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (16+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 36) + out[11] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (28+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 24) + out[12] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (40+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 12) + out[13] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 52) + out[14] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (12+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 40) + out[15] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (24+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 28) + out[16] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (36+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 16) + out[17] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (48+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 4) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 56) + out[18] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (8+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 44) + out[19] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (20+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) + out[20] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (32+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 20) + out[21] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (44+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 8) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 60) + out[22] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (4+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 48) + out[23] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (16+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 36) + out[24] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (28+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 24) + out[25] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (40+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 12) + out[26] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 52) + out[27] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (12+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 40) + out[28] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (24+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 28) + out[29] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (36+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 16) + out[30] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (48+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 4) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 56) + out[31] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (8+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 44) + out[32] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (20+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) + out[33] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (32+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 20) + out[34] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (44+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 8) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 60) + out[35] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (4+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 48) + out[36] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (16+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 36) + out[37] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (28+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 24) + out[38] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (40+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 12) + out[39] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 52) + out[40] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (12+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 40) + out[41] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (24+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 28) + out[42] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (36+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 16) + out[43] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (48+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 4) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 56) + out[44] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (8+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 44) + out[45] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (20+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) + out[46] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (32+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 20) + out[47] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (44+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 8) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 60) + out[48] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (4+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 48) + out[49] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (16+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 36) + out[50] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (28+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 24) + out[51] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (40+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 12) +} + +func deltapackzigzag_int64_53(initoffset int64, in *[64]int64, out *[53]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 53) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (11+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 42) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (22+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 31) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (33+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 20) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (44+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 9) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 62) + out[5] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (2+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 51) + out[6] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (13+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) + out[7] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (24+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 29) + out[8] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (35+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 18) + out[9] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (46+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 7) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 60) + out[10] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (4+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 49) + out[11] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (15+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 38) + out[12] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (26+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 27) + out[13] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (37+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) + out[14] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (48+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 5) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 58) + out[15] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (6+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 47) + out[16] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (17+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 36) + out[17] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (28+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 25) + out[18] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (39+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 14) + out[19] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (50+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 3) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) + out[20] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (8+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 45) + out[21] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (19+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 34) + out[22] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (30+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 23) + out[23] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (41+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 12) + out[24] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (52+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 1) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 54) + out[25] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (10+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 43) + out[26] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (21+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[27] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 21) + out[28] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (43+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 10) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 63) + out[29] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (1+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 52) + out[30] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (12+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 41) + out[31] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (23+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 30) + out[32] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (34+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 19) + out[33] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (45+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 61) + out[34] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (3+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 50) + out[35] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (14+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 39) + out[36] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (25+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 28) + out[37] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (36+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 17) + out[38] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (47+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 6) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 59) + out[39] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (5+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[40] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 37) + out[41] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (27+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 26) + out[42] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (38+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 15) + out[43] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (49+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 4) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 57) + out[44] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (7+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 46) + out[45] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (18+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 35) + out[46] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (29+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) + out[47] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (40+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 13) + out[48] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (51+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 2) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 55) + out[49] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (9+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 44) + out[50] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (20+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 33) + out[51] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (31+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 22) + out[52] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (42+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 11) +} + +func deltapackzigzag_int64_54(initoffset int64, in *[64]int64, out *[54]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 54) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (10+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 44) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (20+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 34) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (30+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 24) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (40+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 14) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (50+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 4) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (6+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) + out[7] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (16+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 38) + out[8] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (26+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 28) + out[9] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (36+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 18) + out[10] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (46+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 8) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 62) + out[11] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (2+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (12+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 42) + out[13] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (22+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[14] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 22) + out[15] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (42+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 12) + out[16] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (52+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 2) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (8+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 46) + out[18] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (18+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 36) + out[19] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (28+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 26) + out[20] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (38+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) + out[21] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (48+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 6) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 60) + out[22] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (4+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 50) + out[23] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (14+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 40) + out[24] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (24+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 30) + out[25] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (34+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 20) + out[26] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (44+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 10) + out[27] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 54) + out[28] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (10+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 44) + out[29] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (20+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 34) + out[30] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (30+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 24) + out[31] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (40+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 14) + out[32] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (50+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 4) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 58) + out[33] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (6+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) + out[34] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (16+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 38) + out[35] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (26+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 28) + out[36] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (36+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 18) + out[37] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (46+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 8) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 62) + out[38] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (2+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 52) + out[39] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (12+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 42) + out[40] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (22+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[41] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 22) + out[42] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (42+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 12) + out[43] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (52+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 2) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 56) + out[44] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (8+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 46) + out[45] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (18+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 36) + out[46] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (28+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 26) + out[47] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (38+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) + out[48] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (48+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 6) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 60) + out[49] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (4+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 50) + out[50] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (14+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 40) + out[51] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (24+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 30) + out[52] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (34+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 20) + out[53] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (44+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 10) +} + +func deltapackzigzag_int64_55(initoffset int64, in *[64]int64, out *[55]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 55) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (9+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 46) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (18+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 37) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (27+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 28) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (36+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 19) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (45+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 10) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (54+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 1) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) + out[7] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (8+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 47) + out[8] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (17+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 38) + out[9] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (26+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 29) + out[10] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (35+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 20) + out[11] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (44+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 11) + out[12] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (53+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 2) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 57) + out[13] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (7+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[14] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 39) + out[15] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (25+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 30) + out[16] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (34+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 21) + out[17] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (43+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 12) + out[18] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (52+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 3) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 58) + out[19] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (6+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 49) + out[20] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (15+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) + out[21] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (24+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 31) + out[22] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (33+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 22) + out[23] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (42+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 13) + out[24] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (51+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 4) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 59) + out[25] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (5+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 50) + out[26] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (14+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 41) + out[27] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (23+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[28] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 23) + out[29] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (41+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 14) + out[30] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (50+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 5) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 60) + out[31] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (4+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 51) + out[32] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (13+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 42) + out[33] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (22+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 33) + out[34] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (31+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) + out[35] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (40+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 15) + out[36] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (49+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 6) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 61) + out[37] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (3+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 52) + out[38] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (12+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 43) + out[39] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (21+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 34) + out[40] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (30+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 25) + out[41] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (39+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) + out[42] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (48+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 7) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 62) + out[43] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (2+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 53) + out[44] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (11+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 44) + out[45] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (20+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 35) + out[46] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (29+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 26) + out[47] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (38+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 17) + out[48] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (47+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 63) + out[49] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (1+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 54) + out[50] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (10+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 45) + out[51] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (19+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 36) + out[52] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (28+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 27) + out[53] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (37+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 18) + out[54] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (46+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 9) +} + +func deltapackzigzag_int64_56(initoffset int64, in *[64]int64, out *[56]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 56) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (8+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 48) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (16+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 40) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (24+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 32) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (32+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 24) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (40+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 16) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (48+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 8) + out[7] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (8+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 48) + out[9] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (16+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 40) + out[10] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (24+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 32) + out[11] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (32+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 24) + out[12] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (40+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 16) + out[13] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (48+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 8) + out[14] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 56) + out[15] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (8+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (16+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 40) + out[17] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (24+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 32) + out[18] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (32+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 24) + out[19] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (40+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 16) + out[20] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (48+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 8) + out[21] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 56) + out[22] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (8+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 48) + out[23] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (16+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 40) + out[24] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (24+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 32) + out[25] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (32+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 24) + out[26] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (40+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 16) + out[27] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (48+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 8) + out[28] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 56) + out[29] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (8+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 48) + out[30] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (16+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 40) + out[31] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (24+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 32) + out[32] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (32+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 24) + out[33] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (40+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 16) + out[34] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (48+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 8) + out[35] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 56) + out[36] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (8+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 48) + out[37] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (16+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 40) + out[38] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (24+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 32) + out[39] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (32+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 24) + out[40] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (40+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 16) + out[41] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (48+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 8) + out[42] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 56) + out[43] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (8+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 48) + out[44] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (16+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 40) + out[45] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (24+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 32) + out[46] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (32+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 24) + out[47] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (40+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 16) + out[48] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (48+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 8) + out[49] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 56) + out[50] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (8+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 48) + out[51] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (16+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 40) + out[52] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (24+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 32) + out[53] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (32+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 24) + out[54] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (40+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 16) + out[55] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (48+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 8) +} + +func deltapackzigzag_int64_57(initoffset int64, in *[64]int64, out *[57]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 57) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (7+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 50) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (14+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 43) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (21+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 36) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (28+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 29) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (35+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 22) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (42+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 15) + out[7] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (49+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 8) + out[8] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (56+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 1) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 58) + out[9] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (6+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 51) + out[10] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (13+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 44) + out[11] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (20+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 37) + out[12] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (27+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 30) + out[13] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (34+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 23) + out[14] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (41+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) + out[15] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (48+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 9) + out[16] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (55+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 2) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 59) + out[17] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (5+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 52) + out[18] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (12+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 45) + out[19] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (19+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 38) + out[20] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (26+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 31) + out[21] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (33+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 24) + out[22] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (40+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 17) + out[23] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (47+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 10) + out[24] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (54+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 3) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 60) + out[25] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (4+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 53) + out[26] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (11+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 46) + out[27] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (18+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 39) + out[28] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (25+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[29] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 25) + out[30] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (39+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 18) + out[31] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (46+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 11) + out[32] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (53+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 4) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 61) + out[33] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (3+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 54) + out[34] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (10+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 47) + out[35] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (17+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 40) + out[36] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (24+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 33) + out[37] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (31+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 26) + out[38] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (38+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 19) + out[39] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (45+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 12) + out[40] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (52+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 5) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 62) + out[41] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (2+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 55) + out[42] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (9+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[43] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 41) + out[44] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (23+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 34) + out[45] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (30+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 27) + out[46] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (37+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 20) + out[47] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (44+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 13) + out[48] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (51+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 6) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 63) + out[49] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (1+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 56) + out[50] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (8+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 49) + out[51] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (15+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 42) + out[52] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (22+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 35) + out[53] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (29+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 28) + out[54] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (36+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 21) + out[55] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (43+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 14) + out[56] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (50+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 7) +} + +func deltapackzigzag_int64_58(initoffset int64, in *[64]int64, out *[58]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 58) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (6+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 52) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (12+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 46) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (18+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 40) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (24+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 34) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (30+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 28) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (36+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 22) + out[7] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (42+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 16) + out[8] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (48+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 10) + out[9] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (54+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 4) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 62) + out[10] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (2+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 56) + out[11] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (8+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 50) + out[12] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (14+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 44) + out[13] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (20+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 38) + out[14] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (26+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[15] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 26) + out[16] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (38+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 20) + out[17] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (44+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 14) + out[18] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (50+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 8) + out[19] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (56+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 2) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 60) + out[20] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (4+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 54) + out[21] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (10+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 48) + out[22] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (16+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 42) + out[23] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (22+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 36) + out[24] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (28+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 30) + out[25] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (34+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 24) + out[26] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (40+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 18) + out[27] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (46+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 12) + out[28] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (52+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 6) + out[29] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 58) + out[30] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (6+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 52) + out[31] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (12+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 46) + out[32] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (18+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 40) + out[33] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (24+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 34) + out[34] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (30+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 28) + out[35] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (36+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 22) + out[36] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (42+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 16) + out[37] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (48+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 10) + out[38] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (54+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 4) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 62) + out[39] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (2+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 56) + out[40] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (8+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 50) + out[41] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (14+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 44) + out[42] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (20+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 38) + out[43] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (26+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[44] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 26) + out[45] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (38+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 20) + out[46] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (44+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 14) + out[47] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (50+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 8) + out[48] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (56+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 2) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 60) + out[49] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (4+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 54) + out[50] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (10+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 48) + out[51] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (16+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 42) + out[52] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (22+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 36) + out[53] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (28+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 30) + out[54] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (34+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 24) + out[55] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (40+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 18) + out[56] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (46+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 12) + out[57] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (52+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 6) +} + +func deltapackzigzag_int64_59(initoffset int64, in *[64]int64, out *[59]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 59) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (5+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 54) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (10+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 49) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (15+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 44) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (20+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 39) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (25+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 34) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (30+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 29) + out[7] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (35+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 24) + out[8] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (40+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 19) + out[9] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (45+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 14) + out[10] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (50+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 9) + out[11] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (55+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 4) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 63) + out[12] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (1+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 58) + out[13] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (6+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 53) + out[14] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (11+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[15] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 43) + out[16] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (21+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 38) + out[17] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (26+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 33) + out[18] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (31+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 28) + out[19] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (36+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 23) + out[20] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (41+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 18) + out[21] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (46+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 13) + out[22] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (51+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 8) + out[23] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (56+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 3) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 62) + out[24] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (2+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 57) + out[25] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (7+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 52) + out[26] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (12+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 47) + out[27] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (17+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 42) + out[28] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (22+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 37) + out[29] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (27+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[30] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 27) + out[31] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (37+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 22) + out[32] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (42+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 17) + out[33] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (47+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 12) + out[34] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (52+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 7) + out[35] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (57+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 2) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 61) + out[36] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (3+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 56) + out[37] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (8+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 51) + out[38] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (13+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 46) + out[39] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (18+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 41) + out[40] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (23+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 36) + out[41] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (28+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 31) + out[42] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (33+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 26) + out[43] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (38+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 21) + out[44] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (43+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) + out[45] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (48+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 11) + out[46] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (53+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 6) + out[47] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (58+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 1) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 60) + out[48] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (4+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 55) + out[49] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (9+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 50) + out[50] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (14+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 45) + out[51] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (19+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 40) + out[52] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (24+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 35) + out[53] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (29+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 30) + out[54] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (34+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 25) + out[55] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (39+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 20) + out[56] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (44+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 15) + out[57] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (49+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 10) + out[58] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (54+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 5) +} + +func deltapackzigzag_int64_60(initoffset int64, in *[64]int64, out *[60]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 60) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (4+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 56) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (8+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 52) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (12+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 48) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (16+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 44) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (20+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 40) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (24+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 36) + out[7] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (28+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 32) + out[8] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (32+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 28) + out[9] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (36+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 24) + out[10] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (40+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 20) + out[11] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (44+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 16) + out[12] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (48+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 12) + out[13] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (52+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 8) + out[14] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (56+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 4) + out[15] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 60) + out[16] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (4+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 56) + out[17] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (8+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 52) + out[18] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (12+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 48) + out[19] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (16+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (20+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 40) + out[21] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (24+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 36) + out[22] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (28+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 32) + out[23] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (32+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 28) + out[24] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (36+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 24) + out[25] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (40+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 20) + out[26] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (44+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 16) + out[27] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (48+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 12) + out[28] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (52+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 8) + out[29] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (56+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 4) + out[30] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 60) + out[31] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (4+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 56) + out[32] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (8+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 52) + out[33] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (12+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 48) + out[34] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (16+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 44) + out[35] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (20+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 40) + out[36] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (24+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 36) + out[37] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (28+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 32) + out[38] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (32+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 28) + out[39] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (36+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 24) + out[40] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (40+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 20) + out[41] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (44+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 16) + out[42] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (48+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 12) + out[43] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (52+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 8) + out[44] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (56+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 4) + out[45] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 60) + out[46] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (4+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 56) + out[47] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (8+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 52) + out[48] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (12+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 48) + out[49] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (16+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 44) + out[50] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (20+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 40) + out[51] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (24+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 36) + out[52] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (28+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 32) + out[53] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (32+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 28) + out[54] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (36+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 24) + out[55] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (40+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 20) + out[56] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (44+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 16) + out[57] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (48+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 12) + out[58] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (52+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 8) + out[59] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (56+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 4) +} + +func deltapackzigzag_int64_61(initoffset int64, in *[64]int64, out *[61]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 61) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (3+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 58) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (6+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 55) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (9+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 52) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (12+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 49) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (15+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 46) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (18+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 43) + out[7] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (21+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 40) + out[8] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (24+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 37) + out[9] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (27+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 34) + out[10] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (30+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 31) + out[11] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (33+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 28) + out[12] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (36+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 25) + out[13] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (39+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 22) + out[14] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (42+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 19) + out[15] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (45+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 16) + out[16] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (48+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 13) + out[17] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (51+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 10) + out[18] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (54+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 7) + out[19] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (57+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 4) + out[20] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (60+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 1) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 62) + out[21] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (2+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 59) + out[22] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (5+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 56) + out[23] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (8+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 53) + out[24] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (11+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 50) + out[25] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (14+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 47) + out[26] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (17+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 44) + out[27] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (20+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 41) + out[28] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (23+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 38) + out[29] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (26+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 35) + out[30] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (29+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[31] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 29) + out[32] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (35+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 26) + out[33] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (38+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 23) + out[34] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (41+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 20) + out[35] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (44+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 17) + out[36] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (47+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 14) + out[37] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (50+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 11) + out[38] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (53+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 8) + out[39] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (56+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 5) + out[40] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (59+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 2) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 63) + out[41] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (1+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 60) + out[42] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (4+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 57) + out[43] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (7+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 54) + out[44] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (10+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 51) + out[45] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (13+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 48) + out[46] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (16+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 45) + out[47] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (19+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 42) + out[48] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (22+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 39) + out[49] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (25+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 36) + out[50] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (28+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 33) + out[51] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (31+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 30) + out[52] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (34+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 27) + out[53] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (37+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 24) + out[54] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (40+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 21) + out[55] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (43+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 18) + out[56] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (46+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 15) + out[57] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (49+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 12) + out[58] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (52+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 9) + out[59] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (55+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 6) + out[60] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (58+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 3) +} + +func deltapackzigzag_int64_62(initoffset int64, in *[64]int64, out *[62]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 62) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (2+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 60) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (4+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 58) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (6+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 56) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (8+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 54) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (10+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 52) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (12+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 50) + out[7] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (14+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 48) + out[8] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (16+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 46) + out[9] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (18+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 44) + out[10] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (20+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 42) + out[11] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (22+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 40) + out[12] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (24+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 38) + out[13] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (26+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 36) + out[14] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (28+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 34) + out[15] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (30+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 32) + out[16] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (32+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 30) + out[17] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (34+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 28) + out[18] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (36+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 26) + out[19] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (38+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 24) + out[20] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (40+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 22) + out[21] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (42+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 20) + out[22] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (44+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 18) + out[23] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (46+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 16) + out[24] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (48+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 14) + out[25] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (50+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 12) + out[26] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (52+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 10) + out[27] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (54+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 8) + out[28] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (56+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 6) + out[29] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (58+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 4) + out[30] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (60+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 2) + out[31] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 62) + out[32] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (2+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 60) + out[33] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (4+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 58) + out[34] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (6+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 56) + out[35] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (8+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 54) + out[36] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (10+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 52) + out[37] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (12+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 50) + out[38] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (14+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 48) + out[39] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (16+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 46) + out[40] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (18+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 44) + out[41] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (20+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 42) + out[42] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (22+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 40) + out[43] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (24+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 38) + out[44] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (26+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 36) + out[45] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (28+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 34) + out[46] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (30+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 32) + out[47] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (32+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 30) + out[48] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (34+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 28) + out[49] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (36+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 26) + out[50] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (38+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 24) + out[51] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (40+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 22) + out[52] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (42+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 20) + out[53] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (44+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 18) + out[54] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (46+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 16) + out[55] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (48+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 14) + out[56] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (50+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 12) + out[57] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (52+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 10) + out[58] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (54+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 8) + out[59] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (56+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 6) + out[60] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (58+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 4) + out[61] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (60+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 2) +} + +func deltapackzigzag_int64_63(initoffset int64, in *[64]int64, out *[63]uint64, ntz int) { + out[0] = + (uint64(((in[0] - initoffset) << 1) ^ ((in[0] - initoffset) >> 63))) >> ntz | + ((uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> ntz << 63) + out[1] = + (uint64(((in[1] - in[0]) << 1) ^ ((in[1] - in[0]) >> 63))) >> (1+ntz) | + ((uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> ntz << 62) + out[2] = + (uint64(((in[2] - in[1]) << 1) ^ ((in[2] - in[1]) >> 63))) >> (2+ntz) | + ((uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> ntz << 61) + out[3] = + (uint64(((in[3] - in[2]) << 1) ^ ((in[3] - in[2]) >> 63))) >> (3+ntz) | + ((uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> ntz << 60) + out[4] = + (uint64(((in[4] - in[3]) << 1) ^ ((in[4] - in[3]) >> 63))) >> (4+ntz) | + ((uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> ntz << 59) + out[5] = + (uint64(((in[5] - in[4]) << 1) ^ ((in[5] - in[4]) >> 63))) >> (5+ntz) | + ((uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> ntz << 58) + out[6] = + (uint64(((in[6] - in[5]) << 1) ^ ((in[6] - in[5]) >> 63))) >> (6+ntz) | + ((uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> ntz << 57) + out[7] = + (uint64(((in[7] - in[6]) << 1) ^ ((in[7] - in[6]) >> 63))) >> (7+ntz) | + ((uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> ntz << 56) + out[8] = + (uint64(((in[8] - in[7]) << 1) ^ ((in[8] - in[7]) >> 63))) >> (8+ntz) | + ((uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> ntz << 55) + out[9] = + (uint64(((in[9] - in[8]) << 1) ^ ((in[9] - in[8]) >> 63))) >> (9+ntz) | + ((uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> ntz << 54) + out[10] = + (uint64(((in[10] - in[9]) << 1) ^ ((in[10] - in[9]) >> 63))) >> (10+ntz) | + ((uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> ntz << 53) + out[11] = + (uint64(((in[11] - in[10]) << 1) ^ ((in[11] - in[10]) >> 63))) >> (11+ntz) | + ((uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> ntz << 52) + out[12] = + (uint64(((in[12] - in[11]) << 1) ^ ((in[12] - in[11]) >> 63))) >> (12+ntz) | + ((uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> ntz << 51) + out[13] = + (uint64(((in[13] - in[12]) << 1) ^ ((in[13] - in[12]) >> 63))) >> (13+ntz) | + ((uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> ntz << 50) + out[14] = + (uint64(((in[14] - in[13]) << 1) ^ ((in[14] - in[13]) >> 63))) >> (14+ntz) | + ((uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> ntz << 49) + out[15] = + (uint64(((in[15] - in[14]) << 1) ^ ((in[15] - in[14]) >> 63))) >> (15+ntz) | + ((uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> ntz << 48) + out[16] = + (uint64(((in[16] - in[15]) << 1) ^ ((in[16] - in[15]) >> 63))) >> (16+ntz) | + ((uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> ntz << 47) + out[17] = + (uint64(((in[17] - in[16]) << 1) ^ ((in[17] - in[16]) >> 63))) >> (17+ntz) | + ((uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> ntz << 46) + out[18] = + (uint64(((in[18] - in[17]) << 1) ^ ((in[18] - in[17]) >> 63))) >> (18+ntz) | + ((uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> ntz << 45) + out[19] = + (uint64(((in[19] - in[18]) << 1) ^ ((in[19] - in[18]) >> 63))) >> (19+ntz) | + ((uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> ntz << 44) + out[20] = + (uint64(((in[20] - in[19]) << 1) ^ ((in[20] - in[19]) >> 63))) >> (20+ntz) | + ((uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> ntz << 43) + out[21] = + (uint64(((in[21] - in[20]) << 1) ^ ((in[21] - in[20]) >> 63))) >> (21+ntz) | + ((uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> ntz << 42) + out[22] = + (uint64(((in[22] - in[21]) << 1) ^ ((in[22] - in[21]) >> 63))) >> (22+ntz) | + ((uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> ntz << 41) + out[23] = + (uint64(((in[23] - in[22]) << 1) ^ ((in[23] - in[22]) >> 63))) >> (23+ntz) | + ((uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> ntz << 40) + out[24] = + (uint64(((in[24] - in[23]) << 1) ^ ((in[24] - in[23]) >> 63))) >> (24+ntz) | + ((uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> ntz << 39) + out[25] = + (uint64(((in[25] - in[24]) << 1) ^ ((in[25] - in[24]) >> 63))) >> (25+ntz) | + ((uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> ntz << 38) + out[26] = + (uint64(((in[26] - in[25]) << 1) ^ ((in[26] - in[25]) >> 63))) >> (26+ntz) | + ((uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> ntz << 37) + out[27] = + (uint64(((in[27] - in[26]) << 1) ^ ((in[27] - in[26]) >> 63))) >> (27+ntz) | + ((uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> ntz << 36) + out[28] = + (uint64(((in[28] - in[27]) << 1) ^ ((in[28] - in[27]) >> 63))) >> (28+ntz) | + ((uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> ntz << 35) + out[29] = + (uint64(((in[29] - in[28]) << 1) ^ ((in[29] - in[28]) >> 63))) >> (29+ntz) | + ((uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> ntz << 34) + out[30] = + (uint64(((in[30] - in[29]) << 1) ^ ((in[30] - in[29]) >> 63))) >> (30+ntz) | + ((uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> ntz << 33) + out[31] = + (uint64(((in[31] - in[30]) << 1) ^ ((in[31] - in[30]) >> 63))) >> (31+ntz) | + ((uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> ntz << 32) + out[32] = + (uint64(((in[32] - in[31]) << 1) ^ ((in[32] - in[31]) >> 63))) >> (32+ntz) | + ((uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> ntz << 31) + out[33] = + (uint64(((in[33] - in[32]) << 1) ^ ((in[33] - in[32]) >> 63))) >> (33+ntz) | + ((uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> ntz << 30) + out[34] = + (uint64(((in[34] - in[33]) << 1) ^ ((in[34] - in[33]) >> 63))) >> (34+ntz) | + ((uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> ntz << 29) + out[35] = + (uint64(((in[35] - in[34]) << 1) ^ ((in[35] - in[34]) >> 63))) >> (35+ntz) | + ((uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> ntz << 28) + out[36] = + (uint64(((in[36] - in[35]) << 1) ^ ((in[36] - in[35]) >> 63))) >> (36+ntz) | + ((uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> ntz << 27) + out[37] = + (uint64(((in[37] - in[36]) << 1) ^ ((in[37] - in[36]) >> 63))) >> (37+ntz) | + ((uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> ntz << 26) + out[38] = + (uint64(((in[38] - in[37]) << 1) ^ ((in[38] - in[37]) >> 63))) >> (38+ntz) | + ((uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> ntz << 25) + out[39] = + (uint64(((in[39] - in[38]) << 1) ^ ((in[39] - in[38]) >> 63))) >> (39+ntz) | + ((uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> ntz << 24) + out[40] = + (uint64(((in[40] - in[39]) << 1) ^ ((in[40] - in[39]) >> 63))) >> (40+ntz) | + ((uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> ntz << 23) + out[41] = + (uint64(((in[41] - in[40]) << 1) ^ ((in[41] - in[40]) >> 63))) >> (41+ntz) | + ((uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> ntz << 22) + out[42] = + (uint64(((in[42] - in[41]) << 1) ^ ((in[42] - in[41]) >> 63))) >> (42+ntz) | + ((uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> ntz << 21) + out[43] = + (uint64(((in[43] - in[42]) << 1) ^ ((in[43] - in[42]) >> 63))) >> (43+ntz) | + ((uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> ntz << 20) + out[44] = + (uint64(((in[44] - in[43]) << 1) ^ ((in[44] - in[43]) >> 63))) >> (44+ntz) | + ((uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> ntz << 19) + out[45] = + (uint64(((in[45] - in[44]) << 1) ^ ((in[45] - in[44]) >> 63))) >> (45+ntz) | + ((uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> ntz << 18) + out[46] = + (uint64(((in[46] - in[45]) << 1) ^ ((in[46] - in[45]) >> 63))) >> (46+ntz) | + ((uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> ntz << 17) + out[47] = + (uint64(((in[47] - in[46]) << 1) ^ ((in[47] - in[46]) >> 63))) >> (47+ntz) | + ((uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> ntz << 16) + out[48] = + (uint64(((in[48] - in[47]) << 1) ^ ((in[48] - in[47]) >> 63))) >> (48+ntz) | + ((uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> ntz << 15) + out[49] = + (uint64(((in[49] - in[48]) << 1) ^ ((in[49] - in[48]) >> 63))) >> (49+ntz) | + ((uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> ntz << 14) + out[50] = + (uint64(((in[50] - in[49]) << 1) ^ ((in[50] - in[49]) >> 63))) >> (50+ntz) | + ((uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> ntz << 13) + out[51] = + (uint64(((in[51] - in[50]) << 1) ^ ((in[51] - in[50]) >> 63))) >> (51+ntz) | + ((uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> ntz << 12) + out[52] = + (uint64(((in[52] - in[51]) << 1) ^ ((in[52] - in[51]) >> 63))) >> (52+ntz) | + ((uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> ntz << 11) + out[53] = + (uint64(((in[53] - in[52]) << 1) ^ ((in[53] - in[52]) >> 63))) >> (53+ntz) | + ((uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> ntz << 10) + out[54] = + (uint64(((in[54] - in[53]) << 1) ^ ((in[54] - in[53]) >> 63))) >> (54+ntz) | + ((uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> ntz << 9) + out[55] = + (uint64(((in[55] - in[54]) << 1) ^ ((in[55] - in[54]) >> 63))) >> (55+ntz) | + ((uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> ntz << 8) + out[56] = + (uint64(((in[56] - in[55]) << 1) ^ ((in[56] - in[55]) >> 63))) >> (56+ntz) | + ((uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> ntz << 7) + out[57] = + (uint64(((in[57] - in[56]) << 1) ^ ((in[57] - in[56]) >> 63))) >> (57+ntz) | + ((uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> ntz << 6) + out[58] = + (uint64(((in[58] - in[57]) << 1) ^ ((in[58] - in[57]) >> 63))) >> (58+ntz) | + ((uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> ntz << 5) + out[59] = + (uint64(((in[59] - in[58]) << 1) ^ ((in[59] - in[58]) >> 63))) >> (59+ntz) | + ((uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> ntz << 4) + out[60] = + (uint64(((in[60] - in[59]) << 1) ^ ((in[60] - in[59]) >> 63))) >> (60+ntz) | + ((uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> ntz << 3) + out[61] = + (uint64(((in[61] - in[60]) << 1) ^ ((in[61] - in[60]) >> 63))) >> (61+ntz) | + ((uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> ntz << 2) + out[62] = + (uint64(((in[62] - in[61]) << 1) ^ ((in[62] - in[61]) >> 63))) >> (62+ntz) | + ((uint64(((in[63] - in[62]) << 1) ^ ((in[63] - in[62]) >> 63))) >> ntz << 1) +} + +func deltaunpackzigzag_int64_0(initoffset int64, in *[0]uint64, out *[64]int64, ntz int) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset + out[32] = initoffset + out[33] = initoffset + out[34] = initoffset + out[35] = initoffset + out[36] = initoffset + out[37] = initoffset + out[38] = initoffset + out[39] = initoffset + out[40] = initoffset + out[41] = initoffset + out[42] = initoffset + out[43] = initoffset + out[44] = initoffset + out[45] = initoffset + out[46] = initoffset + out[47] = initoffset + out[48] = initoffset + out[49] = initoffset + out[50] = initoffset + out[51] = initoffset + out[52] = initoffset + out[53] = initoffset + out[54] = initoffset + out[55] = initoffset + out[56] = initoffset + out[57] = initoffset + out[58] = initoffset + out[59] = initoffset + out[60] = initoffset + out[61] = initoffset + out[62] = initoffset + out[63] = initoffset +} + +func deltaunpackzigzag_int64_1(initoffset int64, in *[1]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1) & 1))^(((in[0] >> 0) & 0x1)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 1) & 0x1) & 1))^(((in[0] >> 1) & 0x1)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 2) & 0x1) & 1))^(((in[0] >> 2) & 0x1)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 3) & 0x1) & 1))^(((in[0] >> 3) & 0x1)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 4) & 0x1) & 1))^(((in[0] >> 4) & 0x1)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 5) & 0x1) & 1))^(((in[0] >> 5) & 0x1)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 6) & 0x1) & 1))^(((in[0] >> 6) & 0x1)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 7) & 0x1) & 1))^(((in[0] >> 7) & 0x1)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[0] >> 8) & 0x1) & 1))^(((in[0] >> 8) & 0x1)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[0] >> 9) & 0x1) & 1))^(((in[0] >> 9) & 0x1)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[0] >> 10) & 0x1) & 1))^(((in[0] >> 10) & 0x1)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[0] >> 11) & 0x1) & 1))^(((in[0] >> 11) & 0x1)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[0] >> 12) & 0x1) & 1))^(((in[0] >> 12) & 0x1)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[0] >> 13) & 0x1) & 1))^(((in[0] >> 13) & 0x1)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[0] >> 14) & 0x1) & 1))^(((in[0] >> 14) & 0x1)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[0] >> 15) & 0x1) & 1))^(((in[0] >> 15) & 0x1)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[0] >> 16) & 0x1) & 1))^(((in[0] >> 16) & 0x1)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[0] >> 17) & 0x1) & 1))^(((in[0] >> 17) & 0x1)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[0] >> 18) & 0x1) & 1))^(((in[0] >> 18) & 0x1)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[0] >> 19) & 0x1) & 1))^(((in[0] >> 19) & 0x1)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[0] >> 20) & 0x1) & 1))^(((in[0] >> 20) & 0x1)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[0] >> 21) & 0x1) & 1))^(((in[0] >> 21) & 0x1)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[0] >> 22) & 0x1) & 1))^(((in[0] >> 22) & 0x1)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[0] >> 23) & 0x1) & 1))^(((in[0] >> 23) & 0x1)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[0] >> 24) & 0x1) & 1))^(((in[0] >> 24) & 0x1)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[0] >> 25) & 0x1) & 1))^(((in[0] >> 25) & 0x1)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[0] >> 26) & 0x1) & 1))^(((in[0] >> 26) & 0x1)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[0] >> 27) & 0x1) & 1))^(((in[0] >> 27) & 0x1)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[0] >> 28) & 0x1) & 1))^(((in[0] >> 28) & 0x1)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[0] >> 29) & 0x1) & 1))^(((in[0] >> 29) & 0x1)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[0] >> 30) & 0x1) & 1))^(((in[0] >> 30) & 0x1)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[0] >> 31) & 0x1) & 1))^(((in[0] >> 31) & 0x1)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[0] >> 32) & 0x1) & 1))^(((in[0] >> 32) & 0x1)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[0] >> 33) & 0x1) & 1))^(((in[0] >> 33) & 0x1)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[0] >> 34) & 0x1) & 1))^(((in[0] >> 34) & 0x1)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[0] >> 35) & 0x1) & 1))^(((in[0] >> 35) & 0x1)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[0] >> 36) & 0x1) & 1))^(((in[0] >> 36) & 0x1)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[0] >> 37) & 0x1) & 1))^(((in[0] >> 37) & 0x1)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[0] >> 38) & 0x1) & 1))^(((in[0] >> 38) & 0x1)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[0] >> 39) & 0x1) & 1))^(((in[0] >> 39) & 0x1)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[0] >> 40) & 0x1) & 1))^(((in[0] >> 40) & 0x1)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[0] >> 41) & 0x1) & 1))^(((in[0] >> 41) & 0x1)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[0] >> 42) & 0x1) & 1))^(((in[0] >> 42) & 0x1)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[0] >> 43) & 0x1) & 1))^(((in[0] >> 43) & 0x1)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[0] >> 44) & 0x1) & 1))^(((in[0] >> 44) & 0x1)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[0] >> 45) & 0x1) & 1))^(((in[0] >> 45) & 0x1)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[0] >> 46) & 0x1) & 1))^(((in[0] >> 46) & 0x1)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[0] >> 47) & 0x1) & 1))^(((in[0] >> 47) & 0x1)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[0] >> 48) & 0x1) & 1))^(((in[0] >> 48) & 0x1)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[0] >> 49) & 0x1) & 1))^(((in[0] >> 49) & 0x1)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[0] >> 50) & 0x1) & 1))^(((in[0] >> 50) & 0x1)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[0] >> 51) & 0x1) & 1))^(((in[0] >> 51) & 0x1)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[0] >> 52) & 0x1) & 1))^(((in[0] >> 52) & 0x1)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[0] >> 53) & 0x1) & 1))^(((in[0] >> 53) & 0x1)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[0] >> 54) & 0x1) & 1))^(((in[0] >> 54) & 0x1)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[0] >> 55) & 0x1) & 1))^(((in[0] >> 55) & 0x1)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[0] >> 56) & 0x1) & 1))^(((in[0] >> 56) & 0x1)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[0] >> 57) & 0x1) & 1))^(((in[0] >> 57) & 0x1)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[0] >> 58) & 0x1) & 1))^(((in[0] >> 58) & 0x1)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[0] >> 59) & 0x1) & 1))^(((in[0] >> 59) & 0x1)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[0] >> 60) & 0x1) & 1))^(((in[0] >> 60) & 0x1)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[0] >> 61) & 0x1) & 1))^(((in[0] >> 61) & 0x1)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[0] >> 62) & 0x1) & 1))^(((in[0] >> 62) & 0x1)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[0] >> 63)) & 1))^(((in[0] >> 63))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_2(initoffset int64, in *[2]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3) & 1))^(((in[0] >> 0) & 0x3)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 2) & 0x3) & 1))^(((in[0] >> 2) & 0x3)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 4) & 0x3) & 1))^(((in[0] >> 4) & 0x3)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 6) & 0x3) & 1))^(((in[0] >> 6) & 0x3)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 8) & 0x3) & 1))^(((in[0] >> 8) & 0x3)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 10) & 0x3) & 1))^(((in[0] >> 10) & 0x3)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 12) & 0x3) & 1))^(((in[0] >> 12) & 0x3)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 14) & 0x3) & 1))^(((in[0] >> 14) & 0x3)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[0] >> 16) & 0x3) & 1))^(((in[0] >> 16) & 0x3)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[0] >> 18) & 0x3) & 1))^(((in[0] >> 18) & 0x3)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[0] >> 20) & 0x3) & 1))^(((in[0] >> 20) & 0x3)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[0] >> 22) & 0x3) & 1))^(((in[0] >> 22) & 0x3)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[0] >> 24) & 0x3) & 1))^(((in[0] >> 24) & 0x3)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[0] >> 26) & 0x3) & 1))^(((in[0] >> 26) & 0x3)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[0] >> 28) & 0x3) & 1))^(((in[0] >> 28) & 0x3)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[0] >> 30) & 0x3) & 1))^(((in[0] >> 30) & 0x3)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[0] >> 32) & 0x3) & 1))^(((in[0] >> 32) & 0x3)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[0] >> 34) & 0x3) & 1))^(((in[0] >> 34) & 0x3)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[0] >> 36) & 0x3) & 1))^(((in[0] >> 36) & 0x3)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[0] >> 38) & 0x3) & 1))^(((in[0] >> 38) & 0x3)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[0] >> 40) & 0x3) & 1))^(((in[0] >> 40) & 0x3)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[0] >> 42) & 0x3) & 1))^(((in[0] >> 42) & 0x3)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[0] >> 44) & 0x3) & 1))^(((in[0] >> 44) & 0x3)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[0] >> 46) & 0x3) & 1))^(((in[0] >> 46) & 0x3)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[0] >> 48) & 0x3) & 1))^(((in[0] >> 48) & 0x3)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[0] >> 50) & 0x3) & 1))^(((in[0] >> 50) & 0x3)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[0] >> 52) & 0x3) & 1))^(((in[0] >> 52) & 0x3)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[0] >> 54) & 0x3) & 1))^(((in[0] >> 54) & 0x3)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[0] >> 56) & 0x3) & 1))^(((in[0] >> 56) & 0x3)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[0] >> 58) & 0x3) & 1))^(((in[0] >> 58) & 0x3)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[0] >> 60) & 0x3) & 1))^(((in[0] >> 60) & 0x3)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[0] >> 62)) & 1))^(((in[0] >> 62))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[1] >> 0) & 0x3) & 1))^(((in[1] >> 0) & 0x3)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[1] >> 2) & 0x3) & 1))^(((in[1] >> 2) & 0x3)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[1] >> 4) & 0x3) & 1))^(((in[1] >> 4) & 0x3)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[1] >> 6) & 0x3) & 1))^(((in[1] >> 6) & 0x3)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[1] >> 8) & 0x3) & 1))^(((in[1] >> 8) & 0x3)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[1] >> 10) & 0x3) & 1))^(((in[1] >> 10) & 0x3)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[1] >> 12) & 0x3) & 1))^(((in[1] >> 12) & 0x3)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[1] >> 14) & 0x3) & 1))^(((in[1] >> 14) & 0x3)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[1] >> 16) & 0x3) & 1))^(((in[1] >> 16) & 0x3)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[1] >> 18) & 0x3) & 1))^(((in[1] >> 18) & 0x3)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[1] >> 20) & 0x3) & 1))^(((in[1] >> 20) & 0x3)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[1] >> 22) & 0x3) & 1))^(((in[1] >> 22) & 0x3)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[1] >> 24) & 0x3) & 1))^(((in[1] >> 24) & 0x3)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[1] >> 26) & 0x3) & 1))^(((in[1] >> 26) & 0x3)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[1] >> 28) & 0x3) & 1))^(((in[1] >> 28) & 0x3)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[1] >> 30) & 0x3) & 1))^(((in[1] >> 30) & 0x3)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[1] >> 32) & 0x3) & 1))^(((in[1] >> 32) & 0x3)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[1] >> 34) & 0x3) & 1))^(((in[1] >> 34) & 0x3)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[1] >> 36) & 0x3) & 1))^(((in[1] >> 36) & 0x3)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[1] >> 38) & 0x3) & 1))^(((in[1] >> 38) & 0x3)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[1] >> 40) & 0x3) & 1))^(((in[1] >> 40) & 0x3)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[1] >> 42) & 0x3) & 1))^(((in[1] >> 42) & 0x3)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[1] >> 44) & 0x3) & 1))^(((in[1] >> 44) & 0x3)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[1] >> 46) & 0x3) & 1))^(((in[1] >> 46) & 0x3)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[1] >> 48) & 0x3) & 1))^(((in[1] >> 48) & 0x3)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[1] >> 50) & 0x3) & 1))^(((in[1] >> 50) & 0x3)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[1] >> 52) & 0x3) & 1))^(((in[1] >> 52) & 0x3)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[1] >> 54) & 0x3) & 1))^(((in[1] >> 54) & 0x3)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[1] >> 56) & 0x3) & 1))^(((in[1] >> 56) & 0x3)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[1] >> 58) & 0x3) & 1))^(((in[1] >> 58) & 0x3)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[1] >> 60) & 0x3) & 1))^(((in[1] >> 60) & 0x3)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[1] >> 62)) & 1))^(((in[1] >> 62))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_3(initoffset int64, in *[3]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7) & 1))^(((in[0] >> 0) & 0x7)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 3) & 0x7) & 1))^(((in[0] >> 3) & 0x7)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 6) & 0x7) & 1))^(((in[0] >> 6) & 0x7)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 9) & 0x7) & 1))^(((in[0] >> 9) & 0x7)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 12) & 0x7) & 1))^(((in[0] >> 12) & 0x7)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 15) & 0x7) & 1))^(((in[0] >> 15) & 0x7)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 18) & 0x7) & 1))^(((in[0] >> 18) & 0x7)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 21) & 0x7) & 1))^(((in[0] >> 21) & 0x7)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[0] >> 24) & 0x7) & 1))^(((in[0] >> 24) & 0x7)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[0] >> 27) & 0x7) & 1))^(((in[0] >> 27) & 0x7)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[0] >> 30) & 0x7) & 1))^(((in[0] >> 30) & 0x7)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[0] >> 33) & 0x7) & 1))^(((in[0] >> 33) & 0x7)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[0] >> 36) & 0x7) & 1))^(((in[0] >> 36) & 0x7)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[0] >> 39) & 0x7) & 1))^(((in[0] >> 39) & 0x7)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[0] >> 42) & 0x7) & 1))^(((in[0] >> 42) & 0x7)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[0] >> 45) & 0x7) & 1))^(((in[0] >> 45) & 0x7)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[0] >> 48) & 0x7) & 1))^(((in[0] >> 48) & 0x7)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[0] >> 51) & 0x7) & 1))^(((in[0] >> 51) & 0x7)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[0] >> 54) & 0x7) & 1))^(((in[0] >> 54) & 0x7)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[0] >> 57) & 0x7) & 1))^(((in[0] >> 57) & 0x7)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[0] >> 60) & 0x7) & 1))^(((in[0] >> 60) & 0x7)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[0] >> 63) | ((in[1] & 0x3) << 1))) & 1))^((((in[0] >> 63) | ((in[1] & 0x3) << 1)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[1] >> 2) & 0x7) & 1))^(((in[1] >> 2) & 0x7)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[1] >> 5) & 0x7) & 1))^(((in[1] >> 5) & 0x7)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[1] >> 8) & 0x7) & 1))^(((in[1] >> 8) & 0x7)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[1] >> 11) & 0x7) & 1))^(((in[1] >> 11) & 0x7)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[1] >> 14) & 0x7) & 1))^(((in[1] >> 14) & 0x7)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[1] >> 17) & 0x7) & 1))^(((in[1] >> 17) & 0x7)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[1] >> 20) & 0x7) & 1))^(((in[1] >> 20) & 0x7)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[1] >> 23) & 0x7) & 1))^(((in[1] >> 23) & 0x7)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[1] >> 26) & 0x7) & 1))^(((in[1] >> 26) & 0x7)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[1] >> 29) & 0x7) & 1))^(((in[1] >> 29) & 0x7)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[1] >> 32) & 0x7) & 1))^(((in[1] >> 32) & 0x7)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[1] >> 35) & 0x7) & 1))^(((in[1] >> 35) & 0x7)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[1] >> 38) & 0x7) & 1))^(((in[1] >> 38) & 0x7)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[1] >> 41) & 0x7) & 1))^(((in[1] >> 41) & 0x7)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[1] >> 44) & 0x7) & 1))^(((in[1] >> 44) & 0x7)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[1] >> 47) & 0x7) & 1))^(((in[1] >> 47) & 0x7)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[1] >> 50) & 0x7) & 1))^(((in[1] >> 50) & 0x7)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[1] >> 53) & 0x7) & 1))^(((in[1] >> 53) & 0x7)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[1] >> 56) & 0x7) & 1))^(((in[1] >> 56) & 0x7)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[1] >> 59) & 0x7) & 1))^(((in[1] >> 59) & 0x7)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[1] >> 62) | ((in[2] & 0x1) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0x1) << 2)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[2] >> 1) & 0x7) & 1))^(((in[2] >> 1) & 0x7)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[2] >> 4) & 0x7) & 1))^(((in[2] >> 4) & 0x7)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[2] >> 7) & 0x7) & 1))^(((in[2] >> 7) & 0x7)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[2] >> 10) & 0x7) & 1))^(((in[2] >> 10) & 0x7)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[2] >> 13) & 0x7) & 1))^(((in[2] >> 13) & 0x7)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[2] >> 16) & 0x7) & 1))^(((in[2] >> 16) & 0x7)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[2] >> 19) & 0x7) & 1))^(((in[2] >> 19) & 0x7)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[2] >> 22) & 0x7) & 1))^(((in[2] >> 22) & 0x7)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[2] >> 25) & 0x7) & 1))^(((in[2] >> 25) & 0x7)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[2] >> 28) & 0x7) & 1))^(((in[2] >> 28) & 0x7)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[2] >> 31) & 0x7) & 1))^(((in[2] >> 31) & 0x7)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[2] >> 34) & 0x7) & 1))^(((in[2] >> 34) & 0x7)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[2] >> 37) & 0x7) & 1))^(((in[2] >> 37) & 0x7)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[2] >> 40) & 0x7) & 1))^(((in[2] >> 40) & 0x7)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[2] >> 43) & 0x7) & 1))^(((in[2] >> 43) & 0x7)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[2] >> 46) & 0x7) & 1))^(((in[2] >> 46) & 0x7)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[2] >> 49) & 0x7) & 1))^(((in[2] >> 49) & 0x7)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[2] >> 52) & 0x7) & 1))^(((in[2] >> 52) & 0x7)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[2] >> 55) & 0x7) & 1))^(((in[2] >> 55) & 0x7)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[2] >> 58) & 0x7) & 1))^(((in[2] >> 58) & 0x7)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[2] >> 61)) & 1))^(((in[2] >> 61))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_4(initoffset int64, in *[4]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xF) & 1))^(((in[0] >> 0) & 0xF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 4) & 0xF) & 1))^(((in[0] >> 4) & 0xF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 8) & 0xF) & 1))^(((in[0] >> 8) & 0xF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 12) & 0xF) & 1))^(((in[0] >> 12) & 0xF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 16) & 0xF) & 1))^(((in[0] >> 16) & 0xF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 20) & 0xF) & 1))^(((in[0] >> 20) & 0xF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 24) & 0xF) & 1))^(((in[0] >> 24) & 0xF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 28) & 0xF) & 1))^(((in[0] >> 28) & 0xF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[0] >> 32) & 0xF) & 1))^(((in[0] >> 32) & 0xF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[0] >> 36) & 0xF) & 1))^(((in[0] >> 36) & 0xF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[0] >> 40) & 0xF) & 1))^(((in[0] >> 40) & 0xF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[0] >> 44) & 0xF) & 1))^(((in[0] >> 44) & 0xF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[0] >> 48) & 0xF) & 1))^(((in[0] >> 48) & 0xF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[0] >> 52) & 0xF) & 1))^(((in[0] >> 52) & 0xF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[0] >> 56) & 0xF) & 1))^(((in[0] >> 56) & 0xF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[0] >> 60)) & 1))^(((in[0] >> 60))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[1] >> 0) & 0xF) & 1))^(((in[1] >> 0) & 0xF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[1] >> 4) & 0xF) & 1))^(((in[1] >> 4) & 0xF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[1] >> 8) & 0xF) & 1))^(((in[1] >> 8) & 0xF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[1] >> 12) & 0xF) & 1))^(((in[1] >> 12) & 0xF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[1] >> 16) & 0xF) & 1))^(((in[1] >> 16) & 0xF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[1] >> 20) & 0xF) & 1))^(((in[1] >> 20) & 0xF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[1] >> 24) & 0xF) & 1))^(((in[1] >> 24) & 0xF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[1] >> 28) & 0xF) & 1))^(((in[1] >> 28) & 0xF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[1] >> 32) & 0xF) & 1))^(((in[1] >> 32) & 0xF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[1] >> 36) & 0xF) & 1))^(((in[1] >> 36) & 0xF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[1] >> 40) & 0xF) & 1))^(((in[1] >> 40) & 0xF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[1] >> 44) & 0xF) & 1))^(((in[1] >> 44) & 0xF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[1] >> 48) & 0xF) & 1))^(((in[1] >> 48) & 0xF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[1] >> 52) & 0xF) & 1))^(((in[1] >> 52) & 0xF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[1] >> 56) & 0xF) & 1))^(((in[1] >> 56) & 0xF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[1] >> 60)) & 1))^(((in[1] >> 60))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[2] >> 0) & 0xF) & 1))^(((in[2] >> 0) & 0xF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[2] >> 4) & 0xF) & 1))^(((in[2] >> 4) & 0xF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[2] >> 8) & 0xF) & 1))^(((in[2] >> 8) & 0xF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[2] >> 12) & 0xF) & 1))^(((in[2] >> 12) & 0xF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[2] >> 16) & 0xF) & 1))^(((in[2] >> 16) & 0xF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[2] >> 20) & 0xF) & 1))^(((in[2] >> 20) & 0xF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[2] >> 24) & 0xF) & 1))^(((in[2] >> 24) & 0xF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[2] >> 28) & 0xF) & 1))^(((in[2] >> 28) & 0xF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[2] >> 32) & 0xF) & 1))^(((in[2] >> 32) & 0xF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[2] >> 36) & 0xF) & 1))^(((in[2] >> 36) & 0xF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[2] >> 40) & 0xF) & 1))^(((in[2] >> 40) & 0xF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[2] >> 44) & 0xF) & 1))^(((in[2] >> 44) & 0xF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[2] >> 48) & 0xF) & 1))^(((in[2] >> 48) & 0xF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[2] >> 52) & 0xF) & 1))^(((in[2] >> 52) & 0xF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[2] >> 56) & 0xF) & 1))^(((in[2] >> 56) & 0xF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[2] >> 60)) & 1))^(((in[2] >> 60))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[3] >> 0) & 0xF) & 1))^(((in[3] >> 0) & 0xF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[3] >> 4) & 0xF) & 1))^(((in[3] >> 4) & 0xF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[3] >> 8) & 0xF) & 1))^(((in[3] >> 8) & 0xF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[3] >> 12) & 0xF) & 1))^(((in[3] >> 12) & 0xF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[3] >> 16) & 0xF) & 1))^(((in[3] >> 16) & 0xF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[3] >> 20) & 0xF) & 1))^(((in[3] >> 20) & 0xF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[3] >> 24) & 0xF) & 1))^(((in[3] >> 24) & 0xF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[3] >> 28) & 0xF) & 1))^(((in[3] >> 28) & 0xF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[3] >> 32) & 0xF) & 1))^(((in[3] >> 32) & 0xF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[3] >> 36) & 0xF) & 1))^(((in[3] >> 36) & 0xF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[3] >> 40) & 0xF) & 1))^(((in[3] >> 40) & 0xF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[3] >> 44) & 0xF) & 1))^(((in[3] >> 44) & 0xF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[3] >> 48) & 0xF) & 1))^(((in[3] >> 48) & 0xF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[3] >> 52) & 0xF) & 1))^(((in[3] >> 52) & 0xF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[3] >> 56) & 0xF) & 1))^(((in[3] >> 56) & 0xF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[3] >> 60)) & 1))^(((in[3] >> 60))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_5(initoffset int64, in *[5]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1F) & 1))^(((in[0] >> 0) & 0x1F)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 5) & 0x1F) & 1))^(((in[0] >> 5) & 0x1F)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 10) & 0x1F) & 1))^(((in[0] >> 10) & 0x1F)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 15) & 0x1F) & 1))^(((in[0] >> 15) & 0x1F)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 20) & 0x1F) & 1))^(((in[0] >> 20) & 0x1F)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 25) & 0x1F) & 1))^(((in[0] >> 25) & 0x1F)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 30) & 0x1F) & 1))^(((in[0] >> 30) & 0x1F)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 35) & 0x1F) & 1))^(((in[0] >> 35) & 0x1F)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[0] >> 40) & 0x1F) & 1))^(((in[0] >> 40) & 0x1F)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[0] >> 45) & 0x1F) & 1))^(((in[0] >> 45) & 0x1F)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[0] >> 50) & 0x1F) & 1))^(((in[0] >> 50) & 0x1F)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[0] >> 55) & 0x1F) & 1))^(((in[0] >> 55) & 0x1F)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[0] >> 60) | ((in[1] & 0x1) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0x1) << 4)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[1] >> 1) & 0x1F) & 1))^(((in[1] >> 1) & 0x1F)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[1] >> 6) & 0x1F) & 1))^(((in[1] >> 6) & 0x1F)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[1] >> 11) & 0x1F) & 1))^(((in[1] >> 11) & 0x1F)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[1] >> 16) & 0x1F) & 1))^(((in[1] >> 16) & 0x1F)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[1] >> 21) & 0x1F) & 1))^(((in[1] >> 21) & 0x1F)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[1] >> 26) & 0x1F) & 1))^(((in[1] >> 26) & 0x1F)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[1] >> 31) & 0x1F) & 1))^(((in[1] >> 31) & 0x1F)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[1] >> 36) & 0x1F) & 1))^(((in[1] >> 36) & 0x1F)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[1] >> 41) & 0x1F) & 1))^(((in[1] >> 41) & 0x1F)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[1] >> 46) & 0x1F) & 1))^(((in[1] >> 46) & 0x1F)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[1] >> 51) & 0x1F) & 1))^(((in[1] >> 51) & 0x1F)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[1] >> 56) & 0x1F) & 1))^(((in[1] >> 56) & 0x1F)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[1] >> 61) | ((in[2] & 0x3) << 3))) & 1))^((((in[1] >> 61) | ((in[2] & 0x3) << 3)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[2] >> 2) & 0x1F) & 1))^(((in[2] >> 2) & 0x1F)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[2] >> 7) & 0x1F) & 1))^(((in[2] >> 7) & 0x1F)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[2] >> 12) & 0x1F) & 1))^(((in[2] >> 12) & 0x1F)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[2] >> 17) & 0x1F) & 1))^(((in[2] >> 17) & 0x1F)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[2] >> 22) & 0x1F) & 1))^(((in[2] >> 22) & 0x1F)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[2] >> 27) & 0x1F) & 1))^(((in[2] >> 27) & 0x1F)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[2] >> 32) & 0x1F) & 1))^(((in[2] >> 32) & 0x1F)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[2] >> 37) & 0x1F) & 1))^(((in[2] >> 37) & 0x1F)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[2] >> 42) & 0x1F) & 1))^(((in[2] >> 42) & 0x1F)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[2] >> 47) & 0x1F) & 1))^(((in[2] >> 47) & 0x1F)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[2] >> 52) & 0x1F) & 1))^(((in[2] >> 52) & 0x1F)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[2] >> 57) & 0x1F) & 1))^(((in[2] >> 57) & 0x1F)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[2] >> 62) | ((in[3] & 0x7) << 2))) & 1))^((((in[2] >> 62) | ((in[3] & 0x7) << 2)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[3] >> 3) & 0x1F) & 1))^(((in[3] >> 3) & 0x1F)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[3] >> 8) & 0x1F) & 1))^(((in[3] >> 8) & 0x1F)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[3] >> 13) & 0x1F) & 1))^(((in[3] >> 13) & 0x1F)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[3] >> 18) & 0x1F) & 1))^(((in[3] >> 18) & 0x1F)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[3] >> 23) & 0x1F) & 1))^(((in[3] >> 23) & 0x1F)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[3] >> 28) & 0x1F) & 1))^(((in[3] >> 28) & 0x1F)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[3] >> 33) & 0x1F) & 1))^(((in[3] >> 33) & 0x1F)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[3] >> 38) & 0x1F) & 1))^(((in[3] >> 38) & 0x1F)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[3] >> 43) & 0x1F) & 1))^(((in[3] >> 43) & 0x1F)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[3] >> 48) & 0x1F) & 1))^(((in[3] >> 48) & 0x1F)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[3] >> 53) & 0x1F) & 1))^(((in[3] >> 53) & 0x1F)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[3] >> 58) & 0x1F) & 1))^(((in[3] >> 58) & 0x1F)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[3] >> 63) | ((in[4] & 0xF) << 1))) & 1))^((((in[3] >> 63) | ((in[4] & 0xF) << 1)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[4] >> 4) & 0x1F) & 1))^(((in[4] >> 4) & 0x1F)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[4] >> 9) & 0x1F) & 1))^(((in[4] >> 9) & 0x1F)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[4] >> 14) & 0x1F) & 1))^(((in[4] >> 14) & 0x1F)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[4] >> 19) & 0x1F) & 1))^(((in[4] >> 19) & 0x1F)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[4] >> 24) & 0x1F) & 1))^(((in[4] >> 24) & 0x1F)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[4] >> 29) & 0x1F) & 1))^(((in[4] >> 29) & 0x1F)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[4] >> 34) & 0x1F) & 1))^(((in[4] >> 34) & 0x1F)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[4] >> 39) & 0x1F) & 1))^(((in[4] >> 39) & 0x1F)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[4] >> 44) & 0x1F) & 1))^(((in[4] >> 44) & 0x1F)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[4] >> 49) & 0x1F) & 1))^(((in[4] >> 49) & 0x1F)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[4] >> 54) & 0x1F) & 1))^(((in[4] >> 54) & 0x1F)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[4] >> 59)) & 1))^(((in[4] >> 59))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_6(initoffset int64, in *[6]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3F) & 1))^(((in[0] >> 0) & 0x3F)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 6) & 0x3F) & 1))^(((in[0] >> 6) & 0x3F)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 12) & 0x3F) & 1))^(((in[0] >> 12) & 0x3F)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 18) & 0x3F) & 1))^(((in[0] >> 18) & 0x3F)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 24) & 0x3F) & 1))^(((in[0] >> 24) & 0x3F)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 30) & 0x3F) & 1))^(((in[0] >> 30) & 0x3F)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 36) & 0x3F) & 1))^(((in[0] >> 36) & 0x3F)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 42) & 0x3F) & 1))^(((in[0] >> 42) & 0x3F)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[0] >> 48) & 0x3F) & 1))^(((in[0] >> 48) & 0x3F)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[0] >> 54) & 0x3F) & 1))^(((in[0] >> 54) & 0x3F)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[0] >> 60) | ((in[1] & 0x3) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0x3) << 4)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[1] >> 2) & 0x3F) & 1))^(((in[1] >> 2) & 0x3F)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[1] >> 8) & 0x3F) & 1))^(((in[1] >> 8) & 0x3F)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[1] >> 14) & 0x3F) & 1))^(((in[1] >> 14) & 0x3F)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[1] >> 20) & 0x3F) & 1))^(((in[1] >> 20) & 0x3F)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[1] >> 26) & 0x3F) & 1))^(((in[1] >> 26) & 0x3F)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[1] >> 32) & 0x3F) & 1))^(((in[1] >> 32) & 0x3F)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[1] >> 38) & 0x3F) & 1))^(((in[1] >> 38) & 0x3F)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[1] >> 44) & 0x3F) & 1))^(((in[1] >> 44) & 0x3F)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[1] >> 50) & 0x3F) & 1))^(((in[1] >> 50) & 0x3F)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[1] >> 56) & 0x3F) & 1))^(((in[1] >> 56) & 0x3F)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[1] >> 62) | ((in[2] & 0xF) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0xF) << 2)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[2] >> 4) & 0x3F) & 1))^(((in[2] >> 4) & 0x3F)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[2] >> 10) & 0x3F) & 1))^(((in[2] >> 10) & 0x3F)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[2] >> 16) & 0x3F) & 1))^(((in[2] >> 16) & 0x3F)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[2] >> 22) & 0x3F) & 1))^(((in[2] >> 22) & 0x3F)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[2] >> 28) & 0x3F) & 1))^(((in[2] >> 28) & 0x3F)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[2] >> 34) & 0x3F) & 1))^(((in[2] >> 34) & 0x3F)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[2] >> 40) & 0x3F) & 1))^(((in[2] >> 40) & 0x3F)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[2] >> 46) & 0x3F) & 1))^(((in[2] >> 46) & 0x3F)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[2] >> 52) & 0x3F) & 1))^(((in[2] >> 52) & 0x3F)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[2] >> 58)) & 1))^(((in[2] >> 58))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[3] >> 0) & 0x3F) & 1))^(((in[3] >> 0) & 0x3F)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[3] >> 6) & 0x3F) & 1))^(((in[3] >> 6) & 0x3F)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[3] >> 12) & 0x3F) & 1))^(((in[3] >> 12) & 0x3F)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[3] >> 18) & 0x3F) & 1))^(((in[3] >> 18) & 0x3F)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[3] >> 24) & 0x3F) & 1))^(((in[3] >> 24) & 0x3F)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[3] >> 30) & 0x3F) & 1))^(((in[3] >> 30) & 0x3F)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[3] >> 36) & 0x3F) & 1))^(((in[3] >> 36) & 0x3F)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[3] >> 42) & 0x3F) & 1))^(((in[3] >> 42) & 0x3F)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[3] >> 48) & 0x3F) & 1))^(((in[3] >> 48) & 0x3F)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[3] >> 54) & 0x3F) & 1))^(((in[3] >> 54) & 0x3F)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[3] >> 60) | ((in[4] & 0x3) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x3) << 4)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[4] >> 2) & 0x3F) & 1))^(((in[4] >> 2) & 0x3F)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[4] >> 8) & 0x3F) & 1))^(((in[4] >> 8) & 0x3F)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[4] >> 14) & 0x3F) & 1))^(((in[4] >> 14) & 0x3F)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[4] >> 20) & 0x3F) & 1))^(((in[4] >> 20) & 0x3F)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[4] >> 26) & 0x3F) & 1))^(((in[4] >> 26) & 0x3F)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[4] >> 32) & 0x3F) & 1))^(((in[4] >> 32) & 0x3F)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[4] >> 38) & 0x3F) & 1))^(((in[4] >> 38) & 0x3F)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[4] >> 44) & 0x3F) & 1))^(((in[4] >> 44) & 0x3F)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[4] >> 50) & 0x3F) & 1))^(((in[4] >> 50) & 0x3F)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[4] >> 56) & 0x3F) & 1))^(((in[4] >> 56) & 0x3F)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[4] >> 62) | ((in[5] & 0xF) << 2))) & 1))^((((in[4] >> 62) | ((in[5] & 0xF) << 2)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[5] >> 4) & 0x3F) & 1))^(((in[5] >> 4) & 0x3F)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[5] >> 10) & 0x3F) & 1))^(((in[5] >> 10) & 0x3F)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[5] >> 16) & 0x3F) & 1))^(((in[5] >> 16) & 0x3F)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[5] >> 22) & 0x3F) & 1))^(((in[5] >> 22) & 0x3F)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[5] >> 28) & 0x3F) & 1))^(((in[5] >> 28) & 0x3F)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[5] >> 34) & 0x3F) & 1))^(((in[5] >> 34) & 0x3F)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[5] >> 40) & 0x3F) & 1))^(((in[5] >> 40) & 0x3F)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[5] >> 46) & 0x3F) & 1))^(((in[5] >> 46) & 0x3F)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[5] >> 52) & 0x3F) & 1))^(((in[5] >> 52) & 0x3F)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[5] >> 58)) & 1))^(((in[5] >> 58))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_7(initoffset int64, in *[7]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7F) & 1))^(((in[0] >> 0) & 0x7F)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 7) & 0x7F) & 1))^(((in[0] >> 7) & 0x7F)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 14) & 0x7F) & 1))^(((in[0] >> 14) & 0x7F)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 21) & 0x7F) & 1))^(((in[0] >> 21) & 0x7F)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 28) & 0x7F) & 1))^(((in[0] >> 28) & 0x7F)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 35) & 0x7F) & 1))^(((in[0] >> 35) & 0x7F)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 42) & 0x7F) & 1))^(((in[0] >> 42) & 0x7F)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 49) & 0x7F) & 1))^(((in[0] >> 49) & 0x7F)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[0] >> 56) & 0x7F) & 1))^(((in[0] >> 56) & 0x7F)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[0] >> 63) | ((in[1] & 0x3F) << 1))) & 1))^((((in[0] >> 63) | ((in[1] & 0x3F) << 1)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[1] >> 6) & 0x7F) & 1))^(((in[1] >> 6) & 0x7F)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[1] >> 13) & 0x7F) & 1))^(((in[1] >> 13) & 0x7F)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[1] >> 20) & 0x7F) & 1))^(((in[1] >> 20) & 0x7F)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[1] >> 27) & 0x7F) & 1))^(((in[1] >> 27) & 0x7F)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[1] >> 34) & 0x7F) & 1))^(((in[1] >> 34) & 0x7F)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[1] >> 41) & 0x7F) & 1))^(((in[1] >> 41) & 0x7F)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[1] >> 48) & 0x7F) & 1))^(((in[1] >> 48) & 0x7F)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[1] >> 55) & 0x7F) & 1))^(((in[1] >> 55) & 0x7F)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[1] >> 62) | ((in[2] & 0x1F) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0x1F) << 2)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[2] >> 5) & 0x7F) & 1))^(((in[2] >> 5) & 0x7F)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[2] >> 12) & 0x7F) & 1))^(((in[2] >> 12) & 0x7F)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[2] >> 19) & 0x7F) & 1))^(((in[2] >> 19) & 0x7F)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[2] >> 26) & 0x7F) & 1))^(((in[2] >> 26) & 0x7F)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[2] >> 33) & 0x7F) & 1))^(((in[2] >> 33) & 0x7F)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[2] >> 40) & 0x7F) & 1))^(((in[2] >> 40) & 0x7F)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[2] >> 47) & 0x7F) & 1))^(((in[2] >> 47) & 0x7F)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[2] >> 54) & 0x7F) & 1))^(((in[2] >> 54) & 0x7F)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[2] >> 61) | ((in[3] & 0xF) << 3))) & 1))^((((in[2] >> 61) | ((in[3] & 0xF) << 3)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[3] >> 4) & 0x7F) & 1))^(((in[3] >> 4) & 0x7F)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[3] >> 11) & 0x7F) & 1))^(((in[3] >> 11) & 0x7F)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[3] >> 18) & 0x7F) & 1))^(((in[3] >> 18) & 0x7F)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[3] >> 25) & 0x7F) & 1))^(((in[3] >> 25) & 0x7F)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[3] >> 32) & 0x7F) & 1))^(((in[3] >> 32) & 0x7F)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[3] >> 39) & 0x7F) & 1))^(((in[3] >> 39) & 0x7F)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[3] >> 46) & 0x7F) & 1))^(((in[3] >> 46) & 0x7F)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[3] >> 53) & 0x7F) & 1))^(((in[3] >> 53) & 0x7F)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[3] >> 60) | ((in[4] & 0x7) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x7) << 4)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[4] >> 3) & 0x7F) & 1))^(((in[4] >> 3) & 0x7F)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[4] >> 10) & 0x7F) & 1))^(((in[4] >> 10) & 0x7F)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[4] >> 17) & 0x7F) & 1))^(((in[4] >> 17) & 0x7F)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[4] >> 24) & 0x7F) & 1))^(((in[4] >> 24) & 0x7F)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[4] >> 31) & 0x7F) & 1))^(((in[4] >> 31) & 0x7F)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[4] >> 38) & 0x7F) & 1))^(((in[4] >> 38) & 0x7F)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[4] >> 45) & 0x7F) & 1))^(((in[4] >> 45) & 0x7F)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[4] >> 52) & 0x7F) & 1))^(((in[4] >> 52) & 0x7F)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[4] >> 59) | ((in[5] & 0x3) << 5))) & 1))^((((in[4] >> 59) | ((in[5] & 0x3) << 5)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[5] >> 2) & 0x7F) & 1))^(((in[5] >> 2) & 0x7F)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[5] >> 9) & 0x7F) & 1))^(((in[5] >> 9) & 0x7F)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[5] >> 16) & 0x7F) & 1))^(((in[5] >> 16) & 0x7F)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[5] >> 23) & 0x7F) & 1))^(((in[5] >> 23) & 0x7F)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[5] >> 30) & 0x7F) & 1))^(((in[5] >> 30) & 0x7F)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[5] >> 37) & 0x7F) & 1))^(((in[5] >> 37) & 0x7F)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[5] >> 44) & 0x7F) & 1))^(((in[5] >> 44) & 0x7F)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[5] >> 51) & 0x7F) & 1))^(((in[5] >> 51) & 0x7F)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[5] >> 58) | ((in[6] & 0x1) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0x1) << 6)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[6] >> 1) & 0x7F) & 1))^(((in[6] >> 1) & 0x7F)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[6] >> 8) & 0x7F) & 1))^(((in[6] >> 8) & 0x7F)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[6] >> 15) & 0x7F) & 1))^(((in[6] >> 15) & 0x7F)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[6] >> 22) & 0x7F) & 1))^(((in[6] >> 22) & 0x7F)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[6] >> 29) & 0x7F) & 1))^(((in[6] >> 29) & 0x7F)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[6] >> 36) & 0x7F) & 1))^(((in[6] >> 36) & 0x7F)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[6] >> 43) & 0x7F) & 1))^(((in[6] >> 43) & 0x7F)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[6] >> 50) & 0x7F) & 1))^(((in[6] >> 50) & 0x7F)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[6] >> 57)) & 1))^(((in[6] >> 57))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_8(initoffset int64, in *[8]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFF) & 1))^(((in[0] >> 0) & 0xFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 8) & 0xFF) & 1))^(((in[0] >> 8) & 0xFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 16) & 0xFF) & 1))^(((in[0] >> 16) & 0xFF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 24) & 0xFF) & 1))^(((in[0] >> 24) & 0xFF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 32) & 0xFF) & 1))^(((in[0] >> 32) & 0xFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 40) & 0xFF) & 1))^(((in[0] >> 40) & 0xFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 48) & 0xFF) & 1))^(((in[0] >> 48) & 0xFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[0] >> 56)) & 1))^(((in[0] >> 56))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[1] >> 0) & 0xFF) & 1))^(((in[1] >> 0) & 0xFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[1] >> 8) & 0xFF) & 1))^(((in[1] >> 8) & 0xFF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[1] >> 16) & 0xFF) & 1))^(((in[1] >> 16) & 0xFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[1] >> 24) & 0xFF) & 1))^(((in[1] >> 24) & 0xFF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[1] >> 32) & 0xFF) & 1))^(((in[1] >> 32) & 0xFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[1] >> 40) & 0xFF) & 1))^(((in[1] >> 40) & 0xFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[1] >> 48) & 0xFF) & 1))^(((in[1] >> 48) & 0xFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[1] >> 56)) & 1))^(((in[1] >> 56))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[2] >> 0) & 0xFF) & 1))^(((in[2] >> 0) & 0xFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[2] >> 8) & 0xFF) & 1))^(((in[2] >> 8) & 0xFF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[2] >> 16) & 0xFF) & 1))^(((in[2] >> 16) & 0xFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[2] >> 24) & 0xFF) & 1))^(((in[2] >> 24) & 0xFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[2] >> 32) & 0xFF) & 1))^(((in[2] >> 32) & 0xFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[2] >> 40) & 0xFF) & 1))^(((in[2] >> 40) & 0xFF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[2] >> 48) & 0xFF) & 1))^(((in[2] >> 48) & 0xFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[2] >> 56)) & 1))^(((in[2] >> 56))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[3] >> 0) & 0xFF) & 1))^(((in[3] >> 0) & 0xFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[3] >> 8) & 0xFF) & 1))^(((in[3] >> 8) & 0xFF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[3] >> 16) & 0xFF) & 1))^(((in[3] >> 16) & 0xFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[3] >> 24) & 0xFF) & 1))^(((in[3] >> 24) & 0xFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[3] >> 32) & 0xFF) & 1))^(((in[3] >> 32) & 0xFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[3] >> 40) & 0xFF) & 1))^(((in[3] >> 40) & 0xFF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[3] >> 48) & 0xFF) & 1))^(((in[3] >> 48) & 0xFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[3] >> 56)) & 1))^(((in[3] >> 56))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[4] >> 0) & 0xFF) & 1))^(((in[4] >> 0) & 0xFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[4] >> 8) & 0xFF) & 1))^(((in[4] >> 8) & 0xFF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[4] >> 16) & 0xFF) & 1))^(((in[4] >> 16) & 0xFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[4] >> 24) & 0xFF) & 1))^(((in[4] >> 24) & 0xFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[4] >> 32) & 0xFF) & 1))^(((in[4] >> 32) & 0xFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[4] >> 40) & 0xFF) & 1))^(((in[4] >> 40) & 0xFF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[4] >> 48) & 0xFF) & 1))^(((in[4] >> 48) & 0xFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[4] >> 56)) & 1))^(((in[4] >> 56))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[5] >> 0) & 0xFF) & 1))^(((in[5] >> 0) & 0xFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[5] >> 8) & 0xFF) & 1))^(((in[5] >> 8) & 0xFF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[5] >> 16) & 0xFF) & 1))^(((in[5] >> 16) & 0xFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[5] >> 24) & 0xFF) & 1))^(((in[5] >> 24) & 0xFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[5] >> 32) & 0xFF) & 1))^(((in[5] >> 32) & 0xFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[5] >> 40) & 0xFF) & 1))^(((in[5] >> 40) & 0xFF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[5] >> 48) & 0xFF) & 1))^(((in[5] >> 48) & 0xFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[5] >> 56)) & 1))^(((in[5] >> 56))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[6] >> 0) & 0xFF) & 1))^(((in[6] >> 0) & 0xFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[6] >> 8) & 0xFF) & 1))^(((in[6] >> 8) & 0xFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[6] >> 16) & 0xFF) & 1))^(((in[6] >> 16) & 0xFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[6] >> 24) & 0xFF) & 1))^(((in[6] >> 24) & 0xFF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[6] >> 32) & 0xFF) & 1))^(((in[6] >> 32) & 0xFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[6] >> 40) & 0xFF) & 1))^(((in[6] >> 40) & 0xFF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[6] >> 48) & 0xFF) & 1))^(((in[6] >> 48) & 0xFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[6] >> 56)) & 1))^(((in[6] >> 56))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[7] >> 0) & 0xFF) & 1))^(((in[7] >> 0) & 0xFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[7] >> 8) & 0xFF) & 1))^(((in[7] >> 8) & 0xFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[7] >> 16) & 0xFF) & 1))^(((in[7] >> 16) & 0xFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[7] >> 24) & 0xFF) & 1))^(((in[7] >> 24) & 0xFF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[7] >> 32) & 0xFF) & 1))^(((in[7] >> 32) & 0xFF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[7] >> 40) & 0xFF) & 1))^(((in[7] >> 40) & 0xFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[7] >> 48) & 0xFF) & 1))^(((in[7] >> 48) & 0xFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[7] >> 56)) & 1))^(((in[7] >> 56))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_9(initoffset int64, in *[9]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FF) & 1))^(((in[0] >> 0) & 0x1FF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 9) & 0x1FF) & 1))^(((in[0] >> 9) & 0x1FF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 18) & 0x1FF) & 1))^(((in[0] >> 18) & 0x1FF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 27) & 0x1FF) & 1))^(((in[0] >> 27) & 0x1FF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 36) & 0x1FF) & 1))^(((in[0] >> 36) & 0x1FF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 45) & 0x1FF) & 1))^(((in[0] >> 45) & 0x1FF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[0] >> 54) & 0x1FF) & 1))^(((in[0] >> 54) & 0x1FF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[0] >> 63) | ((in[1] & 0xFF) << 1))) & 1))^((((in[0] >> 63) | ((in[1] & 0xFF) << 1)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[1] >> 8) & 0x1FF) & 1))^(((in[1] >> 8) & 0x1FF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[1] >> 17) & 0x1FF) & 1))^(((in[1] >> 17) & 0x1FF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[1] >> 26) & 0x1FF) & 1))^(((in[1] >> 26) & 0x1FF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[1] >> 35) & 0x1FF) & 1))^(((in[1] >> 35) & 0x1FF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[1] >> 44) & 0x1FF) & 1))^(((in[1] >> 44) & 0x1FF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[1] >> 53) & 0x1FF) & 1))^(((in[1] >> 53) & 0x1FF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[1] >> 62) | ((in[2] & 0x7F) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0x7F) << 2)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[2] >> 7) & 0x1FF) & 1))^(((in[2] >> 7) & 0x1FF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[2] >> 16) & 0x1FF) & 1))^(((in[2] >> 16) & 0x1FF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[2] >> 25) & 0x1FF) & 1))^(((in[2] >> 25) & 0x1FF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[2] >> 34) & 0x1FF) & 1))^(((in[2] >> 34) & 0x1FF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[2] >> 43) & 0x1FF) & 1))^(((in[2] >> 43) & 0x1FF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[2] >> 52) & 0x1FF) & 1))^(((in[2] >> 52) & 0x1FF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[2] >> 61) | ((in[3] & 0x3F) << 3))) & 1))^((((in[2] >> 61) | ((in[3] & 0x3F) << 3)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[3] >> 6) & 0x1FF) & 1))^(((in[3] >> 6) & 0x1FF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[3] >> 15) & 0x1FF) & 1))^(((in[3] >> 15) & 0x1FF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[3] >> 24) & 0x1FF) & 1))^(((in[3] >> 24) & 0x1FF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[3] >> 33) & 0x1FF) & 1))^(((in[3] >> 33) & 0x1FF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[3] >> 42) & 0x1FF) & 1))^(((in[3] >> 42) & 0x1FF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[3] >> 51) & 0x1FF) & 1))^(((in[3] >> 51) & 0x1FF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[3] >> 60) | ((in[4] & 0x1F) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x1F) << 4)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[4] >> 5) & 0x1FF) & 1))^(((in[4] >> 5) & 0x1FF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[4] >> 14) & 0x1FF) & 1))^(((in[4] >> 14) & 0x1FF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[4] >> 23) & 0x1FF) & 1))^(((in[4] >> 23) & 0x1FF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[4] >> 32) & 0x1FF) & 1))^(((in[4] >> 32) & 0x1FF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[4] >> 41) & 0x1FF) & 1))^(((in[4] >> 41) & 0x1FF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[4] >> 50) & 0x1FF) & 1))^(((in[4] >> 50) & 0x1FF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[4] >> 59) | ((in[5] & 0xF) << 5))) & 1))^((((in[4] >> 59) | ((in[5] & 0xF) << 5)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[5] >> 4) & 0x1FF) & 1))^(((in[5] >> 4) & 0x1FF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[5] >> 13) & 0x1FF) & 1))^(((in[5] >> 13) & 0x1FF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[5] >> 22) & 0x1FF) & 1))^(((in[5] >> 22) & 0x1FF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[5] >> 31) & 0x1FF) & 1))^(((in[5] >> 31) & 0x1FF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[5] >> 40) & 0x1FF) & 1))^(((in[5] >> 40) & 0x1FF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[5] >> 49) & 0x1FF) & 1))^(((in[5] >> 49) & 0x1FF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[5] >> 58) | ((in[6] & 0x7) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0x7) << 6)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[6] >> 3) & 0x1FF) & 1))^(((in[6] >> 3) & 0x1FF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[6] >> 12) & 0x1FF) & 1))^(((in[6] >> 12) & 0x1FF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[6] >> 21) & 0x1FF) & 1))^(((in[6] >> 21) & 0x1FF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[6] >> 30) & 0x1FF) & 1))^(((in[6] >> 30) & 0x1FF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[6] >> 39) & 0x1FF) & 1))^(((in[6] >> 39) & 0x1FF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[6] >> 48) & 0x1FF) & 1))^(((in[6] >> 48) & 0x1FF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[6] >> 57) | ((in[7] & 0x3) << 7))) & 1))^((((in[6] >> 57) | ((in[7] & 0x3) << 7)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[7] >> 2) & 0x1FF) & 1))^(((in[7] >> 2) & 0x1FF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[7] >> 11) & 0x1FF) & 1))^(((in[7] >> 11) & 0x1FF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[7] >> 20) & 0x1FF) & 1))^(((in[7] >> 20) & 0x1FF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[7] >> 29) & 0x1FF) & 1))^(((in[7] >> 29) & 0x1FF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[7] >> 38) & 0x1FF) & 1))^(((in[7] >> 38) & 0x1FF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[7] >> 47) & 0x1FF) & 1))^(((in[7] >> 47) & 0x1FF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[7] >> 56) | ((in[8] & 0x1) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0x1) << 8)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[8] >> 1) & 0x1FF) & 1))^(((in[8] >> 1) & 0x1FF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[8] >> 10) & 0x1FF) & 1))^(((in[8] >> 10) & 0x1FF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[8] >> 19) & 0x1FF) & 1))^(((in[8] >> 19) & 0x1FF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[8] >> 28) & 0x1FF) & 1))^(((in[8] >> 28) & 0x1FF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[8] >> 37) & 0x1FF) & 1))^(((in[8] >> 37) & 0x1FF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[8] >> 46) & 0x1FF) & 1))^(((in[8] >> 46) & 0x1FF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[8] >> 55)) & 1))^(((in[8] >> 55))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_10(initoffset int64, in *[10]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FF) & 1))^(((in[0] >> 0) & 0x3FF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 10) & 0x3FF) & 1))^(((in[0] >> 10) & 0x3FF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 20) & 0x3FF) & 1))^(((in[0] >> 20) & 0x3FF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 30) & 0x3FF) & 1))^(((in[0] >> 30) & 0x3FF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 40) & 0x3FF) & 1))^(((in[0] >> 40) & 0x3FF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[0] >> 50) & 0x3FF) & 1))^(((in[0] >> 50) & 0x3FF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[0] >> 60) | ((in[1] & 0x3F) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0x3F) << 4)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[1] >> 6) & 0x3FF) & 1))^(((in[1] >> 6) & 0x3FF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[1] >> 16) & 0x3FF) & 1))^(((in[1] >> 16) & 0x3FF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[1] >> 26) & 0x3FF) & 1))^(((in[1] >> 26) & 0x3FF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[1] >> 36) & 0x3FF) & 1))^(((in[1] >> 36) & 0x3FF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[1] >> 46) & 0x3FF) & 1))^(((in[1] >> 46) & 0x3FF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[1] >> 56) | ((in[2] & 0x3) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0x3) << 8)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[2] >> 2) & 0x3FF) & 1))^(((in[2] >> 2) & 0x3FF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[2] >> 12) & 0x3FF) & 1))^(((in[2] >> 12) & 0x3FF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[2] >> 22) & 0x3FF) & 1))^(((in[2] >> 22) & 0x3FF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[2] >> 32) & 0x3FF) & 1))^(((in[2] >> 32) & 0x3FF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[2] >> 42) & 0x3FF) & 1))^(((in[2] >> 42) & 0x3FF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[2] >> 52) & 0x3FF) & 1))^(((in[2] >> 52) & 0x3FF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[2] >> 62) | ((in[3] & 0xFF) << 2))) & 1))^((((in[2] >> 62) | ((in[3] & 0xFF) << 2)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[3] >> 8) & 0x3FF) & 1))^(((in[3] >> 8) & 0x3FF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[3] >> 18) & 0x3FF) & 1))^(((in[3] >> 18) & 0x3FF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[3] >> 28) & 0x3FF) & 1))^(((in[3] >> 28) & 0x3FF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[3] >> 38) & 0x3FF) & 1))^(((in[3] >> 38) & 0x3FF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[3] >> 48) & 0x3FF) & 1))^(((in[3] >> 48) & 0x3FF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[3] >> 58) | ((in[4] & 0xF) << 6))) & 1))^((((in[3] >> 58) | ((in[4] & 0xF) << 6)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[4] >> 4) & 0x3FF) & 1))^(((in[4] >> 4) & 0x3FF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[4] >> 14) & 0x3FF) & 1))^(((in[4] >> 14) & 0x3FF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[4] >> 24) & 0x3FF) & 1))^(((in[4] >> 24) & 0x3FF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[4] >> 34) & 0x3FF) & 1))^(((in[4] >> 34) & 0x3FF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[4] >> 44) & 0x3FF) & 1))^(((in[4] >> 44) & 0x3FF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[4] >> 54)) & 1))^(((in[4] >> 54))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[5] >> 0) & 0x3FF) & 1))^(((in[5] >> 0) & 0x3FF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[5] >> 10) & 0x3FF) & 1))^(((in[5] >> 10) & 0x3FF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[5] >> 20) & 0x3FF) & 1))^(((in[5] >> 20) & 0x3FF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[5] >> 30) & 0x3FF) & 1))^(((in[5] >> 30) & 0x3FF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[5] >> 40) & 0x3FF) & 1))^(((in[5] >> 40) & 0x3FF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[5] >> 50) & 0x3FF) & 1))^(((in[5] >> 50) & 0x3FF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[5] >> 60) | ((in[6] & 0x3F) << 4))) & 1))^((((in[5] >> 60) | ((in[6] & 0x3F) << 4)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[6] >> 6) & 0x3FF) & 1))^(((in[6] >> 6) & 0x3FF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[6] >> 16) & 0x3FF) & 1))^(((in[6] >> 16) & 0x3FF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[6] >> 26) & 0x3FF) & 1))^(((in[6] >> 26) & 0x3FF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[6] >> 36) & 0x3FF) & 1))^(((in[6] >> 36) & 0x3FF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[6] >> 46) & 0x3FF) & 1))^(((in[6] >> 46) & 0x3FF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[6] >> 56) | ((in[7] & 0x3) << 8))) & 1))^((((in[6] >> 56) | ((in[7] & 0x3) << 8)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[7] >> 2) & 0x3FF) & 1))^(((in[7] >> 2) & 0x3FF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[7] >> 12) & 0x3FF) & 1))^(((in[7] >> 12) & 0x3FF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[7] >> 22) & 0x3FF) & 1))^(((in[7] >> 22) & 0x3FF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[7] >> 32) & 0x3FF) & 1))^(((in[7] >> 32) & 0x3FF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[7] >> 42) & 0x3FF) & 1))^(((in[7] >> 42) & 0x3FF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[7] >> 52) & 0x3FF) & 1))^(((in[7] >> 52) & 0x3FF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[7] >> 62) | ((in[8] & 0xFF) << 2))) & 1))^((((in[7] >> 62) | ((in[8] & 0xFF) << 2)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[8] >> 8) & 0x3FF) & 1))^(((in[8] >> 8) & 0x3FF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[8] >> 18) & 0x3FF) & 1))^(((in[8] >> 18) & 0x3FF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[8] >> 28) & 0x3FF) & 1))^(((in[8] >> 28) & 0x3FF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[8] >> 38) & 0x3FF) & 1))^(((in[8] >> 38) & 0x3FF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[8] >> 48) & 0x3FF) & 1))^(((in[8] >> 48) & 0x3FF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[8] >> 58) | ((in[9] & 0xF) << 6))) & 1))^((((in[8] >> 58) | ((in[9] & 0xF) << 6)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[9] >> 4) & 0x3FF) & 1))^(((in[9] >> 4) & 0x3FF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[9] >> 14) & 0x3FF) & 1))^(((in[9] >> 14) & 0x3FF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[9] >> 24) & 0x3FF) & 1))^(((in[9] >> 24) & 0x3FF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[9] >> 34) & 0x3FF) & 1))^(((in[9] >> 34) & 0x3FF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[9] >> 44) & 0x3FF) & 1))^(((in[9] >> 44) & 0x3FF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[9] >> 54)) & 1))^(((in[9] >> 54))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_11(initoffset int64, in *[11]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FF) & 1))^(((in[0] >> 0) & 0x7FF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 11) & 0x7FF) & 1))^(((in[0] >> 11) & 0x7FF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 22) & 0x7FF) & 1))^(((in[0] >> 22) & 0x7FF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 33) & 0x7FF) & 1))^(((in[0] >> 33) & 0x7FF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 44) & 0x7FF) & 1))^(((in[0] >> 44) & 0x7FF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[0] >> 55) | ((in[1] & 0x3) << 9))) & 1))^((((in[0] >> 55) | ((in[1] & 0x3) << 9)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 2) & 0x7FF) & 1))^(((in[1] >> 2) & 0x7FF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[1] >> 13) & 0x7FF) & 1))^(((in[1] >> 13) & 0x7FF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[1] >> 24) & 0x7FF) & 1))^(((in[1] >> 24) & 0x7FF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[1] >> 35) & 0x7FF) & 1))^(((in[1] >> 35) & 0x7FF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[1] >> 46) & 0x7FF) & 1))^(((in[1] >> 46) & 0x7FF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[1] >> 57) | ((in[2] & 0xF) << 7))) & 1))^((((in[1] >> 57) | ((in[2] & 0xF) << 7)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[2] >> 4) & 0x7FF) & 1))^(((in[2] >> 4) & 0x7FF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[2] >> 15) & 0x7FF) & 1))^(((in[2] >> 15) & 0x7FF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[2] >> 26) & 0x7FF) & 1))^(((in[2] >> 26) & 0x7FF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[2] >> 37) & 0x7FF) & 1))^(((in[2] >> 37) & 0x7FF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[2] >> 48) & 0x7FF) & 1))^(((in[2] >> 48) & 0x7FF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[2] >> 59) | ((in[3] & 0x3F) << 5))) & 1))^((((in[2] >> 59) | ((in[3] & 0x3F) << 5)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[3] >> 6) & 0x7FF) & 1))^(((in[3] >> 6) & 0x7FF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[3] >> 17) & 0x7FF) & 1))^(((in[3] >> 17) & 0x7FF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[3] >> 28) & 0x7FF) & 1))^(((in[3] >> 28) & 0x7FF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[3] >> 39) & 0x7FF) & 1))^(((in[3] >> 39) & 0x7FF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[3] >> 50) & 0x7FF) & 1))^(((in[3] >> 50) & 0x7FF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[3] >> 61) | ((in[4] & 0xFF) << 3))) & 1))^((((in[3] >> 61) | ((in[4] & 0xFF) << 3)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[4] >> 8) & 0x7FF) & 1))^(((in[4] >> 8) & 0x7FF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[4] >> 19) & 0x7FF) & 1))^(((in[4] >> 19) & 0x7FF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[4] >> 30) & 0x7FF) & 1))^(((in[4] >> 30) & 0x7FF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[4] >> 41) & 0x7FF) & 1))^(((in[4] >> 41) & 0x7FF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[4] >> 52) & 0x7FF) & 1))^(((in[4] >> 52) & 0x7FF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[4] >> 63) | ((in[5] & 0x3FF) << 1))) & 1))^((((in[4] >> 63) | ((in[5] & 0x3FF) << 1)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[5] >> 10) & 0x7FF) & 1))^(((in[5] >> 10) & 0x7FF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[5] >> 21) & 0x7FF) & 1))^(((in[5] >> 21) & 0x7FF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[5] >> 32) & 0x7FF) & 1))^(((in[5] >> 32) & 0x7FF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[5] >> 43) & 0x7FF) & 1))^(((in[5] >> 43) & 0x7FF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[5] >> 54) | ((in[6] & 0x1) << 10))) & 1))^((((in[5] >> 54) | ((in[6] & 0x1) << 10)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[6] >> 1) & 0x7FF) & 1))^(((in[6] >> 1) & 0x7FF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[6] >> 12) & 0x7FF) & 1))^(((in[6] >> 12) & 0x7FF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[6] >> 23) & 0x7FF) & 1))^(((in[6] >> 23) & 0x7FF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[6] >> 34) & 0x7FF) & 1))^(((in[6] >> 34) & 0x7FF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[6] >> 45) & 0x7FF) & 1))^(((in[6] >> 45) & 0x7FF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[6] >> 56) | ((in[7] & 0x7) << 8))) & 1))^((((in[6] >> 56) | ((in[7] & 0x7) << 8)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[7] >> 3) & 0x7FF) & 1))^(((in[7] >> 3) & 0x7FF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[7] >> 14) & 0x7FF) & 1))^(((in[7] >> 14) & 0x7FF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[7] >> 25) & 0x7FF) & 1))^(((in[7] >> 25) & 0x7FF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[7] >> 36) & 0x7FF) & 1))^(((in[7] >> 36) & 0x7FF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[7] >> 47) & 0x7FF) & 1))^(((in[7] >> 47) & 0x7FF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[7] >> 58) | ((in[8] & 0x1F) << 6))) & 1))^((((in[7] >> 58) | ((in[8] & 0x1F) << 6)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[8] >> 5) & 0x7FF) & 1))^(((in[8] >> 5) & 0x7FF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[8] >> 16) & 0x7FF) & 1))^(((in[8] >> 16) & 0x7FF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[8] >> 27) & 0x7FF) & 1))^(((in[8] >> 27) & 0x7FF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[8] >> 38) & 0x7FF) & 1))^(((in[8] >> 38) & 0x7FF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[8] >> 49) & 0x7FF) & 1))^(((in[8] >> 49) & 0x7FF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[8] >> 60) | ((in[9] & 0x7F) << 4))) & 1))^((((in[8] >> 60) | ((in[9] & 0x7F) << 4)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[9] >> 7) & 0x7FF) & 1))^(((in[9] >> 7) & 0x7FF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[9] >> 18) & 0x7FF) & 1))^(((in[9] >> 18) & 0x7FF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[9] >> 29) & 0x7FF) & 1))^(((in[9] >> 29) & 0x7FF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[9] >> 40) & 0x7FF) & 1))^(((in[9] >> 40) & 0x7FF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[9] >> 51) & 0x7FF) & 1))^(((in[9] >> 51) & 0x7FF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[9] >> 62) | ((in[10] & 0x1FF) << 2))) & 1))^((((in[9] >> 62) | ((in[10] & 0x1FF) << 2)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[10] >> 9) & 0x7FF) & 1))^(((in[10] >> 9) & 0x7FF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[10] >> 20) & 0x7FF) & 1))^(((in[10] >> 20) & 0x7FF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[10] >> 31) & 0x7FF) & 1))^(((in[10] >> 31) & 0x7FF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[10] >> 42) & 0x7FF) & 1))^(((in[10] >> 42) & 0x7FF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[10] >> 53)) & 1))^(((in[10] >> 53))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_12(initoffset int64, in *[12]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFF) & 1))^(((in[0] >> 0) & 0xFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 12) & 0xFFF) & 1))^(((in[0] >> 12) & 0xFFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 24) & 0xFFF) & 1))^(((in[0] >> 24) & 0xFFF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 36) & 0xFFF) & 1))^(((in[0] >> 36) & 0xFFF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[0] >> 48) & 0xFFF) & 1))^(((in[0] >> 48) & 0xFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[0] >> 60) | ((in[1] & 0xFF) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0xFF) << 4)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 8) & 0xFFF) & 1))^(((in[1] >> 8) & 0xFFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[1] >> 20) & 0xFFF) & 1))^(((in[1] >> 20) & 0xFFF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[1] >> 32) & 0xFFF) & 1))^(((in[1] >> 32) & 0xFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[1] >> 44) & 0xFFF) & 1))^(((in[1] >> 44) & 0xFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[1] >> 56) | ((in[2] & 0xF) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0xF) << 8)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[2] >> 4) & 0xFFF) & 1))^(((in[2] >> 4) & 0xFFF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[2] >> 16) & 0xFFF) & 1))^(((in[2] >> 16) & 0xFFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[2] >> 28) & 0xFFF) & 1))^(((in[2] >> 28) & 0xFFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[2] >> 40) & 0xFFF) & 1))^(((in[2] >> 40) & 0xFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[2] >> 52)) & 1))^(((in[2] >> 52))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[3] >> 0) & 0xFFF) & 1))^(((in[3] >> 0) & 0xFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[3] >> 12) & 0xFFF) & 1))^(((in[3] >> 12) & 0xFFF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[3] >> 24) & 0xFFF) & 1))^(((in[3] >> 24) & 0xFFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[3] >> 36) & 0xFFF) & 1))^(((in[3] >> 36) & 0xFFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[3] >> 48) & 0xFFF) & 1))^(((in[3] >> 48) & 0xFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[3] >> 60) | ((in[4] & 0xFF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0xFF) << 4)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[4] >> 8) & 0xFFF) & 1))^(((in[4] >> 8) & 0xFFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[4] >> 20) & 0xFFF) & 1))^(((in[4] >> 20) & 0xFFF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[4] >> 32) & 0xFFF) & 1))^(((in[4] >> 32) & 0xFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[4] >> 44) & 0xFFF) & 1))^(((in[4] >> 44) & 0xFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[4] >> 56) | ((in[5] & 0xF) << 8))) & 1))^((((in[4] >> 56) | ((in[5] & 0xF) << 8)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[5] >> 4) & 0xFFF) & 1))^(((in[5] >> 4) & 0xFFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[5] >> 16) & 0xFFF) & 1))^(((in[5] >> 16) & 0xFFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[5] >> 28) & 0xFFF) & 1))^(((in[5] >> 28) & 0xFFF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[5] >> 40) & 0xFFF) & 1))^(((in[5] >> 40) & 0xFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[5] >> 52)) & 1))^(((in[5] >> 52))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[6] >> 0) & 0xFFF) & 1))^(((in[6] >> 0) & 0xFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[6] >> 12) & 0xFFF) & 1))^(((in[6] >> 12) & 0xFFF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[6] >> 24) & 0xFFF) & 1))^(((in[6] >> 24) & 0xFFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[6] >> 36) & 0xFFF) & 1))^(((in[6] >> 36) & 0xFFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[6] >> 48) & 0xFFF) & 1))^(((in[6] >> 48) & 0xFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[6] >> 60) | ((in[7] & 0xFF) << 4))) & 1))^((((in[6] >> 60) | ((in[7] & 0xFF) << 4)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[7] >> 8) & 0xFFF) & 1))^(((in[7] >> 8) & 0xFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[7] >> 20) & 0xFFF) & 1))^(((in[7] >> 20) & 0xFFF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[7] >> 32) & 0xFFF) & 1))^(((in[7] >> 32) & 0xFFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[7] >> 44) & 0xFFF) & 1))^(((in[7] >> 44) & 0xFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[7] >> 56) | ((in[8] & 0xF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0xF) << 8)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[8] >> 4) & 0xFFF) & 1))^(((in[8] >> 4) & 0xFFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[8] >> 16) & 0xFFF) & 1))^(((in[8] >> 16) & 0xFFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[8] >> 28) & 0xFFF) & 1))^(((in[8] >> 28) & 0xFFF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[8] >> 40) & 0xFFF) & 1))^(((in[8] >> 40) & 0xFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[8] >> 52)) & 1))^(((in[8] >> 52))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[9] >> 0) & 0xFFF) & 1))^(((in[9] >> 0) & 0xFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[9] >> 12) & 0xFFF) & 1))^(((in[9] >> 12) & 0xFFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[9] >> 24) & 0xFFF) & 1))^(((in[9] >> 24) & 0xFFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[9] >> 36) & 0xFFF) & 1))^(((in[9] >> 36) & 0xFFF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[9] >> 48) & 0xFFF) & 1))^(((in[9] >> 48) & 0xFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[9] >> 60) | ((in[10] & 0xFF) << 4))) & 1))^((((in[9] >> 60) | ((in[10] & 0xFF) << 4)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[10] >> 8) & 0xFFF) & 1))^(((in[10] >> 8) & 0xFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[10] >> 20) & 0xFFF) & 1))^(((in[10] >> 20) & 0xFFF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[10] >> 32) & 0xFFF) & 1))^(((in[10] >> 32) & 0xFFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[10] >> 44) & 0xFFF) & 1))^(((in[10] >> 44) & 0xFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[10] >> 56) | ((in[11] & 0xF) << 8))) & 1))^((((in[10] >> 56) | ((in[11] & 0xF) << 8)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[11] >> 4) & 0xFFF) & 1))^(((in[11] >> 4) & 0xFFF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[11] >> 16) & 0xFFF) & 1))^(((in[11] >> 16) & 0xFFF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[11] >> 28) & 0xFFF) & 1))^(((in[11] >> 28) & 0xFFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[11] >> 40) & 0xFFF) & 1))^(((in[11] >> 40) & 0xFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[11] >> 52)) & 1))^(((in[11] >> 52))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_13(initoffset int64, in *[13]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFF) & 1))^(((in[0] >> 0) & 0x1FFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 13) & 0x1FFF) & 1))^(((in[0] >> 13) & 0x1FFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 26) & 0x1FFF) & 1))^(((in[0] >> 26) & 0x1FFF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 39) & 0x1FFF) & 1))^(((in[0] >> 39) & 0x1FFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[0] >> 52) | ((in[1] & 0x1) << 12))) & 1))^((((in[0] >> 52) | ((in[1] & 0x1) << 12)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 1) & 0x1FFF) & 1))^(((in[1] >> 1) & 0x1FFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 14) & 0x1FFF) & 1))^(((in[1] >> 14) & 0x1FFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[1] >> 27) & 0x1FFF) & 1))^(((in[1] >> 27) & 0x1FFF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[1] >> 40) & 0x1FFF) & 1))^(((in[1] >> 40) & 0x1FFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[1] >> 53) | ((in[2] & 0x3) << 11))) & 1))^((((in[1] >> 53) | ((in[2] & 0x3) << 11)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[2] >> 2) & 0x1FFF) & 1))^(((in[2] >> 2) & 0x1FFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[2] >> 15) & 0x1FFF) & 1))^(((in[2] >> 15) & 0x1FFF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[2] >> 28) & 0x1FFF) & 1))^(((in[2] >> 28) & 0x1FFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[2] >> 41) & 0x1FFF) & 1))^(((in[2] >> 41) & 0x1FFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[2] >> 54) | ((in[3] & 0x7) << 10))) & 1))^((((in[2] >> 54) | ((in[3] & 0x7) << 10)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[3] >> 3) & 0x1FFF) & 1))^(((in[3] >> 3) & 0x1FFF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[3] >> 16) & 0x1FFF) & 1))^(((in[3] >> 16) & 0x1FFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[3] >> 29) & 0x1FFF) & 1))^(((in[3] >> 29) & 0x1FFF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[3] >> 42) & 0x1FFF) & 1))^(((in[3] >> 42) & 0x1FFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[3] >> 55) | ((in[4] & 0xF) << 9))) & 1))^((((in[3] >> 55) | ((in[4] & 0xF) << 9)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[4] >> 4) & 0x1FFF) & 1))^(((in[4] >> 4) & 0x1FFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[4] >> 17) & 0x1FFF) & 1))^(((in[4] >> 17) & 0x1FFF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[4] >> 30) & 0x1FFF) & 1))^(((in[4] >> 30) & 0x1FFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[4] >> 43) & 0x1FFF) & 1))^(((in[4] >> 43) & 0x1FFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[4] >> 56) | ((in[5] & 0x1F) << 8))) & 1))^((((in[4] >> 56) | ((in[5] & 0x1F) << 8)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[5] >> 5) & 0x1FFF) & 1))^(((in[5] >> 5) & 0x1FFF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[5] >> 18) & 0x1FFF) & 1))^(((in[5] >> 18) & 0x1FFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[5] >> 31) & 0x1FFF) & 1))^(((in[5] >> 31) & 0x1FFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[5] >> 44) & 0x1FFF) & 1))^(((in[5] >> 44) & 0x1FFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[5] >> 57) | ((in[6] & 0x3F) << 7))) & 1))^((((in[5] >> 57) | ((in[6] & 0x3F) << 7)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[6] >> 6) & 0x1FFF) & 1))^(((in[6] >> 6) & 0x1FFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[6] >> 19) & 0x1FFF) & 1))^(((in[6] >> 19) & 0x1FFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[6] >> 32) & 0x1FFF) & 1))^(((in[6] >> 32) & 0x1FFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[6] >> 45) & 0x1FFF) & 1))^(((in[6] >> 45) & 0x1FFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[6] >> 58) | ((in[7] & 0x7F) << 6))) & 1))^((((in[6] >> 58) | ((in[7] & 0x7F) << 6)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[7] >> 7) & 0x1FFF) & 1))^(((in[7] >> 7) & 0x1FFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[7] >> 20) & 0x1FFF) & 1))^(((in[7] >> 20) & 0x1FFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[7] >> 33) & 0x1FFF) & 1))^(((in[7] >> 33) & 0x1FFF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[7] >> 46) & 0x1FFF) & 1))^(((in[7] >> 46) & 0x1FFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[7] >> 59) | ((in[8] & 0xFF) << 5))) & 1))^((((in[7] >> 59) | ((in[8] & 0xFF) << 5)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[8] >> 8) & 0x1FFF) & 1))^(((in[8] >> 8) & 0x1FFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[8] >> 21) & 0x1FFF) & 1))^(((in[8] >> 21) & 0x1FFF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[8] >> 34) & 0x1FFF) & 1))^(((in[8] >> 34) & 0x1FFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[8] >> 47) & 0x1FFF) & 1))^(((in[8] >> 47) & 0x1FFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[8] >> 60) | ((in[9] & 0x1FF) << 4))) & 1))^((((in[8] >> 60) | ((in[9] & 0x1FF) << 4)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[9] >> 9) & 0x1FFF) & 1))^(((in[9] >> 9) & 0x1FFF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[9] >> 22) & 0x1FFF) & 1))^(((in[9] >> 22) & 0x1FFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[9] >> 35) & 0x1FFF) & 1))^(((in[9] >> 35) & 0x1FFF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[9] >> 48) & 0x1FFF) & 1))^(((in[9] >> 48) & 0x1FFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[9] >> 61) | ((in[10] & 0x3FF) << 3))) & 1))^((((in[9] >> 61) | ((in[10] & 0x3FF) << 3)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[10] >> 10) & 0x1FFF) & 1))^(((in[10] >> 10) & 0x1FFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[10] >> 23) & 0x1FFF) & 1))^(((in[10] >> 23) & 0x1FFF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[10] >> 36) & 0x1FFF) & 1))^(((in[10] >> 36) & 0x1FFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[10] >> 49) & 0x1FFF) & 1))^(((in[10] >> 49) & 0x1FFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[10] >> 62) | ((in[11] & 0x7FF) << 2))) & 1))^((((in[10] >> 62) | ((in[11] & 0x7FF) << 2)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[11] >> 11) & 0x1FFF) & 1))^(((in[11] >> 11) & 0x1FFF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[11] >> 24) & 0x1FFF) & 1))^(((in[11] >> 24) & 0x1FFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[11] >> 37) & 0x1FFF) & 1))^(((in[11] >> 37) & 0x1FFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[11] >> 50) & 0x1FFF) & 1))^(((in[11] >> 50) & 0x1FFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[11] >> 63) | ((in[12] & 0xFFF) << 1))) & 1))^((((in[11] >> 63) | ((in[12] & 0xFFF) << 1)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[12] >> 12) & 0x1FFF) & 1))^(((in[12] >> 12) & 0x1FFF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[12] >> 25) & 0x1FFF) & 1))^(((in[12] >> 25) & 0x1FFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[12] >> 38) & 0x1FFF) & 1))^(((in[12] >> 38) & 0x1FFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[12] >> 51)) & 1))^(((in[12] >> 51))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_14(initoffset int64, in *[14]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFF) & 1))^(((in[0] >> 0) & 0x3FFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 14) & 0x3FFF) & 1))^(((in[0] >> 14) & 0x3FFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 28) & 0x3FFF) & 1))^(((in[0] >> 28) & 0x3FFF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 42) & 0x3FFF) & 1))^(((in[0] >> 42) & 0x3FFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[0] >> 56) | ((in[1] & 0x3F) << 8))) & 1))^((((in[0] >> 56) | ((in[1] & 0x3F) << 8)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 6) & 0x3FFF) & 1))^(((in[1] >> 6) & 0x3FFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 20) & 0x3FFF) & 1))^(((in[1] >> 20) & 0x3FFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[1] >> 34) & 0x3FFF) & 1))^(((in[1] >> 34) & 0x3FFF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[1] >> 48) & 0x3FFF) & 1))^(((in[1] >> 48) & 0x3FFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[1] >> 62) | ((in[2] & 0xFFF) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0xFFF) << 2)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[2] >> 12) & 0x3FFF) & 1))^(((in[2] >> 12) & 0x3FFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[2] >> 26) & 0x3FFF) & 1))^(((in[2] >> 26) & 0x3FFF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[2] >> 40) & 0x3FFF) & 1))^(((in[2] >> 40) & 0x3FFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[2] >> 54) | ((in[3] & 0xF) << 10))) & 1))^((((in[2] >> 54) | ((in[3] & 0xF) << 10)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[3] >> 4) & 0x3FFF) & 1))^(((in[3] >> 4) & 0x3FFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[3] >> 18) & 0x3FFF) & 1))^(((in[3] >> 18) & 0x3FFF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[3] >> 32) & 0x3FFF) & 1))^(((in[3] >> 32) & 0x3FFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[3] >> 46) & 0x3FFF) & 1))^(((in[3] >> 46) & 0x3FFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[3] >> 60) | ((in[4] & 0x3FF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x3FF) << 4)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[4] >> 10) & 0x3FFF) & 1))^(((in[4] >> 10) & 0x3FFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[4] >> 24) & 0x3FFF) & 1))^(((in[4] >> 24) & 0x3FFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[4] >> 38) & 0x3FFF) & 1))^(((in[4] >> 38) & 0x3FFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[4] >> 52) | ((in[5] & 0x3) << 12))) & 1))^((((in[4] >> 52) | ((in[5] & 0x3) << 12)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[5] >> 2) & 0x3FFF) & 1))^(((in[5] >> 2) & 0x3FFF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[5] >> 16) & 0x3FFF) & 1))^(((in[5] >> 16) & 0x3FFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[5] >> 30) & 0x3FFF) & 1))^(((in[5] >> 30) & 0x3FFF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[5] >> 44) & 0x3FFF) & 1))^(((in[5] >> 44) & 0x3FFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[5] >> 58) | ((in[6] & 0xFF) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0xFF) << 6)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[6] >> 8) & 0x3FFF) & 1))^(((in[6] >> 8) & 0x3FFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[6] >> 22) & 0x3FFF) & 1))^(((in[6] >> 22) & 0x3FFF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[6] >> 36) & 0x3FFF) & 1))^(((in[6] >> 36) & 0x3FFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[6] >> 50)) & 1))^(((in[6] >> 50))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[7] >> 0) & 0x3FFF) & 1))^(((in[7] >> 0) & 0x3FFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[7] >> 14) & 0x3FFF) & 1))^(((in[7] >> 14) & 0x3FFF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[7] >> 28) & 0x3FFF) & 1))^(((in[7] >> 28) & 0x3FFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[7] >> 42) & 0x3FFF) & 1))^(((in[7] >> 42) & 0x3FFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[7] >> 56) | ((in[8] & 0x3F) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0x3F) << 8)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[8] >> 6) & 0x3FFF) & 1))^(((in[8] >> 6) & 0x3FFF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[8] >> 20) & 0x3FFF) & 1))^(((in[8] >> 20) & 0x3FFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[8] >> 34) & 0x3FFF) & 1))^(((in[8] >> 34) & 0x3FFF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[8] >> 48) & 0x3FFF) & 1))^(((in[8] >> 48) & 0x3FFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[8] >> 62) | ((in[9] & 0xFFF) << 2))) & 1))^((((in[8] >> 62) | ((in[9] & 0xFFF) << 2)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[9] >> 12) & 0x3FFF) & 1))^(((in[9] >> 12) & 0x3FFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[9] >> 26) & 0x3FFF) & 1))^(((in[9] >> 26) & 0x3FFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[9] >> 40) & 0x3FFF) & 1))^(((in[9] >> 40) & 0x3FFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[9] >> 54) | ((in[10] & 0xF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0xF) << 10)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[10] >> 4) & 0x3FFF) & 1))^(((in[10] >> 4) & 0x3FFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[10] >> 18) & 0x3FFF) & 1))^(((in[10] >> 18) & 0x3FFF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[10] >> 32) & 0x3FFF) & 1))^(((in[10] >> 32) & 0x3FFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[10] >> 46) & 0x3FFF) & 1))^(((in[10] >> 46) & 0x3FFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[10] >> 60) | ((in[11] & 0x3FF) << 4))) & 1))^((((in[10] >> 60) | ((in[11] & 0x3FF) << 4)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[11] >> 10) & 0x3FFF) & 1))^(((in[11] >> 10) & 0x3FFF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[11] >> 24) & 0x3FFF) & 1))^(((in[11] >> 24) & 0x3FFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[11] >> 38) & 0x3FFF) & 1))^(((in[11] >> 38) & 0x3FFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[11] >> 52) | ((in[12] & 0x3) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0x3) << 12)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[12] >> 2) & 0x3FFF) & 1))^(((in[12] >> 2) & 0x3FFF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[12] >> 16) & 0x3FFF) & 1))^(((in[12] >> 16) & 0x3FFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[12] >> 30) & 0x3FFF) & 1))^(((in[12] >> 30) & 0x3FFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[12] >> 44) & 0x3FFF) & 1))^(((in[12] >> 44) & 0x3FFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[12] >> 58) | ((in[13] & 0xFF) << 6))) & 1))^((((in[12] >> 58) | ((in[13] & 0xFF) << 6)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[13] >> 8) & 0x3FFF) & 1))^(((in[13] >> 8) & 0x3FFF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[13] >> 22) & 0x3FFF) & 1))^(((in[13] >> 22) & 0x3FFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[13] >> 36) & 0x3FFF) & 1))^(((in[13] >> 36) & 0x3FFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[13] >> 50)) & 1))^(((in[13] >> 50))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_15(initoffset int64, in *[15]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFF) & 1))^(((in[0] >> 0) & 0x7FFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 15) & 0x7FFF) & 1))^(((in[0] >> 15) & 0x7FFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 30) & 0x7FFF) & 1))^(((in[0] >> 30) & 0x7FFF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 45) & 0x7FFF) & 1))^(((in[0] >> 45) & 0x7FFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[0] >> 60) | ((in[1] & 0x7FF) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0x7FF) << 4)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 11) & 0x7FFF) & 1))^(((in[1] >> 11) & 0x7FFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 26) & 0x7FFF) & 1))^(((in[1] >> 26) & 0x7FFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[1] >> 41) & 0x7FFF) & 1))^(((in[1] >> 41) & 0x7FFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[1] >> 56) | ((in[2] & 0x7F) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0x7F) << 8)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[2] >> 7) & 0x7FFF) & 1))^(((in[2] >> 7) & 0x7FFF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[2] >> 22) & 0x7FFF) & 1))^(((in[2] >> 22) & 0x7FFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[2] >> 37) & 0x7FFF) & 1))^(((in[2] >> 37) & 0x7FFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[2] >> 52) | ((in[3] & 0x7) << 12))) & 1))^((((in[2] >> 52) | ((in[3] & 0x7) << 12)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[3] >> 3) & 0x7FFF) & 1))^(((in[3] >> 3) & 0x7FFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[3] >> 18) & 0x7FFF) & 1))^(((in[3] >> 18) & 0x7FFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[3] >> 33) & 0x7FFF) & 1))^(((in[3] >> 33) & 0x7FFF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[3] >> 48) & 0x7FFF) & 1))^(((in[3] >> 48) & 0x7FFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[3] >> 63) | ((in[4] & 0x3FFF) << 1))) & 1))^((((in[3] >> 63) | ((in[4] & 0x3FFF) << 1)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[4] >> 14) & 0x7FFF) & 1))^(((in[4] >> 14) & 0x7FFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[4] >> 29) & 0x7FFF) & 1))^(((in[4] >> 29) & 0x7FFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[4] >> 44) & 0x7FFF) & 1))^(((in[4] >> 44) & 0x7FFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[4] >> 59) | ((in[5] & 0x3FF) << 5))) & 1))^((((in[4] >> 59) | ((in[5] & 0x3FF) << 5)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[5] >> 10) & 0x7FFF) & 1))^(((in[5] >> 10) & 0x7FFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[5] >> 25) & 0x7FFF) & 1))^(((in[5] >> 25) & 0x7FFF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[5] >> 40) & 0x7FFF) & 1))^(((in[5] >> 40) & 0x7FFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[5] >> 55) | ((in[6] & 0x3F) << 9))) & 1))^((((in[5] >> 55) | ((in[6] & 0x3F) << 9)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[6] >> 6) & 0x7FFF) & 1))^(((in[6] >> 6) & 0x7FFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[6] >> 21) & 0x7FFF) & 1))^(((in[6] >> 21) & 0x7FFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[6] >> 36) & 0x7FFF) & 1))^(((in[6] >> 36) & 0x7FFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[6] >> 51) | ((in[7] & 0x3) << 13))) & 1))^((((in[6] >> 51) | ((in[7] & 0x3) << 13)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[7] >> 2) & 0x7FFF) & 1))^(((in[7] >> 2) & 0x7FFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[7] >> 17) & 0x7FFF) & 1))^(((in[7] >> 17) & 0x7FFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[7] >> 32) & 0x7FFF) & 1))^(((in[7] >> 32) & 0x7FFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[7] >> 47) & 0x7FFF) & 1))^(((in[7] >> 47) & 0x7FFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[7] >> 62) | ((in[8] & 0x1FFF) << 2))) & 1))^((((in[7] >> 62) | ((in[8] & 0x1FFF) << 2)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[8] >> 13) & 0x7FFF) & 1))^(((in[8] >> 13) & 0x7FFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[8] >> 28) & 0x7FFF) & 1))^(((in[8] >> 28) & 0x7FFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[8] >> 43) & 0x7FFF) & 1))^(((in[8] >> 43) & 0x7FFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[8] >> 58) | ((in[9] & 0x1FF) << 6))) & 1))^((((in[8] >> 58) | ((in[9] & 0x1FF) << 6)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[9] >> 9) & 0x7FFF) & 1))^(((in[9] >> 9) & 0x7FFF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[9] >> 24) & 0x7FFF) & 1))^(((in[9] >> 24) & 0x7FFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[9] >> 39) & 0x7FFF) & 1))^(((in[9] >> 39) & 0x7FFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[9] >> 54) | ((in[10] & 0x1F) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0x1F) << 10)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[10] >> 5) & 0x7FFF) & 1))^(((in[10] >> 5) & 0x7FFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[10] >> 20) & 0x7FFF) & 1))^(((in[10] >> 20) & 0x7FFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[10] >> 35) & 0x7FFF) & 1))^(((in[10] >> 35) & 0x7FFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[10] >> 50) | ((in[11] & 0x1) << 14))) & 1))^((((in[10] >> 50) | ((in[11] & 0x1) << 14)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[11] >> 1) & 0x7FFF) & 1))^(((in[11] >> 1) & 0x7FFF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[11] >> 16) & 0x7FFF) & 1))^(((in[11] >> 16) & 0x7FFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[11] >> 31) & 0x7FFF) & 1))^(((in[11] >> 31) & 0x7FFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[11] >> 46) & 0x7FFF) & 1))^(((in[11] >> 46) & 0x7FFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[11] >> 61) | ((in[12] & 0xFFF) << 3))) & 1))^((((in[11] >> 61) | ((in[12] & 0xFFF) << 3)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[12] >> 12) & 0x7FFF) & 1))^(((in[12] >> 12) & 0x7FFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[12] >> 27) & 0x7FFF) & 1))^(((in[12] >> 27) & 0x7FFF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[12] >> 42) & 0x7FFF) & 1))^(((in[12] >> 42) & 0x7FFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[12] >> 57) | ((in[13] & 0xFF) << 7))) & 1))^((((in[12] >> 57) | ((in[13] & 0xFF) << 7)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[13] >> 8) & 0x7FFF) & 1))^(((in[13] >> 8) & 0x7FFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[13] >> 23) & 0x7FFF) & 1))^(((in[13] >> 23) & 0x7FFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[13] >> 38) & 0x7FFF) & 1))^(((in[13] >> 38) & 0x7FFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[13] >> 53) | ((in[14] & 0xF) << 11))) & 1))^((((in[13] >> 53) | ((in[14] & 0xF) << 11)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[14] >> 4) & 0x7FFF) & 1))^(((in[14] >> 4) & 0x7FFF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[14] >> 19) & 0x7FFF) & 1))^(((in[14] >> 19) & 0x7FFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[14] >> 34) & 0x7FFF) & 1))^(((in[14] >> 34) & 0x7FFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[14] >> 49)) & 1))^(((in[14] >> 49))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_16(initoffset int64, in *[16]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFF) & 1))^(((in[0] >> 0) & 0xFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 16) & 0xFFFF) & 1))^(((in[0] >> 16) & 0xFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 32) & 0xFFFF) & 1))^(((in[0] >> 32) & 0xFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[0] >> 48)) & 1))^(((in[0] >> 48))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 0) & 0xFFFF) & 1))^(((in[1] >> 0) & 0xFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 16) & 0xFFFF) & 1))^(((in[1] >> 16) & 0xFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 32) & 0xFFFF) & 1))^(((in[1] >> 32) & 0xFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[1] >> 48)) & 1))^(((in[1] >> 48))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[2] >> 0) & 0xFFFF) & 1))^(((in[2] >> 0) & 0xFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[2] >> 16) & 0xFFFF) & 1))^(((in[2] >> 16) & 0xFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[2] >> 32) & 0xFFFF) & 1))^(((in[2] >> 32) & 0xFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[2] >> 48)) & 1))^(((in[2] >> 48))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[3] >> 0) & 0xFFFF) & 1))^(((in[3] >> 0) & 0xFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[3] >> 16) & 0xFFFF) & 1))^(((in[3] >> 16) & 0xFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[3] >> 32) & 0xFFFF) & 1))^(((in[3] >> 32) & 0xFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[3] >> 48)) & 1))^(((in[3] >> 48))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[4] >> 0) & 0xFFFF) & 1))^(((in[4] >> 0) & 0xFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[4] >> 16) & 0xFFFF) & 1))^(((in[4] >> 16) & 0xFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[4] >> 32) & 0xFFFF) & 1))^(((in[4] >> 32) & 0xFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[4] >> 48)) & 1))^(((in[4] >> 48))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[5] >> 0) & 0xFFFF) & 1))^(((in[5] >> 0) & 0xFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[5] >> 16) & 0xFFFF) & 1))^(((in[5] >> 16) & 0xFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[5] >> 32) & 0xFFFF) & 1))^(((in[5] >> 32) & 0xFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[5] >> 48)) & 1))^(((in[5] >> 48))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[6] >> 0) & 0xFFFF) & 1))^(((in[6] >> 0) & 0xFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[6] >> 16) & 0xFFFF) & 1))^(((in[6] >> 16) & 0xFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[6] >> 32) & 0xFFFF) & 1))^(((in[6] >> 32) & 0xFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[6] >> 48)) & 1))^(((in[6] >> 48))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[7] >> 0) & 0xFFFF) & 1))^(((in[7] >> 0) & 0xFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[7] >> 16) & 0xFFFF) & 1))^(((in[7] >> 16) & 0xFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[7] >> 32) & 0xFFFF) & 1))^(((in[7] >> 32) & 0xFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[7] >> 48)) & 1))^(((in[7] >> 48))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[8] >> 0) & 0xFFFF) & 1))^(((in[8] >> 0) & 0xFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[8] >> 16) & 0xFFFF) & 1))^(((in[8] >> 16) & 0xFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[8] >> 32) & 0xFFFF) & 1))^(((in[8] >> 32) & 0xFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[8] >> 48)) & 1))^(((in[8] >> 48))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[9] >> 0) & 0xFFFF) & 1))^(((in[9] >> 0) & 0xFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[9] >> 16) & 0xFFFF) & 1))^(((in[9] >> 16) & 0xFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[9] >> 32) & 0xFFFF) & 1))^(((in[9] >> 32) & 0xFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[9] >> 48)) & 1))^(((in[9] >> 48))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[10] >> 0) & 0xFFFF) & 1))^(((in[10] >> 0) & 0xFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[10] >> 16) & 0xFFFF) & 1))^(((in[10] >> 16) & 0xFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[10] >> 32) & 0xFFFF) & 1))^(((in[10] >> 32) & 0xFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[10] >> 48)) & 1))^(((in[10] >> 48))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[11] >> 0) & 0xFFFF) & 1))^(((in[11] >> 0) & 0xFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[11] >> 16) & 0xFFFF) & 1))^(((in[11] >> 16) & 0xFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[11] >> 32) & 0xFFFF) & 1))^(((in[11] >> 32) & 0xFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[11] >> 48)) & 1))^(((in[11] >> 48))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[12] >> 0) & 0xFFFF) & 1))^(((in[12] >> 0) & 0xFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[12] >> 16) & 0xFFFF) & 1))^(((in[12] >> 16) & 0xFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[12] >> 32) & 0xFFFF) & 1))^(((in[12] >> 32) & 0xFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[12] >> 48)) & 1))^(((in[12] >> 48))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[13] >> 0) & 0xFFFF) & 1))^(((in[13] >> 0) & 0xFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[13] >> 16) & 0xFFFF) & 1))^(((in[13] >> 16) & 0xFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[13] >> 32) & 0xFFFF) & 1))^(((in[13] >> 32) & 0xFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[13] >> 48)) & 1))^(((in[13] >> 48))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[14] >> 0) & 0xFFFF) & 1))^(((in[14] >> 0) & 0xFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[14] >> 16) & 0xFFFF) & 1))^(((in[14] >> 16) & 0xFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[14] >> 32) & 0xFFFF) & 1))^(((in[14] >> 32) & 0xFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[14] >> 48)) & 1))^(((in[14] >> 48))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[15] >> 0) & 0xFFFF) & 1))^(((in[15] >> 0) & 0xFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[15] >> 16) & 0xFFFF) & 1))^(((in[15] >> 16) & 0xFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[15] >> 32) & 0xFFFF) & 1))^(((in[15] >> 32) & 0xFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[15] >> 48)) & 1))^(((in[15] >> 48))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_17(initoffset int64, in *[17]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFF) & 1))^(((in[0] >> 0) & 0x1FFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 17) & 0x1FFFF) & 1))^(((in[0] >> 17) & 0x1FFFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 34) & 0x1FFFF) & 1))^(((in[0] >> 34) & 0x1FFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[0] >> 51) | ((in[1] & 0xF) << 13))) & 1))^((((in[0] >> 51) | ((in[1] & 0xF) << 13)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 4) & 0x1FFFF) & 1))^(((in[1] >> 4) & 0x1FFFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 21) & 0x1FFFF) & 1))^(((in[1] >> 21) & 0x1FFFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 38) & 0x1FFFF) & 1))^(((in[1] >> 38) & 0x1FFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[1] >> 55) | ((in[2] & 0xFF) << 9))) & 1))^((((in[1] >> 55) | ((in[2] & 0xFF) << 9)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[2] >> 8) & 0x1FFFF) & 1))^(((in[2] >> 8) & 0x1FFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[2] >> 25) & 0x1FFFF) & 1))^(((in[2] >> 25) & 0x1FFFF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[2] >> 42) & 0x1FFFF) & 1))^(((in[2] >> 42) & 0x1FFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[2] >> 59) | ((in[3] & 0xFFF) << 5))) & 1))^((((in[2] >> 59) | ((in[3] & 0xFFF) << 5)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[3] >> 12) & 0x1FFFF) & 1))^(((in[3] >> 12) & 0x1FFFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[3] >> 29) & 0x1FFFF) & 1))^(((in[3] >> 29) & 0x1FFFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[3] >> 46) & 0x1FFFF) & 1))^(((in[3] >> 46) & 0x1FFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[3] >> 63) | ((in[4] & 0xFFFF) << 1))) & 1))^((((in[3] >> 63) | ((in[4] & 0xFFFF) << 1)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[4] >> 16) & 0x1FFFF) & 1))^(((in[4] >> 16) & 0x1FFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[4] >> 33) & 0x1FFFF) & 1))^(((in[4] >> 33) & 0x1FFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[4] >> 50) | ((in[5] & 0x7) << 14))) & 1))^((((in[4] >> 50) | ((in[5] & 0x7) << 14)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[5] >> 3) & 0x1FFFF) & 1))^(((in[5] >> 3) & 0x1FFFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[5] >> 20) & 0x1FFFF) & 1))^(((in[5] >> 20) & 0x1FFFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[5] >> 37) & 0x1FFFF) & 1))^(((in[5] >> 37) & 0x1FFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[5] >> 54) | ((in[6] & 0x7F) << 10))) & 1))^((((in[5] >> 54) | ((in[6] & 0x7F) << 10)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[6] >> 7) & 0x1FFFF) & 1))^(((in[6] >> 7) & 0x1FFFF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[6] >> 24) & 0x1FFFF) & 1))^(((in[6] >> 24) & 0x1FFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[6] >> 41) & 0x1FFFF) & 1))^(((in[6] >> 41) & 0x1FFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[6] >> 58) | ((in[7] & 0x7FF) << 6))) & 1))^((((in[6] >> 58) | ((in[7] & 0x7FF) << 6)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[7] >> 11) & 0x1FFFF) & 1))^(((in[7] >> 11) & 0x1FFFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[7] >> 28) & 0x1FFFF) & 1))^(((in[7] >> 28) & 0x1FFFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[7] >> 45) & 0x1FFFF) & 1))^(((in[7] >> 45) & 0x1FFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[7] >> 62) | ((in[8] & 0x7FFF) << 2))) & 1))^((((in[7] >> 62) | ((in[8] & 0x7FFF) << 2)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[8] >> 15) & 0x1FFFF) & 1))^(((in[8] >> 15) & 0x1FFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[8] >> 32) & 0x1FFFF) & 1))^(((in[8] >> 32) & 0x1FFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[8] >> 49) | ((in[9] & 0x3) << 15))) & 1))^((((in[8] >> 49) | ((in[9] & 0x3) << 15)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[9] >> 2) & 0x1FFFF) & 1))^(((in[9] >> 2) & 0x1FFFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[9] >> 19) & 0x1FFFF) & 1))^(((in[9] >> 19) & 0x1FFFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[9] >> 36) & 0x1FFFF) & 1))^(((in[9] >> 36) & 0x1FFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[9] >> 53) | ((in[10] & 0x3F) << 11))) & 1))^((((in[9] >> 53) | ((in[10] & 0x3F) << 11)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[10] >> 6) & 0x1FFFF) & 1))^(((in[10] >> 6) & 0x1FFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[10] >> 23) & 0x1FFFF) & 1))^(((in[10] >> 23) & 0x1FFFF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[10] >> 40) & 0x1FFFF) & 1))^(((in[10] >> 40) & 0x1FFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[10] >> 57) | ((in[11] & 0x3FF) << 7))) & 1))^((((in[10] >> 57) | ((in[11] & 0x3FF) << 7)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[11] >> 10) & 0x1FFFF) & 1))^(((in[11] >> 10) & 0x1FFFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[11] >> 27) & 0x1FFFF) & 1))^(((in[11] >> 27) & 0x1FFFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[11] >> 44) & 0x1FFFF) & 1))^(((in[11] >> 44) & 0x1FFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[11] >> 61) | ((in[12] & 0x3FFF) << 3))) & 1))^((((in[11] >> 61) | ((in[12] & 0x3FFF) << 3)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[12] >> 14) & 0x1FFFF) & 1))^(((in[12] >> 14) & 0x1FFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[12] >> 31) & 0x1FFFF) & 1))^(((in[12] >> 31) & 0x1FFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[12] >> 48) | ((in[13] & 0x1) << 16))) & 1))^((((in[12] >> 48) | ((in[13] & 0x1) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[13] >> 1) & 0x1FFFF) & 1))^(((in[13] >> 1) & 0x1FFFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[13] >> 18) & 0x1FFFF) & 1))^(((in[13] >> 18) & 0x1FFFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[13] >> 35) & 0x1FFFF) & 1))^(((in[13] >> 35) & 0x1FFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[13] >> 52) | ((in[14] & 0x1F) << 12))) & 1))^((((in[13] >> 52) | ((in[14] & 0x1F) << 12)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[14] >> 5) & 0x1FFFF) & 1))^(((in[14] >> 5) & 0x1FFFF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[14] >> 22) & 0x1FFFF) & 1))^(((in[14] >> 22) & 0x1FFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[14] >> 39) & 0x1FFFF) & 1))^(((in[14] >> 39) & 0x1FFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[14] >> 56) | ((in[15] & 0x1FF) << 8))) & 1))^((((in[14] >> 56) | ((in[15] & 0x1FF) << 8)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[15] >> 9) & 0x1FFFF) & 1))^(((in[15] >> 9) & 0x1FFFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[15] >> 26) & 0x1FFFF) & 1))^(((in[15] >> 26) & 0x1FFFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[15] >> 43) & 0x1FFFF) & 1))^(((in[15] >> 43) & 0x1FFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[15] >> 60) | ((in[16] & 0x1FFF) << 4))) & 1))^((((in[15] >> 60) | ((in[16] & 0x1FFF) << 4)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[16] >> 13) & 0x1FFFF) & 1))^(((in[16] >> 13) & 0x1FFFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[16] >> 30) & 0x1FFFF) & 1))^(((in[16] >> 30) & 0x1FFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[16] >> 47)) & 1))^(((in[16] >> 47))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_18(initoffset int64, in *[18]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFF) & 1))^(((in[0] >> 0) & 0x3FFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 18) & 0x3FFFF) & 1))^(((in[0] >> 18) & 0x3FFFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 36) & 0x3FFFF) & 1))^(((in[0] >> 36) & 0x3FFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[0] >> 54) | ((in[1] & 0xFF) << 10))) & 1))^((((in[0] >> 54) | ((in[1] & 0xFF) << 10)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 8) & 0x3FFFF) & 1))^(((in[1] >> 8) & 0x3FFFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 26) & 0x3FFFF) & 1))^(((in[1] >> 26) & 0x3FFFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[1] >> 44) & 0x3FFFF) & 1))^(((in[1] >> 44) & 0x3FFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[1] >> 62) | ((in[2] & 0xFFFF) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0xFFFF) << 2)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[2] >> 16) & 0x3FFFF) & 1))^(((in[2] >> 16) & 0x3FFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[2] >> 34) & 0x3FFFF) & 1))^(((in[2] >> 34) & 0x3FFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[2] >> 52) | ((in[3] & 0x3F) << 12))) & 1))^((((in[2] >> 52) | ((in[3] & 0x3F) << 12)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[3] >> 6) & 0x3FFFF) & 1))^(((in[3] >> 6) & 0x3FFFF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[3] >> 24) & 0x3FFFF) & 1))^(((in[3] >> 24) & 0x3FFFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[3] >> 42) & 0x3FFFF) & 1))^(((in[3] >> 42) & 0x3FFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[3] >> 60) | ((in[4] & 0x3FFF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x3FFF) << 4)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[4] >> 14) & 0x3FFFF) & 1))^(((in[4] >> 14) & 0x3FFFF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[4] >> 32) & 0x3FFFF) & 1))^(((in[4] >> 32) & 0x3FFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[4] >> 50) | ((in[5] & 0xF) << 14))) & 1))^((((in[4] >> 50) | ((in[5] & 0xF) << 14)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[5] >> 4) & 0x3FFFF) & 1))^(((in[5] >> 4) & 0x3FFFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[5] >> 22) & 0x3FFFF) & 1))^(((in[5] >> 22) & 0x3FFFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[5] >> 40) & 0x3FFFF) & 1))^(((in[5] >> 40) & 0x3FFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[5] >> 58) | ((in[6] & 0xFFF) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0xFFF) << 6)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[6] >> 12) & 0x3FFFF) & 1))^(((in[6] >> 12) & 0x3FFFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[6] >> 30) & 0x3FFFF) & 1))^(((in[6] >> 30) & 0x3FFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[6] >> 48) | ((in[7] & 0x3) << 16))) & 1))^((((in[6] >> 48) | ((in[7] & 0x3) << 16)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[7] >> 2) & 0x3FFFF) & 1))^(((in[7] >> 2) & 0x3FFFF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[7] >> 20) & 0x3FFFF) & 1))^(((in[7] >> 20) & 0x3FFFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[7] >> 38) & 0x3FFFF) & 1))^(((in[7] >> 38) & 0x3FFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[7] >> 56) | ((in[8] & 0x3FF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0x3FF) << 8)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[8] >> 10) & 0x3FFFF) & 1))^(((in[8] >> 10) & 0x3FFFF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[8] >> 28) & 0x3FFFF) & 1))^(((in[8] >> 28) & 0x3FFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[8] >> 46)) & 1))^(((in[8] >> 46))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[9] >> 0) & 0x3FFFF) & 1))^(((in[9] >> 0) & 0x3FFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[9] >> 18) & 0x3FFFF) & 1))^(((in[9] >> 18) & 0x3FFFF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[9] >> 36) & 0x3FFFF) & 1))^(((in[9] >> 36) & 0x3FFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[9] >> 54) | ((in[10] & 0xFF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0xFF) << 10)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[10] >> 8) & 0x3FFFF) & 1))^(((in[10] >> 8) & 0x3FFFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[10] >> 26) & 0x3FFFF) & 1))^(((in[10] >> 26) & 0x3FFFF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[10] >> 44) & 0x3FFFF) & 1))^(((in[10] >> 44) & 0x3FFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[10] >> 62) | ((in[11] & 0xFFFF) << 2))) & 1))^((((in[10] >> 62) | ((in[11] & 0xFFFF) << 2)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[11] >> 16) & 0x3FFFF) & 1))^(((in[11] >> 16) & 0x3FFFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[11] >> 34) & 0x3FFFF) & 1))^(((in[11] >> 34) & 0x3FFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[11] >> 52) | ((in[12] & 0x3F) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0x3F) << 12)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[12] >> 6) & 0x3FFFF) & 1))^(((in[12] >> 6) & 0x3FFFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[12] >> 24) & 0x3FFFF) & 1))^(((in[12] >> 24) & 0x3FFFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[12] >> 42) & 0x3FFFF) & 1))^(((in[12] >> 42) & 0x3FFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[12] >> 60) | ((in[13] & 0x3FFF) << 4))) & 1))^((((in[12] >> 60) | ((in[13] & 0x3FFF) << 4)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[13] >> 14) & 0x3FFFF) & 1))^(((in[13] >> 14) & 0x3FFFF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[13] >> 32) & 0x3FFFF) & 1))^(((in[13] >> 32) & 0x3FFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[13] >> 50) | ((in[14] & 0xF) << 14))) & 1))^((((in[13] >> 50) | ((in[14] & 0xF) << 14)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[14] >> 4) & 0x3FFFF) & 1))^(((in[14] >> 4) & 0x3FFFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[14] >> 22) & 0x3FFFF) & 1))^(((in[14] >> 22) & 0x3FFFF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[14] >> 40) & 0x3FFFF) & 1))^(((in[14] >> 40) & 0x3FFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[14] >> 58) | ((in[15] & 0xFFF) << 6))) & 1))^((((in[14] >> 58) | ((in[15] & 0xFFF) << 6)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[15] >> 12) & 0x3FFFF) & 1))^(((in[15] >> 12) & 0x3FFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[15] >> 30) & 0x3FFFF) & 1))^(((in[15] >> 30) & 0x3FFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[15] >> 48) | ((in[16] & 0x3) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0x3) << 16)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[16] >> 2) & 0x3FFFF) & 1))^(((in[16] >> 2) & 0x3FFFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[16] >> 20) & 0x3FFFF) & 1))^(((in[16] >> 20) & 0x3FFFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[16] >> 38) & 0x3FFFF) & 1))^(((in[16] >> 38) & 0x3FFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[16] >> 56) | ((in[17] & 0x3FF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0x3FF) << 8)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[17] >> 10) & 0x3FFFF) & 1))^(((in[17] >> 10) & 0x3FFFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[17] >> 28) & 0x3FFFF) & 1))^(((in[17] >> 28) & 0x3FFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[17] >> 46)) & 1))^(((in[17] >> 46))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_19(initoffset int64, in *[19]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFF) & 1))^(((in[0] >> 0) & 0x7FFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 19) & 0x7FFFF) & 1))^(((in[0] >> 19) & 0x7FFFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 38) & 0x7FFFF) & 1))^(((in[0] >> 38) & 0x7FFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[0] >> 57) | ((in[1] & 0xFFF) << 7))) & 1))^((((in[0] >> 57) | ((in[1] & 0xFFF) << 7)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 12) & 0x7FFFF) & 1))^(((in[1] >> 12) & 0x7FFFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 31) & 0x7FFFF) & 1))^(((in[1] >> 31) & 0x7FFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[1] >> 50) | ((in[2] & 0x1F) << 14))) & 1))^((((in[1] >> 50) | ((in[2] & 0x1F) << 14)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[2] >> 5) & 0x7FFFF) & 1))^(((in[2] >> 5) & 0x7FFFF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[2] >> 24) & 0x7FFFF) & 1))^(((in[2] >> 24) & 0x7FFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[2] >> 43) & 0x7FFFF) & 1))^(((in[2] >> 43) & 0x7FFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[2] >> 62) | ((in[3] & 0x1FFFF) << 2))) & 1))^((((in[2] >> 62) | ((in[3] & 0x1FFFF) << 2)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[3] >> 17) & 0x7FFFF) & 1))^(((in[3] >> 17) & 0x7FFFF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[3] >> 36) & 0x7FFFF) & 1))^(((in[3] >> 36) & 0x7FFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[3] >> 55) | ((in[4] & 0x3FF) << 9))) & 1))^((((in[3] >> 55) | ((in[4] & 0x3FF) << 9)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[4] >> 10) & 0x7FFFF) & 1))^(((in[4] >> 10) & 0x7FFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[4] >> 29) & 0x7FFFF) & 1))^(((in[4] >> 29) & 0x7FFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[4] >> 48) | ((in[5] & 0x7) << 16))) & 1))^((((in[4] >> 48) | ((in[5] & 0x7) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[5] >> 3) & 0x7FFFF) & 1))^(((in[5] >> 3) & 0x7FFFF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[5] >> 22) & 0x7FFFF) & 1))^(((in[5] >> 22) & 0x7FFFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[5] >> 41) & 0x7FFFF) & 1))^(((in[5] >> 41) & 0x7FFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[5] >> 60) | ((in[6] & 0x7FFF) << 4))) & 1))^((((in[5] >> 60) | ((in[6] & 0x7FFF) << 4)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[6] >> 15) & 0x7FFFF) & 1))^(((in[6] >> 15) & 0x7FFFF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[6] >> 34) & 0x7FFFF) & 1))^(((in[6] >> 34) & 0x7FFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[6] >> 53) | ((in[7] & 0xFF) << 11))) & 1))^((((in[6] >> 53) | ((in[7] & 0xFF) << 11)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[7] >> 8) & 0x7FFFF) & 1))^(((in[7] >> 8) & 0x7FFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[7] >> 27) & 0x7FFFF) & 1))^(((in[7] >> 27) & 0x7FFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[7] >> 46) | ((in[8] & 0x1) << 18))) & 1))^((((in[7] >> 46) | ((in[8] & 0x1) << 18)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[8] >> 1) & 0x7FFFF) & 1))^(((in[8] >> 1) & 0x7FFFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[8] >> 20) & 0x7FFFF) & 1))^(((in[8] >> 20) & 0x7FFFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[8] >> 39) & 0x7FFFF) & 1))^(((in[8] >> 39) & 0x7FFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[8] >> 58) | ((in[9] & 0x1FFF) << 6))) & 1))^((((in[8] >> 58) | ((in[9] & 0x1FFF) << 6)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[9] >> 13) & 0x7FFFF) & 1))^(((in[9] >> 13) & 0x7FFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[9] >> 32) & 0x7FFFF) & 1))^(((in[9] >> 32) & 0x7FFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[9] >> 51) | ((in[10] & 0x3F) << 13))) & 1))^((((in[9] >> 51) | ((in[10] & 0x3F) << 13)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[10] >> 6) & 0x7FFFF) & 1))^(((in[10] >> 6) & 0x7FFFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[10] >> 25) & 0x7FFFF) & 1))^(((in[10] >> 25) & 0x7FFFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[10] >> 44) & 0x7FFFF) & 1))^(((in[10] >> 44) & 0x7FFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[10] >> 63) | ((in[11] & 0x3FFFF) << 1))) & 1))^((((in[10] >> 63) | ((in[11] & 0x3FFFF) << 1)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[11] >> 18) & 0x7FFFF) & 1))^(((in[11] >> 18) & 0x7FFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[11] >> 37) & 0x7FFFF) & 1))^(((in[11] >> 37) & 0x7FFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[11] >> 56) | ((in[12] & 0x7FF) << 8))) & 1))^((((in[11] >> 56) | ((in[12] & 0x7FF) << 8)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[12] >> 11) & 0x7FFFF) & 1))^(((in[12] >> 11) & 0x7FFFF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[12] >> 30) & 0x7FFFF) & 1))^(((in[12] >> 30) & 0x7FFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[12] >> 49) | ((in[13] & 0xF) << 15))) & 1))^((((in[12] >> 49) | ((in[13] & 0xF) << 15)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[13] >> 4) & 0x7FFFF) & 1))^(((in[13] >> 4) & 0x7FFFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[13] >> 23) & 0x7FFFF) & 1))^(((in[13] >> 23) & 0x7FFFF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[13] >> 42) & 0x7FFFF) & 1))^(((in[13] >> 42) & 0x7FFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[13] >> 61) | ((in[14] & 0xFFFF) << 3))) & 1))^((((in[13] >> 61) | ((in[14] & 0xFFFF) << 3)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[14] >> 16) & 0x7FFFF) & 1))^(((in[14] >> 16) & 0x7FFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[14] >> 35) & 0x7FFFF) & 1))^(((in[14] >> 35) & 0x7FFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[14] >> 54) | ((in[15] & 0x1FF) << 10))) & 1))^((((in[14] >> 54) | ((in[15] & 0x1FF) << 10)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[15] >> 9) & 0x7FFFF) & 1))^(((in[15] >> 9) & 0x7FFFF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[15] >> 28) & 0x7FFFF) & 1))^(((in[15] >> 28) & 0x7FFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[15] >> 47) | ((in[16] & 0x3) << 17))) & 1))^((((in[15] >> 47) | ((in[16] & 0x3) << 17)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[16] >> 2) & 0x7FFFF) & 1))^(((in[16] >> 2) & 0x7FFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[16] >> 21) & 0x7FFFF) & 1))^(((in[16] >> 21) & 0x7FFFF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[16] >> 40) & 0x7FFFF) & 1))^(((in[16] >> 40) & 0x7FFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[16] >> 59) | ((in[17] & 0x3FFF) << 5))) & 1))^((((in[16] >> 59) | ((in[17] & 0x3FFF) << 5)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[17] >> 14) & 0x7FFFF) & 1))^(((in[17] >> 14) & 0x7FFFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[17] >> 33) & 0x7FFFF) & 1))^(((in[17] >> 33) & 0x7FFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[17] >> 52) | ((in[18] & 0x7F) << 12))) & 1))^((((in[17] >> 52) | ((in[18] & 0x7F) << 12)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[18] >> 7) & 0x7FFFF) & 1))^(((in[18] >> 7) & 0x7FFFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[18] >> 26) & 0x7FFFF) & 1))^(((in[18] >> 26) & 0x7FFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[18] >> 45)) & 1))^(((in[18] >> 45))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_20(initoffset int64, in *[20]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 20) & 0xFFFFF) & 1))^(((in[0] >> 20) & 0xFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 40) & 0xFFFFF) & 1))^(((in[0] >> 40) & 0xFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[0] >> 60) | ((in[1] & 0xFFFF) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0xFFFF) << 4)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 16) & 0xFFFFF) & 1))^(((in[1] >> 16) & 0xFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 36) & 0xFFFFF) & 1))^(((in[1] >> 36) & 0xFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[1] >> 56) | ((in[2] & 0xFFF) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0xFFF) << 8)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[2] >> 12) & 0xFFFFF) & 1))^(((in[2] >> 12) & 0xFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[2] >> 32) & 0xFFFFF) & 1))^(((in[2] >> 32) & 0xFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[2] >> 52) | ((in[3] & 0xFF) << 12))) & 1))^((((in[2] >> 52) | ((in[3] & 0xFF) << 12)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[3] >> 8) & 0xFFFFF) & 1))^(((in[3] >> 8) & 0xFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[3] >> 28) & 0xFFFFF) & 1))^(((in[3] >> 28) & 0xFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[3] >> 48) | ((in[4] & 0xF) << 16))) & 1))^((((in[3] >> 48) | ((in[4] & 0xF) << 16)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[4] >> 4) & 0xFFFFF) & 1))^(((in[4] >> 4) & 0xFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[4] >> 24) & 0xFFFFF) & 1))^(((in[4] >> 24) & 0xFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[4] >> 44)) & 1))^(((in[4] >> 44))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[5] >> 0) & 0xFFFFF) & 1))^(((in[5] >> 0) & 0xFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[5] >> 20) & 0xFFFFF) & 1))^(((in[5] >> 20) & 0xFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[5] >> 40) & 0xFFFFF) & 1))^(((in[5] >> 40) & 0xFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[5] >> 60) | ((in[6] & 0xFFFF) << 4))) & 1))^((((in[5] >> 60) | ((in[6] & 0xFFFF) << 4)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[6] >> 16) & 0xFFFFF) & 1))^(((in[6] >> 16) & 0xFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[6] >> 36) & 0xFFFFF) & 1))^(((in[6] >> 36) & 0xFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[6] >> 56) | ((in[7] & 0xFFF) << 8))) & 1))^((((in[6] >> 56) | ((in[7] & 0xFFF) << 8)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[7] >> 12) & 0xFFFFF) & 1))^(((in[7] >> 12) & 0xFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[7] >> 32) & 0xFFFFF) & 1))^(((in[7] >> 32) & 0xFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[7] >> 52) | ((in[8] & 0xFF) << 12))) & 1))^((((in[7] >> 52) | ((in[8] & 0xFF) << 12)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[8] >> 8) & 0xFFFFF) & 1))^(((in[8] >> 8) & 0xFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[8] >> 28) & 0xFFFFF) & 1))^(((in[8] >> 28) & 0xFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[8] >> 48) | ((in[9] & 0xF) << 16))) & 1))^((((in[8] >> 48) | ((in[9] & 0xF) << 16)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[9] >> 4) & 0xFFFFF) & 1))^(((in[9] >> 4) & 0xFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-(((in[9] >> 24) & 0xFFFFF) & 1))^(((in[9] >> 24) & 0xFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[9] >> 44)) & 1))^(((in[9] >> 44))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[10] >> 0) & 0xFFFFF) & 1))^(((in[10] >> 0) & 0xFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[10] >> 20) & 0xFFFFF) & 1))^(((in[10] >> 20) & 0xFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-(((in[10] >> 40) & 0xFFFFF) & 1))^(((in[10] >> 40) & 0xFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[10] >> 60) | ((in[11] & 0xFFFF) << 4))) & 1))^((((in[10] >> 60) | ((in[11] & 0xFFFF) << 4)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[11] >> 16) & 0xFFFFF) & 1))^(((in[11] >> 16) & 0xFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[11] >> 36) & 0xFFFFF) & 1))^(((in[11] >> 36) & 0xFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[11] >> 56) | ((in[12] & 0xFFF) << 8))) & 1))^((((in[11] >> 56) | ((in[12] & 0xFFF) << 8)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[12] >> 12) & 0xFFFFF) & 1))^(((in[12] >> 12) & 0xFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[12] >> 32) & 0xFFFFF) & 1))^(((in[12] >> 32) & 0xFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[12] >> 52) | ((in[13] & 0xFF) << 12))) & 1))^((((in[12] >> 52) | ((in[13] & 0xFF) << 12)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[13] >> 8) & 0xFFFFF) & 1))^(((in[13] >> 8) & 0xFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[13] >> 28) & 0xFFFFF) & 1))^(((in[13] >> 28) & 0xFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[13] >> 48) | ((in[14] & 0xF) << 16))) & 1))^((((in[13] >> 48) | ((in[14] & 0xF) << 16)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[14] >> 4) & 0xFFFFF) & 1))^(((in[14] >> 4) & 0xFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[14] >> 24) & 0xFFFFF) & 1))^(((in[14] >> 24) & 0xFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[14] >> 44)) & 1))^(((in[14] >> 44))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[15] >> 0) & 0xFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[15] >> 20) & 0xFFFFF) & 1))^(((in[15] >> 20) & 0xFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[15] >> 40) & 0xFFFFF) & 1))^(((in[15] >> 40) & 0xFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[15] >> 60) | ((in[16] & 0xFFFF) << 4))) & 1))^((((in[15] >> 60) | ((in[16] & 0xFFFF) << 4)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[16] >> 16) & 0xFFFFF) & 1))^(((in[16] >> 16) & 0xFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[16] >> 36) & 0xFFFFF) & 1))^(((in[16] >> 36) & 0xFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[16] >> 56) | ((in[17] & 0xFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0xFFF) << 8)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[17] >> 12) & 0xFFFFF) & 1))^(((in[17] >> 12) & 0xFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[17] >> 32) & 0xFFFFF) & 1))^(((in[17] >> 32) & 0xFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[17] >> 52) | ((in[18] & 0xFF) << 12))) & 1))^((((in[17] >> 52) | ((in[18] & 0xFF) << 12)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[18] >> 8) & 0xFFFFF) & 1))^(((in[18] >> 8) & 0xFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[18] >> 28) & 0xFFFFF) & 1))^(((in[18] >> 28) & 0xFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[18] >> 48) | ((in[19] & 0xF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0xF) << 16)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[19] >> 4) & 0xFFFFF) & 1))^(((in[19] >> 4) & 0xFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[19] >> 24) & 0xFFFFF) & 1))^(((in[19] >> 24) & 0xFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[19] >> 44)) & 1))^(((in[19] >> 44))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_21(initoffset int64, in *[21]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 21) & 0x1FFFFF) & 1))^(((in[0] >> 21) & 0x1FFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-(((in[0] >> 42) & 0x1FFFFF) & 1))^(((in[0] >> 42) & 0x1FFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[0] >> 63) | ((in[1] & 0xFFFFF) << 1))) & 1))^((((in[0] >> 63) | ((in[1] & 0xFFFFF) << 1)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 20) & 0x1FFFFF) & 1))^(((in[1] >> 20) & 0x1FFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[1] >> 41) & 0x1FFFFF) & 1))^(((in[1] >> 41) & 0x1FFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[1] >> 62) | ((in[2] & 0x7FFFF) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0x7FFFF) << 2)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[2] >> 19) & 0x1FFFFF) & 1))^(((in[2] >> 19) & 0x1FFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[2] >> 40) & 0x1FFFFF) & 1))^(((in[2] >> 40) & 0x1FFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[2] >> 61) | ((in[3] & 0x3FFFF) << 3))) & 1))^((((in[2] >> 61) | ((in[3] & 0x3FFFF) << 3)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[3] >> 18) & 0x1FFFFF) & 1))^(((in[3] >> 18) & 0x1FFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[3] >> 39) & 0x1FFFFF) & 1))^(((in[3] >> 39) & 0x1FFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[3] >> 60) | ((in[4] & 0x1FFFF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x1FFFF) << 4)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[4] >> 17) & 0x1FFFFF) & 1))^(((in[4] >> 17) & 0x1FFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[4] >> 38) & 0x1FFFFF) & 1))^(((in[4] >> 38) & 0x1FFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[4] >> 59) | ((in[5] & 0xFFFF) << 5))) & 1))^((((in[4] >> 59) | ((in[5] & 0xFFFF) << 5)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[5] >> 16) & 0x1FFFFF) & 1))^(((in[5] >> 16) & 0x1FFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[5] >> 37) & 0x1FFFFF) & 1))^(((in[5] >> 37) & 0x1FFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[5] >> 58) | ((in[6] & 0x7FFF) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0x7FFF) << 6)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[6] >> 15) & 0x1FFFFF) & 1))^(((in[6] >> 15) & 0x1FFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[6] >> 36) & 0x1FFFFF) & 1))^(((in[6] >> 36) & 0x1FFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[6] >> 57) | ((in[7] & 0x3FFF) << 7))) & 1))^((((in[6] >> 57) | ((in[7] & 0x3FFF) << 7)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[7] >> 14) & 0x1FFFFF) & 1))^(((in[7] >> 14) & 0x1FFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[7] >> 35) & 0x1FFFFF) & 1))^(((in[7] >> 35) & 0x1FFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[7] >> 56) | ((in[8] & 0x1FFF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0x1FFF) << 8)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[8] >> 13) & 0x1FFFFF) & 1))^(((in[8] >> 13) & 0x1FFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[8] >> 34) & 0x1FFFFF) & 1))^(((in[8] >> 34) & 0x1FFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[8] >> 55) | ((in[9] & 0xFFF) << 9))) & 1))^((((in[8] >> 55) | ((in[9] & 0xFFF) << 9)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[9] >> 12) & 0x1FFFFF) & 1))^(((in[9] >> 12) & 0x1FFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[9] >> 33) & 0x1FFFFF) & 1))^(((in[9] >> 33) & 0x1FFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[9] >> 54) | ((in[10] & 0x7FF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0x7FF) << 10)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[10] >> 11) & 0x1FFFFF) & 1))^(((in[10] >> 11) & 0x1FFFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[10] >> 32) & 0x1FFFFF) & 1))^(((in[10] >> 32) & 0x1FFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[10] >> 53) | ((in[11] & 0x3FF) << 11))) & 1))^((((in[10] >> 53) | ((in[11] & 0x3FF) << 11)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[11] >> 10) & 0x1FFFFF) & 1))^(((in[11] >> 10) & 0x1FFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[11] >> 31) & 0x1FFFFF) & 1))^(((in[11] >> 31) & 0x1FFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[11] >> 52) | ((in[12] & 0x1FF) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0x1FF) << 12)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[12] >> 9) & 0x1FFFFF) & 1))^(((in[12] >> 9) & 0x1FFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[12] >> 30) & 0x1FFFFF) & 1))^(((in[12] >> 30) & 0x1FFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[12] >> 51) | ((in[13] & 0xFF) << 13))) & 1))^((((in[12] >> 51) | ((in[13] & 0xFF) << 13)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[13] >> 8) & 0x1FFFFF) & 1))^(((in[13] >> 8) & 0x1FFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[13] >> 29) & 0x1FFFFF) & 1))^(((in[13] >> 29) & 0x1FFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[13] >> 50) | ((in[14] & 0x7F) << 14))) & 1))^((((in[13] >> 50) | ((in[14] & 0x7F) << 14)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[14] >> 7) & 0x1FFFFF) & 1))^(((in[14] >> 7) & 0x1FFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[14] >> 28) & 0x1FFFFF) & 1))^(((in[14] >> 28) & 0x1FFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[14] >> 49) | ((in[15] & 0x3F) << 15))) & 1))^((((in[14] >> 49) | ((in[15] & 0x3F) << 15)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[15] >> 6) & 0x1FFFFF) & 1))^(((in[15] >> 6) & 0x1FFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[15] >> 27) & 0x1FFFFF) & 1))^(((in[15] >> 27) & 0x1FFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[15] >> 48) | ((in[16] & 0x1F) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0x1F) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[16] >> 5) & 0x1FFFFF) & 1))^(((in[16] >> 5) & 0x1FFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[16] >> 26) & 0x1FFFFF) & 1))^(((in[16] >> 26) & 0x1FFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[16] >> 47) | ((in[17] & 0xF) << 17))) & 1))^((((in[16] >> 47) | ((in[17] & 0xF) << 17)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[17] >> 4) & 0x1FFFFF) & 1))^(((in[17] >> 4) & 0x1FFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[17] >> 25) & 0x1FFFFF) & 1))^(((in[17] >> 25) & 0x1FFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[17] >> 46) | ((in[18] & 0x7) << 18))) & 1))^((((in[17] >> 46) | ((in[18] & 0x7) << 18)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[18] >> 3) & 0x1FFFFF) & 1))^(((in[18] >> 3) & 0x1FFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[18] >> 24) & 0x1FFFFF) & 1))^(((in[18] >> 24) & 0x1FFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[18] >> 45) | ((in[19] & 0x3) << 19))) & 1))^((((in[18] >> 45) | ((in[19] & 0x3) << 19)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[19] >> 2) & 0x1FFFFF) & 1))^(((in[19] >> 2) & 0x1FFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[19] >> 23) & 0x1FFFFF) & 1))^(((in[19] >> 23) & 0x1FFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[19] >> 44) | ((in[20] & 0x1) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0x1) << 20)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[20] >> 1) & 0x1FFFFF) & 1))^(((in[20] >> 1) & 0x1FFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-(((in[20] >> 22) & 0x1FFFFF) & 1))^(((in[20] >> 22) & 0x1FFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[20] >> 43)) & 1))^(((in[20] >> 43))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_22(initoffset int64, in *[22]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 22) & 0x3FFFFF) & 1))^(((in[0] >> 22) & 0x3FFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 44) | ((in[1] & 0x3) << 20))) & 1))^((((in[0] >> 44) | ((in[1] & 0x3) << 20)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 2) & 0x3FFFFF) & 1))^(((in[1] >> 2) & 0x3FFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 24) & 0x3FFFFF) & 1))^(((in[1] >> 24) & 0x3FFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[1] >> 46) | ((in[2] & 0xF) << 18))) & 1))^((((in[1] >> 46) | ((in[2] & 0xF) << 18)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[2] >> 4) & 0x3FFFFF) & 1))^(((in[2] >> 4) & 0x3FFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[2] >> 26) & 0x3FFFFF) & 1))^(((in[2] >> 26) & 0x3FFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[2] >> 48) | ((in[3] & 0x3F) << 16))) & 1))^((((in[2] >> 48) | ((in[3] & 0x3F) << 16)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[3] >> 6) & 0x3FFFFF) & 1))^(((in[3] >> 6) & 0x3FFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[3] >> 28) & 0x3FFFFF) & 1))^(((in[3] >> 28) & 0x3FFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[3] >> 50) | ((in[4] & 0xFF) << 14))) & 1))^((((in[3] >> 50) | ((in[4] & 0xFF) << 14)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[4] >> 8) & 0x3FFFFF) & 1))^(((in[4] >> 8) & 0x3FFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[4] >> 30) & 0x3FFFFF) & 1))^(((in[4] >> 30) & 0x3FFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[4] >> 52) | ((in[5] & 0x3FF) << 12))) & 1))^((((in[4] >> 52) | ((in[5] & 0x3FF) << 12)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[5] >> 10) & 0x3FFFFF) & 1))^(((in[5] >> 10) & 0x3FFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[5] >> 32) & 0x3FFFFF) & 1))^(((in[5] >> 32) & 0x3FFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[5] >> 54) | ((in[6] & 0xFFF) << 10))) & 1))^((((in[5] >> 54) | ((in[6] & 0xFFF) << 10)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[6] >> 12) & 0x3FFFFF) & 1))^(((in[6] >> 12) & 0x3FFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[6] >> 34) & 0x3FFFFF) & 1))^(((in[6] >> 34) & 0x3FFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[6] >> 56) | ((in[7] & 0x3FFF) << 8))) & 1))^((((in[6] >> 56) | ((in[7] & 0x3FFF) << 8)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[7] >> 14) & 0x3FFFFF) & 1))^(((in[7] >> 14) & 0x3FFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[7] >> 36) & 0x3FFFFF) & 1))^(((in[7] >> 36) & 0x3FFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[7] >> 58) | ((in[8] & 0xFFFF) << 6))) & 1))^((((in[7] >> 58) | ((in[8] & 0xFFFF) << 6)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[8] >> 16) & 0x3FFFFF) & 1))^(((in[8] >> 16) & 0x3FFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[8] >> 38) & 0x3FFFFF) & 1))^(((in[8] >> 38) & 0x3FFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[8] >> 60) | ((in[9] & 0x3FFFF) << 4))) & 1))^((((in[8] >> 60) | ((in[9] & 0x3FFFF) << 4)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[9] >> 18) & 0x3FFFFF) & 1))^(((in[9] >> 18) & 0x3FFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[9] >> 40) & 0x3FFFFF) & 1))^(((in[9] >> 40) & 0x3FFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[9] >> 62) | ((in[10] & 0xFFFFF) << 2))) & 1))^((((in[9] >> 62) | ((in[10] & 0xFFFFF) << 2)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[10] >> 20) & 0x3FFFFF) & 1))^(((in[10] >> 20) & 0x3FFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[10] >> 42)) & 1))^(((in[10] >> 42))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[11] >> 0) & 0x3FFFFF) & 1))^(((in[11] >> 0) & 0x3FFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[11] >> 22) & 0x3FFFFF) & 1))^(((in[11] >> 22) & 0x3FFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[11] >> 44) | ((in[12] & 0x3) << 20))) & 1))^((((in[11] >> 44) | ((in[12] & 0x3) << 20)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[12] >> 2) & 0x3FFFFF) & 1))^(((in[12] >> 2) & 0x3FFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[12] >> 24) & 0x3FFFFF) & 1))^(((in[12] >> 24) & 0x3FFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[12] >> 46) | ((in[13] & 0xF) << 18))) & 1))^((((in[12] >> 46) | ((in[13] & 0xF) << 18)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[13] >> 4) & 0x3FFFFF) & 1))^(((in[13] >> 4) & 0x3FFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[13] >> 26) & 0x3FFFFF) & 1))^(((in[13] >> 26) & 0x3FFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[13] >> 48) | ((in[14] & 0x3F) << 16))) & 1))^((((in[13] >> 48) | ((in[14] & 0x3F) << 16)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[14] >> 6) & 0x3FFFFF) & 1))^(((in[14] >> 6) & 0x3FFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[14] >> 28) & 0x3FFFFF) & 1))^(((in[14] >> 28) & 0x3FFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[14] >> 50) | ((in[15] & 0xFF) << 14))) & 1))^((((in[14] >> 50) | ((in[15] & 0xFF) << 14)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[15] >> 8) & 0x3FFFFF) & 1))^(((in[15] >> 8) & 0x3FFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[15] >> 30) & 0x3FFFFF) & 1))^(((in[15] >> 30) & 0x3FFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[15] >> 52) | ((in[16] & 0x3FF) << 12))) & 1))^((((in[15] >> 52) | ((in[16] & 0x3FF) << 12)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[16] >> 10) & 0x3FFFFF) & 1))^(((in[16] >> 10) & 0x3FFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[16] >> 32) & 0x3FFFFF) & 1))^(((in[16] >> 32) & 0x3FFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[16] >> 54) | ((in[17] & 0xFFF) << 10))) & 1))^((((in[16] >> 54) | ((in[17] & 0xFFF) << 10)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[17] >> 12) & 0x3FFFFF) & 1))^(((in[17] >> 12) & 0x3FFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[17] >> 34) & 0x3FFFFF) & 1))^(((in[17] >> 34) & 0x3FFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[17] >> 56) | ((in[18] & 0x3FFF) << 8))) & 1))^((((in[17] >> 56) | ((in[18] & 0x3FFF) << 8)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[18] >> 14) & 0x3FFFFF) & 1))^(((in[18] >> 14) & 0x3FFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[18] >> 36) & 0x3FFFFF) & 1))^(((in[18] >> 36) & 0x3FFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[18] >> 58) | ((in[19] & 0xFFFF) << 6))) & 1))^((((in[18] >> 58) | ((in[19] & 0xFFFF) << 6)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[19] >> 16) & 0x3FFFFF) & 1))^(((in[19] >> 16) & 0x3FFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[19] >> 38) & 0x3FFFFF) & 1))^(((in[19] >> 38) & 0x3FFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[19] >> 60) | ((in[20] & 0x3FFFF) << 4))) & 1))^((((in[19] >> 60) | ((in[20] & 0x3FFFF) << 4)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[20] >> 18) & 0x3FFFFF) & 1))^(((in[20] >> 18) & 0x3FFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[20] >> 40) & 0x3FFFFF) & 1))^(((in[20] >> 40) & 0x3FFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[20] >> 62) | ((in[21] & 0xFFFFF) << 2))) & 1))^((((in[20] >> 62) | ((in[21] & 0xFFFFF) << 2)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[21] >> 20) & 0x3FFFFF) & 1))^(((in[21] >> 20) & 0x3FFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[21] >> 42)) & 1))^(((in[21] >> 42))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_23(initoffset int64, in *[23]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 23) & 0x7FFFFF) & 1))^(((in[0] >> 23) & 0x7FFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 46) | ((in[1] & 0x1F) << 18))) & 1))^((((in[0] >> 46) | ((in[1] & 0x1F) << 18)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 5) & 0x7FFFFF) & 1))^(((in[1] >> 5) & 0x7FFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 28) & 0x7FFFFF) & 1))^(((in[1] >> 28) & 0x7FFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[1] >> 51) | ((in[2] & 0x3FF) << 13))) & 1))^((((in[1] >> 51) | ((in[2] & 0x3FF) << 13)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[2] >> 10) & 0x7FFFFF) & 1))^(((in[2] >> 10) & 0x7FFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[2] >> 33) & 0x7FFFFF) & 1))^(((in[2] >> 33) & 0x7FFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[2] >> 56) | ((in[3] & 0x7FFF) << 8))) & 1))^((((in[2] >> 56) | ((in[3] & 0x7FFF) << 8)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[3] >> 15) & 0x7FFFFF) & 1))^(((in[3] >> 15) & 0x7FFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[3] >> 38) & 0x7FFFFF) & 1))^(((in[3] >> 38) & 0x7FFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[3] >> 61) | ((in[4] & 0xFFFFF) << 3))) & 1))^((((in[3] >> 61) | ((in[4] & 0xFFFFF) << 3)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[4] >> 20) & 0x7FFFFF) & 1))^(((in[4] >> 20) & 0x7FFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[4] >> 43) | ((in[5] & 0x3) << 21))) & 1))^((((in[4] >> 43) | ((in[5] & 0x3) << 21)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[5] >> 2) & 0x7FFFFF) & 1))^(((in[5] >> 2) & 0x7FFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[5] >> 25) & 0x7FFFFF) & 1))^(((in[5] >> 25) & 0x7FFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[5] >> 48) | ((in[6] & 0x7F) << 16))) & 1))^((((in[5] >> 48) | ((in[6] & 0x7F) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[6] >> 7) & 0x7FFFFF) & 1))^(((in[6] >> 7) & 0x7FFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-(((in[6] >> 30) & 0x7FFFFF) & 1))^(((in[6] >> 30) & 0x7FFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[6] >> 53) | ((in[7] & 0xFFF) << 11))) & 1))^((((in[6] >> 53) | ((in[7] & 0xFFF) << 11)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[7] >> 12) & 0x7FFFFF) & 1))^(((in[7] >> 12) & 0x7FFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[7] >> 35) & 0x7FFFFF) & 1))^(((in[7] >> 35) & 0x7FFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[7] >> 58) | ((in[8] & 0x1FFFF) << 6))) & 1))^((((in[7] >> 58) | ((in[8] & 0x1FFFF) << 6)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[8] >> 17) & 0x7FFFFF) & 1))^(((in[8] >> 17) & 0x7FFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[8] >> 40) & 0x7FFFFF) & 1))^(((in[8] >> 40) & 0x7FFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[8] >> 63) | ((in[9] & 0x3FFFFF) << 1))) & 1))^((((in[8] >> 63) | ((in[9] & 0x3FFFFF) << 1)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[9] >> 22) & 0x7FFFFF) & 1))^(((in[9] >> 22) & 0x7FFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[9] >> 45) | ((in[10] & 0xF) << 19))) & 1))^((((in[9] >> 45) | ((in[10] & 0xF) << 19)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[10] >> 4) & 0x7FFFFF) & 1))^(((in[10] >> 4) & 0x7FFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[10] >> 27) & 0x7FFFFF) & 1))^(((in[10] >> 27) & 0x7FFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[10] >> 50) | ((in[11] & 0x1FF) << 14))) & 1))^((((in[10] >> 50) | ((in[11] & 0x1FF) << 14)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[11] >> 9) & 0x7FFFFF) & 1))^(((in[11] >> 9) & 0x7FFFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[11] >> 32) & 0x7FFFFF) & 1))^(((in[11] >> 32) & 0x7FFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[11] >> 55) | ((in[12] & 0x3FFF) << 9))) & 1))^((((in[11] >> 55) | ((in[12] & 0x3FFF) << 9)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[12] >> 14) & 0x7FFFFF) & 1))^(((in[12] >> 14) & 0x7FFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[12] >> 37) & 0x7FFFFF) & 1))^(((in[12] >> 37) & 0x7FFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[12] >> 60) | ((in[13] & 0x7FFFF) << 4))) & 1))^((((in[12] >> 60) | ((in[13] & 0x7FFFF) << 4)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[13] >> 19) & 0x7FFFFF) & 1))^(((in[13] >> 19) & 0x7FFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[13] >> 42) | ((in[14] & 0x1) << 22))) & 1))^((((in[13] >> 42) | ((in[14] & 0x1) << 22)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[14] >> 1) & 0x7FFFFF) & 1))^(((in[14] >> 1) & 0x7FFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[14] >> 24) & 0x7FFFFF) & 1))^(((in[14] >> 24) & 0x7FFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[14] >> 47) | ((in[15] & 0x3F) << 17))) & 1))^((((in[14] >> 47) | ((in[15] & 0x3F) << 17)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[15] >> 6) & 0x7FFFFF) & 1))^(((in[15] >> 6) & 0x7FFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[15] >> 29) & 0x7FFFFF) & 1))^(((in[15] >> 29) & 0x7FFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[15] >> 52) | ((in[16] & 0x7FF) << 12))) & 1))^((((in[15] >> 52) | ((in[16] & 0x7FF) << 12)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[16] >> 11) & 0x7FFFFF) & 1))^(((in[16] >> 11) & 0x7FFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-(((in[16] >> 34) & 0x7FFFFF) & 1))^(((in[16] >> 34) & 0x7FFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[16] >> 57) | ((in[17] & 0xFFFF) << 7))) & 1))^((((in[16] >> 57) | ((in[17] & 0xFFFF) << 7)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[17] >> 16) & 0x7FFFFF) & 1))^(((in[17] >> 16) & 0x7FFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[17] >> 39) & 0x7FFFFF) & 1))^(((in[17] >> 39) & 0x7FFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[17] >> 62) | ((in[18] & 0x1FFFFF) << 2))) & 1))^((((in[17] >> 62) | ((in[18] & 0x1FFFFF) << 2)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[18] >> 21) & 0x7FFFFF) & 1))^(((in[18] >> 21) & 0x7FFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[18] >> 44) | ((in[19] & 0x7) << 20))) & 1))^((((in[18] >> 44) | ((in[19] & 0x7) << 20)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[19] >> 3) & 0x7FFFFF) & 1))^(((in[19] >> 3) & 0x7FFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[19] >> 26) & 0x7FFFFF) & 1))^(((in[19] >> 26) & 0x7FFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[19] >> 49) | ((in[20] & 0xFF) << 15))) & 1))^((((in[19] >> 49) | ((in[20] & 0xFF) << 15)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[20] >> 8) & 0x7FFFFF) & 1))^(((in[20] >> 8) & 0x7FFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[20] >> 31) & 0x7FFFFF) & 1))^(((in[20] >> 31) & 0x7FFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[20] >> 54) | ((in[21] & 0x1FFF) << 10))) & 1))^((((in[20] >> 54) | ((in[21] & 0x1FFF) << 10)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[21] >> 13) & 0x7FFFFF) & 1))^(((in[21] >> 13) & 0x7FFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[21] >> 36) & 0x7FFFFF) & 1))^(((in[21] >> 36) & 0x7FFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[21] >> 59) | ((in[22] & 0x3FFFF) << 5))) & 1))^((((in[21] >> 59) | ((in[22] & 0x3FFFF) << 5)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[22] >> 18) & 0x7FFFFF) & 1))^(((in[22] >> 18) & 0x7FFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[22] >> 41)) & 1))^(((in[22] >> 41))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_24(initoffset int64, in *[24]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 24) & 0xFFFFFF) & 1))^(((in[0] >> 24) & 0xFFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 48) | ((in[1] & 0xFF) << 16))) & 1))^((((in[0] >> 48) | ((in[1] & 0xFF) << 16)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 8) & 0xFFFFFF) & 1))^(((in[1] >> 8) & 0xFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 32) & 0xFFFFFF) & 1))^(((in[1] >> 32) & 0xFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[1] >> 56) | ((in[2] & 0xFFFF) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0xFFFF) << 8)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[2] >> 16) & 0xFFFFFF) & 1))^(((in[2] >> 16) & 0xFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[2] >> 40)) & 1))^(((in[2] >> 40))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[3] >> 0) & 0xFFFFFF) & 1))^(((in[3] >> 0) & 0xFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[3] >> 24) & 0xFFFFFF) & 1))^(((in[3] >> 24) & 0xFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[3] >> 48) | ((in[4] & 0xFF) << 16))) & 1))^((((in[3] >> 48) | ((in[4] & 0xFF) << 16)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[4] >> 8) & 0xFFFFFF) & 1))^(((in[4] >> 8) & 0xFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-(((in[4] >> 32) & 0xFFFFFF) & 1))^(((in[4] >> 32) & 0xFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[4] >> 56) | ((in[5] & 0xFFFF) << 8))) & 1))^((((in[4] >> 56) | ((in[5] & 0xFFFF) << 8)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[5] >> 16) & 0xFFFFFF) & 1))^(((in[5] >> 16) & 0xFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[5] >> 40)) & 1))^(((in[5] >> 40))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[6] >> 0) & 0xFFFFFF) & 1))^(((in[6] >> 0) & 0xFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[6] >> 24) & 0xFFFFFF) & 1))^(((in[6] >> 24) & 0xFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[6] >> 48) | ((in[7] & 0xFF) << 16))) & 1))^((((in[6] >> 48) | ((in[7] & 0xFF) << 16)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[7] >> 8) & 0xFFFFFF) & 1))^(((in[7] >> 8) & 0xFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[7] >> 32) & 0xFFFFFF) & 1))^(((in[7] >> 32) & 0xFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[7] >> 56) | ((in[8] & 0xFFFF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0xFFFF) << 8)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[8] >> 16) & 0xFFFFFF) & 1))^(((in[8] >> 16) & 0xFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[8] >> 40)) & 1))^(((in[8] >> 40))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[9] >> 0) & 0xFFFFFF) & 1))^(((in[9] >> 0) & 0xFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[9] >> 24) & 0xFFFFFF) & 1))^(((in[9] >> 24) & 0xFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[9] >> 48) | ((in[10] & 0xFF) << 16))) & 1))^((((in[9] >> 48) | ((in[10] & 0xFF) << 16)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[10] >> 8) & 0xFFFFFF) & 1))^(((in[10] >> 8) & 0xFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-(((in[10] >> 32) & 0xFFFFFF) & 1))^(((in[10] >> 32) & 0xFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[10] >> 56) | ((in[11] & 0xFFFF) << 8))) & 1))^((((in[10] >> 56) | ((in[11] & 0xFFFF) << 8)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[11] >> 16) & 0xFFFFFF) & 1))^(((in[11] >> 16) & 0xFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[11] >> 40)) & 1))^(((in[11] >> 40))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[12] >> 0) & 0xFFFFFF) & 1))^(((in[12] >> 0) & 0xFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[12] >> 24) & 0xFFFFFF) & 1))^(((in[12] >> 24) & 0xFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[12] >> 48) | ((in[13] & 0xFF) << 16))) & 1))^((((in[12] >> 48) | ((in[13] & 0xFF) << 16)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[13] >> 8) & 0xFFFFFF) & 1))^(((in[13] >> 8) & 0xFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-(((in[13] >> 32) & 0xFFFFFF) & 1))^(((in[13] >> 32) & 0xFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[13] >> 56) | ((in[14] & 0xFFFF) << 8))) & 1))^((((in[13] >> 56) | ((in[14] & 0xFFFF) << 8)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[14] >> 16) & 0xFFFFFF) & 1))^(((in[14] >> 16) & 0xFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[14] >> 40)) & 1))^(((in[14] >> 40))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[15] >> 0) & 0xFFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[15] >> 24) & 0xFFFFFF) & 1))^(((in[15] >> 24) & 0xFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[15] >> 48) | ((in[16] & 0xFF) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0xFF) << 16)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[16] >> 8) & 0xFFFFFF) & 1))^(((in[16] >> 8) & 0xFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[16] >> 32) & 0xFFFFFF) & 1))^(((in[16] >> 32) & 0xFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[16] >> 56) | ((in[17] & 0xFFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0xFFFF) << 8)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[17] >> 16) & 0xFFFFFF) & 1))^(((in[17] >> 16) & 0xFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[17] >> 40)) & 1))^(((in[17] >> 40))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[18] >> 0) & 0xFFFFFF) & 1))^(((in[18] >> 0) & 0xFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[18] >> 24) & 0xFFFFFF) & 1))^(((in[18] >> 24) & 0xFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[18] >> 48) | ((in[19] & 0xFF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0xFF) << 16)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[19] >> 8) & 0xFFFFFF) & 1))^(((in[19] >> 8) & 0xFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-(((in[19] >> 32) & 0xFFFFFF) & 1))^(((in[19] >> 32) & 0xFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[19] >> 56) | ((in[20] & 0xFFFF) << 8))) & 1))^((((in[19] >> 56) | ((in[20] & 0xFFFF) << 8)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[20] >> 16) & 0xFFFFFF) & 1))^(((in[20] >> 16) & 0xFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[20] >> 40)) & 1))^(((in[20] >> 40))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[21] >> 0) & 0xFFFFFF) & 1))^(((in[21] >> 0) & 0xFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[21] >> 24) & 0xFFFFFF) & 1))^(((in[21] >> 24) & 0xFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[21] >> 48) | ((in[22] & 0xFF) << 16))) & 1))^((((in[21] >> 48) | ((in[22] & 0xFF) << 16)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[22] >> 8) & 0xFFFFFF) & 1))^(((in[22] >> 8) & 0xFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[22] >> 32) & 0xFFFFFF) & 1))^(((in[22] >> 32) & 0xFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[22] >> 56) | ((in[23] & 0xFFFF) << 8))) & 1))^((((in[22] >> 56) | ((in[23] & 0xFFFF) << 8)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[23] >> 16) & 0xFFFFFF) & 1))^(((in[23] >> 16) & 0xFFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[23] >> 40)) & 1))^(((in[23] >> 40))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_25(initoffset int64, in *[25]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 25) & 0x1FFFFFF) & 1))^(((in[0] >> 25) & 0x1FFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 50) | ((in[1] & 0x7FF) << 14))) & 1))^((((in[0] >> 50) | ((in[1] & 0x7FF) << 14)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 11) & 0x1FFFFFF) & 1))^(((in[1] >> 11) & 0x1FFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-(((in[1] >> 36) & 0x1FFFFFF) & 1))^(((in[1] >> 36) & 0x1FFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[1] >> 61) | ((in[2] & 0x3FFFFF) << 3))) & 1))^((((in[1] >> 61) | ((in[2] & 0x3FFFFF) << 3)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[2] >> 22) & 0x1FFFFFF) & 1))^(((in[2] >> 22) & 0x1FFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[2] >> 47) | ((in[3] & 0xFF) << 17))) & 1))^((((in[2] >> 47) | ((in[3] & 0xFF) << 17)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[3] >> 8) & 0x1FFFFFF) & 1))^(((in[3] >> 8) & 0x1FFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[3] >> 33) & 0x1FFFFFF) & 1))^(((in[3] >> 33) & 0x1FFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[3] >> 58) | ((in[4] & 0x7FFFF) << 6))) & 1))^((((in[3] >> 58) | ((in[4] & 0x7FFFF) << 6)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[4] >> 19) & 0x1FFFFFF) & 1))^(((in[4] >> 19) & 0x1FFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[4] >> 44) | ((in[5] & 0x1F) << 20))) & 1))^((((in[4] >> 44) | ((in[5] & 0x1F) << 20)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[5] >> 5) & 0x1FFFFFF) & 1))^(((in[5] >> 5) & 0x1FFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-(((in[5] >> 30) & 0x1FFFFFF) & 1))^(((in[5] >> 30) & 0x1FFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[5] >> 55) | ((in[6] & 0xFFFF) << 9))) & 1))^((((in[5] >> 55) | ((in[6] & 0xFFFF) << 9)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[6] >> 16) & 0x1FFFFFF) & 1))^(((in[6] >> 16) & 0x1FFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[6] >> 41) | ((in[7] & 0x3) << 23))) & 1))^((((in[6] >> 41) | ((in[7] & 0x3) << 23)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[7] >> 2) & 0x1FFFFFF) & 1))^(((in[7] >> 2) & 0x1FFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[7] >> 27) & 0x1FFFFFF) & 1))^(((in[7] >> 27) & 0x1FFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[7] >> 52) | ((in[8] & 0x1FFF) << 12))) & 1))^((((in[7] >> 52) | ((in[8] & 0x1FFF) << 12)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[8] >> 13) & 0x1FFFFFF) & 1))^(((in[8] >> 13) & 0x1FFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-(((in[8] >> 38) & 0x1FFFFFF) & 1))^(((in[8] >> 38) & 0x1FFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[8] >> 63) | ((in[9] & 0xFFFFFF) << 1))) & 1))^((((in[8] >> 63) | ((in[9] & 0xFFFFFF) << 1)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[9] >> 24) & 0x1FFFFFF) & 1))^(((in[9] >> 24) & 0x1FFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[9] >> 49) | ((in[10] & 0x3FF) << 15))) & 1))^((((in[9] >> 49) | ((in[10] & 0x3FF) << 15)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[10] >> 10) & 0x1FFFFFF) & 1))^(((in[10] >> 10) & 0x1FFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[10] >> 35) & 0x1FFFFFF) & 1))^(((in[10] >> 35) & 0x1FFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[10] >> 60) | ((in[11] & 0x1FFFFF) << 4))) & 1))^((((in[10] >> 60) | ((in[11] & 0x1FFFFF) << 4)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[11] >> 21) & 0x1FFFFFF) & 1))^(((in[11] >> 21) & 0x1FFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[11] >> 46) | ((in[12] & 0x7F) << 18))) & 1))^((((in[11] >> 46) | ((in[12] & 0x7F) << 18)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[12] >> 7) & 0x1FFFFFF) & 1))^(((in[12] >> 7) & 0x1FFFFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[12] >> 32) & 0x1FFFFFF) & 1))^(((in[12] >> 32) & 0x1FFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[12] >> 57) | ((in[13] & 0x3FFFF) << 7))) & 1))^((((in[12] >> 57) | ((in[13] & 0x3FFFF) << 7)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[13] >> 18) & 0x1FFFFFF) & 1))^(((in[13] >> 18) & 0x1FFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[13] >> 43) | ((in[14] & 0xF) << 21))) & 1))^((((in[13] >> 43) | ((in[14] & 0xF) << 21)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[14] >> 4) & 0x1FFFFFF) & 1))^(((in[14] >> 4) & 0x1FFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[14] >> 29) & 0x1FFFFFF) & 1))^(((in[14] >> 29) & 0x1FFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[14] >> 54) | ((in[15] & 0x7FFF) << 10))) & 1))^((((in[14] >> 54) | ((in[15] & 0x7FFF) << 10)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[15] >> 15) & 0x1FFFFFF) & 1))^(((in[15] >> 15) & 0x1FFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[15] >> 40) | ((in[16] & 0x1) << 24))) & 1))^((((in[15] >> 40) | ((in[16] & 0x1) << 24)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[16] >> 1) & 0x1FFFFFF) & 1))^(((in[16] >> 1) & 0x1FFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-(((in[16] >> 26) & 0x1FFFFFF) & 1))^(((in[16] >> 26) & 0x1FFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[16] >> 51) | ((in[17] & 0xFFF) << 13))) & 1))^((((in[16] >> 51) | ((in[17] & 0xFFF) << 13)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[17] >> 12) & 0x1FFFFFF) & 1))^(((in[17] >> 12) & 0x1FFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[17] >> 37) & 0x1FFFFFF) & 1))^(((in[17] >> 37) & 0x1FFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[17] >> 62) | ((in[18] & 0x7FFFFF) << 2))) & 1))^((((in[17] >> 62) | ((in[18] & 0x7FFFFF) << 2)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[18] >> 23) & 0x1FFFFFF) & 1))^(((in[18] >> 23) & 0x1FFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[18] >> 48) | ((in[19] & 0x1FF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0x1FF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[19] >> 9) & 0x1FFFFFF) & 1))^(((in[19] >> 9) & 0x1FFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-(((in[19] >> 34) & 0x1FFFFFF) & 1))^(((in[19] >> 34) & 0x1FFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[19] >> 59) | ((in[20] & 0xFFFFF) << 5))) & 1))^((((in[19] >> 59) | ((in[20] & 0xFFFFF) << 5)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[20] >> 20) & 0x1FFFFFF) & 1))^(((in[20] >> 20) & 0x1FFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[20] >> 45) | ((in[21] & 0x3F) << 19))) & 1))^((((in[20] >> 45) | ((in[21] & 0x3F) << 19)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[21] >> 6) & 0x1FFFFFF) & 1))^(((in[21] >> 6) & 0x1FFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[21] >> 31) & 0x1FFFFFF) & 1))^(((in[21] >> 31) & 0x1FFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[21] >> 56) | ((in[22] & 0x1FFFF) << 8))) & 1))^((((in[21] >> 56) | ((in[22] & 0x1FFFF) << 8)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[22] >> 17) & 0x1FFFFFF) & 1))^(((in[22] >> 17) & 0x1FFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[22] >> 42) | ((in[23] & 0x7) << 22))) & 1))^((((in[22] >> 42) | ((in[23] & 0x7) << 22)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[23] >> 3) & 0x1FFFFFF) & 1))^(((in[23] >> 3) & 0x1FFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-(((in[23] >> 28) & 0x1FFFFFF) & 1))^(((in[23] >> 28) & 0x1FFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[23] >> 53) | ((in[24] & 0x3FFF) << 11))) & 1))^((((in[23] >> 53) | ((in[24] & 0x3FFF) << 11)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[24] >> 14) & 0x1FFFFFF) & 1))^(((in[24] >> 14) & 0x1FFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[24] >> 39)) & 1))^(((in[24] >> 39))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_26(initoffset int64, in *[26]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 26) & 0x3FFFFFF) & 1))^(((in[0] >> 26) & 0x3FFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 52) | ((in[1] & 0x3FFF) << 12))) & 1))^((((in[0] >> 52) | ((in[1] & 0x3FFF) << 12)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 14) & 0x3FFFFFF) & 1))^(((in[1] >> 14) & 0x3FFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[1] >> 40) | ((in[2] & 0x3) << 24))) & 1))^((((in[1] >> 40) | ((in[2] & 0x3) << 24)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[2] >> 2) & 0x3FFFFFF) & 1))^(((in[2] >> 2) & 0x3FFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[2] >> 28) & 0x3FFFFFF) & 1))^(((in[2] >> 28) & 0x3FFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[2] >> 54) | ((in[3] & 0xFFFF) << 10))) & 1))^((((in[2] >> 54) | ((in[3] & 0xFFFF) << 10)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[3] >> 16) & 0x3FFFFFF) & 1))^(((in[3] >> 16) & 0x3FFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[3] >> 42) | ((in[4] & 0xF) << 22))) & 1))^((((in[3] >> 42) | ((in[4] & 0xF) << 22)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[4] >> 4) & 0x3FFFFFF) & 1))^(((in[4] >> 4) & 0x3FFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[4] >> 30) & 0x3FFFFFF) & 1))^(((in[4] >> 30) & 0x3FFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[4] >> 56) | ((in[5] & 0x3FFFF) << 8))) & 1))^((((in[4] >> 56) | ((in[5] & 0x3FFFF) << 8)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[5] >> 18) & 0x3FFFFFF) & 1))^(((in[5] >> 18) & 0x3FFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[5] >> 44) | ((in[6] & 0x3F) << 20))) & 1))^((((in[5] >> 44) | ((in[6] & 0x3F) << 20)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[6] >> 6) & 0x3FFFFFF) & 1))^(((in[6] >> 6) & 0x3FFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[6] >> 32) & 0x3FFFFFF) & 1))^(((in[6] >> 32) & 0x3FFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[6] >> 58) | ((in[7] & 0xFFFFF) << 6))) & 1))^((((in[6] >> 58) | ((in[7] & 0xFFFFF) << 6)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[7] >> 20) & 0x3FFFFFF) & 1))^(((in[7] >> 20) & 0x3FFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[7] >> 46) | ((in[8] & 0xFF) << 18))) & 1))^((((in[7] >> 46) | ((in[8] & 0xFF) << 18)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[8] >> 8) & 0x3FFFFFF) & 1))^(((in[8] >> 8) & 0x3FFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[8] >> 34) & 0x3FFFFFF) & 1))^(((in[8] >> 34) & 0x3FFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[8] >> 60) | ((in[9] & 0x3FFFFF) << 4))) & 1))^((((in[8] >> 60) | ((in[9] & 0x3FFFFF) << 4)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[9] >> 22) & 0x3FFFFFF) & 1))^(((in[9] >> 22) & 0x3FFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[9] >> 48) | ((in[10] & 0x3FF) << 16))) & 1))^((((in[9] >> 48) | ((in[10] & 0x3FF) << 16)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[10] >> 10) & 0x3FFFFFF) & 1))^(((in[10] >> 10) & 0x3FFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-(((in[10] >> 36) & 0x3FFFFFF) & 1))^(((in[10] >> 36) & 0x3FFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[10] >> 62) | ((in[11] & 0xFFFFFF) << 2))) & 1))^((((in[10] >> 62) | ((in[11] & 0xFFFFFF) << 2)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[11] >> 24) & 0x3FFFFFF) & 1))^(((in[11] >> 24) & 0x3FFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[11] >> 50) | ((in[12] & 0xFFF) << 14))) & 1))^((((in[11] >> 50) | ((in[12] & 0xFFF) << 14)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[12] >> 12) & 0x3FFFFFF) & 1))^(((in[12] >> 12) & 0x3FFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[12] >> 38)) & 1))^(((in[12] >> 38))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[13] >> 0) & 0x3FFFFFF) & 1))^(((in[13] >> 0) & 0x3FFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[13] >> 26) & 0x3FFFFFF) & 1))^(((in[13] >> 26) & 0x3FFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[13] >> 52) | ((in[14] & 0x3FFF) << 12))) & 1))^((((in[13] >> 52) | ((in[14] & 0x3FFF) << 12)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[14] >> 14) & 0x3FFFFFF) & 1))^(((in[14] >> 14) & 0x3FFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[14] >> 40) | ((in[15] & 0x3) << 24))) & 1))^((((in[14] >> 40) | ((in[15] & 0x3) << 24)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[15] >> 2) & 0x3FFFFFF) & 1))^(((in[15] >> 2) & 0x3FFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-(((in[15] >> 28) & 0x3FFFFFF) & 1))^(((in[15] >> 28) & 0x3FFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[15] >> 54) | ((in[16] & 0xFFFF) << 10))) & 1))^((((in[15] >> 54) | ((in[16] & 0xFFFF) << 10)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[16] >> 16) & 0x3FFFFFF) & 1))^(((in[16] >> 16) & 0x3FFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[16] >> 42) | ((in[17] & 0xF) << 22))) & 1))^((((in[16] >> 42) | ((in[17] & 0xF) << 22)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[17] >> 4) & 0x3FFFFFF) & 1))^(((in[17] >> 4) & 0x3FFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[17] >> 30) & 0x3FFFFFF) & 1))^(((in[17] >> 30) & 0x3FFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[17] >> 56) | ((in[18] & 0x3FFFF) << 8))) & 1))^((((in[17] >> 56) | ((in[18] & 0x3FFFF) << 8)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[18] >> 18) & 0x3FFFFFF) & 1))^(((in[18] >> 18) & 0x3FFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[18] >> 44) | ((in[19] & 0x3F) << 20))) & 1))^((((in[18] >> 44) | ((in[19] & 0x3F) << 20)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[19] >> 6) & 0x3FFFFFF) & 1))^(((in[19] >> 6) & 0x3FFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[19] >> 32) & 0x3FFFFFF) & 1))^(((in[19] >> 32) & 0x3FFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[19] >> 58) | ((in[20] & 0xFFFFF) << 6))) & 1))^((((in[19] >> 58) | ((in[20] & 0xFFFFF) << 6)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[20] >> 20) & 0x3FFFFFF) & 1))^(((in[20] >> 20) & 0x3FFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[20] >> 46) | ((in[21] & 0xFF) << 18))) & 1))^((((in[20] >> 46) | ((in[21] & 0xFF) << 18)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[21] >> 8) & 0x3FFFFFF) & 1))^(((in[21] >> 8) & 0x3FFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[21] >> 34) & 0x3FFFFFF) & 1))^(((in[21] >> 34) & 0x3FFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[21] >> 60) | ((in[22] & 0x3FFFFF) << 4))) & 1))^((((in[21] >> 60) | ((in[22] & 0x3FFFFF) << 4)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[22] >> 22) & 0x3FFFFFF) & 1))^(((in[22] >> 22) & 0x3FFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[22] >> 48) | ((in[23] & 0x3FF) << 16))) & 1))^((((in[22] >> 48) | ((in[23] & 0x3FF) << 16)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[23] >> 10) & 0x3FFFFFF) & 1))^(((in[23] >> 10) & 0x3FFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[23] >> 36) & 0x3FFFFFF) & 1))^(((in[23] >> 36) & 0x3FFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[23] >> 62) | ((in[24] & 0xFFFFFF) << 2))) & 1))^((((in[23] >> 62) | ((in[24] & 0xFFFFFF) << 2)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[24] >> 24) & 0x3FFFFFF) & 1))^(((in[24] >> 24) & 0x3FFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[24] >> 50) | ((in[25] & 0xFFF) << 14))) & 1))^((((in[24] >> 50) | ((in[25] & 0xFFF) << 14)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[25] >> 12) & 0x3FFFFFF) & 1))^(((in[25] >> 12) & 0x3FFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[25] >> 38)) & 1))^(((in[25] >> 38))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_27(initoffset int64, in *[27]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 27) & 0x7FFFFFF) & 1))^(((in[0] >> 27) & 0x7FFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 54) | ((in[1] & 0x1FFFF) << 10))) & 1))^((((in[0] >> 54) | ((in[1] & 0x1FFFF) << 10)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 17) & 0x7FFFFFF) & 1))^(((in[1] >> 17) & 0x7FFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[1] >> 44) | ((in[2] & 0x7F) << 20))) & 1))^((((in[1] >> 44) | ((in[2] & 0x7F) << 20)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[2] >> 7) & 0x7FFFFFF) & 1))^(((in[2] >> 7) & 0x7FFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-(((in[2] >> 34) & 0x7FFFFFF) & 1))^(((in[2] >> 34) & 0x7FFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[2] >> 61) | ((in[3] & 0xFFFFFF) << 3))) & 1))^((((in[2] >> 61) | ((in[3] & 0xFFFFFF) << 3)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[3] >> 24) & 0x7FFFFFF) & 1))^(((in[3] >> 24) & 0x7FFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[3] >> 51) | ((in[4] & 0x3FFF) << 13))) & 1))^((((in[3] >> 51) | ((in[4] & 0x3FFF) << 13)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[4] >> 14) & 0x7FFFFFF) & 1))^(((in[4] >> 14) & 0x7FFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[4] >> 41) | ((in[5] & 0xF) << 23))) & 1))^((((in[4] >> 41) | ((in[5] & 0xF) << 23)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[5] >> 4) & 0x7FFFFFF) & 1))^(((in[5] >> 4) & 0x7FFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[5] >> 31) & 0x7FFFFFF) & 1))^(((in[5] >> 31) & 0x7FFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[5] >> 58) | ((in[6] & 0x1FFFFF) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0x1FFFFF) << 6)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[6] >> 21) & 0x7FFFFFF) & 1))^(((in[6] >> 21) & 0x7FFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[6] >> 48) | ((in[7] & 0x7FF) << 16))) & 1))^((((in[6] >> 48) | ((in[7] & 0x7FF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[7] >> 11) & 0x7FFFFFF) & 1))^(((in[7] >> 11) & 0x7FFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[7] >> 38) | ((in[8] & 0x1) << 26))) & 1))^((((in[7] >> 38) | ((in[8] & 0x1) << 26)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[8] >> 1) & 0x7FFFFFF) & 1))^(((in[8] >> 1) & 0x7FFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-(((in[8] >> 28) & 0x7FFFFFF) & 1))^(((in[8] >> 28) & 0x7FFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[8] >> 55) | ((in[9] & 0x3FFFF) << 9))) & 1))^((((in[8] >> 55) | ((in[9] & 0x3FFFF) << 9)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[9] >> 18) & 0x7FFFFFF) & 1))^(((in[9] >> 18) & 0x7FFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[9] >> 45) | ((in[10] & 0xFF) << 19))) & 1))^((((in[9] >> 45) | ((in[10] & 0xFF) << 19)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[10] >> 8) & 0x7FFFFFF) & 1))^(((in[10] >> 8) & 0x7FFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[10] >> 35) & 0x7FFFFFF) & 1))^(((in[10] >> 35) & 0x7FFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[10] >> 62) | ((in[11] & 0x1FFFFFF) << 2))) & 1))^((((in[10] >> 62) | ((in[11] & 0x1FFFFFF) << 2)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[11] >> 25) & 0x7FFFFFF) & 1))^(((in[11] >> 25) & 0x7FFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[11] >> 52) | ((in[12] & 0x7FFF) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0x7FFF) << 12)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[12] >> 15) & 0x7FFFFFF) & 1))^(((in[12] >> 15) & 0x7FFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[12] >> 42) | ((in[13] & 0x1F) << 22))) & 1))^((((in[12] >> 42) | ((in[13] & 0x1F) << 22)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[13] >> 5) & 0x7FFFFFF) & 1))^(((in[13] >> 5) & 0x7FFFFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[13] >> 32) & 0x7FFFFFF) & 1))^(((in[13] >> 32) & 0x7FFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[13] >> 59) | ((in[14] & 0x3FFFFF) << 5))) & 1))^((((in[13] >> 59) | ((in[14] & 0x3FFFFF) << 5)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[14] >> 22) & 0x7FFFFFF) & 1))^(((in[14] >> 22) & 0x7FFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[14] >> 49) | ((in[15] & 0xFFF) << 15))) & 1))^((((in[14] >> 49) | ((in[15] & 0xFFF) << 15)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[15] >> 12) & 0x7FFFFFF) & 1))^(((in[15] >> 12) & 0x7FFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[15] >> 39) | ((in[16] & 0x3) << 25))) & 1))^((((in[15] >> 39) | ((in[16] & 0x3) << 25)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[16] >> 2) & 0x7FFFFFF) & 1))^(((in[16] >> 2) & 0x7FFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[16] >> 29) & 0x7FFFFFF) & 1))^(((in[16] >> 29) & 0x7FFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[16] >> 56) | ((in[17] & 0x7FFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0x7FFFF) << 8)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[17] >> 19) & 0x7FFFFFF) & 1))^(((in[17] >> 19) & 0x7FFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[17] >> 46) | ((in[18] & 0x1FF) << 18))) & 1))^((((in[17] >> 46) | ((in[18] & 0x1FF) << 18)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[18] >> 9) & 0x7FFFFFF) & 1))^(((in[18] >> 9) & 0x7FFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-(((in[18] >> 36) & 0x7FFFFFF) & 1))^(((in[18] >> 36) & 0x7FFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[18] >> 63) | ((in[19] & 0x3FFFFFF) << 1))) & 1))^((((in[18] >> 63) | ((in[19] & 0x3FFFFFF) << 1)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[19] >> 26) & 0x7FFFFFF) & 1))^(((in[19] >> 26) & 0x7FFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[19] >> 53) | ((in[20] & 0xFFFF) << 11))) & 1))^((((in[19] >> 53) | ((in[20] & 0xFFFF) << 11)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[20] >> 16) & 0x7FFFFFF) & 1))^(((in[20] >> 16) & 0x7FFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[20] >> 43) | ((in[21] & 0x3F) << 21))) & 1))^((((in[20] >> 43) | ((in[21] & 0x3F) << 21)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[21] >> 6) & 0x7FFFFFF) & 1))^(((in[21] >> 6) & 0x7FFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[21] >> 33) & 0x7FFFFFF) & 1))^(((in[21] >> 33) & 0x7FFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[21] >> 60) | ((in[22] & 0x7FFFFF) << 4))) & 1))^((((in[21] >> 60) | ((in[22] & 0x7FFFFF) << 4)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[22] >> 23) & 0x7FFFFFF) & 1))^(((in[22] >> 23) & 0x7FFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[22] >> 50) | ((in[23] & 0x1FFF) << 14))) & 1))^((((in[22] >> 50) | ((in[23] & 0x1FFF) << 14)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[23] >> 13) & 0x7FFFFFF) & 1))^(((in[23] >> 13) & 0x7FFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[23] >> 40) | ((in[24] & 0x7) << 24))) & 1))^((((in[23] >> 40) | ((in[24] & 0x7) << 24)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[24] >> 3) & 0x7FFFFFF) & 1))^(((in[24] >> 3) & 0x7FFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-(((in[24] >> 30) & 0x7FFFFFF) & 1))^(((in[24] >> 30) & 0x7FFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[24] >> 57) | ((in[25] & 0xFFFFF) << 7))) & 1))^((((in[24] >> 57) | ((in[25] & 0xFFFFF) << 7)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[25] >> 20) & 0x7FFFFFF) & 1))^(((in[25] >> 20) & 0x7FFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[25] >> 47) | ((in[26] & 0x3FF) << 17))) & 1))^((((in[25] >> 47) | ((in[26] & 0x3FF) << 17)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[26] >> 10) & 0x7FFFFFF) & 1))^(((in[26] >> 10) & 0x7FFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[26] >> 37)) & 1))^(((in[26] >> 37))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_28(initoffset int64, in *[28]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 28) & 0xFFFFFFF) & 1))^(((in[0] >> 28) & 0xFFFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 56) | ((in[1] & 0xFFFFF) << 8))) & 1))^((((in[0] >> 56) | ((in[1] & 0xFFFFF) << 8)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 20) & 0xFFFFFFF) & 1))^(((in[1] >> 20) & 0xFFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[1] >> 48) | ((in[2] & 0xFFF) << 16))) & 1))^((((in[1] >> 48) | ((in[2] & 0xFFF) << 16)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[2] >> 12) & 0xFFFFFFF) & 1))^(((in[2] >> 12) & 0xFFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[2] >> 40) | ((in[3] & 0xF) << 24))) & 1))^((((in[2] >> 40) | ((in[3] & 0xF) << 24)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[3] >> 4) & 0xFFFFFFF) & 1))^(((in[3] >> 4) & 0xFFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-(((in[3] >> 32) & 0xFFFFFFF) & 1))^(((in[3] >> 32) & 0xFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[3] >> 60) | ((in[4] & 0xFFFFFF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0xFFFFFF) << 4)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[4] >> 24) & 0xFFFFFFF) & 1))^(((in[4] >> 24) & 0xFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[4] >> 52) | ((in[5] & 0xFFFF) << 12))) & 1))^((((in[4] >> 52) | ((in[5] & 0xFFFF) << 12)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[5] >> 16) & 0xFFFFFFF) & 1))^(((in[5] >> 16) & 0xFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[5] >> 44) | ((in[6] & 0xFF) << 20))) & 1))^((((in[5] >> 44) | ((in[6] & 0xFF) << 20)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[6] >> 8) & 0xFFFFFFF) & 1))^(((in[6] >> 8) & 0xFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[6] >> 36)) & 1))^(((in[6] >> 36))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[7] >> 0) & 0xFFFFFFF) & 1))^(((in[7] >> 0) & 0xFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[7] >> 28) & 0xFFFFFFF) & 1))^(((in[7] >> 28) & 0xFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[7] >> 56) | ((in[8] & 0xFFFFF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0xFFFFF) << 8)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[8] >> 20) & 0xFFFFFFF) & 1))^(((in[8] >> 20) & 0xFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[8] >> 48) | ((in[9] & 0xFFF) << 16))) & 1))^((((in[8] >> 48) | ((in[9] & 0xFFF) << 16)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[9] >> 12) & 0xFFFFFFF) & 1))^(((in[9] >> 12) & 0xFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[9] >> 40) | ((in[10] & 0xF) << 24))) & 1))^((((in[9] >> 40) | ((in[10] & 0xF) << 24)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[10] >> 4) & 0xFFFFFFF) & 1))^(((in[10] >> 4) & 0xFFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-(((in[10] >> 32) & 0xFFFFFFF) & 1))^(((in[10] >> 32) & 0xFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[10] >> 60) | ((in[11] & 0xFFFFFF) << 4))) & 1))^((((in[10] >> 60) | ((in[11] & 0xFFFFFF) << 4)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[11] >> 24) & 0xFFFFFFF) & 1))^(((in[11] >> 24) & 0xFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[11] >> 52) | ((in[12] & 0xFFFF) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0xFFFF) << 12)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[12] >> 16) & 0xFFFFFFF) & 1))^(((in[12] >> 16) & 0xFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[12] >> 44) | ((in[13] & 0xFF) << 20))) & 1))^((((in[12] >> 44) | ((in[13] & 0xFF) << 20)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[13] >> 8) & 0xFFFFFFF) & 1))^(((in[13] >> 8) & 0xFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[13] >> 36)) & 1))^(((in[13] >> 36))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[14] >> 0) & 0xFFFFFFF) & 1))^(((in[14] >> 0) & 0xFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[14] >> 28) & 0xFFFFFFF) & 1))^(((in[14] >> 28) & 0xFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[14] >> 56) | ((in[15] & 0xFFFFF) << 8))) & 1))^((((in[14] >> 56) | ((in[15] & 0xFFFFF) << 8)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[15] >> 20) & 0xFFFFFFF) & 1))^(((in[15] >> 20) & 0xFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[15] >> 48) | ((in[16] & 0xFFF) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0xFFF) << 16)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[16] >> 12) & 0xFFFFFFF) & 1))^(((in[16] >> 12) & 0xFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[16] >> 40) | ((in[17] & 0xF) << 24))) & 1))^((((in[16] >> 40) | ((in[17] & 0xF) << 24)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[17] >> 4) & 0xFFFFFFF) & 1))^(((in[17] >> 4) & 0xFFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-(((in[17] >> 32) & 0xFFFFFFF) & 1))^(((in[17] >> 32) & 0xFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[17] >> 60) | ((in[18] & 0xFFFFFF) << 4))) & 1))^((((in[17] >> 60) | ((in[18] & 0xFFFFFF) << 4)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[18] >> 24) & 0xFFFFFFF) & 1))^(((in[18] >> 24) & 0xFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[18] >> 52) | ((in[19] & 0xFFFF) << 12))) & 1))^((((in[18] >> 52) | ((in[19] & 0xFFFF) << 12)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[19] >> 16) & 0xFFFFFFF) & 1))^(((in[19] >> 16) & 0xFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[19] >> 44) | ((in[20] & 0xFF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0xFF) << 20)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[20] >> 8) & 0xFFFFFFF) & 1))^(((in[20] >> 8) & 0xFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[20] >> 36)) & 1))^(((in[20] >> 36))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[21] >> 0) & 0xFFFFFFF) & 1))^(((in[21] >> 0) & 0xFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[21] >> 28) & 0xFFFFFFF) & 1))^(((in[21] >> 28) & 0xFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[21] >> 56) | ((in[22] & 0xFFFFF) << 8))) & 1))^((((in[21] >> 56) | ((in[22] & 0xFFFFF) << 8)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[22] >> 20) & 0xFFFFFFF) & 1))^(((in[22] >> 20) & 0xFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[22] >> 48) | ((in[23] & 0xFFF) << 16))) & 1))^((((in[22] >> 48) | ((in[23] & 0xFFF) << 16)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[23] >> 12) & 0xFFFFFFF) & 1))^(((in[23] >> 12) & 0xFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[23] >> 40) | ((in[24] & 0xF) << 24))) & 1))^((((in[23] >> 40) | ((in[24] & 0xF) << 24)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[24] >> 4) & 0xFFFFFFF) & 1))^(((in[24] >> 4) & 0xFFFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-(((in[24] >> 32) & 0xFFFFFFF) & 1))^(((in[24] >> 32) & 0xFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[24] >> 60) | ((in[25] & 0xFFFFFF) << 4))) & 1))^((((in[24] >> 60) | ((in[25] & 0xFFFFFF) << 4)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[25] >> 24) & 0xFFFFFFF) & 1))^(((in[25] >> 24) & 0xFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[25] >> 52) | ((in[26] & 0xFFFF) << 12))) & 1))^((((in[25] >> 52) | ((in[26] & 0xFFFF) << 12)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[26] >> 16) & 0xFFFFFFF) & 1))^(((in[26] >> 16) & 0xFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[26] >> 44) | ((in[27] & 0xFF) << 20))) & 1))^((((in[26] >> 44) | ((in[27] & 0xFF) << 20)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[27] >> 8) & 0xFFFFFFF) & 1))^(((in[27] >> 8) & 0xFFFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[27] >> 36)) & 1))^(((in[27] >> 36))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_29(initoffset int64, in *[29]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 29) & 0x1FFFFFFF) & 1))^(((in[0] >> 29) & 0x1FFFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 58) | ((in[1] & 0x7FFFFF) << 6))) & 1))^((((in[0] >> 58) | ((in[1] & 0x7FFFFF) << 6)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 23) & 0x1FFFFFFF) & 1))^(((in[1] >> 23) & 0x1FFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[1] >> 52) | ((in[2] & 0x1FFFF) << 12))) & 1))^((((in[1] >> 52) | ((in[2] & 0x1FFFF) << 12)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[2] >> 17) & 0x1FFFFFFF) & 1))^(((in[2] >> 17) & 0x1FFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[2] >> 46) | ((in[3] & 0x7FF) << 18))) & 1))^((((in[2] >> 46) | ((in[3] & 0x7FF) << 18)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[3] >> 11) & 0x1FFFFFFF) & 1))^(((in[3] >> 11) & 0x1FFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[3] >> 40) | ((in[4] & 0x1F) << 24))) & 1))^((((in[3] >> 40) | ((in[4] & 0x1F) << 24)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[4] >> 5) & 0x1FFFFFFF) & 1))^(((in[4] >> 5) & 0x1FFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-(((in[4] >> 34) & 0x1FFFFFFF) & 1))^(((in[4] >> 34) & 0x1FFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[4] >> 63) | ((in[5] & 0xFFFFFFF) << 1))) & 1))^((((in[4] >> 63) | ((in[5] & 0xFFFFFFF) << 1)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[5] >> 28) & 0x1FFFFFFF) & 1))^(((in[5] >> 28) & 0x1FFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[5] >> 57) | ((in[6] & 0x3FFFFF) << 7))) & 1))^((((in[5] >> 57) | ((in[6] & 0x3FFFFF) << 7)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[6] >> 22) & 0x1FFFFFFF) & 1))^(((in[6] >> 22) & 0x1FFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[6] >> 51) | ((in[7] & 0xFFFF) << 13))) & 1))^((((in[6] >> 51) | ((in[7] & 0xFFFF) << 13)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[7] >> 16) & 0x1FFFFFFF) & 1))^(((in[7] >> 16) & 0x1FFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[7] >> 45) | ((in[8] & 0x3FF) << 19))) & 1))^((((in[7] >> 45) | ((in[8] & 0x3FF) << 19)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[8] >> 10) & 0x1FFFFFFF) & 1))^(((in[8] >> 10) & 0x1FFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[8] >> 39) | ((in[9] & 0xF) << 25))) & 1))^((((in[8] >> 39) | ((in[9] & 0xF) << 25)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[9] >> 4) & 0x1FFFFFFF) & 1))^(((in[9] >> 4) & 0x1FFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[9] >> 33) & 0x1FFFFFFF) & 1))^(((in[9] >> 33) & 0x1FFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[9] >> 62) | ((in[10] & 0x7FFFFFF) << 2))) & 1))^((((in[9] >> 62) | ((in[10] & 0x7FFFFFF) << 2)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[10] >> 27) & 0x1FFFFFFF) & 1))^(((in[10] >> 27) & 0x1FFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[10] >> 56) | ((in[11] & 0x1FFFFF) << 8))) & 1))^((((in[10] >> 56) | ((in[11] & 0x1FFFFF) << 8)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[11] >> 21) & 0x1FFFFFFF) & 1))^(((in[11] >> 21) & 0x1FFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[11] >> 50) | ((in[12] & 0x7FFF) << 14))) & 1))^((((in[11] >> 50) | ((in[12] & 0x7FFF) << 14)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[12] >> 15) & 0x1FFFFFFF) & 1))^(((in[12] >> 15) & 0x1FFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[12] >> 44) | ((in[13] & 0x1FF) << 20))) & 1))^((((in[12] >> 44) | ((in[13] & 0x1FF) << 20)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[13] >> 9) & 0x1FFFFFFF) & 1))^(((in[13] >> 9) & 0x1FFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[13] >> 38) | ((in[14] & 0x7) << 26))) & 1))^((((in[13] >> 38) | ((in[14] & 0x7) << 26)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[14] >> 3) & 0x1FFFFFFF) & 1))^(((in[14] >> 3) & 0x1FFFFFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[14] >> 32) & 0x1FFFFFFF) & 1))^(((in[14] >> 32) & 0x1FFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[14] >> 61) | ((in[15] & 0x3FFFFFF) << 3))) & 1))^((((in[14] >> 61) | ((in[15] & 0x3FFFFFF) << 3)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[15] >> 26) & 0x1FFFFFFF) & 1))^(((in[15] >> 26) & 0x1FFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[15] >> 55) | ((in[16] & 0xFFFFF) << 9))) & 1))^((((in[15] >> 55) | ((in[16] & 0xFFFFF) << 9)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[16] >> 20) & 0x1FFFFFFF) & 1))^(((in[16] >> 20) & 0x1FFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[16] >> 49) | ((in[17] & 0x3FFF) << 15))) & 1))^((((in[16] >> 49) | ((in[17] & 0x3FFF) << 15)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[17] >> 14) & 0x1FFFFFFF) & 1))^(((in[17] >> 14) & 0x1FFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[17] >> 43) | ((in[18] & 0xFF) << 21))) & 1))^((((in[17] >> 43) | ((in[18] & 0xFF) << 21)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[18] >> 8) & 0x1FFFFFFF) & 1))^(((in[18] >> 8) & 0x1FFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[18] >> 37) | ((in[19] & 0x3) << 27))) & 1))^((((in[18] >> 37) | ((in[19] & 0x3) << 27)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[19] >> 2) & 0x1FFFFFFF) & 1))^(((in[19] >> 2) & 0x1FFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[19] >> 31) & 0x1FFFFFFF) & 1))^(((in[19] >> 31) & 0x1FFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[19] >> 60) | ((in[20] & 0x1FFFFFF) << 4))) & 1))^((((in[19] >> 60) | ((in[20] & 0x1FFFFFF) << 4)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[20] >> 25) & 0x1FFFFFFF) & 1))^(((in[20] >> 25) & 0x1FFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[20] >> 54) | ((in[21] & 0x7FFFF) << 10))) & 1))^((((in[20] >> 54) | ((in[21] & 0x7FFFF) << 10)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[21] >> 19) & 0x1FFFFFFF) & 1))^(((in[21] >> 19) & 0x1FFFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[21] >> 48) | ((in[22] & 0x1FFF) << 16))) & 1))^((((in[21] >> 48) | ((in[22] & 0x1FFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[22] >> 13) & 0x1FFFFFFF) & 1))^(((in[22] >> 13) & 0x1FFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[22] >> 42) | ((in[23] & 0x7F) << 22))) & 1))^((((in[22] >> 42) | ((in[23] & 0x7F) << 22)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[23] >> 7) & 0x1FFFFFFF) & 1))^(((in[23] >> 7) & 0x1FFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[23] >> 36) | ((in[24] & 0x1) << 28))) & 1))^((((in[23] >> 36) | ((in[24] & 0x1) << 28)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[24] >> 1) & 0x1FFFFFFF) & 1))^(((in[24] >> 1) & 0x1FFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-(((in[24] >> 30) & 0x1FFFFFFF) & 1))^(((in[24] >> 30) & 0x1FFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[24] >> 59) | ((in[25] & 0xFFFFFF) << 5))) & 1))^((((in[24] >> 59) | ((in[25] & 0xFFFFFF) << 5)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[25] >> 24) & 0x1FFFFFFF) & 1))^(((in[25] >> 24) & 0x1FFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[25] >> 53) | ((in[26] & 0x3FFFF) << 11))) & 1))^((((in[25] >> 53) | ((in[26] & 0x3FFFF) << 11)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[26] >> 18) & 0x1FFFFFFF) & 1))^(((in[26] >> 18) & 0x1FFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[26] >> 47) | ((in[27] & 0xFFF) << 17))) & 1))^((((in[26] >> 47) | ((in[27] & 0xFFF) << 17)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[27] >> 12) & 0x1FFFFFFF) & 1))^(((in[27] >> 12) & 0x1FFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[27] >> 41) | ((in[28] & 0x3F) << 23))) & 1))^((((in[27] >> 41) | ((in[28] & 0x3F) << 23)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[28] >> 6) & 0x1FFFFFFF) & 1))^(((in[28] >> 6) & 0x1FFFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[28] >> 35)) & 1))^(((in[28] >> 35))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_30(initoffset int64, in *[30]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 30) & 0x3FFFFFFF) & 1))^(((in[0] >> 30) & 0x3FFFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 60) | ((in[1] & 0x3FFFFFF) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0x3FFFFFF) << 4)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 26) & 0x3FFFFFFF) & 1))^(((in[1] >> 26) & 0x3FFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[1] >> 56) | ((in[2] & 0x3FFFFF) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0x3FFFFF) << 8)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[2] >> 22) & 0x3FFFFFFF) & 1))^(((in[2] >> 22) & 0x3FFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[2] >> 52) | ((in[3] & 0x3FFFF) << 12))) & 1))^((((in[2] >> 52) | ((in[3] & 0x3FFFF) << 12)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[3] >> 18) & 0x3FFFFFFF) & 1))^(((in[3] >> 18) & 0x3FFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[3] >> 48) | ((in[4] & 0x3FFF) << 16))) & 1))^((((in[3] >> 48) | ((in[4] & 0x3FFF) << 16)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[4] >> 14) & 0x3FFFFFFF) & 1))^(((in[4] >> 14) & 0x3FFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[4] >> 44) | ((in[5] & 0x3FF) << 20))) & 1))^((((in[4] >> 44) | ((in[5] & 0x3FF) << 20)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[5] >> 10) & 0x3FFFFFFF) & 1))^(((in[5] >> 10) & 0x3FFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[5] >> 40) | ((in[6] & 0x3F) << 24))) & 1))^((((in[5] >> 40) | ((in[6] & 0x3F) << 24)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[6] >> 6) & 0x3FFFFFFF) & 1))^(((in[6] >> 6) & 0x3FFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[6] >> 36) | ((in[7] & 0x3) << 28))) & 1))^((((in[6] >> 36) | ((in[7] & 0x3) << 28)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[7] >> 2) & 0x3FFFFFFF) & 1))^(((in[7] >> 2) & 0x3FFFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-(((in[7] >> 32) & 0x3FFFFFFF) & 1))^(((in[7] >> 32) & 0x3FFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[7] >> 62) | ((in[8] & 0xFFFFFFF) << 2))) & 1))^((((in[7] >> 62) | ((in[8] & 0xFFFFFFF) << 2)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[8] >> 28) & 0x3FFFFFFF) & 1))^(((in[8] >> 28) & 0x3FFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[8] >> 58) | ((in[9] & 0xFFFFFF) << 6))) & 1))^((((in[8] >> 58) | ((in[9] & 0xFFFFFF) << 6)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[9] >> 24) & 0x3FFFFFFF) & 1))^(((in[9] >> 24) & 0x3FFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[9] >> 54) | ((in[10] & 0xFFFFF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0xFFFFF) << 10)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[10] >> 20) & 0x3FFFFFFF) & 1))^(((in[10] >> 20) & 0x3FFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[10] >> 50) | ((in[11] & 0xFFFF) << 14))) & 1))^((((in[10] >> 50) | ((in[11] & 0xFFFF) << 14)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[11] >> 16) & 0x3FFFFFFF) & 1))^(((in[11] >> 16) & 0x3FFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[11] >> 46) | ((in[12] & 0xFFF) << 18))) & 1))^((((in[11] >> 46) | ((in[12] & 0xFFF) << 18)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[12] >> 12) & 0x3FFFFFFF) & 1))^(((in[12] >> 12) & 0x3FFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[12] >> 42) | ((in[13] & 0xFF) << 22))) & 1))^((((in[12] >> 42) | ((in[13] & 0xFF) << 22)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[13] >> 8) & 0x3FFFFFFF) & 1))^(((in[13] >> 8) & 0x3FFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[13] >> 38) | ((in[14] & 0xF) << 26))) & 1))^((((in[13] >> 38) | ((in[14] & 0xF) << 26)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[14] >> 4) & 0x3FFFFFFF) & 1))^(((in[14] >> 4) & 0x3FFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[14] >> 34)) & 1))^(((in[14] >> 34))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[15] >> 0) & 0x3FFFFFFF) & 1))^(((in[15] >> 0) & 0x3FFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[15] >> 30) & 0x3FFFFFFF) & 1))^(((in[15] >> 30) & 0x3FFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[15] >> 60) | ((in[16] & 0x3FFFFFF) << 4))) & 1))^((((in[15] >> 60) | ((in[16] & 0x3FFFFFF) << 4)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[16] >> 26) & 0x3FFFFFFF) & 1))^(((in[16] >> 26) & 0x3FFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[16] >> 56) | ((in[17] & 0x3FFFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0x3FFFFF) << 8)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[17] >> 22) & 0x3FFFFFFF) & 1))^(((in[17] >> 22) & 0x3FFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[17] >> 52) | ((in[18] & 0x3FFFF) << 12))) & 1))^((((in[17] >> 52) | ((in[18] & 0x3FFFF) << 12)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[18] >> 18) & 0x3FFFFFFF) & 1))^(((in[18] >> 18) & 0x3FFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[18] >> 48) | ((in[19] & 0x3FFF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0x3FFF) << 16)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[19] >> 14) & 0x3FFFFFFF) & 1))^(((in[19] >> 14) & 0x3FFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[19] >> 44) | ((in[20] & 0x3FF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0x3FF) << 20)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[20] >> 10) & 0x3FFFFFFF) & 1))^(((in[20] >> 10) & 0x3FFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[20] >> 40) | ((in[21] & 0x3F) << 24))) & 1))^((((in[20] >> 40) | ((in[21] & 0x3F) << 24)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[21] >> 6) & 0x3FFFFFFF) & 1))^(((in[21] >> 6) & 0x3FFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[21] >> 36) | ((in[22] & 0x3) << 28))) & 1))^((((in[21] >> 36) | ((in[22] & 0x3) << 28)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[22] >> 2) & 0x3FFFFFFF) & 1))^(((in[22] >> 2) & 0x3FFFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-(((in[22] >> 32) & 0x3FFFFFFF) & 1))^(((in[22] >> 32) & 0x3FFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[22] >> 62) | ((in[23] & 0xFFFFFFF) << 2))) & 1))^((((in[22] >> 62) | ((in[23] & 0xFFFFFFF) << 2)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[23] >> 28) & 0x3FFFFFFF) & 1))^(((in[23] >> 28) & 0x3FFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[23] >> 58) | ((in[24] & 0xFFFFFF) << 6))) & 1))^((((in[23] >> 58) | ((in[24] & 0xFFFFFF) << 6)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[24] >> 24) & 0x3FFFFFFF) & 1))^(((in[24] >> 24) & 0x3FFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[24] >> 54) | ((in[25] & 0xFFFFF) << 10))) & 1))^((((in[24] >> 54) | ((in[25] & 0xFFFFF) << 10)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[25] >> 20) & 0x3FFFFFFF) & 1))^(((in[25] >> 20) & 0x3FFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[25] >> 50) | ((in[26] & 0xFFFF) << 14))) & 1))^((((in[25] >> 50) | ((in[26] & 0xFFFF) << 14)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[26] >> 16) & 0x3FFFFFFF) & 1))^(((in[26] >> 16) & 0x3FFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[26] >> 46) | ((in[27] & 0xFFF) << 18))) & 1))^((((in[26] >> 46) | ((in[27] & 0xFFF) << 18)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[27] >> 12) & 0x3FFFFFFF) & 1))^(((in[27] >> 12) & 0x3FFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[27] >> 42) | ((in[28] & 0xFF) << 22))) & 1))^((((in[27] >> 42) | ((in[28] & 0xFF) << 22)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[28] >> 8) & 0x3FFFFFFF) & 1))^(((in[28] >> 8) & 0x3FFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[28] >> 38) | ((in[29] & 0xF) << 26))) & 1))^((((in[28] >> 38) | ((in[29] & 0xF) << 26)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[29] >> 4) & 0x3FFFFFFF) & 1))^(((in[29] >> 4) & 0x3FFFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[29] >> 34)) & 1))^(((in[29] >> 34))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_31(initoffset int64, in *[31]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 31) & 0x7FFFFFFF) & 1))^(((in[0] >> 31) & 0x7FFFFFFF)>>1))) << ntz + out[0] + out[2] = int64(((-((((in[0] >> 62) | ((in[1] & 0x1FFFFFFF) << 2))) & 1))^((((in[0] >> 62) | ((in[1] & 0x1FFFFFFF) << 2)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 29) & 0x7FFFFFFF) & 1))^(((in[1] >> 29) & 0x7FFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[1] >> 60) | ((in[2] & 0x7FFFFFF) << 4))) & 1))^((((in[1] >> 60) | ((in[2] & 0x7FFFFFF) << 4)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[2] >> 27) & 0x7FFFFFFF) & 1))^(((in[2] >> 27) & 0x7FFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[2] >> 58) | ((in[3] & 0x1FFFFFF) << 6))) & 1))^((((in[2] >> 58) | ((in[3] & 0x1FFFFFF) << 6)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[3] >> 25) & 0x7FFFFFFF) & 1))^(((in[3] >> 25) & 0x7FFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[3] >> 56) | ((in[4] & 0x7FFFFF) << 8))) & 1))^((((in[3] >> 56) | ((in[4] & 0x7FFFFF) << 8)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[4] >> 23) & 0x7FFFFFFF) & 1))^(((in[4] >> 23) & 0x7FFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[4] >> 54) | ((in[5] & 0x1FFFFF) << 10))) & 1))^((((in[4] >> 54) | ((in[5] & 0x1FFFFF) << 10)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[5] >> 21) & 0x7FFFFFFF) & 1))^(((in[5] >> 21) & 0x7FFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[5] >> 52) | ((in[6] & 0x7FFFF) << 12))) & 1))^((((in[5] >> 52) | ((in[6] & 0x7FFFF) << 12)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[6] >> 19) & 0x7FFFFFFF) & 1))^(((in[6] >> 19) & 0x7FFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[6] >> 50) | ((in[7] & 0x1FFFF) << 14))) & 1))^((((in[6] >> 50) | ((in[7] & 0x1FFFF) << 14)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[7] >> 17) & 0x7FFFFFFF) & 1))^(((in[7] >> 17) & 0x7FFFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[7] >> 48) | ((in[8] & 0x7FFF) << 16))) & 1))^((((in[7] >> 48) | ((in[8] & 0x7FFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[8] >> 15) & 0x7FFFFFFF) & 1))^(((in[8] >> 15) & 0x7FFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[8] >> 46) | ((in[9] & 0x1FFF) << 18))) & 1))^((((in[8] >> 46) | ((in[9] & 0x1FFF) << 18)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[9] >> 13) & 0x7FFFFFFF) & 1))^(((in[9] >> 13) & 0x7FFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[9] >> 44) | ((in[10] & 0x7FF) << 20))) & 1))^((((in[9] >> 44) | ((in[10] & 0x7FF) << 20)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[10] >> 11) & 0x7FFFFFFF) & 1))^(((in[10] >> 11) & 0x7FFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[10] >> 42) | ((in[11] & 0x1FF) << 22))) & 1))^((((in[10] >> 42) | ((in[11] & 0x1FF) << 22)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[11] >> 9) & 0x7FFFFFFF) & 1))^(((in[11] >> 9) & 0x7FFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[11] >> 40) | ((in[12] & 0x7F) << 24))) & 1))^((((in[11] >> 40) | ((in[12] & 0x7F) << 24)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[12] >> 7) & 0x7FFFFFFF) & 1))^(((in[12] >> 7) & 0x7FFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[12] >> 38) | ((in[13] & 0x1F) << 26))) & 1))^((((in[12] >> 38) | ((in[13] & 0x1F) << 26)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[13] >> 5) & 0x7FFFFFFF) & 1))^(((in[13] >> 5) & 0x7FFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[13] >> 36) | ((in[14] & 0x7) << 28))) & 1))^((((in[13] >> 36) | ((in[14] & 0x7) << 28)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[14] >> 3) & 0x7FFFFFFF) & 1))^(((in[14] >> 3) & 0x7FFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[14] >> 34) | ((in[15] & 0x1) << 30))) & 1))^((((in[14] >> 34) | ((in[15] & 0x1) << 30)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[15] >> 1) & 0x7FFFFFFF) & 1))^(((in[15] >> 1) & 0x7FFFFFFF)>>1))) << ntz + out[30] + out[32] = int64(((-(((in[15] >> 32) & 0x7FFFFFFF) & 1))^(((in[15] >> 32) & 0x7FFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[15] >> 63) | ((in[16] & 0x3FFFFFFF) << 1))) & 1))^((((in[15] >> 63) | ((in[16] & 0x3FFFFFFF) << 1)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[16] >> 30) & 0x7FFFFFFF) & 1))^(((in[16] >> 30) & 0x7FFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[16] >> 61) | ((in[17] & 0xFFFFFFF) << 3))) & 1))^((((in[16] >> 61) | ((in[17] & 0xFFFFFFF) << 3)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[17] >> 28) & 0x7FFFFFFF) & 1))^(((in[17] >> 28) & 0x7FFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[17] >> 59) | ((in[18] & 0x3FFFFFF) << 5))) & 1))^((((in[17] >> 59) | ((in[18] & 0x3FFFFFF) << 5)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[18] >> 26) & 0x7FFFFFFF) & 1))^(((in[18] >> 26) & 0x7FFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[18] >> 57) | ((in[19] & 0xFFFFFF) << 7))) & 1))^((((in[18] >> 57) | ((in[19] & 0xFFFFFF) << 7)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[19] >> 24) & 0x7FFFFFFF) & 1))^(((in[19] >> 24) & 0x7FFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[19] >> 55) | ((in[20] & 0x3FFFFF) << 9))) & 1))^((((in[19] >> 55) | ((in[20] & 0x3FFFFF) << 9)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[20] >> 22) & 0x7FFFFFFF) & 1))^(((in[20] >> 22) & 0x7FFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[20] >> 53) | ((in[21] & 0xFFFFF) << 11))) & 1))^((((in[20] >> 53) | ((in[21] & 0xFFFFF) << 11)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[21] >> 20) & 0x7FFFFFFF) & 1))^(((in[21] >> 20) & 0x7FFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[21] >> 51) | ((in[22] & 0x3FFFF) << 13))) & 1))^((((in[21] >> 51) | ((in[22] & 0x3FFFF) << 13)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[22] >> 18) & 0x7FFFFFFF) & 1))^(((in[22] >> 18) & 0x7FFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[22] >> 49) | ((in[23] & 0xFFFF) << 15))) & 1))^((((in[22] >> 49) | ((in[23] & 0xFFFF) << 15)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[23] >> 16) & 0x7FFFFFFF) & 1))^(((in[23] >> 16) & 0x7FFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[23] >> 47) | ((in[24] & 0x3FFF) << 17))) & 1))^((((in[23] >> 47) | ((in[24] & 0x3FFF) << 17)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[24] >> 14) & 0x7FFFFFFF) & 1))^(((in[24] >> 14) & 0x7FFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[24] >> 45) | ((in[25] & 0xFFF) << 19))) & 1))^((((in[24] >> 45) | ((in[25] & 0xFFF) << 19)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[25] >> 12) & 0x7FFFFFFF) & 1))^(((in[25] >> 12) & 0x7FFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[25] >> 43) | ((in[26] & 0x3FF) << 21))) & 1))^((((in[25] >> 43) | ((in[26] & 0x3FF) << 21)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[26] >> 10) & 0x7FFFFFFF) & 1))^(((in[26] >> 10) & 0x7FFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[26] >> 41) | ((in[27] & 0xFF) << 23))) & 1))^((((in[26] >> 41) | ((in[27] & 0xFF) << 23)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[27] >> 8) & 0x7FFFFFFF) & 1))^(((in[27] >> 8) & 0x7FFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[27] >> 39) | ((in[28] & 0x3F) << 25))) & 1))^((((in[27] >> 39) | ((in[28] & 0x3F) << 25)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[28] >> 6) & 0x7FFFFFFF) & 1))^(((in[28] >> 6) & 0x7FFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[28] >> 37) | ((in[29] & 0xF) << 27))) & 1))^((((in[28] >> 37) | ((in[29] & 0xF) << 27)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[29] >> 4) & 0x7FFFFFFF) & 1))^(((in[29] >> 4) & 0x7FFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[29] >> 35) | ((in[30] & 0x3) << 29))) & 1))^((((in[29] >> 35) | ((in[30] & 0x3) << 29)))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[30] >> 2) & 0x7FFFFFFF) & 1))^(((in[30] >> 2) & 0x7FFFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[30] >> 33)) & 1))^(((in[30] >> 33))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_32(initoffset int64, in *[32]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-(((in[0] >> 32)) & 1))^(((in[0] >> 32))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 0) & 0xFFFFFFFF) & 1))^(((in[1] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-(((in[1] >> 32)) & 1))^(((in[1] >> 32))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[2] >> 0) & 0xFFFFFFFF) & 1))^(((in[2] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-(((in[2] >> 32)) & 1))^(((in[2] >> 32))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[3] >> 0) & 0xFFFFFFFF) & 1))^(((in[3] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-(((in[3] >> 32)) & 1))^(((in[3] >> 32))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[4] >> 0) & 0xFFFFFFFF) & 1))^(((in[4] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-(((in[4] >> 32)) & 1))^(((in[4] >> 32))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[5] >> 0) & 0xFFFFFFFF) & 1))^(((in[5] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-(((in[5] >> 32)) & 1))^(((in[5] >> 32))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[6] >> 0) & 0xFFFFFFFF) & 1))^(((in[6] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-(((in[6] >> 32)) & 1))^(((in[6] >> 32))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[7] >> 0) & 0xFFFFFFFF) & 1))^(((in[7] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-(((in[7] >> 32)) & 1))^(((in[7] >> 32))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[8] >> 0) & 0xFFFFFFFF) & 1))^(((in[8] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-(((in[8] >> 32)) & 1))^(((in[8] >> 32))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[9] >> 0) & 0xFFFFFFFF) & 1))^(((in[9] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-(((in[9] >> 32)) & 1))^(((in[9] >> 32))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[10] >> 0) & 0xFFFFFFFF) & 1))^(((in[10] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-(((in[10] >> 32)) & 1))^(((in[10] >> 32))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[11] >> 0) & 0xFFFFFFFF) & 1))^(((in[11] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-(((in[11] >> 32)) & 1))^(((in[11] >> 32))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[12] >> 0) & 0xFFFFFFFF) & 1))^(((in[12] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-(((in[12] >> 32)) & 1))^(((in[12] >> 32))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[13] >> 0) & 0xFFFFFFFF) & 1))^(((in[13] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-(((in[13] >> 32)) & 1))^(((in[13] >> 32))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[14] >> 0) & 0xFFFFFFFF) & 1))^(((in[14] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-(((in[14] >> 32)) & 1))^(((in[14] >> 32))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[15] >> 0) & 0xFFFFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-(((in[15] >> 32)) & 1))^(((in[15] >> 32))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[16] >> 0) & 0xFFFFFFFF) & 1))^(((in[16] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-(((in[16] >> 32)) & 1))^(((in[16] >> 32))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[17] >> 0) & 0xFFFFFFFF) & 1))^(((in[17] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-(((in[17] >> 32)) & 1))^(((in[17] >> 32))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[18] >> 0) & 0xFFFFFFFF) & 1))^(((in[18] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-(((in[18] >> 32)) & 1))^(((in[18] >> 32))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[19] >> 0) & 0xFFFFFFFF) & 1))^(((in[19] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-(((in[19] >> 32)) & 1))^(((in[19] >> 32))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[20] >> 0) & 0xFFFFFFFF) & 1))^(((in[20] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-(((in[20] >> 32)) & 1))^(((in[20] >> 32))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[21] >> 0) & 0xFFFFFFFF) & 1))^(((in[21] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-(((in[21] >> 32)) & 1))^(((in[21] >> 32))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[22] >> 0) & 0xFFFFFFFF) & 1))^(((in[22] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-(((in[22] >> 32)) & 1))^(((in[22] >> 32))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[23] >> 0) & 0xFFFFFFFF) & 1))^(((in[23] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-(((in[23] >> 32)) & 1))^(((in[23] >> 32))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[24] >> 0) & 0xFFFFFFFF) & 1))^(((in[24] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-(((in[24] >> 32)) & 1))^(((in[24] >> 32))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[25] >> 0) & 0xFFFFFFFF) & 1))^(((in[25] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-(((in[25] >> 32)) & 1))^(((in[25] >> 32))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[26] >> 0) & 0xFFFFFFFF) & 1))^(((in[26] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-(((in[26] >> 32)) & 1))^(((in[26] >> 32))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[27] >> 0) & 0xFFFFFFFF) & 1))^(((in[27] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-(((in[27] >> 32)) & 1))^(((in[27] >> 32))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[28] >> 0) & 0xFFFFFFFF) & 1))^(((in[28] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-(((in[28] >> 32)) & 1))^(((in[28] >> 32))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[29] >> 0) & 0xFFFFFFFF) & 1))^(((in[29] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-(((in[29] >> 32)) & 1))^(((in[29] >> 32))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[30] >> 0) & 0xFFFFFFFF) & 1))^(((in[30] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-(((in[30] >> 32)) & 1))^(((in[30] >> 32))>>1))) << ntz + out[60] + out[62] = int64(((-(((in[31] >> 0) & 0xFFFFFFFF) & 1))^(((in[31] >> 0) & 0xFFFFFFFF)>>1))) << ntz + out[61] + out[63] = int64(((-(((in[31] >> 32)) & 1))^(((in[31] >> 32))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_33(initoffset int64, in *[33]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 33) | ((in[1] & 0x3) << 31))) & 1))^((((in[0] >> 33) | ((in[1] & 0x3) << 31)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 2) & 0x1FFFFFFFF) & 1))^(((in[1] >> 2) & 0x1FFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 35) | ((in[2] & 0xF) << 29))) & 1))^((((in[1] >> 35) | ((in[2] & 0xF) << 29)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[2] >> 4) & 0x1FFFFFFFF) & 1))^(((in[2] >> 4) & 0x1FFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[2] >> 37) | ((in[3] & 0x3F) << 27))) & 1))^((((in[2] >> 37) | ((in[3] & 0x3F) << 27)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[3] >> 6) & 0x1FFFFFFFF) & 1))^(((in[3] >> 6) & 0x1FFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[3] >> 39) | ((in[4] & 0xFF) << 25))) & 1))^((((in[3] >> 39) | ((in[4] & 0xFF) << 25)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[4] >> 8) & 0x1FFFFFFFF) & 1))^(((in[4] >> 8) & 0x1FFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[4] >> 41) | ((in[5] & 0x3FF) << 23))) & 1))^((((in[4] >> 41) | ((in[5] & 0x3FF) << 23)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[5] >> 10) & 0x1FFFFFFFF) & 1))^(((in[5] >> 10) & 0x1FFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[5] >> 43) | ((in[6] & 0xFFF) << 21))) & 1))^((((in[5] >> 43) | ((in[6] & 0xFFF) << 21)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[6] >> 12) & 0x1FFFFFFFF) & 1))^(((in[6] >> 12) & 0x1FFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[6] >> 45) | ((in[7] & 0x3FFF) << 19))) & 1))^((((in[6] >> 45) | ((in[7] & 0x3FFF) << 19)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[7] >> 14) & 0x1FFFFFFFF) & 1))^(((in[7] >> 14) & 0x1FFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[7] >> 47) | ((in[8] & 0xFFFF) << 17))) & 1))^((((in[7] >> 47) | ((in[8] & 0xFFFF) << 17)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[8] >> 16) & 0x1FFFFFFFF) & 1))^(((in[8] >> 16) & 0x1FFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[8] >> 49) | ((in[9] & 0x3FFFF) << 15))) & 1))^((((in[8] >> 49) | ((in[9] & 0x3FFFF) << 15)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[9] >> 18) & 0x1FFFFFFFF) & 1))^(((in[9] >> 18) & 0x1FFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[9] >> 51) | ((in[10] & 0xFFFFF) << 13))) & 1))^((((in[9] >> 51) | ((in[10] & 0xFFFFF) << 13)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[10] >> 20) & 0x1FFFFFFFF) & 1))^(((in[10] >> 20) & 0x1FFFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[10] >> 53) | ((in[11] & 0x3FFFFF) << 11))) & 1))^((((in[10] >> 53) | ((in[11] & 0x3FFFFF) << 11)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[11] >> 22) & 0x1FFFFFFFF) & 1))^(((in[11] >> 22) & 0x1FFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[11] >> 55) | ((in[12] & 0xFFFFFF) << 9))) & 1))^((((in[11] >> 55) | ((in[12] & 0xFFFFFF) << 9)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[12] >> 24) & 0x1FFFFFFFF) & 1))^(((in[12] >> 24) & 0x1FFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[12] >> 57) | ((in[13] & 0x3FFFFFF) << 7))) & 1))^((((in[12] >> 57) | ((in[13] & 0x3FFFFFF) << 7)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[13] >> 26) & 0x1FFFFFFFF) & 1))^(((in[13] >> 26) & 0x1FFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[13] >> 59) | ((in[14] & 0xFFFFFFF) << 5))) & 1))^((((in[13] >> 59) | ((in[14] & 0xFFFFFFF) << 5)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[14] >> 28) & 0x1FFFFFFFF) & 1))^(((in[14] >> 28) & 0x1FFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[14] >> 61) | ((in[15] & 0x3FFFFFFF) << 3))) & 1))^((((in[14] >> 61) | ((in[15] & 0x3FFFFFFF) << 3)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[15] >> 30) & 0x1FFFFFFFF) & 1))^(((in[15] >> 30) & 0x1FFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[15] >> 63) | ((in[16] & 0xFFFFFFFF) << 1))) & 1))^((((in[15] >> 63) | ((in[16] & 0xFFFFFFFF) << 1)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[16] >> 32) | ((in[17] & 0x1) << 32))) & 1))^((((in[16] >> 32) | ((in[17] & 0x1) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[17] >> 1) & 0x1FFFFFFFF) & 1))^(((in[17] >> 1) & 0x1FFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[17] >> 34) | ((in[18] & 0x7) << 30))) & 1))^((((in[17] >> 34) | ((in[18] & 0x7) << 30)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[18] >> 3) & 0x1FFFFFFFF) & 1))^(((in[18] >> 3) & 0x1FFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[18] >> 36) | ((in[19] & 0x1F) << 28))) & 1))^((((in[18] >> 36) | ((in[19] & 0x1F) << 28)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[19] >> 5) & 0x1FFFFFFFF) & 1))^(((in[19] >> 5) & 0x1FFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[19] >> 38) | ((in[20] & 0x7F) << 26))) & 1))^((((in[19] >> 38) | ((in[20] & 0x7F) << 26)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[20] >> 7) & 0x1FFFFFFFF) & 1))^(((in[20] >> 7) & 0x1FFFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[20] >> 40) | ((in[21] & 0x1FF) << 24))) & 1))^((((in[20] >> 40) | ((in[21] & 0x1FF) << 24)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[21] >> 9) & 0x1FFFFFFFF) & 1))^(((in[21] >> 9) & 0x1FFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[21] >> 42) | ((in[22] & 0x7FF) << 22))) & 1))^((((in[21] >> 42) | ((in[22] & 0x7FF) << 22)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[22] >> 11) & 0x1FFFFFFFF) & 1))^(((in[22] >> 11) & 0x1FFFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[22] >> 44) | ((in[23] & 0x1FFF) << 20))) & 1))^((((in[22] >> 44) | ((in[23] & 0x1FFF) << 20)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[23] >> 13) & 0x1FFFFFFFF) & 1))^(((in[23] >> 13) & 0x1FFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[23] >> 46) | ((in[24] & 0x7FFF) << 18))) & 1))^((((in[23] >> 46) | ((in[24] & 0x7FFF) << 18)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[24] >> 15) & 0x1FFFFFFFF) & 1))^(((in[24] >> 15) & 0x1FFFFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[24] >> 48) | ((in[25] & 0x1FFFF) << 16))) & 1))^((((in[24] >> 48) | ((in[25] & 0x1FFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[25] >> 17) & 0x1FFFFFFFF) & 1))^(((in[25] >> 17) & 0x1FFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[25] >> 50) | ((in[26] & 0x7FFFF) << 14))) & 1))^((((in[25] >> 50) | ((in[26] & 0x7FFFF) << 14)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[26] >> 19) & 0x1FFFFFFFF) & 1))^(((in[26] >> 19) & 0x1FFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[26] >> 52) | ((in[27] & 0x1FFFFF) << 12))) & 1))^((((in[26] >> 52) | ((in[27] & 0x1FFFFF) << 12)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[27] >> 21) & 0x1FFFFFFFF) & 1))^(((in[27] >> 21) & 0x1FFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[27] >> 54) | ((in[28] & 0x7FFFFF) << 10))) & 1))^((((in[27] >> 54) | ((in[28] & 0x7FFFFF) << 10)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[28] >> 23) & 0x1FFFFFFFF) & 1))^(((in[28] >> 23) & 0x1FFFFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[28] >> 56) | ((in[29] & 0x1FFFFFF) << 8))) & 1))^((((in[28] >> 56) | ((in[29] & 0x1FFFFFF) << 8)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[29] >> 25) & 0x1FFFFFFFF) & 1))^(((in[29] >> 25) & 0x1FFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[29] >> 58) | ((in[30] & 0x7FFFFFF) << 6))) & 1))^((((in[29] >> 58) | ((in[30] & 0x7FFFFFF) << 6)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[30] >> 27) & 0x1FFFFFFFF) & 1))^(((in[30] >> 27) & 0x1FFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[30] >> 60) | ((in[31] & 0x1FFFFFFF) << 4))) & 1))^((((in[30] >> 60) | ((in[31] & 0x1FFFFFFF) << 4)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[31] >> 29) & 0x1FFFFFFFF) & 1))^(((in[31] >> 29) & 0x1FFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[31] >> 62) | ((in[32] & 0x7FFFFFFF) << 2))) & 1))^((((in[31] >> 62) | ((in[32] & 0x7FFFFFFF) << 2)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[32] >> 31)) & 1))^(((in[32] >> 31))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_34(initoffset int64, in *[34]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 34) | ((in[1] & 0xF) << 30))) & 1))^((((in[0] >> 34) | ((in[1] & 0xF) << 30)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 4) & 0x3FFFFFFFF) & 1))^(((in[1] >> 4) & 0x3FFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 38) | ((in[2] & 0xFF) << 26))) & 1))^((((in[1] >> 38) | ((in[2] & 0xFF) << 26)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[2] >> 8) & 0x3FFFFFFFF) & 1))^(((in[2] >> 8) & 0x3FFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[2] >> 42) | ((in[3] & 0xFFF) << 22))) & 1))^((((in[2] >> 42) | ((in[3] & 0xFFF) << 22)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[3] >> 12) & 0x3FFFFFFFF) & 1))^(((in[3] >> 12) & 0x3FFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[3] >> 46) | ((in[4] & 0xFFFF) << 18))) & 1))^((((in[3] >> 46) | ((in[4] & 0xFFFF) << 18)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[4] >> 16) & 0x3FFFFFFFF) & 1))^(((in[4] >> 16) & 0x3FFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[4] >> 50) | ((in[5] & 0xFFFFF) << 14))) & 1))^((((in[4] >> 50) | ((in[5] & 0xFFFFF) << 14)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[5] >> 20) & 0x3FFFFFFFF) & 1))^(((in[5] >> 20) & 0x3FFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[5] >> 54) | ((in[6] & 0xFFFFFF) << 10))) & 1))^((((in[5] >> 54) | ((in[6] & 0xFFFFFF) << 10)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[6] >> 24) & 0x3FFFFFFFF) & 1))^(((in[6] >> 24) & 0x3FFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[6] >> 58) | ((in[7] & 0xFFFFFFF) << 6))) & 1))^((((in[6] >> 58) | ((in[7] & 0xFFFFFFF) << 6)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[7] >> 28) & 0x3FFFFFFFF) & 1))^(((in[7] >> 28) & 0x3FFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[7] >> 62) | ((in[8] & 0xFFFFFFFF) << 2))) & 1))^((((in[7] >> 62) | ((in[8] & 0xFFFFFFFF) << 2)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[8] >> 32) | ((in[9] & 0x3) << 32))) & 1))^((((in[8] >> 32) | ((in[9] & 0x3) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[9] >> 2) & 0x3FFFFFFFF) & 1))^(((in[9] >> 2) & 0x3FFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[9] >> 36) | ((in[10] & 0x3F) << 28))) & 1))^((((in[9] >> 36) | ((in[10] & 0x3F) << 28)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[10] >> 6) & 0x3FFFFFFFF) & 1))^(((in[10] >> 6) & 0x3FFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[10] >> 40) | ((in[11] & 0x3FF) << 24))) & 1))^((((in[10] >> 40) | ((in[11] & 0x3FF) << 24)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[11] >> 10) & 0x3FFFFFFFF) & 1))^(((in[11] >> 10) & 0x3FFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[11] >> 44) | ((in[12] & 0x3FFF) << 20))) & 1))^((((in[11] >> 44) | ((in[12] & 0x3FFF) << 20)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[12] >> 14) & 0x3FFFFFFFF) & 1))^(((in[12] >> 14) & 0x3FFFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[12] >> 48) | ((in[13] & 0x3FFFF) << 16))) & 1))^((((in[12] >> 48) | ((in[13] & 0x3FFFF) << 16)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[13] >> 18) & 0x3FFFFFFFF) & 1))^(((in[13] >> 18) & 0x3FFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[13] >> 52) | ((in[14] & 0x3FFFFF) << 12))) & 1))^((((in[13] >> 52) | ((in[14] & 0x3FFFFF) << 12)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[14] >> 22) & 0x3FFFFFFFF) & 1))^(((in[14] >> 22) & 0x3FFFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[14] >> 56) | ((in[15] & 0x3FFFFFF) << 8))) & 1))^((((in[14] >> 56) | ((in[15] & 0x3FFFFFF) << 8)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[15] >> 26) & 0x3FFFFFFFF) & 1))^(((in[15] >> 26) & 0x3FFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[15] >> 60) | ((in[16] & 0x3FFFFFFF) << 4))) & 1))^((((in[15] >> 60) | ((in[16] & 0x3FFFFFFF) << 4)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[16] >> 30)) & 1))^(((in[16] >> 30))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[17] >> 0) & 0x3FFFFFFFF) & 1))^(((in[17] >> 0) & 0x3FFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[17] >> 34) | ((in[18] & 0xF) << 30))) & 1))^((((in[17] >> 34) | ((in[18] & 0xF) << 30)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[18] >> 4) & 0x3FFFFFFFF) & 1))^(((in[18] >> 4) & 0x3FFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[18] >> 38) | ((in[19] & 0xFF) << 26))) & 1))^((((in[18] >> 38) | ((in[19] & 0xFF) << 26)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[19] >> 8) & 0x3FFFFFFFF) & 1))^(((in[19] >> 8) & 0x3FFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[19] >> 42) | ((in[20] & 0xFFF) << 22))) & 1))^((((in[19] >> 42) | ((in[20] & 0xFFF) << 22)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[20] >> 12) & 0x3FFFFFFFF) & 1))^(((in[20] >> 12) & 0x3FFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[20] >> 46) | ((in[21] & 0xFFFF) << 18))) & 1))^((((in[20] >> 46) | ((in[21] & 0xFFFF) << 18)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[21] >> 16) & 0x3FFFFFFFF) & 1))^(((in[21] >> 16) & 0x3FFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[21] >> 50) | ((in[22] & 0xFFFFF) << 14))) & 1))^((((in[21] >> 50) | ((in[22] & 0xFFFFF) << 14)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[22] >> 20) & 0x3FFFFFFFF) & 1))^(((in[22] >> 20) & 0x3FFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[22] >> 54) | ((in[23] & 0xFFFFFF) << 10))) & 1))^((((in[22] >> 54) | ((in[23] & 0xFFFFFF) << 10)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[23] >> 24) & 0x3FFFFFFFF) & 1))^(((in[23] >> 24) & 0x3FFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[23] >> 58) | ((in[24] & 0xFFFFFFF) << 6))) & 1))^((((in[23] >> 58) | ((in[24] & 0xFFFFFFF) << 6)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[24] >> 28) & 0x3FFFFFFFF) & 1))^(((in[24] >> 28) & 0x3FFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[24] >> 62) | ((in[25] & 0xFFFFFFFF) << 2))) & 1))^((((in[24] >> 62) | ((in[25] & 0xFFFFFFFF) << 2)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[25] >> 32) | ((in[26] & 0x3) << 32))) & 1))^((((in[25] >> 32) | ((in[26] & 0x3) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[26] >> 2) & 0x3FFFFFFFF) & 1))^(((in[26] >> 2) & 0x3FFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[26] >> 36) | ((in[27] & 0x3F) << 28))) & 1))^((((in[26] >> 36) | ((in[27] & 0x3F) << 28)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[27] >> 6) & 0x3FFFFFFFF) & 1))^(((in[27] >> 6) & 0x3FFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[27] >> 40) | ((in[28] & 0x3FF) << 24))) & 1))^((((in[27] >> 40) | ((in[28] & 0x3FF) << 24)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[28] >> 10) & 0x3FFFFFFFF) & 1))^(((in[28] >> 10) & 0x3FFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[28] >> 44) | ((in[29] & 0x3FFF) << 20))) & 1))^((((in[28] >> 44) | ((in[29] & 0x3FFF) << 20)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[29] >> 14) & 0x3FFFFFFFF) & 1))^(((in[29] >> 14) & 0x3FFFFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[29] >> 48) | ((in[30] & 0x3FFFF) << 16))) & 1))^((((in[29] >> 48) | ((in[30] & 0x3FFFF) << 16)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[30] >> 18) & 0x3FFFFFFFF) & 1))^(((in[30] >> 18) & 0x3FFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[30] >> 52) | ((in[31] & 0x3FFFFF) << 12))) & 1))^((((in[30] >> 52) | ((in[31] & 0x3FFFFF) << 12)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[31] >> 22) & 0x3FFFFFFFF) & 1))^(((in[31] >> 22) & 0x3FFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[31] >> 56) | ((in[32] & 0x3FFFFFF) << 8))) & 1))^((((in[31] >> 56) | ((in[32] & 0x3FFFFFF) << 8)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[32] >> 26) & 0x3FFFFFFFF) & 1))^(((in[32] >> 26) & 0x3FFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[32] >> 60) | ((in[33] & 0x3FFFFFFF) << 4))) & 1))^((((in[32] >> 60) | ((in[33] & 0x3FFFFFFF) << 4)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[33] >> 30)) & 1))^(((in[33] >> 30))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_35(initoffset int64, in *[35]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 35) | ((in[1] & 0x3F) << 29))) & 1))^((((in[0] >> 35) | ((in[1] & 0x3F) << 29)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 6) & 0x7FFFFFFFF) & 1))^(((in[1] >> 6) & 0x7FFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 41) | ((in[2] & 0xFFF) << 23))) & 1))^((((in[1] >> 41) | ((in[2] & 0xFFF) << 23)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[2] >> 12) & 0x7FFFFFFFF) & 1))^(((in[2] >> 12) & 0x7FFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[2] >> 47) | ((in[3] & 0x3FFFF) << 17))) & 1))^((((in[2] >> 47) | ((in[3] & 0x3FFFF) << 17)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[3] >> 18) & 0x7FFFFFFFF) & 1))^(((in[3] >> 18) & 0x7FFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[3] >> 53) | ((in[4] & 0xFFFFFF) << 11))) & 1))^((((in[3] >> 53) | ((in[4] & 0xFFFFFF) << 11)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[4] >> 24) & 0x7FFFFFFFF) & 1))^(((in[4] >> 24) & 0x7FFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[4] >> 59) | ((in[5] & 0x3FFFFFFF) << 5))) & 1))^((((in[4] >> 59) | ((in[5] & 0x3FFFFFFF) << 5)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[5] >> 30) | ((in[6] & 0x1) << 34))) & 1))^((((in[5] >> 30) | ((in[6] & 0x1) << 34)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[6] >> 1) & 0x7FFFFFFFF) & 1))^(((in[6] >> 1) & 0x7FFFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[6] >> 36) | ((in[7] & 0x7F) << 28))) & 1))^((((in[6] >> 36) | ((in[7] & 0x7F) << 28)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[7] >> 7) & 0x7FFFFFFFF) & 1))^(((in[7] >> 7) & 0x7FFFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[7] >> 42) | ((in[8] & 0x1FFF) << 22))) & 1))^((((in[7] >> 42) | ((in[8] & 0x1FFF) << 22)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[8] >> 13) & 0x7FFFFFFFF) & 1))^(((in[8] >> 13) & 0x7FFFFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[8] >> 48) | ((in[9] & 0x7FFFF) << 16))) & 1))^((((in[8] >> 48) | ((in[9] & 0x7FFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[9] >> 19) & 0x7FFFFFFFF) & 1))^(((in[9] >> 19) & 0x7FFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[9] >> 54) | ((in[10] & 0x1FFFFFF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0x1FFFFFF) << 10)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[10] >> 25) & 0x7FFFFFFFF) & 1))^(((in[10] >> 25) & 0x7FFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[10] >> 60) | ((in[11] & 0x7FFFFFFF) << 4))) & 1))^((((in[10] >> 60) | ((in[11] & 0x7FFFFFFF) << 4)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[11] >> 31) | ((in[12] & 0x3) << 33))) & 1))^((((in[11] >> 31) | ((in[12] & 0x3) << 33)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[12] >> 2) & 0x7FFFFFFFF) & 1))^(((in[12] >> 2) & 0x7FFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[12] >> 37) | ((in[13] & 0xFF) << 27))) & 1))^((((in[12] >> 37) | ((in[13] & 0xFF) << 27)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[13] >> 8) & 0x7FFFFFFFF) & 1))^(((in[13] >> 8) & 0x7FFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[13] >> 43) | ((in[14] & 0x3FFF) << 21))) & 1))^((((in[13] >> 43) | ((in[14] & 0x3FFF) << 21)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[14] >> 14) & 0x7FFFFFFFF) & 1))^(((in[14] >> 14) & 0x7FFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[14] >> 49) | ((in[15] & 0xFFFFF) << 15))) & 1))^((((in[14] >> 49) | ((in[15] & 0xFFFFF) << 15)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[15] >> 20) & 0x7FFFFFFFF) & 1))^(((in[15] >> 20) & 0x7FFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[15] >> 55) | ((in[16] & 0x3FFFFFF) << 9))) & 1))^((((in[15] >> 55) | ((in[16] & 0x3FFFFFF) << 9)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[16] >> 26) & 0x7FFFFFFFF) & 1))^(((in[16] >> 26) & 0x7FFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[16] >> 61) | ((in[17] & 0xFFFFFFFF) << 3))) & 1))^((((in[16] >> 61) | ((in[17] & 0xFFFFFFFF) << 3)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[17] >> 32) | ((in[18] & 0x7) << 32))) & 1))^((((in[17] >> 32) | ((in[18] & 0x7) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[18] >> 3) & 0x7FFFFFFFF) & 1))^(((in[18] >> 3) & 0x7FFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[18] >> 38) | ((in[19] & 0x1FF) << 26))) & 1))^((((in[18] >> 38) | ((in[19] & 0x1FF) << 26)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[19] >> 9) & 0x7FFFFFFFF) & 1))^(((in[19] >> 9) & 0x7FFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[19] >> 44) | ((in[20] & 0x7FFF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0x7FFF) << 20)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[20] >> 15) & 0x7FFFFFFFF) & 1))^(((in[20] >> 15) & 0x7FFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[20] >> 50) | ((in[21] & 0x1FFFFF) << 14))) & 1))^((((in[20] >> 50) | ((in[21] & 0x1FFFFF) << 14)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[21] >> 21) & 0x7FFFFFFFF) & 1))^(((in[21] >> 21) & 0x7FFFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[21] >> 56) | ((in[22] & 0x7FFFFFF) << 8))) & 1))^((((in[21] >> 56) | ((in[22] & 0x7FFFFFF) << 8)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[22] >> 27) & 0x7FFFFFFFF) & 1))^(((in[22] >> 27) & 0x7FFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[22] >> 62) | ((in[23] & 0x1FFFFFFFF) << 2))) & 1))^((((in[22] >> 62) | ((in[23] & 0x1FFFFFFFF) << 2)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[23] >> 33) | ((in[24] & 0xF) << 31))) & 1))^((((in[23] >> 33) | ((in[24] & 0xF) << 31)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[24] >> 4) & 0x7FFFFFFFF) & 1))^(((in[24] >> 4) & 0x7FFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[24] >> 39) | ((in[25] & 0x3FF) << 25))) & 1))^((((in[24] >> 39) | ((in[25] & 0x3FF) << 25)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[25] >> 10) & 0x7FFFFFFFF) & 1))^(((in[25] >> 10) & 0x7FFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[25] >> 45) | ((in[26] & 0xFFFF) << 19))) & 1))^((((in[25] >> 45) | ((in[26] & 0xFFFF) << 19)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[26] >> 16) & 0x7FFFFFFFF) & 1))^(((in[26] >> 16) & 0x7FFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[26] >> 51) | ((in[27] & 0x3FFFFF) << 13))) & 1))^((((in[26] >> 51) | ((in[27] & 0x3FFFFF) << 13)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[27] >> 22) & 0x7FFFFFFFF) & 1))^(((in[27] >> 22) & 0x7FFFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[27] >> 57) | ((in[28] & 0xFFFFFFF) << 7))) & 1))^((((in[27] >> 57) | ((in[28] & 0xFFFFFFF) << 7)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[28] >> 28) & 0x7FFFFFFFF) & 1))^(((in[28] >> 28) & 0x7FFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[28] >> 63) | ((in[29] & 0x3FFFFFFFF) << 1))) & 1))^((((in[28] >> 63) | ((in[29] & 0x3FFFFFFFF) << 1)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[29] >> 34) | ((in[30] & 0x1F) << 30))) & 1))^((((in[29] >> 34) | ((in[30] & 0x1F) << 30)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[30] >> 5) & 0x7FFFFFFFF) & 1))^(((in[30] >> 5) & 0x7FFFFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[30] >> 40) | ((in[31] & 0x7FF) << 24))) & 1))^((((in[30] >> 40) | ((in[31] & 0x7FF) << 24)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[31] >> 11) & 0x7FFFFFFFF) & 1))^(((in[31] >> 11) & 0x7FFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[31] >> 46) | ((in[32] & 0x1FFFF) << 18))) & 1))^((((in[31] >> 46) | ((in[32] & 0x1FFFF) << 18)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[32] >> 17) & 0x7FFFFFFFF) & 1))^(((in[32] >> 17) & 0x7FFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[32] >> 52) | ((in[33] & 0x7FFFFF) << 12))) & 1))^((((in[32] >> 52) | ((in[33] & 0x7FFFFF) << 12)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[33] >> 23) & 0x7FFFFFFFF) & 1))^(((in[33] >> 23) & 0x7FFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[33] >> 58) | ((in[34] & 0x1FFFFFFF) << 6))) & 1))^((((in[33] >> 58) | ((in[34] & 0x1FFFFFFF) << 6)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[34] >> 29)) & 1))^(((in[34] >> 29))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_36(initoffset int64, in *[36]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 36) | ((in[1] & 0xFF) << 28))) & 1))^((((in[0] >> 36) | ((in[1] & 0xFF) << 28)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 8) & 0xFFFFFFFFF) & 1))^(((in[1] >> 8) & 0xFFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 44) | ((in[2] & 0xFFFF) << 20))) & 1))^((((in[1] >> 44) | ((in[2] & 0xFFFF) << 20)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[2] >> 16) & 0xFFFFFFFFF) & 1))^(((in[2] >> 16) & 0xFFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[2] >> 52) | ((in[3] & 0xFFFFFF) << 12))) & 1))^((((in[2] >> 52) | ((in[3] & 0xFFFFFF) << 12)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[3] >> 24) & 0xFFFFFFFFF) & 1))^(((in[3] >> 24) & 0xFFFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[3] >> 60) | ((in[4] & 0xFFFFFFFF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0xFFFFFFFF) << 4)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[4] >> 32) | ((in[5] & 0xF) << 32))) & 1))^((((in[4] >> 32) | ((in[5] & 0xF) << 32)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[5] >> 4) & 0xFFFFFFFFF) & 1))^(((in[5] >> 4) & 0xFFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[5] >> 40) | ((in[6] & 0xFFF) << 24))) & 1))^((((in[5] >> 40) | ((in[6] & 0xFFF) << 24)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[6] >> 12) & 0xFFFFFFFFF) & 1))^(((in[6] >> 12) & 0xFFFFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[6] >> 48) | ((in[7] & 0xFFFFF) << 16))) & 1))^((((in[6] >> 48) | ((in[7] & 0xFFFFF) << 16)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[7] >> 20) & 0xFFFFFFFFF) & 1))^(((in[7] >> 20) & 0xFFFFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[7] >> 56) | ((in[8] & 0xFFFFFFF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0xFFFFFFF) << 8)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[8] >> 28)) & 1))^(((in[8] >> 28))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[9] >> 0) & 0xFFFFFFFFF) & 1))^(((in[9] >> 0) & 0xFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[9] >> 36) | ((in[10] & 0xFF) << 28))) & 1))^((((in[9] >> 36) | ((in[10] & 0xFF) << 28)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[10] >> 8) & 0xFFFFFFFFF) & 1))^(((in[10] >> 8) & 0xFFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[10] >> 44) | ((in[11] & 0xFFFF) << 20))) & 1))^((((in[10] >> 44) | ((in[11] & 0xFFFF) << 20)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[11] >> 16) & 0xFFFFFFFFF) & 1))^(((in[11] >> 16) & 0xFFFFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[11] >> 52) | ((in[12] & 0xFFFFFF) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0xFFFFFF) << 12)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[12] >> 24) & 0xFFFFFFFFF) & 1))^(((in[12] >> 24) & 0xFFFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[12] >> 60) | ((in[13] & 0xFFFFFFFF) << 4))) & 1))^((((in[12] >> 60) | ((in[13] & 0xFFFFFFFF) << 4)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[13] >> 32) | ((in[14] & 0xF) << 32))) & 1))^((((in[13] >> 32) | ((in[14] & 0xF) << 32)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[14] >> 4) & 0xFFFFFFFFF) & 1))^(((in[14] >> 4) & 0xFFFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[14] >> 40) | ((in[15] & 0xFFF) << 24))) & 1))^((((in[14] >> 40) | ((in[15] & 0xFFF) << 24)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[15] >> 12) & 0xFFFFFFFFF) & 1))^(((in[15] >> 12) & 0xFFFFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[15] >> 48) | ((in[16] & 0xFFFFF) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0xFFFFF) << 16)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[16] >> 20) & 0xFFFFFFFFF) & 1))^(((in[16] >> 20) & 0xFFFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[16] >> 56) | ((in[17] & 0xFFFFFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0xFFFFFFF) << 8)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[17] >> 28)) & 1))^(((in[17] >> 28))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[18] >> 0) & 0xFFFFFFFFF) & 1))^(((in[18] >> 0) & 0xFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[18] >> 36) | ((in[19] & 0xFF) << 28))) & 1))^((((in[18] >> 36) | ((in[19] & 0xFF) << 28)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[19] >> 8) & 0xFFFFFFFFF) & 1))^(((in[19] >> 8) & 0xFFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[19] >> 44) | ((in[20] & 0xFFFF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0xFFFF) << 20)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[20] >> 16) & 0xFFFFFFFFF) & 1))^(((in[20] >> 16) & 0xFFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[20] >> 52) | ((in[21] & 0xFFFFFF) << 12))) & 1))^((((in[20] >> 52) | ((in[21] & 0xFFFFFF) << 12)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[21] >> 24) & 0xFFFFFFFFF) & 1))^(((in[21] >> 24) & 0xFFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[21] >> 60) | ((in[22] & 0xFFFFFFFF) << 4))) & 1))^((((in[21] >> 60) | ((in[22] & 0xFFFFFFFF) << 4)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[22] >> 32) | ((in[23] & 0xF) << 32))) & 1))^((((in[22] >> 32) | ((in[23] & 0xF) << 32)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[23] >> 4) & 0xFFFFFFFFF) & 1))^(((in[23] >> 4) & 0xFFFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[23] >> 40) | ((in[24] & 0xFFF) << 24))) & 1))^((((in[23] >> 40) | ((in[24] & 0xFFF) << 24)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[24] >> 12) & 0xFFFFFFFFF) & 1))^(((in[24] >> 12) & 0xFFFFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[24] >> 48) | ((in[25] & 0xFFFFF) << 16))) & 1))^((((in[24] >> 48) | ((in[25] & 0xFFFFF) << 16)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[25] >> 20) & 0xFFFFFFFFF) & 1))^(((in[25] >> 20) & 0xFFFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[25] >> 56) | ((in[26] & 0xFFFFFFF) << 8))) & 1))^((((in[25] >> 56) | ((in[26] & 0xFFFFFFF) << 8)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[26] >> 28)) & 1))^(((in[26] >> 28))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[27] >> 0) & 0xFFFFFFFFF) & 1))^(((in[27] >> 0) & 0xFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[27] >> 36) | ((in[28] & 0xFF) << 28))) & 1))^((((in[27] >> 36) | ((in[28] & 0xFF) << 28)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[28] >> 8) & 0xFFFFFFFFF) & 1))^(((in[28] >> 8) & 0xFFFFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[28] >> 44) | ((in[29] & 0xFFFF) << 20))) & 1))^((((in[28] >> 44) | ((in[29] & 0xFFFF) << 20)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[29] >> 16) & 0xFFFFFFFFF) & 1))^(((in[29] >> 16) & 0xFFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[29] >> 52) | ((in[30] & 0xFFFFFF) << 12))) & 1))^((((in[29] >> 52) | ((in[30] & 0xFFFFFF) << 12)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[30] >> 24) & 0xFFFFFFFFF) & 1))^(((in[30] >> 24) & 0xFFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[30] >> 60) | ((in[31] & 0xFFFFFFFF) << 4))) & 1))^((((in[30] >> 60) | ((in[31] & 0xFFFFFFFF) << 4)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[31] >> 32) | ((in[32] & 0xF) << 32))) & 1))^((((in[31] >> 32) | ((in[32] & 0xF) << 32)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[32] >> 4) & 0xFFFFFFFFF) & 1))^(((in[32] >> 4) & 0xFFFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[32] >> 40) | ((in[33] & 0xFFF) << 24))) & 1))^((((in[32] >> 40) | ((in[33] & 0xFFF) << 24)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[33] >> 12) & 0xFFFFFFFFF) & 1))^(((in[33] >> 12) & 0xFFFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[33] >> 48) | ((in[34] & 0xFFFFF) << 16))) & 1))^((((in[33] >> 48) | ((in[34] & 0xFFFFF) << 16)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[34] >> 20) & 0xFFFFFFFFF) & 1))^(((in[34] >> 20) & 0xFFFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[34] >> 56) | ((in[35] & 0xFFFFFFF) << 8))) & 1))^((((in[34] >> 56) | ((in[35] & 0xFFFFFFF) << 8)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[35] >> 28)) & 1))^(((in[35] >> 28))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_37(initoffset int64, in *[37]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 37) | ((in[1] & 0x3FF) << 27))) & 1))^((((in[0] >> 37) | ((in[1] & 0x3FF) << 27)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 10) & 0x1FFFFFFFFF) & 1))^(((in[1] >> 10) & 0x1FFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 47) | ((in[2] & 0xFFFFF) << 17))) & 1))^((((in[1] >> 47) | ((in[2] & 0xFFFFF) << 17)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[2] >> 20) & 0x1FFFFFFFFF) & 1))^(((in[2] >> 20) & 0x1FFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[2] >> 57) | ((in[3] & 0x3FFFFFFF) << 7))) & 1))^((((in[2] >> 57) | ((in[3] & 0x3FFFFFFF) << 7)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[3] >> 30) | ((in[4] & 0x7) << 34))) & 1))^((((in[3] >> 30) | ((in[4] & 0x7) << 34)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[4] >> 3) & 0x1FFFFFFFFF) & 1))^(((in[4] >> 3) & 0x1FFFFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[4] >> 40) | ((in[5] & 0x1FFF) << 24))) & 1))^((((in[4] >> 40) | ((in[5] & 0x1FFF) << 24)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[5] >> 13) & 0x1FFFFFFFFF) & 1))^(((in[5] >> 13) & 0x1FFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[5] >> 50) | ((in[6] & 0x7FFFFF) << 14))) & 1))^((((in[5] >> 50) | ((in[6] & 0x7FFFFF) << 14)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[6] >> 23) & 0x1FFFFFFFFF) & 1))^(((in[6] >> 23) & 0x1FFFFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[6] >> 60) | ((in[7] & 0x1FFFFFFFF) << 4))) & 1))^((((in[6] >> 60) | ((in[7] & 0x1FFFFFFFF) << 4)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[7] >> 33) | ((in[8] & 0x3F) << 31))) & 1))^((((in[7] >> 33) | ((in[8] & 0x3F) << 31)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[8] >> 6) & 0x1FFFFFFFFF) & 1))^(((in[8] >> 6) & 0x1FFFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[8] >> 43) | ((in[9] & 0xFFFF) << 21))) & 1))^((((in[8] >> 43) | ((in[9] & 0xFFFF) << 21)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[9] >> 16) & 0x1FFFFFFFFF) & 1))^(((in[9] >> 16) & 0x1FFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[9] >> 53) | ((in[10] & 0x3FFFFFF) << 11))) & 1))^((((in[9] >> 53) | ((in[10] & 0x3FFFFFF) << 11)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[10] >> 26) & 0x1FFFFFFFFF) & 1))^(((in[10] >> 26) & 0x1FFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[10] >> 63) | ((in[11] & 0xFFFFFFFFF) << 1))) & 1))^((((in[10] >> 63) | ((in[11] & 0xFFFFFFFFF) << 1)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[11] >> 36) | ((in[12] & 0x1FF) << 28))) & 1))^((((in[11] >> 36) | ((in[12] & 0x1FF) << 28)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[12] >> 9) & 0x1FFFFFFFFF) & 1))^(((in[12] >> 9) & 0x1FFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[12] >> 46) | ((in[13] & 0x7FFFF) << 18))) & 1))^((((in[12] >> 46) | ((in[13] & 0x7FFFF) << 18)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[13] >> 19) & 0x1FFFFFFFFF) & 1))^(((in[13] >> 19) & 0x1FFFFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[13] >> 56) | ((in[14] & 0x1FFFFFFF) << 8))) & 1))^((((in[13] >> 56) | ((in[14] & 0x1FFFFFFF) << 8)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[14] >> 29) | ((in[15] & 0x3) << 35))) & 1))^((((in[14] >> 29) | ((in[15] & 0x3) << 35)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[15] >> 2) & 0x1FFFFFFFFF) & 1))^(((in[15] >> 2) & 0x1FFFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[15] >> 39) | ((in[16] & 0xFFF) << 25))) & 1))^((((in[15] >> 39) | ((in[16] & 0xFFF) << 25)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[16] >> 12) & 0x1FFFFFFFFF) & 1))^(((in[16] >> 12) & 0x1FFFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[16] >> 49) | ((in[17] & 0x3FFFFF) << 15))) & 1))^((((in[16] >> 49) | ((in[17] & 0x3FFFFF) << 15)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[17] >> 22) & 0x1FFFFFFFFF) & 1))^(((in[17] >> 22) & 0x1FFFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[17] >> 59) | ((in[18] & 0xFFFFFFFF) << 5))) & 1))^((((in[17] >> 59) | ((in[18] & 0xFFFFFFFF) << 5)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[18] >> 32) | ((in[19] & 0x1F) << 32))) & 1))^((((in[18] >> 32) | ((in[19] & 0x1F) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[19] >> 5) & 0x1FFFFFFFFF) & 1))^(((in[19] >> 5) & 0x1FFFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[19] >> 42) | ((in[20] & 0x7FFF) << 22))) & 1))^((((in[19] >> 42) | ((in[20] & 0x7FFF) << 22)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[20] >> 15) & 0x1FFFFFFFFF) & 1))^(((in[20] >> 15) & 0x1FFFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[20] >> 52) | ((in[21] & 0x1FFFFFF) << 12))) & 1))^((((in[20] >> 52) | ((in[21] & 0x1FFFFFF) << 12)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[21] >> 25) & 0x1FFFFFFFFF) & 1))^(((in[21] >> 25) & 0x1FFFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[21] >> 62) | ((in[22] & 0x7FFFFFFFF) << 2))) & 1))^((((in[21] >> 62) | ((in[22] & 0x7FFFFFFFF) << 2)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[22] >> 35) | ((in[23] & 0xFF) << 29))) & 1))^((((in[22] >> 35) | ((in[23] & 0xFF) << 29)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[23] >> 8) & 0x1FFFFFFFFF) & 1))^(((in[23] >> 8) & 0x1FFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[23] >> 45) | ((in[24] & 0x3FFFF) << 19))) & 1))^((((in[23] >> 45) | ((in[24] & 0x3FFFF) << 19)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[24] >> 18) & 0x1FFFFFFFFF) & 1))^(((in[24] >> 18) & 0x1FFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[24] >> 55) | ((in[25] & 0xFFFFFFF) << 9))) & 1))^((((in[24] >> 55) | ((in[25] & 0xFFFFFFF) << 9)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[25] >> 28) | ((in[26] & 0x1) << 36))) & 1))^((((in[25] >> 28) | ((in[26] & 0x1) << 36)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[26] >> 1) & 0x1FFFFFFFFF) & 1))^(((in[26] >> 1) & 0x1FFFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[26] >> 38) | ((in[27] & 0x7FF) << 26))) & 1))^((((in[26] >> 38) | ((in[27] & 0x7FF) << 26)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[27] >> 11) & 0x1FFFFFFFFF) & 1))^(((in[27] >> 11) & 0x1FFFFFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[27] >> 48) | ((in[28] & 0x1FFFFF) << 16))) & 1))^((((in[27] >> 48) | ((in[28] & 0x1FFFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[28] >> 21) & 0x1FFFFFFFFF) & 1))^(((in[28] >> 21) & 0x1FFFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[28] >> 58) | ((in[29] & 0x7FFFFFFF) << 6))) & 1))^((((in[28] >> 58) | ((in[29] & 0x7FFFFFFF) << 6)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[29] >> 31) | ((in[30] & 0xF) << 33))) & 1))^((((in[29] >> 31) | ((in[30] & 0xF) << 33)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[30] >> 4) & 0x1FFFFFFFFF) & 1))^(((in[30] >> 4) & 0x1FFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[30] >> 41) | ((in[31] & 0x3FFF) << 23))) & 1))^((((in[30] >> 41) | ((in[31] & 0x3FFF) << 23)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[31] >> 14) & 0x1FFFFFFFFF) & 1))^(((in[31] >> 14) & 0x1FFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[31] >> 51) | ((in[32] & 0xFFFFFF) << 13))) & 1))^((((in[31] >> 51) | ((in[32] & 0xFFFFFF) << 13)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[32] >> 24) & 0x1FFFFFFFFF) & 1))^(((in[32] >> 24) & 0x1FFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[32] >> 61) | ((in[33] & 0x3FFFFFFFF) << 3))) & 1))^((((in[32] >> 61) | ((in[33] & 0x3FFFFFFFF) << 3)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[33] >> 34) | ((in[34] & 0x7F) << 30))) & 1))^((((in[33] >> 34) | ((in[34] & 0x7F) << 30)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[34] >> 7) & 0x1FFFFFFFFF) & 1))^(((in[34] >> 7) & 0x1FFFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[34] >> 44) | ((in[35] & 0x1FFFF) << 20))) & 1))^((((in[34] >> 44) | ((in[35] & 0x1FFFF) << 20)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[35] >> 17) & 0x1FFFFFFFFF) & 1))^(((in[35] >> 17) & 0x1FFFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[35] >> 54) | ((in[36] & 0x7FFFFFF) << 10))) & 1))^((((in[35] >> 54) | ((in[36] & 0x7FFFFFF) << 10)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[36] >> 27)) & 1))^(((in[36] >> 27))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_38(initoffset int64, in *[38]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 38) | ((in[1] & 0xFFF) << 26))) & 1))^((((in[0] >> 38) | ((in[1] & 0xFFF) << 26)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 12) & 0x3FFFFFFFFF) & 1))^(((in[1] >> 12) & 0x3FFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 50) | ((in[2] & 0xFFFFFF) << 14))) & 1))^((((in[1] >> 50) | ((in[2] & 0xFFFFFF) << 14)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[2] >> 24) & 0x3FFFFFFFFF) & 1))^(((in[2] >> 24) & 0x3FFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[2] >> 62) | ((in[3] & 0xFFFFFFFFF) << 2))) & 1))^((((in[2] >> 62) | ((in[3] & 0xFFFFFFFFF) << 2)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[3] >> 36) | ((in[4] & 0x3FF) << 28))) & 1))^((((in[3] >> 36) | ((in[4] & 0x3FF) << 28)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[4] >> 10) & 0x3FFFFFFFFF) & 1))^(((in[4] >> 10) & 0x3FFFFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[4] >> 48) | ((in[5] & 0x3FFFFF) << 16))) & 1))^((((in[4] >> 48) | ((in[5] & 0x3FFFFF) << 16)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[5] >> 22) & 0x3FFFFFFFFF) & 1))^(((in[5] >> 22) & 0x3FFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[5] >> 60) | ((in[6] & 0x3FFFFFFFF) << 4))) & 1))^((((in[5] >> 60) | ((in[6] & 0x3FFFFFFFF) << 4)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[6] >> 34) | ((in[7] & 0xFF) << 30))) & 1))^((((in[6] >> 34) | ((in[7] & 0xFF) << 30)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[7] >> 8) & 0x3FFFFFFFFF) & 1))^(((in[7] >> 8) & 0x3FFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[7] >> 46) | ((in[8] & 0xFFFFF) << 18))) & 1))^((((in[7] >> 46) | ((in[8] & 0xFFFFF) << 18)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[8] >> 20) & 0x3FFFFFFFFF) & 1))^(((in[8] >> 20) & 0x3FFFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[8] >> 58) | ((in[9] & 0xFFFFFFFF) << 6))) & 1))^((((in[8] >> 58) | ((in[9] & 0xFFFFFFFF) << 6)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[9] >> 32) | ((in[10] & 0x3F) << 32))) & 1))^((((in[9] >> 32) | ((in[10] & 0x3F) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[10] >> 6) & 0x3FFFFFFFFF) & 1))^(((in[10] >> 6) & 0x3FFFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[10] >> 44) | ((in[11] & 0x3FFFF) << 20))) & 1))^((((in[10] >> 44) | ((in[11] & 0x3FFFF) << 20)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[11] >> 18) & 0x3FFFFFFFFF) & 1))^(((in[11] >> 18) & 0x3FFFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[11] >> 56) | ((in[12] & 0x3FFFFFFF) << 8))) & 1))^((((in[11] >> 56) | ((in[12] & 0x3FFFFFFF) << 8)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[12] >> 30) | ((in[13] & 0xF) << 34))) & 1))^((((in[12] >> 30) | ((in[13] & 0xF) << 34)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[13] >> 4) & 0x3FFFFFFFFF) & 1))^(((in[13] >> 4) & 0x3FFFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[13] >> 42) | ((in[14] & 0xFFFF) << 22))) & 1))^((((in[13] >> 42) | ((in[14] & 0xFFFF) << 22)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[14] >> 16) & 0x3FFFFFFFFF) & 1))^(((in[14] >> 16) & 0x3FFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[14] >> 54) | ((in[15] & 0xFFFFFFF) << 10))) & 1))^((((in[14] >> 54) | ((in[15] & 0xFFFFFFF) << 10)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[15] >> 28) | ((in[16] & 0x3) << 36))) & 1))^((((in[15] >> 28) | ((in[16] & 0x3) << 36)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[16] >> 2) & 0x3FFFFFFFFF) & 1))^(((in[16] >> 2) & 0x3FFFFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[16] >> 40) | ((in[17] & 0x3FFF) << 24))) & 1))^((((in[16] >> 40) | ((in[17] & 0x3FFF) << 24)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[17] >> 14) & 0x3FFFFFFFFF) & 1))^(((in[17] >> 14) & 0x3FFFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[17] >> 52) | ((in[18] & 0x3FFFFFF) << 12))) & 1))^((((in[17] >> 52) | ((in[18] & 0x3FFFFFF) << 12)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[18] >> 26)) & 1))^(((in[18] >> 26))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[19] >> 0) & 0x3FFFFFFFFF) & 1))^(((in[19] >> 0) & 0x3FFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[19] >> 38) | ((in[20] & 0xFFF) << 26))) & 1))^((((in[19] >> 38) | ((in[20] & 0xFFF) << 26)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[20] >> 12) & 0x3FFFFFFFFF) & 1))^(((in[20] >> 12) & 0x3FFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[20] >> 50) | ((in[21] & 0xFFFFFF) << 14))) & 1))^((((in[20] >> 50) | ((in[21] & 0xFFFFFF) << 14)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[21] >> 24) & 0x3FFFFFFFFF) & 1))^(((in[21] >> 24) & 0x3FFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[21] >> 62) | ((in[22] & 0xFFFFFFFFF) << 2))) & 1))^((((in[21] >> 62) | ((in[22] & 0xFFFFFFFFF) << 2)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[22] >> 36) | ((in[23] & 0x3FF) << 28))) & 1))^((((in[22] >> 36) | ((in[23] & 0x3FF) << 28)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[23] >> 10) & 0x3FFFFFFFFF) & 1))^(((in[23] >> 10) & 0x3FFFFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[23] >> 48) | ((in[24] & 0x3FFFFF) << 16))) & 1))^((((in[23] >> 48) | ((in[24] & 0x3FFFFF) << 16)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[24] >> 22) & 0x3FFFFFFFFF) & 1))^(((in[24] >> 22) & 0x3FFFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[24] >> 60) | ((in[25] & 0x3FFFFFFFF) << 4))) & 1))^((((in[24] >> 60) | ((in[25] & 0x3FFFFFFFF) << 4)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[25] >> 34) | ((in[26] & 0xFF) << 30))) & 1))^((((in[25] >> 34) | ((in[26] & 0xFF) << 30)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[26] >> 8) & 0x3FFFFFFFFF) & 1))^(((in[26] >> 8) & 0x3FFFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[26] >> 46) | ((in[27] & 0xFFFFF) << 18))) & 1))^((((in[26] >> 46) | ((in[27] & 0xFFFFF) << 18)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[27] >> 20) & 0x3FFFFFFFFF) & 1))^(((in[27] >> 20) & 0x3FFFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[27] >> 58) | ((in[28] & 0xFFFFFFFF) << 6))) & 1))^((((in[27] >> 58) | ((in[28] & 0xFFFFFFFF) << 6)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[28] >> 32) | ((in[29] & 0x3F) << 32))) & 1))^((((in[28] >> 32) | ((in[29] & 0x3F) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[29] >> 6) & 0x3FFFFFFFFF) & 1))^(((in[29] >> 6) & 0x3FFFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[29] >> 44) | ((in[30] & 0x3FFFF) << 20))) & 1))^((((in[29] >> 44) | ((in[30] & 0x3FFFF) << 20)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[30] >> 18) & 0x3FFFFFFFFF) & 1))^(((in[30] >> 18) & 0x3FFFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[30] >> 56) | ((in[31] & 0x3FFFFFFF) << 8))) & 1))^((((in[30] >> 56) | ((in[31] & 0x3FFFFFFF) << 8)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[31] >> 30) | ((in[32] & 0xF) << 34))) & 1))^((((in[31] >> 30) | ((in[32] & 0xF) << 34)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[32] >> 4) & 0x3FFFFFFFFF) & 1))^(((in[32] >> 4) & 0x3FFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[32] >> 42) | ((in[33] & 0xFFFF) << 22))) & 1))^((((in[32] >> 42) | ((in[33] & 0xFFFF) << 22)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[33] >> 16) & 0x3FFFFFFFFF) & 1))^(((in[33] >> 16) & 0x3FFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[33] >> 54) | ((in[34] & 0xFFFFFFF) << 10))) & 1))^((((in[33] >> 54) | ((in[34] & 0xFFFFFFF) << 10)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[34] >> 28) | ((in[35] & 0x3) << 36))) & 1))^((((in[34] >> 28) | ((in[35] & 0x3) << 36)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[35] >> 2) & 0x3FFFFFFFFF) & 1))^(((in[35] >> 2) & 0x3FFFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[35] >> 40) | ((in[36] & 0x3FFF) << 24))) & 1))^((((in[35] >> 40) | ((in[36] & 0x3FFF) << 24)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[36] >> 14) & 0x3FFFFFFFFF) & 1))^(((in[36] >> 14) & 0x3FFFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[36] >> 52) | ((in[37] & 0x3FFFFFF) << 12))) & 1))^((((in[36] >> 52) | ((in[37] & 0x3FFFFFF) << 12)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[37] >> 26)) & 1))^(((in[37] >> 26))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_39(initoffset int64, in *[39]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 39) | ((in[1] & 0x3FFF) << 25))) & 1))^((((in[0] >> 39) | ((in[1] & 0x3FFF) << 25)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 14) & 0x7FFFFFFFFF) & 1))^(((in[1] >> 14) & 0x7FFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 53) | ((in[2] & 0xFFFFFFF) << 11))) & 1))^((((in[1] >> 53) | ((in[2] & 0xFFFFFFF) << 11)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 28) | ((in[3] & 0x7) << 36))) & 1))^((((in[2] >> 28) | ((in[3] & 0x7) << 36)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[3] >> 3) & 0x7FFFFFFFFF) & 1))^(((in[3] >> 3) & 0x7FFFFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[3] >> 42) | ((in[4] & 0x1FFFF) << 22))) & 1))^((((in[3] >> 42) | ((in[4] & 0x1FFFF) << 22)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[4] >> 17) & 0x7FFFFFFFFF) & 1))^(((in[4] >> 17) & 0x7FFFFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[4] >> 56) | ((in[5] & 0x7FFFFFFF) << 8))) & 1))^((((in[4] >> 56) | ((in[5] & 0x7FFFFFFF) << 8)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[5] >> 31) | ((in[6] & 0x3F) << 33))) & 1))^((((in[5] >> 31) | ((in[6] & 0x3F) << 33)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[6] >> 6) & 0x7FFFFFFFFF) & 1))^(((in[6] >> 6) & 0x7FFFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[6] >> 45) | ((in[7] & 0xFFFFF) << 19))) & 1))^((((in[6] >> 45) | ((in[7] & 0xFFFFF) << 19)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[7] >> 20) & 0x7FFFFFFFFF) & 1))^(((in[7] >> 20) & 0x7FFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[7] >> 59) | ((in[8] & 0x3FFFFFFFF) << 5))) & 1))^((((in[7] >> 59) | ((in[8] & 0x3FFFFFFFF) << 5)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[8] >> 34) | ((in[9] & 0x1FF) << 30))) & 1))^((((in[8] >> 34) | ((in[9] & 0x1FF) << 30)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[9] >> 9) & 0x7FFFFFFFFF) & 1))^(((in[9] >> 9) & 0x7FFFFFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[9] >> 48) | ((in[10] & 0x7FFFFF) << 16))) & 1))^((((in[9] >> 48) | ((in[10] & 0x7FFFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[10] >> 23) & 0x7FFFFFFFFF) & 1))^(((in[10] >> 23) & 0x7FFFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[10] >> 62) | ((in[11] & 0x1FFFFFFFFF) << 2))) & 1))^((((in[10] >> 62) | ((in[11] & 0x1FFFFFFFFF) << 2)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[11] >> 37) | ((in[12] & 0xFFF) << 27))) & 1))^((((in[11] >> 37) | ((in[12] & 0xFFF) << 27)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[12] >> 12) & 0x7FFFFFFFFF) & 1))^(((in[12] >> 12) & 0x7FFFFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[12] >> 51) | ((in[13] & 0x3FFFFFF) << 13))) & 1))^((((in[12] >> 51) | ((in[13] & 0x3FFFFFF) << 13)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[13] >> 26) | ((in[14] & 0x1) << 38))) & 1))^((((in[13] >> 26) | ((in[14] & 0x1) << 38)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[14] >> 1) & 0x7FFFFFFFFF) & 1))^(((in[14] >> 1) & 0x7FFFFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[14] >> 40) | ((in[15] & 0x7FFF) << 24))) & 1))^((((in[14] >> 40) | ((in[15] & 0x7FFF) << 24)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[15] >> 15) & 0x7FFFFFFFFF) & 1))^(((in[15] >> 15) & 0x7FFFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[15] >> 54) | ((in[16] & 0x1FFFFFFF) << 10))) & 1))^((((in[15] >> 54) | ((in[16] & 0x1FFFFFFF) << 10)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[16] >> 29) | ((in[17] & 0xF) << 35))) & 1))^((((in[16] >> 29) | ((in[17] & 0xF) << 35)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[17] >> 4) & 0x7FFFFFFFFF) & 1))^(((in[17] >> 4) & 0x7FFFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[17] >> 43) | ((in[18] & 0x3FFFF) << 21))) & 1))^((((in[17] >> 43) | ((in[18] & 0x3FFFF) << 21)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[18] >> 18) & 0x7FFFFFFFFF) & 1))^(((in[18] >> 18) & 0x7FFFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[18] >> 57) | ((in[19] & 0xFFFFFFFF) << 7))) & 1))^((((in[18] >> 57) | ((in[19] & 0xFFFFFFFF) << 7)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[19] >> 32) | ((in[20] & 0x7F) << 32))) & 1))^((((in[19] >> 32) | ((in[20] & 0x7F) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[20] >> 7) & 0x7FFFFFFFFF) & 1))^(((in[20] >> 7) & 0x7FFFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[20] >> 46) | ((in[21] & 0x1FFFFF) << 18))) & 1))^((((in[20] >> 46) | ((in[21] & 0x1FFFFF) << 18)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[21] >> 21) & 0x7FFFFFFFFF) & 1))^(((in[21] >> 21) & 0x7FFFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[21] >> 60) | ((in[22] & 0x7FFFFFFFF) << 4))) & 1))^((((in[21] >> 60) | ((in[22] & 0x7FFFFFFFF) << 4)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[22] >> 35) | ((in[23] & 0x3FF) << 29))) & 1))^((((in[22] >> 35) | ((in[23] & 0x3FF) << 29)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[23] >> 10) & 0x7FFFFFFFFF) & 1))^(((in[23] >> 10) & 0x7FFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[23] >> 49) | ((in[24] & 0xFFFFFF) << 15))) & 1))^((((in[23] >> 49) | ((in[24] & 0xFFFFFF) << 15)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[24] >> 24) & 0x7FFFFFFFFF) & 1))^(((in[24] >> 24) & 0x7FFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[24] >> 63) | ((in[25] & 0x3FFFFFFFFF) << 1))) & 1))^((((in[24] >> 63) | ((in[25] & 0x3FFFFFFFFF) << 1)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[25] >> 38) | ((in[26] & 0x1FFF) << 26))) & 1))^((((in[25] >> 38) | ((in[26] & 0x1FFF) << 26)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[26] >> 13) & 0x7FFFFFFFFF) & 1))^(((in[26] >> 13) & 0x7FFFFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[26] >> 52) | ((in[27] & 0x7FFFFFF) << 12))) & 1))^((((in[26] >> 52) | ((in[27] & 0x7FFFFFF) << 12)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[27] >> 27) | ((in[28] & 0x3) << 37))) & 1))^((((in[27] >> 27) | ((in[28] & 0x3) << 37)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[28] >> 2) & 0x7FFFFFFFFF) & 1))^(((in[28] >> 2) & 0x7FFFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[28] >> 41) | ((in[29] & 0xFFFF) << 23))) & 1))^((((in[28] >> 41) | ((in[29] & 0xFFFF) << 23)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[29] >> 16) & 0x7FFFFFFFFF) & 1))^(((in[29] >> 16) & 0x7FFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[29] >> 55) | ((in[30] & 0x3FFFFFFF) << 9))) & 1))^((((in[29] >> 55) | ((in[30] & 0x3FFFFFFF) << 9)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[30] >> 30) | ((in[31] & 0x1F) << 34))) & 1))^((((in[30] >> 30) | ((in[31] & 0x1F) << 34)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[31] >> 5) & 0x7FFFFFFFFF) & 1))^(((in[31] >> 5) & 0x7FFFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[31] >> 44) | ((in[32] & 0x7FFFF) << 20))) & 1))^((((in[31] >> 44) | ((in[32] & 0x7FFFF) << 20)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[32] >> 19) & 0x7FFFFFFFFF) & 1))^(((in[32] >> 19) & 0x7FFFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[32] >> 58) | ((in[33] & 0x1FFFFFFFF) << 6))) & 1))^((((in[32] >> 58) | ((in[33] & 0x1FFFFFFFF) << 6)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[33] >> 33) | ((in[34] & 0xFF) << 31))) & 1))^((((in[33] >> 33) | ((in[34] & 0xFF) << 31)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[34] >> 8) & 0x7FFFFFFFFF) & 1))^(((in[34] >> 8) & 0x7FFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[34] >> 47) | ((in[35] & 0x3FFFFF) << 17))) & 1))^((((in[34] >> 47) | ((in[35] & 0x3FFFFF) << 17)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[35] >> 22) & 0x7FFFFFFFFF) & 1))^(((in[35] >> 22) & 0x7FFFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[35] >> 61) | ((in[36] & 0xFFFFFFFFF) << 3))) & 1))^((((in[35] >> 61) | ((in[36] & 0xFFFFFFFFF) << 3)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[36] >> 36) | ((in[37] & 0x7FF) << 28))) & 1))^((((in[36] >> 36) | ((in[37] & 0x7FF) << 28)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[37] >> 11) & 0x7FFFFFFFFF) & 1))^(((in[37] >> 11) & 0x7FFFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[37] >> 50) | ((in[38] & 0x1FFFFFF) << 14))) & 1))^((((in[37] >> 50) | ((in[38] & 0x1FFFFFF) << 14)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[38] >> 25)) & 1))^(((in[38] >> 25))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_40(initoffset int64, in *[40]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 40) | ((in[1] & 0xFFFF) << 24))) & 1))^((((in[0] >> 40) | ((in[1] & 0xFFFF) << 24)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[1] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 56) | ((in[2] & 0xFFFFFFFF) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 32) | ((in[3] & 0xFF) << 32))) & 1))^((((in[2] >> 32) | ((in[3] & 0xFF) << 32)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[3] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[3] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[3] >> 48) | ((in[4] & 0xFFFFFF) << 16))) & 1))^((((in[3] >> 48) | ((in[4] & 0xFFFFFF) << 16)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[4] >> 24)) & 1))^(((in[4] >> 24))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[5] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[5] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[5] >> 40) | ((in[6] & 0xFFFF) << 24))) & 1))^((((in[5] >> 40) | ((in[6] & 0xFFFF) << 24)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[6] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[6] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[6] >> 56) | ((in[7] & 0xFFFFFFFF) << 8))) & 1))^((((in[6] >> 56) | ((in[7] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[7] >> 32) | ((in[8] & 0xFF) << 32))) & 1))^((((in[7] >> 32) | ((in[8] & 0xFF) << 32)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[8] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[8] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[8] >> 48) | ((in[9] & 0xFFFFFF) << 16))) & 1))^((((in[8] >> 48) | ((in[9] & 0xFFFFFF) << 16)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[9] >> 24)) & 1))^(((in[9] >> 24))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[10] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[10] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[10] >> 40) | ((in[11] & 0xFFFF) << 24))) & 1))^((((in[10] >> 40) | ((in[11] & 0xFFFF) << 24)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[11] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[11] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[11] >> 56) | ((in[12] & 0xFFFFFFFF) << 8))) & 1))^((((in[11] >> 56) | ((in[12] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[12] >> 32) | ((in[13] & 0xFF) << 32))) & 1))^((((in[12] >> 32) | ((in[13] & 0xFF) << 32)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[13] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[13] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[13] >> 48) | ((in[14] & 0xFFFFFF) << 16))) & 1))^((((in[13] >> 48) | ((in[14] & 0xFFFFFF) << 16)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[14] >> 24)) & 1))^(((in[14] >> 24))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[15] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[15] >> 40) | ((in[16] & 0xFFFF) << 24))) & 1))^((((in[15] >> 40) | ((in[16] & 0xFFFF) << 24)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[16] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[16] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[16] >> 56) | ((in[17] & 0xFFFFFFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[17] >> 32) | ((in[18] & 0xFF) << 32))) & 1))^((((in[17] >> 32) | ((in[18] & 0xFF) << 32)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[18] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[18] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[18] >> 48) | ((in[19] & 0xFFFFFF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0xFFFFFF) << 16)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[19] >> 24)) & 1))^(((in[19] >> 24))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[20] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[20] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[20] >> 40) | ((in[21] & 0xFFFF) << 24))) & 1))^((((in[20] >> 40) | ((in[21] & 0xFFFF) << 24)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[21] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[21] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[21] >> 56) | ((in[22] & 0xFFFFFFFF) << 8))) & 1))^((((in[21] >> 56) | ((in[22] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[22] >> 32) | ((in[23] & 0xFF) << 32))) & 1))^((((in[22] >> 32) | ((in[23] & 0xFF) << 32)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[23] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[23] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[23] >> 48) | ((in[24] & 0xFFFFFF) << 16))) & 1))^((((in[23] >> 48) | ((in[24] & 0xFFFFFF) << 16)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[24] >> 24)) & 1))^(((in[24] >> 24))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[25] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[25] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[25] >> 40) | ((in[26] & 0xFFFF) << 24))) & 1))^((((in[25] >> 40) | ((in[26] & 0xFFFF) << 24)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[26] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[26] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[26] >> 56) | ((in[27] & 0xFFFFFFFF) << 8))) & 1))^((((in[26] >> 56) | ((in[27] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[27] >> 32) | ((in[28] & 0xFF) << 32))) & 1))^((((in[27] >> 32) | ((in[28] & 0xFF) << 32)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[28] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[28] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[28] >> 48) | ((in[29] & 0xFFFFFF) << 16))) & 1))^((((in[28] >> 48) | ((in[29] & 0xFFFFFF) << 16)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[29] >> 24)) & 1))^(((in[29] >> 24))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[30] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[30] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[30] >> 40) | ((in[31] & 0xFFFF) << 24))) & 1))^((((in[30] >> 40) | ((in[31] & 0xFFFF) << 24)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[31] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[31] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[31] >> 56) | ((in[32] & 0xFFFFFFFF) << 8))) & 1))^((((in[31] >> 56) | ((in[32] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[32] >> 32) | ((in[33] & 0xFF) << 32))) & 1))^((((in[32] >> 32) | ((in[33] & 0xFF) << 32)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[33] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[33] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[33] >> 48) | ((in[34] & 0xFFFFFF) << 16))) & 1))^((((in[33] >> 48) | ((in[34] & 0xFFFFFF) << 16)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[34] >> 24)) & 1))^(((in[34] >> 24))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[35] >> 0) & 0xFFFFFFFFFF) & 1))^(((in[35] >> 0) & 0xFFFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[35] >> 40) | ((in[36] & 0xFFFF) << 24))) & 1))^((((in[35] >> 40) | ((in[36] & 0xFFFF) << 24)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[36] >> 16) & 0xFFFFFFFFFF) & 1))^(((in[36] >> 16) & 0xFFFFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[36] >> 56) | ((in[37] & 0xFFFFFFFF) << 8))) & 1))^((((in[36] >> 56) | ((in[37] & 0xFFFFFFFF) << 8)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[37] >> 32) | ((in[38] & 0xFF) << 32))) & 1))^((((in[37] >> 32) | ((in[38] & 0xFF) << 32)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[38] >> 8) & 0xFFFFFFFFFF) & 1))^(((in[38] >> 8) & 0xFFFFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[38] >> 48) | ((in[39] & 0xFFFFFF) << 16))) & 1))^((((in[38] >> 48) | ((in[39] & 0xFFFFFF) << 16)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[39] >> 24)) & 1))^(((in[39] >> 24))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_41(initoffset int64, in *[41]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 41) | ((in[1] & 0x3FFFF) << 23))) & 1))^((((in[0] >> 41) | ((in[1] & 0x3FFFF) << 23)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 18) & 0x1FFFFFFFFFF) & 1))^(((in[1] >> 18) & 0x1FFFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 59) | ((in[2] & 0xFFFFFFFFF) << 5))) & 1))^((((in[1] >> 59) | ((in[2] & 0xFFFFFFFFF) << 5)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 36) | ((in[3] & 0x1FFF) << 28))) & 1))^((((in[2] >> 36) | ((in[3] & 0x1FFF) << 28)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[3] >> 13) & 0x1FFFFFFFFFF) & 1))^(((in[3] >> 13) & 0x1FFFFFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[3] >> 54) | ((in[4] & 0x7FFFFFFF) << 10))) & 1))^((((in[3] >> 54) | ((in[4] & 0x7FFFFFFF) << 10)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[4] >> 31) | ((in[5] & 0xFF) << 33))) & 1))^((((in[4] >> 31) | ((in[5] & 0xFF) << 33)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[5] >> 8) & 0x1FFFFFFFFFF) & 1))^(((in[5] >> 8) & 0x1FFFFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[5] >> 49) | ((in[6] & 0x3FFFFFF) << 15))) & 1))^((((in[5] >> 49) | ((in[6] & 0x3FFFFFF) << 15)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[6] >> 26) | ((in[7] & 0x7) << 38))) & 1))^((((in[6] >> 26) | ((in[7] & 0x7) << 38)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[7] >> 3) & 0x1FFFFFFFFFF) & 1))^(((in[7] >> 3) & 0x1FFFFFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[7] >> 44) | ((in[8] & 0x1FFFFF) << 20))) & 1))^((((in[7] >> 44) | ((in[8] & 0x1FFFFF) << 20)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[8] >> 21) & 0x1FFFFFFFFFF) & 1))^(((in[8] >> 21) & 0x1FFFFFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[8] >> 62) | ((in[9] & 0x7FFFFFFFFF) << 2))) & 1))^((((in[8] >> 62) | ((in[9] & 0x7FFFFFFFFF) << 2)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[9] >> 39) | ((in[10] & 0xFFFF) << 25))) & 1))^((((in[9] >> 39) | ((in[10] & 0xFFFF) << 25)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[10] >> 16) & 0x1FFFFFFFFFF) & 1))^(((in[10] >> 16) & 0x1FFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[10] >> 57) | ((in[11] & 0x3FFFFFFFF) << 7))) & 1))^((((in[10] >> 57) | ((in[11] & 0x3FFFFFFFF) << 7)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[11] >> 34) | ((in[12] & 0x7FF) << 30))) & 1))^((((in[11] >> 34) | ((in[12] & 0x7FF) << 30)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[12] >> 11) & 0x1FFFFFFFFFF) & 1))^(((in[12] >> 11) & 0x1FFFFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[12] >> 52) | ((in[13] & 0x1FFFFFFF) << 12))) & 1))^((((in[12] >> 52) | ((in[13] & 0x1FFFFFFF) << 12)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[13] >> 29) | ((in[14] & 0x3F) << 35))) & 1))^((((in[13] >> 29) | ((in[14] & 0x3F) << 35)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[14] >> 6) & 0x1FFFFFFFFFF) & 1))^(((in[14] >> 6) & 0x1FFFFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[14] >> 47) | ((in[15] & 0xFFFFFF) << 17))) & 1))^((((in[14] >> 47) | ((in[15] & 0xFFFFFF) << 17)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[15] >> 24) | ((in[16] & 0x1) << 40))) & 1))^((((in[15] >> 24) | ((in[16] & 0x1) << 40)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[16] >> 1) & 0x1FFFFFFFFFF) & 1))^(((in[16] >> 1) & 0x1FFFFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[16] >> 42) | ((in[17] & 0x7FFFF) << 22))) & 1))^((((in[16] >> 42) | ((in[17] & 0x7FFFF) << 22)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[17] >> 19) & 0x1FFFFFFFFFF) & 1))^(((in[17] >> 19) & 0x1FFFFFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[17] >> 60) | ((in[18] & 0x1FFFFFFFFF) << 4))) & 1))^((((in[17] >> 60) | ((in[18] & 0x1FFFFFFFFF) << 4)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[18] >> 37) | ((in[19] & 0x3FFF) << 27))) & 1))^((((in[18] >> 37) | ((in[19] & 0x3FFF) << 27)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[19] >> 14) & 0x1FFFFFFFFFF) & 1))^(((in[19] >> 14) & 0x1FFFFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[19] >> 55) | ((in[20] & 0xFFFFFFFF) << 9))) & 1))^((((in[19] >> 55) | ((in[20] & 0xFFFFFFFF) << 9)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[20] >> 32) | ((in[21] & 0x1FF) << 32))) & 1))^((((in[20] >> 32) | ((in[21] & 0x1FF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[21] >> 9) & 0x1FFFFFFFFFF) & 1))^(((in[21] >> 9) & 0x1FFFFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[21] >> 50) | ((in[22] & 0x7FFFFFF) << 14))) & 1))^((((in[21] >> 50) | ((in[22] & 0x7FFFFFF) << 14)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[22] >> 27) | ((in[23] & 0xF) << 37))) & 1))^((((in[22] >> 27) | ((in[23] & 0xF) << 37)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[23] >> 4) & 0x1FFFFFFFFFF) & 1))^(((in[23] >> 4) & 0x1FFFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[23] >> 45) | ((in[24] & 0x3FFFFF) << 19))) & 1))^((((in[23] >> 45) | ((in[24] & 0x3FFFFF) << 19)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[24] >> 22) & 0x1FFFFFFFFFF) & 1))^(((in[24] >> 22) & 0x1FFFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[24] >> 63) | ((in[25] & 0xFFFFFFFFFF) << 1))) & 1))^((((in[24] >> 63) | ((in[25] & 0xFFFFFFFFFF) << 1)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[25] >> 40) | ((in[26] & 0x1FFFF) << 24))) & 1))^((((in[25] >> 40) | ((in[26] & 0x1FFFF) << 24)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[26] >> 17) & 0x1FFFFFFFFFF) & 1))^(((in[26] >> 17) & 0x1FFFFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[26] >> 58) | ((in[27] & 0x7FFFFFFFF) << 6))) & 1))^((((in[26] >> 58) | ((in[27] & 0x7FFFFFFFF) << 6)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[27] >> 35) | ((in[28] & 0xFFF) << 29))) & 1))^((((in[27] >> 35) | ((in[28] & 0xFFF) << 29)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[28] >> 12) & 0x1FFFFFFFFFF) & 1))^(((in[28] >> 12) & 0x1FFFFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[28] >> 53) | ((in[29] & 0x3FFFFFFF) << 11))) & 1))^((((in[28] >> 53) | ((in[29] & 0x3FFFFFFF) << 11)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[29] >> 30) | ((in[30] & 0x7F) << 34))) & 1))^((((in[29] >> 30) | ((in[30] & 0x7F) << 34)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[30] >> 7) & 0x1FFFFFFFFFF) & 1))^(((in[30] >> 7) & 0x1FFFFFFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[30] >> 48) | ((in[31] & 0x1FFFFFF) << 16))) & 1))^((((in[30] >> 48) | ((in[31] & 0x1FFFFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[31] >> 25) | ((in[32] & 0x3) << 39))) & 1))^((((in[31] >> 25) | ((in[32] & 0x3) << 39)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[32] >> 2) & 0x1FFFFFFFFFF) & 1))^(((in[32] >> 2) & 0x1FFFFFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[32] >> 43) | ((in[33] & 0xFFFFF) << 21))) & 1))^((((in[32] >> 43) | ((in[33] & 0xFFFFF) << 21)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[33] >> 20) & 0x1FFFFFFFFFF) & 1))^(((in[33] >> 20) & 0x1FFFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFF) << 3))) & 1))^((((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFF) << 3)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[34] >> 38) | ((in[35] & 0x7FFF) << 26))) & 1))^((((in[34] >> 38) | ((in[35] & 0x7FFF) << 26)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[35] >> 15) & 0x1FFFFFFFFFF) & 1))^(((in[35] >> 15) & 0x1FFFFFFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[35] >> 56) | ((in[36] & 0x1FFFFFFFF) << 8))) & 1))^((((in[35] >> 56) | ((in[36] & 0x1FFFFFFFF) << 8)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[36] >> 33) | ((in[37] & 0x3FF) << 31))) & 1))^((((in[36] >> 33) | ((in[37] & 0x3FF) << 31)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[37] >> 10) & 0x1FFFFFFFFFF) & 1))^(((in[37] >> 10) & 0x1FFFFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[37] >> 51) | ((in[38] & 0xFFFFFFF) << 13))) & 1))^((((in[37] >> 51) | ((in[38] & 0xFFFFFFF) << 13)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[38] >> 28) | ((in[39] & 0x1F) << 36))) & 1))^((((in[38] >> 28) | ((in[39] & 0x1F) << 36)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[39] >> 5) & 0x1FFFFFFFFFF) & 1))^(((in[39] >> 5) & 0x1FFFFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[39] >> 46) | ((in[40] & 0x7FFFFF) << 18))) & 1))^((((in[39] >> 46) | ((in[40] & 0x7FFFFF) << 18)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[40] >> 23)) & 1))^(((in[40] >> 23))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_42(initoffset int64, in *[42]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 42) | ((in[1] & 0xFFFFF) << 22))) & 1))^((((in[0] >> 42) | ((in[1] & 0xFFFFF) << 22)))>>1))) << ntz + out[0] + out[2] = int64(((-(((in[1] >> 20) & 0x3FFFFFFFFFF) & 1))^(((in[1] >> 20) & 0x3FFFFFFFFFF)>>1))) << ntz + out[1] + out[3] = int64(((-((((in[1] >> 62) | ((in[2] & 0xFFFFFFFFFF) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0xFFFFFFFFFF) << 2)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 40) | ((in[3] & 0x3FFFF) << 24))) & 1))^((((in[2] >> 40) | ((in[3] & 0x3FFFF) << 24)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[3] >> 18) & 0x3FFFFFFFFFF) & 1))^(((in[3] >> 18) & 0x3FFFFFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[3] >> 60) | ((in[4] & 0x3FFFFFFFFF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x3FFFFFFFFF) << 4)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[4] >> 38) | ((in[5] & 0xFFFF) << 26))) & 1))^((((in[4] >> 38) | ((in[5] & 0xFFFF) << 26)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[5] >> 16) & 0x3FFFFFFFFFF) & 1))^(((in[5] >> 16) & 0x3FFFFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[5] >> 58) | ((in[6] & 0xFFFFFFFFF) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0xFFFFFFFFF) << 6)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[6] >> 36) | ((in[7] & 0x3FFF) << 28))) & 1))^((((in[6] >> 36) | ((in[7] & 0x3FFF) << 28)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[7] >> 14) & 0x3FFFFFFFFFF) & 1))^(((in[7] >> 14) & 0x3FFFFFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[7] >> 56) | ((in[8] & 0x3FFFFFFFF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0x3FFFFFFFF) << 8)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[8] >> 34) | ((in[9] & 0xFFF) << 30))) & 1))^((((in[8] >> 34) | ((in[9] & 0xFFF) << 30)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[9] >> 12) & 0x3FFFFFFFFFF) & 1))^(((in[9] >> 12) & 0x3FFFFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[9] >> 54) | ((in[10] & 0xFFFFFFFF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0xFFFFFFFF) << 10)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[10] >> 32) | ((in[11] & 0x3FF) << 32))) & 1))^((((in[10] >> 32) | ((in[11] & 0x3FF) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[11] >> 10) & 0x3FFFFFFFFFF) & 1))^(((in[11] >> 10) & 0x3FFFFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[11] >> 52) | ((in[12] & 0x3FFFFFFF) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0x3FFFFFFF) << 12)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[12] >> 30) | ((in[13] & 0xFF) << 34))) & 1))^((((in[12] >> 30) | ((in[13] & 0xFF) << 34)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[13] >> 8) & 0x3FFFFFFFFFF) & 1))^(((in[13] >> 8) & 0x3FFFFFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[13] >> 50) | ((in[14] & 0xFFFFFFF) << 14))) & 1))^((((in[13] >> 50) | ((in[14] & 0xFFFFFFF) << 14)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[14] >> 28) | ((in[15] & 0x3F) << 36))) & 1))^((((in[14] >> 28) | ((in[15] & 0x3F) << 36)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[15] >> 6) & 0x3FFFFFFFFFF) & 1))^(((in[15] >> 6) & 0x3FFFFFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[15] >> 48) | ((in[16] & 0x3FFFFFF) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0x3FFFFFF) << 16)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[16] >> 26) | ((in[17] & 0xF) << 38))) & 1))^((((in[16] >> 26) | ((in[17] & 0xF) << 38)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[17] >> 4) & 0x3FFFFFFFFFF) & 1))^(((in[17] >> 4) & 0x3FFFFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[17] >> 46) | ((in[18] & 0xFFFFFF) << 18))) & 1))^((((in[17] >> 46) | ((in[18] & 0xFFFFFF) << 18)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[18] >> 24) | ((in[19] & 0x3) << 40))) & 1))^((((in[18] >> 24) | ((in[19] & 0x3) << 40)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[19] >> 2) & 0x3FFFFFFFFFF) & 1))^(((in[19] >> 2) & 0x3FFFFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[19] >> 44) | ((in[20] & 0x3FFFFF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0x3FFFFF) << 20)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[20] >> 22)) & 1))^(((in[20] >> 22))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[21] >> 0) & 0x3FFFFFFFFFF) & 1))^(((in[21] >> 0) & 0x3FFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[21] >> 42) | ((in[22] & 0xFFFFF) << 22))) & 1))^((((in[21] >> 42) | ((in[22] & 0xFFFFF) << 22)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[22] >> 20) & 0x3FFFFFFFFFF) & 1))^(((in[22] >> 20) & 0x3FFFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[22] >> 62) | ((in[23] & 0xFFFFFFFFFF) << 2))) & 1))^((((in[22] >> 62) | ((in[23] & 0xFFFFFFFFFF) << 2)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[23] >> 40) | ((in[24] & 0x3FFFF) << 24))) & 1))^((((in[23] >> 40) | ((in[24] & 0x3FFFF) << 24)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[24] >> 18) & 0x3FFFFFFFFFF) & 1))^(((in[24] >> 18) & 0x3FFFFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[24] >> 60) | ((in[25] & 0x3FFFFFFFFF) << 4))) & 1))^((((in[24] >> 60) | ((in[25] & 0x3FFFFFFFFF) << 4)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[25] >> 38) | ((in[26] & 0xFFFF) << 26))) & 1))^((((in[25] >> 38) | ((in[26] & 0xFFFF) << 26)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[26] >> 16) & 0x3FFFFFFFFFF) & 1))^(((in[26] >> 16) & 0x3FFFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[26] >> 58) | ((in[27] & 0xFFFFFFFFF) << 6))) & 1))^((((in[26] >> 58) | ((in[27] & 0xFFFFFFFFF) << 6)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[27] >> 36) | ((in[28] & 0x3FFF) << 28))) & 1))^((((in[27] >> 36) | ((in[28] & 0x3FFF) << 28)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[28] >> 14) & 0x3FFFFFFFFFF) & 1))^(((in[28] >> 14) & 0x3FFFFFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[28] >> 56) | ((in[29] & 0x3FFFFFFFF) << 8))) & 1))^((((in[28] >> 56) | ((in[29] & 0x3FFFFFFFF) << 8)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[29] >> 34) | ((in[30] & 0xFFF) << 30))) & 1))^((((in[29] >> 34) | ((in[30] & 0xFFF) << 30)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[30] >> 12) & 0x3FFFFFFFFFF) & 1))^(((in[30] >> 12) & 0x3FFFFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[30] >> 54) | ((in[31] & 0xFFFFFFFF) << 10))) & 1))^((((in[30] >> 54) | ((in[31] & 0xFFFFFFFF) << 10)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[31] >> 32) | ((in[32] & 0x3FF) << 32))) & 1))^((((in[31] >> 32) | ((in[32] & 0x3FF) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[32] >> 10) & 0x3FFFFFFFFFF) & 1))^(((in[32] >> 10) & 0x3FFFFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[32] >> 52) | ((in[33] & 0x3FFFFFFF) << 12))) & 1))^((((in[32] >> 52) | ((in[33] & 0x3FFFFFFF) << 12)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[33] >> 30) | ((in[34] & 0xFF) << 34))) & 1))^((((in[33] >> 30) | ((in[34] & 0xFF) << 34)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[34] >> 8) & 0x3FFFFFFFFFF) & 1))^(((in[34] >> 8) & 0x3FFFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[34] >> 50) | ((in[35] & 0xFFFFFFF) << 14))) & 1))^((((in[34] >> 50) | ((in[35] & 0xFFFFFFF) << 14)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[35] >> 28) | ((in[36] & 0x3F) << 36))) & 1))^((((in[35] >> 28) | ((in[36] & 0x3F) << 36)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[36] >> 6) & 0x3FFFFFFFFFF) & 1))^(((in[36] >> 6) & 0x3FFFFFFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[36] >> 48) | ((in[37] & 0x3FFFFFF) << 16))) & 1))^((((in[36] >> 48) | ((in[37] & 0x3FFFFFF) << 16)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[37] >> 26) | ((in[38] & 0xF) << 38))) & 1))^((((in[37] >> 26) | ((in[38] & 0xF) << 38)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[38] >> 4) & 0x3FFFFFFFFFF) & 1))^(((in[38] >> 4) & 0x3FFFFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[38] >> 46) | ((in[39] & 0xFFFFFF) << 18))) & 1))^((((in[38] >> 46) | ((in[39] & 0xFFFFFF) << 18)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[39] >> 24) | ((in[40] & 0x3) << 40))) & 1))^((((in[39] >> 24) | ((in[40] & 0x3) << 40)))>>1))) << ntz + out[59] + out[61] = int64(((-(((in[40] >> 2) & 0x3FFFFFFFFFF) & 1))^(((in[40] >> 2) & 0x3FFFFFFFFFF)>>1))) << ntz + out[60] + out[62] = int64(((-((((in[40] >> 44) | ((in[41] & 0x3FFFFF) << 20))) & 1))^((((in[40] >> 44) | ((in[41] & 0x3FFFFF) << 20)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[41] >> 22)) & 1))^(((in[41] >> 22))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_43(initoffset int64, in *[43]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 43) | ((in[1] & 0x3FFFFF) << 21))) & 1))^((((in[0] >> 43) | ((in[1] & 0x3FFFFF) << 21)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 22) | ((in[2] & 0x1) << 42))) & 1))^((((in[1] >> 22) | ((in[2] & 0x1) << 42)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[2] >> 1) & 0x7FFFFFFFFFF) & 1))^(((in[2] >> 1) & 0x7FFFFFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 44) | ((in[3] & 0x7FFFFF) << 20))) & 1))^((((in[2] >> 44) | ((in[3] & 0x7FFFFF) << 20)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 23) | ((in[4] & 0x3) << 41))) & 1))^((((in[3] >> 23) | ((in[4] & 0x3) << 41)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[4] >> 2) & 0x7FFFFFFFFFF) & 1))^(((in[4] >> 2) & 0x7FFFFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[4] >> 45) | ((in[5] & 0xFFFFFF) << 19))) & 1))^((((in[4] >> 45) | ((in[5] & 0xFFFFFF) << 19)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[5] >> 24) | ((in[6] & 0x7) << 40))) & 1))^((((in[5] >> 24) | ((in[6] & 0x7) << 40)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[6] >> 3) & 0x7FFFFFFFFFF) & 1))^(((in[6] >> 3) & 0x7FFFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[6] >> 46) | ((in[7] & 0x1FFFFFF) << 18))) & 1))^((((in[6] >> 46) | ((in[7] & 0x1FFFFFF) << 18)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[7] >> 25) | ((in[8] & 0xF) << 39))) & 1))^((((in[7] >> 25) | ((in[8] & 0xF) << 39)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[8] >> 4) & 0x7FFFFFFFFFF) & 1))^(((in[8] >> 4) & 0x7FFFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[8] >> 47) | ((in[9] & 0x3FFFFFF) << 17))) & 1))^((((in[8] >> 47) | ((in[9] & 0x3FFFFFF) << 17)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[9] >> 26) | ((in[10] & 0x1F) << 38))) & 1))^((((in[9] >> 26) | ((in[10] & 0x1F) << 38)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[10] >> 5) & 0x7FFFFFFFFFF) & 1))^(((in[10] >> 5) & 0x7FFFFFFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[10] >> 48) | ((in[11] & 0x7FFFFFF) << 16))) & 1))^((((in[10] >> 48) | ((in[11] & 0x7FFFFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[11] >> 27) | ((in[12] & 0x3F) << 37))) & 1))^((((in[11] >> 27) | ((in[12] & 0x3F) << 37)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[12] >> 6) & 0x7FFFFFFFFFF) & 1))^(((in[12] >> 6) & 0x7FFFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[12] >> 49) | ((in[13] & 0xFFFFFFF) << 15))) & 1))^((((in[12] >> 49) | ((in[13] & 0xFFFFFFF) << 15)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[13] >> 28) | ((in[14] & 0x7F) << 36))) & 1))^((((in[13] >> 28) | ((in[14] & 0x7F) << 36)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[14] >> 7) & 0x7FFFFFFFFFF) & 1))^(((in[14] >> 7) & 0x7FFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[14] >> 50) | ((in[15] & 0x1FFFFFFF) << 14))) & 1))^((((in[14] >> 50) | ((in[15] & 0x1FFFFFFF) << 14)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[15] >> 29) | ((in[16] & 0xFF) << 35))) & 1))^((((in[15] >> 29) | ((in[16] & 0xFF) << 35)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[16] >> 8) & 0x7FFFFFFFFFF) & 1))^(((in[16] >> 8) & 0x7FFFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[16] >> 51) | ((in[17] & 0x3FFFFFFF) << 13))) & 1))^((((in[16] >> 51) | ((in[17] & 0x3FFFFFFF) << 13)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[17] >> 30) | ((in[18] & 0x1FF) << 34))) & 1))^((((in[17] >> 30) | ((in[18] & 0x1FF) << 34)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[18] >> 9) & 0x7FFFFFFFFFF) & 1))^(((in[18] >> 9) & 0x7FFFFFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[18] >> 52) | ((in[19] & 0x7FFFFFFF) << 12))) & 1))^((((in[18] >> 52) | ((in[19] & 0x7FFFFFFF) << 12)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[19] >> 31) | ((in[20] & 0x3FF) << 33))) & 1))^((((in[19] >> 31) | ((in[20] & 0x3FF) << 33)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[20] >> 10) & 0x7FFFFFFFFFF) & 1))^(((in[20] >> 10) & 0x7FFFFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[20] >> 53) | ((in[21] & 0xFFFFFFFF) << 11))) & 1))^((((in[20] >> 53) | ((in[21] & 0xFFFFFFFF) << 11)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[21] >> 32) | ((in[22] & 0x7FF) << 32))) & 1))^((((in[21] >> 32) | ((in[22] & 0x7FF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[22] >> 11) & 0x7FFFFFFFFFF) & 1))^(((in[22] >> 11) & 0x7FFFFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[22] >> 54) | ((in[23] & 0x1FFFFFFFF) << 10))) & 1))^((((in[22] >> 54) | ((in[23] & 0x1FFFFFFFF) << 10)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[23] >> 33) | ((in[24] & 0xFFF) << 31))) & 1))^((((in[23] >> 33) | ((in[24] & 0xFFF) << 31)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[24] >> 12) & 0x7FFFFFFFFFF) & 1))^(((in[24] >> 12) & 0x7FFFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[24] >> 55) | ((in[25] & 0x3FFFFFFFF) << 9))) & 1))^((((in[24] >> 55) | ((in[25] & 0x3FFFFFFFF) << 9)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[25] >> 34) | ((in[26] & 0x1FFF) << 30))) & 1))^((((in[25] >> 34) | ((in[26] & 0x1FFF) << 30)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[26] >> 13) & 0x7FFFFFFFFFF) & 1))^(((in[26] >> 13) & 0x7FFFFFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[26] >> 56) | ((in[27] & 0x7FFFFFFFF) << 8))) & 1))^((((in[26] >> 56) | ((in[27] & 0x7FFFFFFFF) << 8)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[27] >> 35) | ((in[28] & 0x3FFF) << 29))) & 1))^((((in[27] >> 35) | ((in[28] & 0x3FFF) << 29)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[28] >> 14) & 0x7FFFFFFFFFF) & 1))^(((in[28] >> 14) & 0x7FFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[28] >> 57) | ((in[29] & 0xFFFFFFFFF) << 7))) & 1))^((((in[28] >> 57) | ((in[29] & 0xFFFFFFFFF) << 7)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[29] >> 36) | ((in[30] & 0x7FFF) << 28))) & 1))^((((in[29] >> 36) | ((in[30] & 0x7FFF) << 28)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[30] >> 15) & 0x7FFFFFFFFFF) & 1))^(((in[30] >> 15) & 0x7FFFFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[30] >> 58) | ((in[31] & 0x1FFFFFFFFF) << 6))) & 1))^((((in[30] >> 58) | ((in[31] & 0x1FFFFFFFFF) << 6)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[31] >> 37) | ((in[32] & 0xFFFF) << 27))) & 1))^((((in[31] >> 37) | ((in[32] & 0xFFFF) << 27)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[32] >> 16) & 0x7FFFFFFFFFF) & 1))^(((in[32] >> 16) & 0x7FFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[32] >> 59) | ((in[33] & 0x3FFFFFFFFF) << 5))) & 1))^((((in[32] >> 59) | ((in[33] & 0x3FFFFFFFFF) << 5)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[33] >> 38) | ((in[34] & 0x1FFFF) << 26))) & 1))^((((in[33] >> 38) | ((in[34] & 0x1FFFF) << 26)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[34] >> 17) & 0x7FFFFFFFFFF) & 1))^(((in[34] >> 17) & 0x7FFFFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[34] >> 60) | ((in[35] & 0x7FFFFFFFFF) << 4))) & 1))^((((in[34] >> 60) | ((in[35] & 0x7FFFFFFFFF) << 4)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[35] >> 39) | ((in[36] & 0x3FFFF) << 25))) & 1))^((((in[35] >> 39) | ((in[36] & 0x3FFFF) << 25)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[36] >> 18) & 0x7FFFFFFFFFF) & 1))^(((in[36] >> 18) & 0x7FFFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFF) << 3))) & 1))^((((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFF) << 3)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[37] >> 40) | ((in[38] & 0x7FFFF) << 24))) & 1))^((((in[37] >> 40) | ((in[38] & 0x7FFFF) << 24)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[38] >> 19) & 0x7FFFFFFFFFF) & 1))^(((in[38] >> 19) & 0x7FFFFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[38] >> 62) | ((in[39] & 0x1FFFFFFFFFF) << 2))) & 1))^((((in[38] >> 62) | ((in[39] & 0x1FFFFFFFFFF) << 2)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[39] >> 41) | ((in[40] & 0xFFFFF) << 23))) & 1))^((((in[39] >> 41) | ((in[40] & 0xFFFFF) << 23)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[40] >> 20) & 0x7FFFFFFFFFF) & 1))^(((in[40] >> 20) & 0x7FFFFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[40] >> 63) | ((in[41] & 0x3FFFFFFFFFF) << 1))) & 1))^((((in[40] >> 63) | ((in[41] & 0x3FFFFFFFFFF) << 1)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[41] >> 42) | ((in[42] & 0x1FFFFF) << 22))) & 1))^((((in[41] >> 42) | ((in[42] & 0x1FFFFF) << 22)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[42] >> 21)) & 1))^(((in[42] >> 21))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_44(initoffset int64, in *[44]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 44) | ((in[1] & 0xFFFFFF) << 20))) & 1))^((((in[0] >> 44) | ((in[1] & 0xFFFFFF) << 20)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 24) | ((in[2] & 0xF) << 40))) & 1))^((((in[1] >> 24) | ((in[2] & 0xF) << 40)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[2] >> 4) & 0xFFFFFFFFFFF) & 1))^(((in[2] >> 4) & 0xFFFFFFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 48) | ((in[3] & 0xFFFFFFF) << 16))) & 1))^((((in[2] >> 48) | ((in[3] & 0xFFFFFFF) << 16)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 28) | ((in[4] & 0xFF) << 36))) & 1))^((((in[3] >> 28) | ((in[4] & 0xFF) << 36)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[4] >> 8) & 0xFFFFFFFFFFF) & 1))^(((in[4] >> 8) & 0xFFFFFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[4] >> 52) | ((in[5] & 0xFFFFFFFF) << 12))) & 1))^((((in[4] >> 52) | ((in[5] & 0xFFFFFFFF) << 12)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[5] >> 32) | ((in[6] & 0xFFF) << 32))) & 1))^((((in[5] >> 32) | ((in[6] & 0xFFF) << 32)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[6] >> 12) & 0xFFFFFFFFFFF) & 1))^(((in[6] >> 12) & 0xFFFFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[6] >> 56) | ((in[7] & 0xFFFFFFFFF) << 8))) & 1))^((((in[6] >> 56) | ((in[7] & 0xFFFFFFFFF) << 8)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[7] >> 36) | ((in[8] & 0xFFFF) << 28))) & 1))^((((in[7] >> 36) | ((in[8] & 0xFFFF) << 28)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[8] >> 16) & 0xFFFFFFFFFFF) & 1))^(((in[8] >> 16) & 0xFFFFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFF) << 4))) & 1))^((((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFF) << 4)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[9] >> 40) | ((in[10] & 0xFFFFF) << 24))) & 1))^((((in[9] >> 40) | ((in[10] & 0xFFFFF) << 24)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[10] >> 20)) & 1))^(((in[10] >> 20))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[11] >> 0) & 0xFFFFFFFFFFF) & 1))^(((in[11] >> 0) & 0xFFFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[11] >> 44) | ((in[12] & 0xFFFFFF) << 20))) & 1))^((((in[11] >> 44) | ((in[12] & 0xFFFFFF) << 20)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[12] >> 24) | ((in[13] & 0xF) << 40))) & 1))^((((in[12] >> 24) | ((in[13] & 0xF) << 40)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[13] >> 4) & 0xFFFFFFFFFFF) & 1))^(((in[13] >> 4) & 0xFFFFFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[13] >> 48) | ((in[14] & 0xFFFFFFF) << 16))) & 1))^((((in[13] >> 48) | ((in[14] & 0xFFFFFFF) << 16)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[14] >> 28) | ((in[15] & 0xFF) << 36))) & 1))^((((in[14] >> 28) | ((in[15] & 0xFF) << 36)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[15] >> 8) & 0xFFFFFFFFFFF) & 1))^(((in[15] >> 8) & 0xFFFFFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[15] >> 52) | ((in[16] & 0xFFFFFFFF) << 12))) & 1))^((((in[15] >> 52) | ((in[16] & 0xFFFFFFFF) << 12)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[16] >> 32) | ((in[17] & 0xFFF) << 32))) & 1))^((((in[16] >> 32) | ((in[17] & 0xFFF) << 32)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[17] >> 12) & 0xFFFFFFFFFFF) & 1))^(((in[17] >> 12) & 0xFFFFFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[17] >> 56) | ((in[18] & 0xFFFFFFFFF) << 8))) & 1))^((((in[17] >> 56) | ((in[18] & 0xFFFFFFFFF) << 8)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[18] >> 36) | ((in[19] & 0xFFFF) << 28))) & 1))^((((in[18] >> 36) | ((in[19] & 0xFFFF) << 28)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[19] >> 16) & 0xFFFFFFFFFFF) & 1))^(((in[19] >> 16) & 0xFFFFFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[19] >> 60) | ((in[20] & 0xFFFFFFFFFF) << 4))) & 1))^((((in[19] >> 60) | ((in[20] & 0xFFFFFFFFFF) << 4)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[20] >> 40) | ((in[21] & 0xFFFFF) << 24))) & 1))^((((in[20] >> 40) | ((in[21] & 0xFFFFF) << 24)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[21] >> 20)) & 1))^(((in[21] >> 20))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[22] >> 0) & 0xFFFFFFFFFFF) & 1))^(((in[22] >> 0) & 0xFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[22] >> 44) | ((in[23] & 0xFFFFFF) << 20))) & 1))^((((in[22] >> 44) | ((in[23] & 0xFFFFFF) << 20)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[23] >> 24) | ((in[24] & 0xF) << 40))) & 1))^((((in[23] >> 24) | ((in[24] & 0xF) << 40)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[24] >> 4) & 0xFFFFFFFFFFF) & 1))^(((in[24] >> 4) & 0xFFFFFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[24] >> 48) | ((in[25] & 0xFFFFFFF) << 16))) & 1))^((((in[24] >> 48) | ((in[25] & 0xFFFFFFF) << 16)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[25] >> 28) | ((in[26] & 0xFF) << 36))) & 1))^((((in[25] >> 28) | ((in[26] & 0xFF) << 36)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[26] >> 8) & 0xFFFFFFFFFFF) & 1))^(((in[26] >> 8) & 0xFFFFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[26] >> 52) | ((in[27] & 0xFFFFFFFF) << 12))) & 1))^((((in[26] >> 52) | ((in[27] & 0xFFFFFFFF) << 12)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[27] >> 32) | ((in[28] & 0xFFF) << 32))) & 1))^((((in[27] >> 32) | ((in[28] & 0xFFF) << 32)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[28] >> 12) & 0xFFFFFFFFFFF) & 1))^(((in[28] >> 12) & 0xFFFFFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[28] >> 56) | ((in[29] & 0xFFFFFFFFF) << 8))) & 1))^((((in[28] >> 56) | ((in[29] & 0xFFFFFFFFF) << 8)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[29] >> 36) | ((in[30] & 0xFFFF) << 28))) & 1))^((((in[29] >> 36) | ((in[30] & 0xFFFF) << 28)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[30] >> 16) & 0xFFFFFFFFFFF) & 1))^(((in[30] >> 16) & 0xFFFFFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFF) << 4))) & 1))^((((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFF) << 4)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[31] >> 40) | ((in[32] & 0xFFFFF) << 24))) & 1))^((((in[31] >> 40) | ((in[32] & 0xFFFFF) << 24)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[32] >> 20)) & 1))^(((in[32] >> 20))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[33] >> 0) & 0xFFFFFFFFFFF) & 1))^(((in[33] >> 0) & 0xFFFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[33] >> 44) | ((in[34] & 0xFFFFFF) << 20))) & 1))^((((in[33] >> 44) | ((in[34] & 0xFFFFFF) << 20)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[34] >> 24) | ((in[35] & 0xF) << 40))) & 1))^((((in[34] >> 24) | ((in[35] & 0xF) << 40)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[35] >> 4) & 0xFFFFFFFFFFF) & 1))^(((in[35] >> 4) & 0xFFFFFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[35] >> 48) | ((in[36] & 0xFFFFFFF) << 16))) & 1))^((((in[35] >> 48) | ((in[36] & 0xFFFFFFF) << 16)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[36] >> 28) | ((in[37] & 0xFF) << 36))) & 1))^((((in[36] >> 28) | ((in[37] & 0xFF) << 36)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[37] >> 8) & 0xFFFFFFFFFFF) & 1))^(((in[37] >> 8) & 0xFFFFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[37] >> 52) | ((in[38] & 0xFFFFFFFF) << 12))) & 1))^((((in[37] >> 52) | ((in[38] & 0xFFFFFFFF) << 12)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[38] >> 32) | ((in[39] & 0xFFF) << 32))) & 1))^((((in[38] >> 32) | ((in[39] & 0xFFF) << 32)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[39] >> 12) & 0xFFFFFFFFFFF) & 1))^(((in[39] >> 12) & 0xFFFFFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[39] >> 56) | ((in[40] & 0xFFFFFFFFF) << 8))) & 1))^((((in[39] >> 56) | ((in[40] & 0xFFFFFFFFF) << 8)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[40] >> 36) | ((in[41] & 0xFFFF) << 28))) & 1))^((((in[40] >> 36) | ((in[41] & 0xFFFF) << 28)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[41] >> 16) & 0xFFFFFFFFFFF) & 1))^(((in[41] >> 16) & 0xFFFFFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[41] >> 60) | ((in[42] & 0xFFFFFFFFFF) << 4))) & 1))^((((in[41] >> 60) | ((in[42] & 0xFFFFFFFFFF) << 4)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[42] >> 40) | ((in[43] & 0xFFFFF) << 24))) & 1))^((((in[42] >> 40) | ((in[43] & 0xFFFFF) << 24)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[43] >> 20)) & 1))^(((in[43] >> 20))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_45(initoffset int64, in *[45]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 45) | ((in[1] & 0x3FFFFFF) << 19))) & 1))^((((in[0] >> 45) | ((in[1] & 0x3FFFFFF) << 19)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 26) | ((in[2] & 0x7F) << 38))) & 1))^((((in[1] >> 26) | ((in[2] & 0x7F) << 38)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[2] >> 7) & 0x1FFFFFFFFFFF) & 1))^(((in[2] >> 7) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 52) | ((in[3] & 0x1FFFFFFFF) << 12))) & 1))^((((in[2] >> 52) | ((in[3] & 0x1FFFFFFFF) << 12)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 33) | ((in[4] & 0x3FFF) << 31))) & 1))^((((in[3] >> 33) | ((in[4] & 0x3FFF) << 31)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[4] >> 14) & 0x1FFFFFFFFFFF) & 1))^(((in[4] >> 14) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[4] >> 59) | ((in[5] & 0xFFFFFFFFFF) << 5))) & 1))^((((in[4] >> 59) | ((in[5] & 0xFFFFFFFFFF) << 5)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[5] >> 40) | ((in[6] & 0x1FFFFF) << 24))) & 1))^((((in[5] >> 40) | ((in[6] & 0x1FFFFF) << 24)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[6] >> 21) | ((in[7] & 0x3) << 43))) & 1))^((((in[6] >> 21) | ((in[7] & 0x3) << 43)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[7] >> 2) & 0x1FFFFFFFFFFF) & 1))^(((in[7] >> 2) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[7] >> 47) | ((in[8] & 0xFFFFFFF) << 17))) & 1))^((((in[7] >> 47) | ((in[8] & 0xFFFFFFF) << 17)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[8] >> 28) | ((in[9] & 0x1FF) << 36))) & 1))^((((in[8] >> 28) | ((in[9] & 0x1FF) << 36)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[9] >> 9) & 0x1FFFFFFFFFFF) & 1))^(((in[9] >> 9) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[9] >> 54) | ((in[10] & 0x7FFFFFFFF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0x7FFFFFFFF) << 10)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[10] >> 35) | ((in[11] & 0xFFFF) << 29))) & 1))^((((in[10] >> 35) | ((in[11] & 0xFFFF) << 29)))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[11] >> 16) & 0x1FFFFFFFFFFF) & 1))^(((in[11] >> 16) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[11] >> 61) | ((in[12] & 0x3FFFFFFFFFF) << 3))) & 1))^((((in[11] >> 61) | ((in[12] & 0x3FFFFFFFFFF) << 3)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[12] >> 42) | ((in[13] & 0x7FFFFF) << 22))) & 1))^((((in[12] >> 42) | ((in[13] & 0x7FFFFF) << 22)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[13] >> 23) | ((in[14] & 0xF) << 41))) & 1))^((((in[13] >> 23) | ((in[14] & 0xF) << 41)))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[14] >> 4) & 0x1FFFFFFFFFFF) & 1))^(((in[14] >> 4) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[14] >> 49) | ((in[15] & 0x3FFFFFFF) << 15))) & 1))^((((in[14] >> 49) | ((in[15] & 0x3FFFFFFF) << 15)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[15] >> 30) | ((in[16] & 0x7FF) << 34))) & 1))^((((in[15] >> 30) | ((in[16] & 0x7FF) << 34)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[16] >> 11) & 0x1FFFFFFFFFFF) & 1))^(((in[16] >> 11) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[16] >> 56) | ((in[17] & 0x1FFFFFFFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0x1FFFFFFFFF) << 8)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[17] >> 37) | ((in[18] & 0x3FFFF) << 27))) & 1))^((((in[17] >> 37) | ((in[18] & 0x3FFFF) << 27)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[18] >> 18) & 0x1FFFFFFFFFFF) & 1))^(((in[18] >> 18) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[18] >> 63) | ((in[19] & 0xFFFFFFFFFFF) << 1))) & 1))^((((in[18] >> 63) | ((in[19] & 0xFFFFFFFFFFF) << 1)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[19] >> 44) | ((in[20] & 0x1FFFFFF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0x1FFFFFF) << 20)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[20] >> 25) | ((in[21] & 0x3F) << 39))) & 1))^((((in[20] >> 25) | ((in[21] & 0x3F) << 39)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[21] >> 6) & 0x1FFFFFFFFFFF) & 1))^(((in[21] >> 6) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[21] >> 51) | ((in[22] & 0xFFFFFFFF) << 13))) & 1))^((((in[21] >> 51) | ((in[22] & 0xFFFFFFFF) << 13)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[22] >> 32) | ((in[23] & 0x1FFF) << 32))) & 1))^((((in[22] >> 32) | ((in[23] & 0x1FFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[23] >> 13) & 0x1FFFFFFFFFFF) & 1))^(((in[23] >> 13) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[23] >> 58) | ((in[24] & 0x7FFFFFFFFF) << 6))) & 1))^((((in[23] >> 58) | ((in[24] & 0x7FFFFFFFFF) << 6)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[24] >> 39) | ((in[25] & 0xFFFFF) << 25))) & 1))^((((in[24] >> 39) | ((in[25] & 0xFFFFF) << 25)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[25] >> 20) | ((in[26] & 0x1) << 44))) & 1))^((((in[25] >> 20) | ((in[26] & 0x1) << 44)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[26] >> 1) & 0x1FFFFFFFFFFF) & 1))^(((in[26] >> 1) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[26] >> 46) | ((in[27] & 0x7FFFFFF) << 18))) & 1))^((((in[26] >> 46) | ((in[27] & 0x7FFFFFF) << 18)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[27] >> 27) | ((in[28] & 0xFF) << 37))) & 1))^((((in[27] >> 27) | ((in[28] & 0xFF) << 37)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[28] >> 8) & 0x1FFFFFFFFFFF) & 1))^(((in[28] >> 8) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[28] >> 53) | ((in[29] & 0x3FFFFFFFF) << 11))) & 1))^((((in[28] >> 53) | ((in[29] & 0x3FFFFFFFF) << 11)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[29] >> 34) | ((in[30] & 0x7FFF) << 30))) & 1))^((((in[29] >> 34) | ((in[30] & 0x7FFF) << 30)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[30] >> 15) & 0x1FFFFFFFFFFF) & 1))^(((in[30] >> 15) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[42] + out[44] = int64(((-((((in[30] >> 60) | ((in[31] & 0x1FFFFFFFFFF) << 4))) & 1))^((((in[30] >> 60) | ((in[31] & 0x1FFFFFFFFFF) << 4)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[31] >> 41) | ((in[32] & 0x3FFFFF) << 23))) & 1))^((((in[31] >> 41) | ((in[32] & 0x3FFFFF) << 23)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[32] >> 22) | ((in[33] & 0x7) << 42))) & 1))^((((in[32] >> 22) | ((in[33] & 0x7) << 42)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[33] >> 3) & 0x1FFFFFFFFFFF) & 1))^(((in[33] >> 3) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[46] + out[48] = int64(((-((((in[33] >> 48) | ((in[34] & 0x1FFFFFFF) << 16))) & 1))^((((in[33] >> 48) | ((in[34] & 0x1FFFFFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[34] >> 29) | ((in[35] & 0x3FF) << 35))) & 1))^((((in[34] >> 29) | ((in[35] & 0x3FF) << 35)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[35] >> 10) & 0x1FFFFFFFFFFF) & 1))^(((in[35] >> 10) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[35] >> 55) | ((in[36] & 0xFFFFFFFFF) << 9))) & 1))^((((in[35] >> 55) | ((in[36] & 0xFFFFFFFFF) << 9)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[36] >> 36) | ((in[37] & 0x1FFFF) << 28))) & 1))^((((in[36] >> 36) | ((in[37] & 0x1FFFF) << 28)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[37] >> 17) & 0x1FFFFFFFFFFF) & 1))^(((in[37] >> 17) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[37] >> 62) | ((in[38] & 0x7FFFFFFFFFF) << 2))) & 1))^((((in[37] >> 62) | ((in[38] & 0x7FFFFFFFFFF) << 2)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[38] >> 43) | ((in[39] & 0xFFFFFF) << 21))) & 1))^((((in[38] >> 43) | ((in[39] & 0xFFFFFF) << 21)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[39] >> 24) | ((in[40] & 0x1F) << 40))) & 1))^((((in[39] >> 24) | ((in[40] & 0x1F) << 40)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[40] >> 5) & 0x1FFFFFFFFFFF) & 1))^(((in[40] >> 5) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[40] >> 50) | ((in[41] & 0x7FFFFFFF) << 14))) & 1))^((((in[40] >> 50) | ((in[41] & 0x7FFFFFFF) << 14)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[41] >> 31) | ((in[42] & 0xFFF) << 33))) & 1))^((((in[41] >> 31) | ((in[42] & 0xFFF) << 33)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[42] >> 12) & 0x1FFFFFFFFFFF) & 1))^(((in[42] >> 12) & 0x1FFFFFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFF) << 7))) & 1))^((((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFF) << 7)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[43] >> 38) | ((in[44] & 0x7FFFF) << 26))) & 1))^((((in[43] >> 38) | ((in[44] & 0x7FFFF) << 26)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[44] >> 19)) & 1))^(((in[44] >> 19))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_46(initoffset int64, in *[46]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 46) | ((in[1] & 0xFFFFFFF) << 18))) & 1))^((((in[0] >> 46) | ((in[1] & 0xFFFFFFF) << 18)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 28) | ((in[2] & 0x3FF) << 36))) & 1))^((((in[1] >> 28) | ((in[2] & 0x3FF) << 36)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[2] >> 10) & 0x3FFFFFFFFFFF) & 1))^(((in[2] >> 10) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 56) | ((in[3] & 0x3FFFFFFFFF) << 8))) & 1))^((((in[2] >> 56) | ((in[3] & 0x3FFFFFFFFF) << 8)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 38) | ((in[4] & 0xFFFFF) << 26))) & 1))^((((in[3] >> 38) | ((in[4] & 0xFFFFF) << 26)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 20) | ((in[5] & 0x3) << 44))) & 1))^((((in[4] >> 20) | ((in[5] & 0x3) << 44)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[5] >> 2) & 0x3FFFFFFFFFFF) & 1))^(((in[5] >> 2) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[5] >> 48) | ((in[6] & 0x3FFFFFFF) << 16))) & 1))^((((in[5] >> 48) | ((in[6] & 0x3FFFFFFF) << 16)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[6] >> 30) | ((in[7] & 0xFFF) << 34))) & 1))^((((in[6] >> 30) | ((in[7] & 0xFFF) << 34)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[7] >> 12) & 0x3FFFFFFFFFFF) & 1))^(((in[7] >> 12) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[7] >> 58) | ((in[8] & 0xFFFFFFFFFF) << 6))) & 1))^((((in[7] >> 58) | ((in[8] & 0xFFFFFFFFFF) << 6)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[8] >> 40) | ((in[9] & 0x3FFFFF) << 24))) & 1))^((((in[8] >> 40) | ((in[9] & 0x3FFFFF) << 24)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[9] >> 22) | ((in[10] & 0xF) << 42))) & 1))^((((in[9] >> 22) | ((in[10] & 0xF) << 42)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[10] >> 4) & 0x3FFFFFFFFFFF) & 1))^(((in[10] >> 4) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[10] >> 50) | ((in[11] & 0xFFFFFFFF) << 14))) & 1))^((((in[10] >> 50) | ((in[11] & 0xFFFFFFFF) << 14)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[11] >> 32) | ((in[12] & 0x3FFF) << 32))) & 1))^((((in[11] >> 32) | ((in[12] & 0x3FFF) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[12] >> 14) & 0x3FFFFFFFFFFF) & 1))^(((in[12] >> 14) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[12] >> 60) | ((in[13] & 0x3FFFFFFFFFF) << 4))) & 1))^((((in[12] >> 60) | ((in[13] & 0x3FFFFFFFFFF) << 4)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[13] >> 42) | ((in[14] & 0xFFFFFF) << 22))) & 1))^((((in[13] >> 42) | ((in[14] & 0xFFFFFF) << 22)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[14] >> 24) | ((in[15] & 0x3F) << 40))) & 1))^((((in[14] >> 24) | ((in[15] & 0x3F) << 40)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[15] >> 6) & 0x3FFFFFFFFFFF) & 1))^(((in[15] >> 6) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[15] >> 52) | ((in[16] & 0x3FFFFFFFF) << 12))) & 1))^((((in[15] >> 52) | ((in[16] & 0x3FFFFFFFF) << 12)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[16] >> 34) | ((in[17] & 0xFFFF) << 30))) & 1))^((((in[16] >> 34) | ((in[17] & 0xFFFF) << 30)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[17] >> 16) & 0x3FFFFFFFFFFF) & 1))^(((in[17] >> 16) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFF) << 2))) & 1))^((((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFF) << 2)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[18] >> 44) | ((in[19] & 0x3FFFFFF) << 20))) & 1))^((((in[18] >> 44) | ((in[19] & 0x3FFFFFF) << 20)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[19] >> 26) | ((in[20] & 0xFF) << 38))) & 1))^((((in[19] >> 26) | ((in[20] & 0xFF) << 38)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[20] >> 8) & 0x3FFFFFFFFFFF) & 1))^(((in[20] >> 8) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[20] >> 54) | ((in[21] & 0xFFFFFFFFF) << 10))) & 1))^((((in[20] >> 54) | ((in[21] & 0xFFFFFFFFF) << 10)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[21] >> 36) | ((in[22] & 0x3FFFF) << 28))) & 1))^((((in[21] >> 36) | ((in[22] & 0x3FFFF) << 28)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[22] >> 18)) & 1))^(((in[22] >> 18))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[23] >> 0) & 0x3FFFFFFFFFFF) & 1))^(((in[23] >> 0) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[23] >> 46) | ((in[24] & 0xFFFFFFF) << 18))) & 1))^((((in[23] >> 46) | ((in[24] & 0xFFFFFFF) << 18)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[24] >> 28) | ((in[25] & 0x3FF) << 36))) & 1))^((((in[24] >> 28) | ((in[25] & 0x3FF) << 36)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[25] >> 10) & 0x3FFFFFFFFFFF) & 1))^(((in[25] >> 10) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[25] >> 56) | ((in[26] & 0x3FFFFFFFFF) << 8))) & 1))^((((in[25] >> 56) | ((in[26] & 0x3FFFFFFFFF) << 8)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[26] >> 38) | ((in[27] & 0xFFFFF) << 26))) & 1))^((((in[26] >> 38) | ((in[27] & 0xFFFFF) << 26)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[27] >> 20) | ((in[28] & 0x3) << 44))) & 1))^((((in[27] >> 20) | ((in[28] & 0x3) << 44)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[28] >> 2) & 0x3FFFFFFFFFFF) & 1))^(((in[28] >> 2) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[28] >> 48) | ((in[29] & 0x3FFFFFFF) << 16))) & 1))^((((in[28] >> 48) | ((in[29] & 0x3FFFFFFF) << 16)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[29] >> 30) | ((in[30] & 0xFFF) << 34))) & 1))^((((in[29] >> 30) | ((in[30] & 0xFFF) << 34)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[30] >> 12) & 0x3FFFFFFFFFFF) & 1))^(((in[30] >> 12) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[30] >> 58) | ((in[31] & 0xFFFFFFFFFF) << 6))) & 1))^((((in[30] >> 58) | ((in[31] & 0xFFFFFFFFFF) << 6)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[31] >> 40) | ((in[32] & 0x3FFFFF) << 24))) & 1))^((((in[31] >> 40) | ((in[32] & 0x3FFFFF) << 24)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[32] >> 22) | ((in[33] & 0xF) << 42))) & 1))^((((in[32] >> 22) | ((in[33] & 0xF) << 42)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[33] >> 4) & 0x3FFFFFFFFFFF) & 1))^(((in[33] >> 4) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[33] >> 50) | ((in[34] & 0xFFFFFFFF) << 14))) & 1))^((((in[33] >> 50) | ((in[34] & 0xFFFFFFFF) << 14)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[34] >> 32) | ((in[35] & 0x3FFF) << 32))) & 1))^((((in[34] >> 32) | ((in[35] & 0x3FFF) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[35] >> 14) & 0x3FFFFFFFFFFF) & 1))^(((in[35] >> 14) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFF) << 4))) & 1))^((((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFF) << 4)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[36] >> 42) | ((in[37] & 0xFFFFFF) << 22))) & 1))^((((in[36] >> 42) | ((in[37] & 0xFFFFFF) << 22)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[37] >> 24) | ((in[38] & 0x3F) << 40))) & 1))^((((in[37] >> 24) | ((in[38] & 0x3F) << 40)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[38] >> 6) & 0x3FFFFFFFFFFF) & 1))^(((in[38] >> 6) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[38] >> 52) | ((in[39] & 0x3FFFFFFFF) << 12))) & 1))^((((in[38] >> 52) | ((in[39] & 0x3FFFFFFFF) << 12)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[39] >> 34) | ((in[40] & 0xFFFF) << 30))) & 1))^((((in[39] >> 34) | ((in[40] & 0xFFFF) << 30)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[40] >> 16) & 0x3FFFFFFFFFFF) & 1))^(((in[40] >> 16) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[40] >> 62) | ((in[41] & 0xFFFFFFFFFFF) << 2))) & 1))^((((in[40] >> 62) | ((in[41] & 0xFFFFFFFFFFF) << 2)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[41] >> 44) | ((in[42] & 0x3FFFFFF) << 20))) & 1))^((((in[41] >> 44) | ((in[42] & 0x3FFFFFF) << 20)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[42] >> 26) | ((in[43] & 0xFF) << 38))) & 1))^((((in[42] >> 26) | ((in[43] & 0xFF) << 38)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[43] >> 8) & 0x3FFFFFFFFFFF) & 1))^(((in[43] >> 8) & 0x3FFFFFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[43] >> 54) | ((in[44] & 0xFFFFFFFFF) << 10))) & 1))^((((in[43] >> 54) | ((in[44] & 0xFFFFFFFFF) << 10)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[44] >> 36) | ((in[45] & 0x3FFFF) << 28))) & 1))^((((in[44] >> 36) | ((in[45] & 0x3FFFF) << 28)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[45] >> 18)) & 1))^(((in[45] >> 18))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_47(initoffset int64, in *[47]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 47) | ((in[1] & 0x3FFFFFFF) << 17))) & 1))^((((in[0] >> 47) | ((in[1] & 0x3FFFFFFF) << 17)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 30) | ((in[2] & 0x1FFF) << 34))) & 1))^((((in[1] >> 30) | ((in[2] & 0x1FFF) << 34)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[2] >> 13) & 0x7FFFFFFFFFFF) & 1))^(((in[2] >> 13) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[2] + out[4] = int64(((-((((in[2] >> 60) | ((in[3] & 0x7FFFFFFFFFF) << 4))) & 1))^((((in[2] >> 60) | ((in[3] & 0x7FFFFFFFFFF) << 4)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 43) | ((in[4] & 0x3FFFFFF) << 21))) & 1))^((((in[3] >> 43) | ((in[4] & 0x3FFFFFF) << 21)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 26) | ((in[5] & 0x1FF) << 38))) & 1))^((((in[4] >> 26) | ((in[5] & 0x1FF) << 38)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[5] >> 9) & 0x7FFFFFFFFFFF) & 1))^(((in[5] >> 9) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[5] >> 56) | ((in[6] & 0x7FFFFFFFFF) << 8))) & 1))^((((in[5] >> 56) | ((in[6] & 0x7FFFFFFFFF) << 8)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[6] >> 39) | ((in[7] & 0x3FFFFF) << 25))) & 1))^((((in[6] >> 39) | ((in[7] & 0x3FFFFF) << 25)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[7] >> 22) | ((in[8] & 0x1F) << 42))) & 1))^((((in[7] >> 22) | ((in[8] & 0x1F) << 42)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[8] >> 5) & 0x7FFFFFFFFFFF) & 1))^(((in[8] >> 5) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[8] >> 52) | ((in[9] & 0x7FFFFFFFF) << 12))) & 1))^((((in[8] >> 52) | ((in[9] & 0x7FFFFFFFF) << 12)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[9] >> 35) | ((in[10] & 0x3FFFF) << 29))) & 1))^((((in[9] >> 35) | ((in[10] & 0x3FFFF) << 29)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[10] >> 18) | ((in[11] & 0x1) << 46))) & 1))^((((in[10] >> 18) | ((in[11] & 0x1) << 46)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[11] >> 1) & 0x7FFFFFFFFFFF) & 1))^(((in[11] >> 1) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[14] + out[16] = int64(((-((((in[11] >> 48) | ((in[12] & 0x7FFFFFFF) << 16))) & 1))^((((in[11] >> 48) | ((in[12] & 0x7FFFFFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[12] >> 31) | ((in[13] & 0x3FFF) << 33))) & 1))^((((in[12] >> 31) | ((in[13] & 0x3FFF) << 33)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[13] >> 14) & 0x7FFFFFFFFFFF) & 1))^(((in[13] >> 14) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[13] >> 61) | ((in[14] & 0xFFFFFFFFFFF) << 3))) & 1))^((((in[13] >> 61) | ((in[14] & 0xFFFFFFFFFFF) << 3)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[14] >> 44) | ((in[15] & 0x7FFFFFF) << 20))) & 1))^((((in[14] >> 44) | ((in[15] & 0x7FFFFFF) << 20)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[15] >> 27) | ((in[16] & 0x3FF) << 37))) & 1))^((((in[15] >> 27) | ((in[16] & 0x3FF) << 37)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[16] >> 10) & 0x7FFFFFFFFFFF) & 1))^(((in[16] >> 10) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[16] >> 57) | ((in[17] & 0xFFFFFFFFFF) << 7))) & 1))^((((in[16] >> 57) | ((in[17] & 0xFFFFFFFFFF) << 7)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[17] >> 40) | ((in[18] & 0x7FFFFF) << 24))) & 1))^((((in[17] >> 40) | ((in[18] & 0x7FFFFF) << 24)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[18] >> 23) | ((in[19] & 0x3F) << 41))) & 1))^((((in[18] >> 23) | ((in[19] & 0x3F) << 41)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[19] >> 6) & 0x7FFFFFFFFFFF) & 1))^(((in[19] >> 6) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[19] >> 53) | ((in[20] & 0xFFFFFFFFF) << 11))) & 1))^((((in[19] >> 53) | ((in[20] & 0xFFFFFFFFF) << 11)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[20] >> 36) | ((in[21] & 0x7FFFF) << 28))) & 1))^((((in[20] >> 36) | ((in[21] & 0x7FFFF) << 28)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[21] >> 19) | ((in[22] & 0x3) << 45))) & 1))^((((in[21] >> 19) | ((in[22] & 0x3) << 45)))>>1))) << ntz + out[28] + out[30] = int64(((-(((in[22] >> 2) & 0x7FFFFFFFFFFF) & 1))^(((in[22] >> 2) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[29] + out[31] = int64(((-((((in[22] >> 49) | ((in[23] & 0xFFFFFFFF) << 15))) & 1))^((((in[22] >> 49) | ((in[23] & 0xFFFFFFFF) << 15)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[23] >> 32) | ((in[24] & 0x7FFF) << 32))) & 1))^((((in[23] >> 32) | ((in[24] & 0x7FFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-(((in[24] >> 15) & 0x7FFFFFFFFFFF) & 1))^(((in[24] >> 15) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[32] + out[34] = int64(((-((((in[24] >> 62) | ((in[25] & 0x1FFFFFFFFFFF) << 2))) & 1))^((((in[24] >> 62) | ((in[25] & 0x1FFFFFFFFFFF) << 2)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[25] >> 45) | ((in[26] & 0xFFFFFFF) << 19))) & 1))^((((in[25] >> 45) | ((in[26] & 0xFFFFFFF) << 19)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[26] >> 28) | ((in[27] & 0x7FF) << 36))) & 1))^((((in[26] >> 28) | ((in[27] & 0x7FF) << 36)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[27] >> 11) & 0x7FFFFFFFFFFF) & 1))^(((in[27] >> 11) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[27] >> 58) | ((in[28] & 0x1FFFFFFFFFF) << 6))) & 1))^((((in[27] >> 58) | ((in[28] & 0x1FFFFFFFFFF) << 6)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[28] >> 41) | ((in[29] & 0xFFFFFF) << 23))) & 1))^((((in[28] >> 41) | ((in[29] & 0xFFFFFF) << 23)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[29] >> 24) | ((in[30] & 0x7F) << 40))) & 1))^((((in[29] >> 24) | ((in[30] & 0x7F) << 40)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[30] >> 7) & 0x7FFFFFFFFFFF) & 1))^(((in[30] >> 7) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[30] >> 54) | ((in[31] & 0x1FFFFFFFFF) << 10))) & 1))^((((in[30] >> 54) | ((in[31] & 0x1FFFFFFFFF) << 10)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[31] >> 37) | ((in[32] & 0xFFFFF) << 27))) & 1))^((((in[31] >> 37) | ((in[32] & 0xFFFFF) << 27)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[32] >> 20) | ((in[33] & 0x7) << 44))) & 1))^((((in[32] >> 20) | ((in[33] & 0x7) << 44)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[33] >> 3) & 0x7FFFFFFFFFFF) & 1))^(((in[33] >> 3) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[33] >> 50) | ((in[34] & 0x1FFFFFFFF) << 14))) & 1))^((((in[33] >> 50) | ((in[34] & 0x1FFFFFFFF) << 14)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[34] >> 33) | ((in[35] & 0xFFFF) << 31))) & 1))^((((in[34] >> 33) | ((in[35] & 0xFFFF) << 31)))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[35] >> 16) & 0x7FFFFFFFFFFF) & 1))^(((in[35] >> 16) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[35] >> 63) | ((in[36] & 0x3FFFFFFFFFFF) << 1))) & 1))^((((in[35] >> 63) | ((in[36] & 0x3FFFFFFFFFFF) << 1)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[36] >> 46) | ((in[37] & 0x1FFFFFFF) << 18))) & 1))^((((in[36] >> 46) | ((in[37] & 0x1FFFFFFF) << 18)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[37] >> 29) | ((in[38] & 0xFFF) << 35))) & 1))^((((in[37] >> 29) | ((in[38] & 0xFFF) << 35)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[38] >> 12) & 0x7FFFFFFFFFFF) & 1))^(((in[38] >> 12) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[38] >> 59) | ((in[39] & 0x3FFFFFFFFFF) << 5))) & 1))^((((in[38] >> 59) | ((in[39] & 0x3FFFFFFFFFF) << 5)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[39] >> 42) | ((in[40] & 0x1FFFFFF) << 22))) & 1))^((((in[39] >> 42) | ((in[40] & 0x1FFFFFF) << 22)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[40] >> 25) | ((in[41] & 0xFF) << 39))) & 1))^((((in[40] >> 25) | ((in[41] & 0xFF) << 39)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[41] >> 8) & 0x7FFFFFFFFFFF) & 1))^(((in[41] >> 8) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[41] >> 55) | ((in[42] & 0x3FFFFFFFFF) << 9))) & 1))^((((in[41] >> 55) | ((in[42] & 0x3FFFFFFFFF) << 9)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[42] >> 38) | ((in[43] & 0x1FFFFF) << 26))) & 1))^((((in[42] >> 38) | ((in[43] & 0x1FFFFF) << 26)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[43] >> 21) | ((in[44] & 0xF) << 43))) & 1))^((((in[43] >> 21) | ((in[44] & 0xF) << 43)))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[44] >> 4) & 0x7FFFFFFFFFFF) & 1))^(((in[44] >> 4) & 0x7FFFFFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[44] >> 51) | ((in[45] & 0x3FFFFFFFF) << 13))) & 1))^((((in[44] >> 51) | ((in[45] & 0x3FFFFFFFF) << 13)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[45] >> 34) | ((in[46] & 0x1FFFF) << 30))) & 1))^((((in[45] >> 34) | ((in[46] & 0x1FFFF) << 30)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[46] >> 17)) & 1))^(((in[46] >> 17))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_48(initoffset int64, in *[48]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 48) | ((in[1] & 0xFFFFFFFF) << 16))) & 1))^((((in[0] >> 48) | ((in[1] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 32) | ((in[2] & 0xFFFF) << 32))) & 1))^((((in[1] >> 32) | ((in[2] & 0xFFFF) << 32)))>>1))) << ntz + out[1] + out[3] = int64(((-(((in[2] >> 16)) & 1))^(((in[2] >> 16))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[3] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[3] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 48) | ((in[4] & 0xFFFFFFFF) << 16))) & 1))^((((in[3] >> 48) | ((in[4] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 32) | ((in[5] & 0xFFFF) << 32))) & 1))^((((in[4] >> 32) | ((in[5] & 0xFFFF) << 32)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[5] >> 16)) & 1))^(((in[5] >> 16))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[6] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[6] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[6] >> 48) | ((in[7] & 0xFFFFFFFF) << 16))) & 1))^((((in[6] >> 48) | ((in[7] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[7] >> 32) | ((in[8] & 0xFFFF) << 32))) & 1))^((((in[7] >> 32) | ((in[8] & 0xFFFF) << 32)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[8] >> 16)) & 1))^(((in[8] >> 16))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[9] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[9] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[9] >> 48) | ((in[10] & 0xFFFFFFFF) << 16))) & 1))^((((in[9] >> 48) | ((in[10] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[10] >> 32) | ((in[11] & 0xFFFF) << 32))) & 1))^((((in[10] >> 32) | ((in[11] & 0xFFFF) << 32)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[11] >> 16)) & 1))^(((in[11] >> 16))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[12] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[12] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[12] >> 48) | ((in[13] & 0xFFFFFFFF) << 16))) & 1))^((((in[12] >> 48) | ((in[13] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[13] >> 32) | ((in[14] & 0xFFFF) << 32))) & 1))^((((in[13] >> 32) | ((in[14] & 0xFFFF) << 32)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[14] >> 16)) & 1))^(((in[14] >> 16))>>1))) << ntz + out[18] + out[20] = int64(((-(((in[15] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[19] + out[21] = int64(((-((((in[15] >> 48) | ((in[16] & 0xFFFFFFFF) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[16] >> 32) | ((in[17] & 0xFFFF) << 32))) & 1))^((((in[16] >> 32) | ((in[17] & 0xFFFF) << 32)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[17] >> 16)) & 1))^(((in[17] >> 16))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[18] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[18] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[18] >> 48) | ((in[19] & 0xFFFFFFFF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[19] >> 32) | ((in[20] & 0xFFFF) << 32))) & 1))^((((in[19] >> 32) | ((in[20] & 0xFFFF) << 32)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[20] >> 16)) & 1))^(((in[20] >> 16))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[21] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[21] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[21] >> 48) | ((in[22] & 0xFFFFFFFF) << 16))) & 1))^((((in[21] >> 48) | ((in[22] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[22] >> 32) | ((in[23] & 0xFFFF) << 32))) & 1))^((((in[22] >> 32) | ((in[23] & 0xFFFF) << 32)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[23] >> 16)) & 1))^(((in[23] >> 16))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[24] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[24] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[24] >> 48) | ((in[25] & 0xFFFFFFFF) << 16))) & 1))^((((in[24] >> 48) | ((in[25] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[25] >> 32) | ((in[26] & 0xFFFF) << 32))) & 1))^((((in[25] >> 32) | ((in[26] & 0xFFFF) << 32)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[26] >> 16)) & 1))^(((in[26] >> 16))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[27] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[27] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[27] >> 48) | ((in[28] & 0xFFFFFFFF) << 16))) & 1))^((((in[27] >> 48) | ((in[28] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[28] >> 32) | ((in[29] & 0xFFFF) << 32))) & 1))^((((in[28] >> 32) | ((in[29] & 0xFFFF) << 32)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[29] >> 16)) & 1))^(((in[29] >> 16))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[30] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[30] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[30] >> 48) | ((in[31] & 0xFFFFFFFF) << 16))) & 1))^((((in[30] >> 48) | ((in[31] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[31] >> 32) | ((in[32] & 0xFFFF) << 32))) & 1))^((((in[31] >> 32) | ((in[32] & 0xFFFF) << 32)))>>1))) << ntz + out[41] + out[43] = int64(((-(((in[32] >> 16)) & 1))^(((in[32] >> 16))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[33] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[33] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[33] >> 48) | ((in[34] & 0xFFFFFFFF) << 16))) & 1))^((((in[33] >> 48) | ((in[34] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[34] >> 32) | ((in[35] & 0xFFFF) << 32))) & 1))^((((in[34] >> 32) | ((in[35] & 0xFFFF) << 32)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[35] >> 16)) & 1))^(((in[35] >> 16))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[36] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[36] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[36] >> 48) | ((in[37] & 0xFFFFFFFF) << 16))) & 1))^((((in[36] >> 48) | ((in[37] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[37] >> 32) | ((in[38] & 0xFFFF) << 32))) & 1))^((((in[37] >> 32) | ((in[38] & 0xFFFF) << 32)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[38] >> 16)) & 1))^(((in[38] >> 16))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[39] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[39] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[39] >> 48) | ((in[40] & 0xFFFFFFFF) << 16))) & 1))^((((in[39] >> 48) | ((in[40] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[40] >> 32) | ((in[41] & 0xFFFF) << 32))) & 1))^((((in[40] >> 32) | ((in[41] & 0xFFFF) << 32)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[41] >> 16)) & 1))^(((in[41] >> 16))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[42] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[42] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[42] >> 48) | ((in[43] & 0xFFFFFFFF) << 16))) & 1))^((((in[42] >> 48) | ((in[43] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[43] >> 32) | ((in[44] & 0xFFFF) << 32))) & 1))^((((in[43] >> 32) | ((in[44] & 0xFFFF) << 32)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[44] >> 16)) & 1))^(((in[44] >> 16))>>1))) << ntz + out[58] + out[60] = int64(((-(((in[45] >> 0) & 0xFFFFFFFFFFFF) & 1))^(((in[45] >> 0) & 0xFFFFFFFFFFFF)>>1))) << ntz + out[59] + out[61] = int64(((-((((in[45] >> 48) | ((in[46] & 0xFFFFFFFF) << 16))) & 1))^((((in[45] >> 48) | ((in[46] & 0xFFFFFFFF) << 16)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[46] >> 32) | ((in[47] & 0xFFFF) << 32))) & 1))^((((in[46] >> 32) | ((in[47] & 0xFFFF) << 32)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[47] >> 16)) & 1))^(((in[47] >> 16))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_49(initoffset int64, in *[49]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 49) | ((in[1] & 0x3FFFFFFFF) << 15))) & 1))^((((in[0] >> 49) | ((in[1] & 0x3FFFFFFFF) << 15)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 34) | ((in[2] & 0x7FFFF) << 30))) & 1))^((((in[1] >> 34) | ((in[2] & 0x7FFFF) << 30)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 19) | ((in[3] & 0xF) << 45))) & 1))^((((in[2] >> 19) | ((in[3] & 0xF) << 45)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[3] >> 4) & 0x1FFFFFFFFFFFF) & 1))^(((in[3] >> 4) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 53) | ((in[4] & 0x3FFFFFFFFF) << 11))) & 1))^((((in[3] >> 53) | ((in[4] & 0x3FFFFFFFFF) << 11)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 38) | ((in[5] & 0x7FFFFF) << 26))) & 1))^((((in[4] >> 38) | ((in[5] & 0x7FFFFF) << 26)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[5] >> 23) | ((in[6] & 0xFF) << 41))) & 1))^((((in[5] >> 23) | ((in[6] & 0xFF) << 41)))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[6] >> 8) & 0x1FFFFFFFFFFFF) & 1))^(((in[6] >> 8) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[6] >> 57) | ((in[7] & 0x3FFFFFFFFFF) << 7))) & 1))^((((in[6] >> 57) | ((in[7] & 0x3FFFFFFFFFF) << 7)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[7] >> 42) | ((in[8] & 0x7FFFFFF) << 22))) & 1))^((((in[7] >> 42) | ((in[8] & 0x7FFFFFF) << 22)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[8] >> 27) | ((in[9] & 0xFFF) << 37))) & 1))^((((in[8] >> 27) | ((in[9] & 0xFFF) << 37)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[9] >> 12) & 0x1FFFFFFFFFFFF) & 1))^(((in[9] >> 12) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[9] >> 61) | ((in[10] & 0x3FFFFFFFFFFF) << 3))) & 1))^((((in[9] >> 61) | ((in[10] & 0x3FFFFFFFFFFF) << 3)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[10] >> 46) | ((in[11] & 0x7FFFFFFF) << 18))) & 1))^((((in[10] >> 46) | ((in[11] & 0x7FFFFFFF) << 18)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[11] >> 31) | ((in[12] & 0xFFFF) << 33))) & 1))^((((in[11] >> 31) | ((in[12] & 0xFFFF) << 33)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[12] >> 16) | ((in[13] & 0x1) << 48))) & 1))^((((in[12] >> 16) | ((in[13] & 0x1) << 48)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[13] >> 1) & 0x1FFFFFFFFFFFF) & 1))^(((in[13] >> 1) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[13] >> 50) | ((in[14] & 0x7FFFFFFFF) << 14))) & 1))^((((in[13] >> 50) | ((in[14] & 0x7FFFFFFFF) << 14)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[14] >> 35) | ((in[15] & 0xFFFFF) << 29))) & 1))^((((in[14] >> 35) | ((in[15] & 0xFFFFF) << 29)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[15] >> 20) | ((in[16] & 0x1F) << 44))) & 1))^((((in[15] >> 20) | ((in[16] & 0x1F) << 44)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[16] >> 5) & 0x1FFFFFFFFFFFF) & 1))^(((in[16] >> 5) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[16] >> 54) | ((in[17] & 0x7FFFFFFFFF) << 10))) & 1))^((((in[16] >> 54) | ((in[17] & 0x7FFFFFFFFF) << 10)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[17] >> 39) | ((in[18] & 0xFFFFFF) << 25))) & 1))^((((in[17] >> 39) | ((in[18] & 0xFFFFFF) << 25)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[18] >> 24) | ((in[19] & 0x1FF) << 40))) & 1))^((((in[18] >> 24) | ((in[19] & 0x1FF) << 40)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[19] >> 9) & 0x1FFFFFFFFFFFF) & 1))^(((in[19] >> 9) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[19] >> 58) | ((in[20] & 0x7FFFFFFFFFF) << 6))) & 1))^((((in[19] >> 58) | ((in[20] & 0x7FFFFFFFFFF) << 6)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[20] >> 43) | ((in[21] & 0xFFFFFFF) << 21))) & 1))^((((in[20] >> 43) | ((in[21] & 0xFFFFFFF) << 21)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[21] >> 28) | ((in[22] & 0x1FFF) << 36))) & 1))^((((in[21] >> 28) | ((in[22] & 0x1FFF) << 36)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[22] >> 13) & 0x1FFFFFFFFFFFF) & 1))^(((in[22] >> 13) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[22] >> 62) | ((in[23] & 0x7FFFFFFFFFFF) << 2))) & 1))^((((in[22] >> 62) | ((in[23] & 0x7FFFFFFFFFFF) << 2)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[23] >> 47) | ((in[24] & 0xFFFFFFFF) << 17))) & 1))^((((in[23] >> 47) | ((in[24] & 0xFFFFFFFF) << 17)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[24] >> 32) | ((in[25] & 0x1FFFF) << 32))) & 1))^((((in[24] >> 32) | ((in[25] & 0x1FFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[25] >> 17) | ((in[26] & 0x3) << 47))) & 1))^((((in[25] >> 17) | ((in[26] & 0x3) << 47)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[26] >> 2) & 0x1FFFFFFFFFFFF) & 1))^(((in[26] >> 2) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[26] >> 51) | ((in[27] & 0xFFFFFFFFF) << 13))) & 1))^((((in[26] >> 51) | ((in[27] & 0xFFFFFFFFF) << 13)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[27] >> 36) | ((in[28] & 0x1FFFFF) << 28))) & 1))^((((in[27] >> 36) | ((in[28] & 0x1FFFFF) << 28)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[28] >> 21) | ((in[29] & 0x3F) << 43))) & 1))^((((in[28] >> 21) | ((in[29] & 0x3F) << 43)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[29] >> 6) & 0x1FFFFFFFFFFFF) & 1))^(((in[29] >> 6) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[29] >> 55) | ((in[30] & 0xFFFFFFFFFF) << 9))) & 1))^((((in[29] >> 55) | ((in[30] & 0xFFFFFFFFFF) << 9)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[30] >> 40) | ((in[31] & 0x1FFFFFF) << 24))) & 1))^((((in[30] >> 40) | ((in[31] & 0x1FFFFFF) << 24)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[31] >> 25) | ((in[32] & 0x3FF) << 39))) & 1))^((((in[31] >> 25) | ((in[32] & 0x3FF) << 39)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[32] >> 10) & 0x1FFFFFFFFFFFF) & 1))^(((in[32] >> 10) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[32] >> 59) | ((in[33] & 0xFFFFFFFFFFF) << 5))) & 1))^((((in[32] >> 59) | ((in[33] & 0xFFFFFFFFFFF) << 5)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[33] >> 44) | ((in[34] & 0x1FFFFFFF) << 20))) & 1))^((((in[33] >> 44) | ((in[34] & 0x1FFFFFFF) << 20)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[34] >> 29) | ((in[35] & 0x3FFF) << 35))) & 1))^((((in[34] >> 29) | ((in[35] & 0x3FFF) << 35)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[35] >> 14) & 0x1FFFFFFFFFFFF) & 1))^(((in[35] >> 14) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[35] >> 63) | ((in[36] & 0xFFFFFFFFFFFF) << 1))) & 1))^((((in[35] >> 63) | ((in[36] & 0xFFFFFFFFFFFF) << 1)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[36] >> 48) | ((in[37] & 0x1FFFFFFFF) << 16))) & 1))^((((in[36] >> 48) | ((in[37] & 0x1FFFFFFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[37] >> 33) | ((in[38] & 0x3FFFF) << 31))) & 1))^((((in[37] >> 33) | ((in[38] & 0x3FFFF) << 31)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[38] >> 18) | ((in[39] & 0x7) << 46))) & 1))^((((in[38] >> 18) | ((in[39] & 0x7) << 46)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[39] >> 3) & 0x1FFFFFFFFFFFF) & 1))^(((in[39] >> 3) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[39] >> 52) | ((in[40] & 0x1FFFFFFFFF) << 12))) & 1))^((((in[39] >> 52) | ((in[40] & 0x1FFFFFFFFF) << 12)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[40] >> 37) | ((in[41] & 0x3FFFFF) << 27))) & 1))^((((in[40] >> 37) | ((in[41] & 0x3FFFFF) << 27)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[41] >> 22) | ((in[42] & 0x7F) << 42))) & 1))^((((in[41] >> 22) | ((in[42] & 0x7F) << 42)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[42] >> 7) & 0x1FFFFFFFFFFFF) & 1))^(((in[42] >> 7) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[54] + out[56] = int64(((-((((in[42] >> 56) | ((in[43] & 0x1FFFFFFFFFF) << 8))) & 1))^((((in[42] >> 56) | ((in[43] & 0x1FFFFFFFFFF) << 8)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[43] >> 41) | ((in[44] & 0x3FFFFFF) << 23))) & 1))^((((in[43] >> 41) | ((in[44] & 0x3FFFFFF) << 23)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[44] >> 26) | ((in[45] & 0x7FF) << 38))) & 1))^((((in[44] >> 26) | ((in[45] & 0x7FF) << 38)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[45] >> 11) & 0x1FFFFFFFFFFFF) & 1))^(((in[45] >> 11) & 0x1FFFFFFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[45] >> 60) | ((in[46] & 0x1FFFFFFFFFFF) << 4))) & 1))^((((in[45] >> 60) | ((in[46] & 0x1FFFFFFFFFFF) << 4)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[46] >> 45) | ((in[47] & 0x3FFFFFFF) << 19))) & 1))^((((in[46] >> 45) | ((in[47] & 0x3FFFFFFF) << 19)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[47] >> 30) | ((in[48] & 0x7FFF) << 34))) & 1))^((((in[47] >> 30) | ((in[48] & 0x7FFF) << 34)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[48] >> 15)) & 1))^(((in[48] >> 15))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_50(initoffset int64, in *[50]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 50) | ((in[1] & 0xFFFFFFFFF) << 14))) & 1))^((((in[0] >> 50) | ((in[1] & 0xFFFFFFFFF) << 14)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 36) | ((in[2] & 0x3FFFFF) << 28))) & 1))^((((in[1] >> 36) | ((in[2] & 0x3FFFFF) << 28)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 22) | ((in[3] & 0xFF) << 42))) & 1))^((((in[2] >> 22) | ((in[3] & 0xFF) << 42)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[3] >> 8) & 0x3FFFFFFFFFFFF) & 1))^(((in[3] >> 8) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 58) | ((in[4] & 0xFFFFFFFFFFF) << 6))) & 1))^((((in[3] >> 58) | ((in[4] & 0xFFFFFFFFFFF) << 6)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 44) | ((in[5] & 0x3FFFFFFF) << 20))) & 1))^((((in[4] >> 44) | ((in[5] & 0x3FFFFFFF) << 20)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[5] >> 30) | ((in[6] & 0xFFFF) << 34))) & 1))^((((in[5] >> 30) | ((in[6] & 0xFFFF) << 34)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[6] >> 16) | ((in[7] & 0x3) << 48))) & 1))^((((in[6] >> 16) | ((in[7] & 0x3) << 48)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[7] >> 2) & 0x3FFFFFFFFFFFF) & 1))^(((in[7] >> 2) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[7] >> 52) | ((in[8] & 0x3FFFFFFFFF) << 12))) & 1))^((((in[7] >> 52) | ((in[8] & 0x3FFFFFFFFF) << 12)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[8] >> 38) | ((in[9] & 0xFFFFFF) << 26))) & 1))^((((in[8] >> 38) | ((in[9] & 0xFFFFFF) << 26)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[9] >> 24) | ((in[10] & 0x3FF) << 40))) & 1))^((((in[9] >> 24) | ((in[10] & 0x3FF) << 40)))>>1))) << ntz + out[11] + out[13] = int64(((-(((in[10] >> 10) & 0x3FFFFFFFFFFFF) & 1))^(((in[10] >> 10) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[12] + out[14] = int64(((-((((in[10] >> 60) | ((in[11] & 0x3FFFFFFFFFFF) << 4))) & 1))^((((in[10] >> 60) | ((in[11] & 0x3FFFFFFFFFFF) << 4)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[11] >> 46) | ((in[12] & 0xFFFFFFFF) << 18))) & 1))^((((in[11] >> 46) | ((in[12] & 0xFFFFFFFF) << 18)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[12] >> 32) | ((in[13] & 0x3FFFF) << 32))) & 1))^((((in[12] >> 32) | ((in[13] & 0x3FFFF) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[13] >> 18) | ((in[14] & 0xF) << 46))) & 1))^((((in[13] >> 18) | ((in[14] & 0xF) << 46)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[14] >> 4) & 0x3FFFFFFFFFFFF) & 1))^(((in[14] >> 4) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[14] >> 54) | ((in[15] & 0xFFFFFFFFFF) << 10))) & 1))^((((in[14] >> 54) | ((in[15] & 0xFFFFFFFFFF) << 10)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[15] >> 40) | ((in[16] & 0x3FFFFFF) << 24))) & 1))^((((in[15] >> 40) | ((in[16] & 0x3FFFFFF) << 24)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[16] >> 26) | ((in[17] & 0xFFF) << 38))) & 1))^((((in[16] >> 26) | ((in[17] & 0xFFF) << 38)))>>1))) << ntz + out[20] + out[22] = int64(((-(((in[17] >> 12) & 0x3FFFFFFFFFFFF) & 1))^(((in[17] >> 12) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[21] + out[23] = int64(((-((((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFFF) << 2))) & 1))^((((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[18] >> 48) | ((in[19] & 0x3FFFFFFFF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0x3FFFFFFFF) << 16)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[19] >> 34) | ((in[20] & 0xFFFFF) << 30))) & 1))^((((in[19] >> 34) | ((in[20] & 0xFFFFF) << 30)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[20] >> 20) | ((in[21] & 0x3F) << 44))) & 1))^((((in[20] >> 20) | ((in[21] & 0x3F) << 44)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[21] >> 6) & 0x3FFFFFFFFFFFF) & 1))^(((in[21] >> 6) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[21] >> 56) | ((in[22] & 0x3FFFFFFFFFF) << 8))) & 1))^((((in[21] >> 56) | ((in[22] & 0x3FFFFFFFFFF) << 8)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[22] >> 42) | ((in[23] & 0xFFFFFFF) << 22))) & 1))^((((in[22] >> 42) | ((in[23] & 0xFFFFFFF) << 22)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[23] >> 28) | ((in[24] & 0x3FFF) << 36))) & 1))^((((in[23] >> 28) | ((in[24] & 0x3FFF) << 36)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[24] >> 14)) & 1))^(((in[24] >> 14))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[25] >> 0) & 0x3FFFFFFFFFFFF) & 1))^(((in[25] >> 0) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[25] >> 50) | ((in[26] & 0xFFFFFFFFF) << 14))) & 1))^((((in[25] >> 50) | ((in[26] & 0xFFFFFFFFF) << 14)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[26] >> 36) | ((in[27] & 0x3FFFFF) << 28))) & 1))^((((in[26] >> 36) | ((in[27] & 0x3FFFFF) << 28)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[27] >> 22) | ((in[28] & 0xFF) << 42))) & 1))^((((in[27] >> 22) | ((in[28] & 0xFF) << 42)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[28] >> 8) & 0x3FFFFFFFFFFFF) & 1))^(((in[28] >> 8) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[28] >> 58) | ((in[29] & 0xFFFFFFFFFFF) << 6))) & 1))^((((in[28] >> 58) | ((in[29] & 0xFFFFFFFFFFF) << 6)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[29] >> 44) | ((in[30] & 0x3FFFFFFF) << 20))) & 1))^((((in[29] >> 44) | ((in[30] & 0x3FFFFFFF) << 20)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[30] >> 30) | ((in[31] & 0xFFFF) << 34))) & 1))^((((in[30] >> 30) | ((in[31] & 0xFFFF) << 34)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[31] >> 16) | ((in[32] & 0x3) << 48))) & 1))^((((in[31] >> 16) | ((in[32] & 0x3) << 48)))>>1))) << ntz + out[39] + out[41] = int64(((-(((in[32] >> 2) & 0x3FFFFFFFFFFFF) & 1))^(((in[32] >> 2) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[40] + out[42] = int64(((-((((in[32] >> 52) | ((in[33] & 0x3FFFFFFFFF) << 12))) & 1))^((((in[32] >> 52) | ((in[33] & 0x3FFFFFFFFF) << 12)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[33] >> 38) | ((in[34] & 0xFFFFFF) << 26))) & 1))^((((in[33] >> 38) | ((in[34] & 0xFFFFFF) << 26)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[34] >> 24) | ((in[35] & 0x3FF) << 40))) & 1))^((((in[34] >> 24) | ((in[35] & 0x3FF) << 40)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[35] >> 10) & 0x3FFFFFFFFFFFF) & 1))^(((in[35] >> 10) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFFF) << 4))) & 1))^((((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFFF) << 4)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[36] >> 46) | ((in[37] & 0xFFFFFFFF) << 18))) & 1))^((((in[36] >> 46) | ((in[37] & 0xFFFFFFFF) << 18)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[37] >> 32) | ((in[38] & 0x3FFFF) << 32))) & 1))^((((in[37] >> 32) | ((in[38] & 0x3FFFF) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[38] >> 18) | ((in[39] & 0xF) << 46))) & 1))^((((in[38] >> 18) | ((in[39] & 0xF) << 46)))>>1))) << ntz + out[48] + out[50] = int64(((-(((in[39] >> 4) & 0x3FFFFFFFFFFFF) & 1))^(((in[39] >> 4) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[49] + out[51] = int64(((-((((in[39] >> 54) | ((in[40] & 0xFFFFFFFFFF) << 10))) & 1))^((((in[39] >> 54) | ((in[40] & 0xFFFFFFFFFF) << 10)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[40] >> 40) | ((in[41] & 0x3FFFFFF) << 24))) & 1))^((((in[40] >> 40) | ((in[41] & 0x3FFFFFF) << 24)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[41] >> 26) | ((in[42] & 0xFFF) << 38))) & 1))^((((in[41] >> 26) | ((in[42] & 0xFFF) << 38)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[42] >> 12) & 0x3FFFFFFFFFFFF) & 1))^(((in[42] >> 12) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[42] >> 62) | ((in[43] & 0xFFFFFFFFFFFF) << 2))) & 1))^((((in[42] >> 62) | ((in[43] & 0xFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[43] >> 48) | ((in[44] & 0x3FFFFFFFF) << 16))) & 1))^((((in[43] >> 48) | ((in[44] & 0x3FFFFFFFF) << 16)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[44] >> 34) | ((in[45] & 0xFFFFF) << 30))) & 1))^((((in[44] >> 34) | ((in[45] & 0xFFFFF) << 30)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[45] >> 20) | ((in[46] & 0x3F) << 44))) & 1))^((((in[45] >> 20) | ((in[46] & 0x3F) << 44)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[46] >> 6) & 0x3FFFFFFFFFFFF) & 1))^(((in[46] >> 6) & 0x3FFFFFFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[46] >> 56) | ((in[47] & 0x3FFFFFFFFFF) << 8))) & 1))^((((in[46] >> 56) | ((in[47] & 0x3FFFFFFFFFF) << 8)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[47] >> 42) | ((in[48] & 0xFFFFFFF) << 22))) & 1))^((((in[47] >> 42) | ((in[48] & 0xFFFFFFF) << 22)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[48] >> 28) | ((in[49] & 0x3FFF) << 36))) & 1))^((((in[48] >> 28) | ((in[49] & 0x3FFF) << 36)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[49] >> 14)) & 1))^(((in[49] >> 14))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_51(initoffset int64, in *[51]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 51) | ((in[1] & 0x3FFFFFFFFF) << 13))) & 1))^((((in[0] >> 51) | ((in[1] & 0x3FFFFFFFFF) << 13)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 38) | ((in[2] & 0x1FFFFFF) << 26))) & 1))^((((in[1] >> 38) | ((in[2] & 0x1FFFFFF) << 26)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 25) | ((in[3] & 0xFFF) << 39))) & 1))^((((in[2] >> 25) | ((in[3] & 0xFFF) << 39)))>>1))) << ntz + out[2] + out[4] = int64(((-(((in[3] >> 12) & 0x7FFFFFFFFFFFF) & 1))^(((in[3] >> 12) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[3] + out[5] = int64(((-((((in[3] >> 63) | ((in[4] & 0x3FFFFFFFFFFFF) << 1))) & 1))^((((in[3] >> 63) | ((in[4] & 0x3FFFFFFFFFFFF) << 1)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 50) | ((in[5] & 0x1FFFFFFFFF) << 14))) & 1))^((((in[4] >> 50) | ((in[5] & 0x1FFFFFFFFF) << 14)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[5] >> 37) | ((in[6] & 0xFFFFFF) << 27))) & 1))^((((in[5] >> 37) | ((in[6] & 0xFFFFFF) << 27)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[6] >> 24) | ((in[7] & 0x7FF) << 40))) & 1))^((((in[6] >> 24) | ((in[7] & 0x7FF) << 40)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[7] >> 11) & 0x7FFFFFFFFFFFF) & 1))^(((in[7] >> 11) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[7] >> 62) | ((in[8] & 0x1FFFFFFFFFFFF) << 2))) & 1))^((((in[7] >> 62) | ((in[8] & 0x1FFFFFFFFFFFF) << 2)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[8] >> 49) | ((in[9] & 0xFFFFFFFFF) << 15))) & 1))^((((in[8] >> 49) | ((in[9] & 0xFFFFFFFFF) << 15)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[9] >> 36) | ((in[10] & 0x7FFFFF) << 28))) & 1))^((((in[9] >> 36) | ((in[10] & 0x7FFFFF) << 28)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[10] >> 23) | ((in[11] & 0x3FF) << 41))) & 1))^((((in[10] >> 23) | ((in[11] & 0x3FF) << 41)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[11] >> 10) & 0x7FFFFFFFFFFFF) & 1))^(((in[11] >> 10) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[11] >> 61) | ((in[12] & 0xFFFFFFFFFFFF) << 3))) & 1))^((((in[11] >> 61) | ((in[12] & 0xFFFFFFFFFFFF) << 3)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[12] >> 48) | ((in[13] & 0x7FFFFFFFF) << 16))) & 1))^((((in[12] >> 48) | ((in[13] & 0x7FFFFFFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[13] >> 35) | ((in[14] & 0x3FFFFF) << 29))) & 1))^((((in[13] >> 35) | ((in[14] & 0x3FFFFF) << 29)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[14] >> 22) | ((in[15] & 0x1FF) << 42))) & 1))^((((in[14] >> 22) | ((in[15] & 0x1FF) << 42)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[15] >> 9) & 0x7FFFFFFFFFFFF) & 1))^(((in[15] >> 9) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[15] >> 60) | ((in[16] & 0x7FFFFFFFFFFF) << 4))) & 1))^((((in[15] >> 60) | ((in[16] & 0x7FFFFFFFFFFF) << 4)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[16] >> 47) | ((in[17] & 0x3FFFFFFFF) << 17))) & 1))^((((in[16] >> 47) | ((in[17] & 0x3FFFFFFFF) << 17)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[17] >> 34) | ((in[18] & 0x1FFFFF) << 30))) & 1))^((((in[17] >> 34) | ((in[18] & 0x1FFFFF) << 30)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[18] >> 21) | ((in[19] & 0xFF) << 43))) & 1))^((((in[18] >> 21) | ((in[19] & 0xFF) << 43)))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[19] >> 8) & 0x7FFFFFFFFFFFF) & 1))^(((in[19] >> 8) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[19] >> 59) | ((in[20] & 0x3FFFFFFFFFFF) << 5))) & 1))^((((in[19] >> 59) | ((in[20] & 0x3FFFFFFFFFFF) << 5)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[20] >> 46) | ((in[21] & 0x1FFFFFFFF) << 18))) & 1))^((((in[20] >> 46) | ((in[21] & 0x1FFFFFFFF) << 18)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[21] >> 33) | ((in[22] & 0xFFFFF) << 31))) & 1))^((((in[21] >> 33) | ((in[22] & 0xFFFFF) << 31)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[22] >> 20) | ((in[23] & 0x7F) << 44))) & 1))^((((in[22] >> 20) | ((in[23] & 0x7F) << 44)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[23] >> 7) & 0x7FFFFFFFFFFFF) & 1))^(((in[23] >> 7) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[23] >> 58) | ((in[24] & 0x1FFFFFFFFFFF) << 6))) & 1))^((((in[23] >> 58) | ((in[24] & 0x1FFFFFFFFFFF) << 6)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[24] >> 45) | ((in[25] & 0xFFFFFFFF) << 19))) & 1))^((((in[24] >> 45) | ((in[25] & 0xFFFFFFFF) << 19)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[25] >> 32) | ((in[26] & 0x7FFFF) << 32))) & 1))^((((in[25] >> 32) | ((in[26] & 0x7FFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[26] >> 19) | ((in[27] & 0x3F) << 45))) & 1))^((((in[26] >> 19) | ((in[27] & 0x3F) << 45)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[27] >> 6) & 0x7FFFFFFFFFFFF) & 1))^(((in[27] >> 6) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[27] >> 57) | ((in[28] & 0xFFFFFFFFFFF) << 7))) & 1))^((((in[27] >> 57) | ((in[28] & 0xFFFFFFFFFFF) << 7)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[28] >> 44) | ((in[29] & 0x7FFFFFFF) << 20))) & 1))^((((in[28] >> 44) | ((in[29] & 0x7FFFFFFF) << 20)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[29] >> 31) | ((in[30] & 0x3FFFF) << 33))) & 1))^((((in[29] >> 31) | ((in[30] & 0x3FFFF) << 33)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[30] >> 18) | ((in[31] & 0x1F) << 46))) & 1))^((((in[30] >> 18) | ((in[31] & 0x1F) << 46)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[31] >> 5) & 0x7FFFFFFFFFFFF) & 1))^(((in[31] >> 5) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[38] + out[40] = int64(((-((((in[31] >> 56) | ((in[32] & 0x7FFFFFFFFFF) << 8))) & 1))^((((in[31] >> 56) | ((in[32] & 0x7FFFFFFFFFF) << 8)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[32] >> 43) | ((in[33] & 0x3FFFFFFF) << 21))) & 1))^((((in[32] >> 43) | ((in[33] & 0x3FFFFFFF) << 21)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[33] >> 30) | ((in[34] & 0x1FFFF) << 34))) & 1))^((((in[33] >> 30) | ((in[34] & 0x1FFFF) << 34)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[34] >> 17) | ((in[35] & 0xF) << 47))) & 1))^((((in[34] >> 17) | ((in[35] & 0xF) << 47)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[35] >> 4) & 0x7FFFFFFFFFFFF) & 1))^(((in[35] >> 4) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[35] >> 55) | ((in[36] & 0x3FFFFFFFFFF) << 9))) & 1))^((((in[35] >> 55) | ((in[36] & 0x3FFFFFFFFFF) << 9)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[36] >> 42) | ((in[37] & 0x1FFFFFFF) << 22))) & 1))^((((in[36] >> 42) | ((in[37] & 0x1FFFFFFF) << 22)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[37] >> 29) | ((in[38] & 0xFFFF) << 35))) & 1))^((((in[37] >> 29) | ((in[38] & 0xFFFF) << 35)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[38] >> 16) | ((in[39] & 0x7) << 48))) & 1))^((((in[38] >> 16) | ((in[39] & 0x7) << 48)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[39] >> 3) & 0x7FFFFFFFFFFFF) & 1))^(((in[39] >> 3) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[39] >> 54) | ((in[40] & 0x1FFFFFFFFFF) << 10))) & 1))^((((in[39] >> 54) | ((in[40] & 0x1FFFFFFFFFF) << 10)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[40] >> 41) | ((in[41] & 0xFFFFFFF) << 23))) & 1))^((((in[40] >> 41) | ((in[41] & 0xFFFFFFF) << 23)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[41] >> 28) | ((in[42] & 0x7FFF) << 36))) & 1))^((((in[41] >> 28) | ((in[42] & 0x7FFF) << 36)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[42] >> 15) | ((in[43] & 0x3) << 49))) & 1))^((((in[42] >> 15) | ((in[43] & 0x3) << 49)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[43] >> 2) & 0x7FFFFFFFFFFFF) & 1))^(((in[43] >> 2) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFF) << 11))) & 1))^((((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFF) << 11)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[44] >> 40) | ((in[45] & 0x7FFFFFF) << 24))) & 1))^((((in[44] >> 40) | ((in[45] & 0x7FFFFFF) << 24)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[45] >> 27) | ((in[46] & 0x3FFF) << 37))) & 1))^((((in[45] >> 27) | ((in[46] & 0x3FFF) << 37)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[46] >> 14) | ((in[47] & 0x1) << 50))) & 1))^((((in[46] >> 14) | ((in[47] & 0x1) << 50)))>>1))) << ntz + out[57] + out[59] = int64(((-(((in[47] >> 1) & 0x7FFFFFFFFFFFF) & 1))^(((in[47] >> 1) & 0x7FFFFFFFFFFFF)>>1))) << ntz + out[58] + out[60] = int64(((-((((in[47] >> 52) | ((in[48] & 0x7FFFFFFFFF) << 12))) & 1))^((((in[47] >> 52) | ((in[48] & 0x7FFFFFFFFF) << 12)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[48] >> 39) | ((in[49] & 0x3FFFFFF) << 25))) & 1))^((((in[48] >> 39) | ((in[49] & 0x3FFFFFF) << 25)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[49] >> 26) | ((in[50] & 0x1FFF) << 38))) & 1))^((((in[49] >> 26) | ((in[50] & 0x1FFF) << 38)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[50] >> 13)) & 1))^(((in[50] >> 13))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_52(initoffset int64, in *[52]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 52) | ((in[1] & 0xFFFFFFFFFF) << 12))) & 1))^((((in[0] >> 52) | ((in[1] & 0xFFFFFFFFFF) << 12)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 40) | ((in[2] & 0xFFFFFFF) << 24))) & 1))^((((in[1] >> 40) | ((in[2] & 0xFFFFFFF) << 24)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 28) | ((in[3] & 0xFFFF) << 36))) & 1))^((((in[2] >> 28) | ((in[3] & 0xFFFF) << 36)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 16) | ((in[4] & 0xF) << 48))) & 1))^((((in[3] >> 16) | ((in[4] & 0xF) << 48)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[4] >> 4) & 0xFFFFFFFFFFFFF) & 1))^(((in[4] >> 4) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 56) | ((in[5] & 0xFFFFFFFFFFF) << 8))) & 1))^((((in[4] >> 56) | ((in[5] & 0xFFFFFFFFFFF) << 8)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[5] >> 44) | ((in[6] & 0xFFFFFFFF) << 20))) & 1))^((((in[5] >> 44) | ((in[6] & 0xFFFFFFFF) << 20)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[6] >> 32) | ((in[7] & 0xFFFFF) << 32))) & 1))^((((in[6] >> 32) | ((in[7] & 0xFFFFF) << 32)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[7] >> 20) | ((in[8] & 0xFF) << 44))) & 1))^((((in[7] >> 20) | ((in[8] & 0xFF) << 44)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[8] >> 8) & 0xFFFFFFFFFFFFF) & 1))^(((in[8] >> 8) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFFFF) << 4))) & 1))^((((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[9] >> 48) | ((in[10] & 0xFFFFFFFFF) << 16))) & 1))^((((in[9] >> 48) | ((in[10] & 0xFFFFFFFFF) << 16)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[10] >> 36) | ((in[11] & 0xFFFFFF) << 28))) & 1))^((((in[10] >> 36) | ((in[11] & 0xFFFFFF) << 28)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[11] >> 24) | ((in[12] & 0xFFF) << 40))) & 1))^((((in[11] >> 24) | ((in[12] & 0xFFF) << 40)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[12] >> 12)) & 1))^(((in[12] >> 12))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[13] >> 0) & 0xFFFFFFFFFFFFF) & 1))^(((in[13] >> 0) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[13] >> 52) | ((in[14] & 0xFFFFFFFFFF) << 12))) & 1))^((((in[13] >> 52) | ((in[14] & 0xFFFFFFFFFF) << 12)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[14] >> 40) | ((in[15] & 0xFFFFFFF) << 24))) & 1))^((((in[14] >> 40) | ((in[15] & 0xFFFFFFF) << 24)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[15] >> 28) | ((in[16] & 0xFFFF) << 36))) & 1))^((((in[15] >> 28) | ((in[16] & 0xFFFF) << 36)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[16] >> 16) | ((in[17] & 0xF) << 48))) & 1))^((((in[16] >> 16) | ((in[17] & 0xF) << 48)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[17] >> 4) & 0xFFFFFFFFFFFFF) & 1))^(((in[17] >> 4) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[17] >> 56) | ((in[18] & 0xFFFFFFFFFFF) << 8))) & 1))^((((in[17] >> 56) | ((in[18] & 0xFFFFFFFFFFF) << 8)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[18] >> 44) | ((in[19] & 0xFFFFFFFF) << 20))) & 1))^((((in[18] >> 44) | ((in[19] & 0xFFFFFFFF) << 20)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[19] >> 32) | ((in[20] & 0xFFFFF) << 32))) & 1))^((((in[19] >> 32) | ((in[20] & 0xFFFFF) << 32)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[20] >> 20) | ((in[21] & 0xFF) << 44))) & 1))^((((in[20] >> 20) | ((in[21] & 0xFF) << 44)))>>1))) << ntz + out[24] + out[26] = int64(((-(((in[21] >> 8) & 0xFFFFFFFFFFFFF) & 1))^(((in[21] >> 8) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[25] + out[27] = int64(((-((((in[21] >> 60) | ((in[22] & 0xFFFFFFFFFFFF) << 4))) & 1))^((((in[21] >> 60) | ((in[22] & 0xFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[22] >> 48) | ((in[23] & 0xFFFFFFFFF) << 16))) & 1))^((((in[22] >> 48) | ((in[23] & 0xFFFFFFFFF) << 16)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[23] >> 36) | ((in[24] & 0xFFFFFF) << 28))) & 1))^((((in[23] >> 36) | ((in[24] & 0xFFFFFF) << 28)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[24] >> 24) | ((in[25] & 0xFFF) << 40))) & 1))^((((in[24] >> 24) | ((in[25] & 0xFFF) << 40)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[25] >> 12)) & 1))^(((in[25] >> 12))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[26] >> 0) & 0xFFFFFFFFFFFFF) & 1))^(((in[26] >> 0) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[26] >> 52) | ((in[27] & 0xFFFFFFFFFF) << 12))) & 1))^((((in[26] >> 52) | ((in[27] & 0xFFFFFFFFFF) << 12)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[27] >> 40) | ((in[28] & 0xFFFFFFF) << 24))) & 1))^((((in[27] >> 40) | ((in[28] & 0xFFFFFFF) << 24)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[28] >> 28) | ((in[29] & 0xFFFF) << 36))) & 1))^((((in[28] >> 28) | ((in[29] & 0xFFFF) << 36)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[29] >> 16) | ((in[30] & 0xF) << 48))) & 1))^((((in[29] >> 16) | ((in[30] & 0xF) << 48)))>>1))) << ntz + out[35] + out[37] = int64(((-(((in[30] >> 4) & 0xFFFFFFFFFFFFF) & 1))^(((in[30] >> 4) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[36] + out[38] = int64(((-((((in[30] >> 56) | ((in[31] & 0xFFFFFFFFFFF) << 8))) & 1))^((((in[30] >> 56) | ((in[31] & 0xFFFFFFFFFFF) << 8)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[31] >> 44) | ((in[32] & 0xFFFFFFFF) << 20))) & 1))^((((in[31] >> 44) | ((in[32] & 0xFFFFFFFF) << 20)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[32] >> 32) | ((in[33] & 0xFFFFF) << 32))) & 1))^((((in[32] >> 32) | ((in[33] & 0xFFFFF) << 32)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[33] >> 20) | ((in[34] & 0xFF) << 44))) & 1))^((((in[33] >> 20) | ((in[34] & 0xFF) << 44)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[34] >> 8) & 0xFFFFFFFFFFFFF) & 1))^(((in[34] >> 8) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[34] >> 60) | ((in[35] & 0xFFFFFFFFFFFF) << 4))) & 1))^((((in[34] >> 60) | ((in[35] & 0xFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[35] >> 48) | ((in[36] & 0xFFFFFFFFF) << 16))) & 1))^((((in[35] >> 48) | ((in[36] & 0xFFFFFFFFF) << 16)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[36] >> 36) | ((in[37] & 0xFFFFFF) << 28))) & 1))^((((in[36] >> 36) | ((in[37] & 0xFFFFFF) << 28)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[37] >> 24) | ((in[38] & 0xFFF) << 40))) & 1))^((((in[37] >> 24) | ((in[38] & 0xFFF) << 40)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[38] >> 12)) & 1))^(((in[38] >> 12))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[39] >> 0) & 0xFFFFFFFFFFFFF) & 1))^(((in[39] >> 0) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[39] >> 52) | ((in[40] & 0xFFFFFFFFFF) << 12))) & 1))^((((in[39] >> 52) | ((in[40] & 0xFFFFFFFFFF) << 12)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[40] >> 40) | ((in[41] & 0xFFFFFFF) << 24))) & 1))^((((in[40] >> 40) | ((in[41] & 0xFFFFFFF) << 24)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[41] >> 28) | ((in[42] & 0xFFFF) << 36))) & 1))^((((in[41] >> 28) | ((in[42] & 0xFFFF) << 36)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[42] >> 16) | ((in[43] & 0xF) << 48))) & 1))^((((in[42] >> 16) | ((in[43] & 0xF) << 48)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[43] >> 4) & 0xFFFFFFFFFFFFF) & 1))^(((in[43] >> 4) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[43] >> 56) | ((in[44] & 0xFFFFFFFFFFF) << 8))) & 1))^((((in[43] >> 56) | ((in[44] & 0xFFFFFFFFFFF) << 8)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[44] >> 44) | ((in[45] & 0xFFFFFFFF) << 20))) & 1))^((((in[44] >> 44) | ((in[45] & 0xFFFFFFFF) << 20)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[45] >> 32) | ((in[46] & 0xFFFFF) << 32))) & 1))^((((in[45] >> 32) | ((in[46] & 0xFFFFF) << 32)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[46] >> 20) | ((in[47] & 0xFF) << 44))) & 1))^((((in[46] >> 20) | ((in[47] & 0xFF) << 44)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[47] >> 8) & 0xFFFFFFFFFFFFF) & 1))^(((in[47] >> 8) & 0xFFFFFFFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[47] >> 60) | ((in[48] & 0xFFFFFFFFFFFF) << 4))) & 1))^((((in[47] >> 60) | ((in[48] & 0xFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[48] >> 48) | ((in[49] & 0xFFFFFFFFF) << 16))) & 1))^((((in[48] >> 48) | ((in[49] & 0xFFFFFFFFF) << 16)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[49] >> 36) | ((in[50] & 0xFFFFFF) << 28))) & 1))^((((in[49] >> 36) | ((in[50] & 0xFFFFFF) << 28)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[50] >> 24) | ((in[51] & 0xFFF) << 40))) & 1))^((((in[50] >> 24) | ((in[51] & 0xFFF) << 40)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[51] >> 12)) & 1))^(((in[51] >> 12))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_53(initoffset int64, in *[53]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 53) | ((in[1] & 0x3FFFFFFFFFF) << 11))) & 1))^((((in[0] >> 53) | ((in[1] & 0x3FFFFFFFFFF) << 11)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 42) | ((in[2] & 0x7FFFFFFF) << 22))) & 1))^((((in[1] >> 42) | ((in[2] & 0x7FFFFFFF) << 22)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 31) | ((in[3] & 0xFFFFF) << 33))) & 1))^((((in[2] >> 31) | ((in[3] & 0xFFFFF) << 33)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 20) | ((in[4] & 0x1FF) << 44))) & 1))^((((in[3] >> 20) | ((in[4] & 0x1FF) << 44)))>>1))) << ntz + out[3] + out[5] = int64(((-(((in[4] >> 9) & 0x1FFFFFFFFFFFFF) & 1))^(((in[4] >> 9) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[4] + out[6] = int64(((-((((in[4] >> 62) | ((in[5] & 0x7FFFFFFFFFFFF) << 2))) & 1))^((((in[4] >> 62) | ((in[5] & 0x7FFFFFFFFFFFF) << 2)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[5] >> 51) | ((in[6] & 0xFFFFFFFFFF) << 13))) & 1))^((((in[5] >> 51) | ((in[6] & 0xFFFFFFFFFF) << 13)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[6] >> 40) | ((in[7] & 0x1FFFFFFF) << 24))) & 1))^((((in[6] >> 40) | ((in[7] & 0x1FFFFFFF) << 24)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[7] >> 29) | ((in[8] & 0x3FFFF) << 35))) & 1))^((((in[7] >> 29) | ((in[8] & 0x3FFFF) << 35)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[8] >> 18) | ((in[9] & 0x7F) << 46))) & 1))^((((in[8] >> 18) | ((in[9] & 0x7F) << 46)))>>1))) << ntz + out[9] + out[11] = int64(((-(((in[9] >> 7) & 0x1FFFFFFFFFFFFF) & 1))^(((in[9] >> 7) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[10] + out[12] = int64(((-((((in[9] >> 60) | ((in[10] & 0x1FFFFFFFFFFFF) << 4))) & 1))^((((in[9] >> 60) | ((in[10] & 0x1FFFFFFFFFFFF) << 4)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[10] >> 49) | ((in[11] & 0x3FFFFFFFFF) << 15))) & 1))^((((in[10] >> 49) | ((in[11] & 0x3FFFFFFFFF) << 15)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[11] >> 38) | ((in[12] & 0x7FFFFFF) << 26))) & 1))^((((in[11] >> 38) | ((in[12] & 0x7FFFFFF) << 26)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[12] >> 27) | ((in[13] & 0xFFFF) << 37))) & 1))^((((in[12] >> 27) | ((in[13] & 0xFFFF) << 37)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[13] >> 16) | ((in[14] & 0x1F) << 48))) & 1))^((((in[13] >> 16) | ((in[14] & 0x1F) << 48)))>>1))) << ntz + out[15] + out[17] = int64(((-(((in[14] >> 5) & 0x1FFFFFFFFFFFFF) & 1))^(((in[14] >> 5) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[16] + out[18] = int64(((-((((in[14] >> 58) | ((in[15] & 0x7FFFFFFFFFFF) << 6))) & 1))^((((in[14] >> 58) | ((in[15] & 0x7FFFFFFFFFFF) << 6)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[15] >> 47) | ((in[16] & 0xFFFFFFFFF) << 17))) & 1))^((((in[15] >> 47) | ((in[16] & 0xFFFFFFFFF) << 17)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[16] >> 36) | ((in[17] & 0x1FFFFFF) << 28))) & 1))^((((in[16] >> 36) | ((in[17] & 0x1FFFFFF) << 28)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[17] >> 25) | ((in[18] & 0x3FFF) << 39))) & 1))^((((in[17] >> 25) | ((in[18] & 0x3FFF) << 39)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[18] >> 14) | ((in[19] & 0x7) << 50))) & 1))^((((in[18] >> 14) | ((in[19] & 0x7) << 50)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[19] >> 3) & 0x1FFFFFFFFFFFFF) & 1))^(((in[19] >> 3) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[22] + out[24] = int64(((-((((in[19] >> 56) | ((in[20] & 0x1FFFFFFFFFFF) << 8))) & 1))^((((in[19] >> 56) | ((in[20] & 0x1FFFFFFFFFFF) << 8)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[20] >> 45) | ((in[21] & 0x3FFFFFFFF) << 19))) & 1))^((((in[20] >> 45) | ((in[21] & 0x3FFFFFFFF) << 19)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[21] >> 34) | ((in[22] & 0x7FFFFF) << 30))) & 1))^((((in[21] >> 34) | ((in[22] & 0x7FFFFF) << 30)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[22] >> 23) | ((in[23] & 0xFFF) << 41))) & 1))^((((in[22] >> 23) | ((in[23] & 0xFFF) << 41)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[23] >> 12) | ((in[24] & 0x1) << 52))) & 1))^((((in[23] >> 12) | ((in[24] & 0x1) << 52)))>>1))) << ntz + out[27] + out[29] = int64(((-(((in[24] >> 1) & 0x1FFFFFFFFFFFFF) & 1))^(((in[24] >> 1) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[28] + out[30] = int64(((-((((in[24] >> 54) | ((in[25] & 0x7FFFFFFFFFF) << 10))) & 1))^((((in[24] >> 54) | ((in[25] & 0x7FFFFFFFFFF) << 10)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[25] >> 43) | ((in[26] & 0xFFFFFFFF) << 21))) & 1))^((((in[25] >> 43) | ((in[26] & 0xFFFFFFFF) << 21)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[26] >> 32) | ((in[27] & 0x1FFFFF) << 32))) & 1))^((((in[26] >> 32) | ((in[27] & 0x1FFFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[27] >> 21) | ((in[28] & 0x3FF) << 43))) & 1))^((((in[27] >> 21) | ((in[28] & 0x3FF) << 43)))>>1))) << ntz + out[32] + out[34] = int64(((-(((in[28] >> 10) & 0x1FFFFFFFFFFFFF) & 1))^(((in[28] >> 10) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[33] + out[35] = int64(((-((((in[28] >> 63) | ((in[29] & 0xFFFFFFFFFFFFF) << 1))) & 1))^((((in[28] >> 63) | ((in[29] & 0xFFFFFFFFFFFFF) << 1)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[29] >> 52) | ((in[30] & 0x1FFFFFFFFFF) << 12))) & 1))^((((in[29] >> 52) | ((in[30] & 0x1FFFFFFFFFF) << 12)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[30] >> 41) | ((in[31] & 0x3FFFFFFF) << 23))) & 1))^((((in[30] >> 41) | ((in[31] & 0x3FFFFFFF) << 23)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[31] >> 30) | ((in[32] & 0x7FFFF) << 34))) & 1))^((((in[31] >> 30) | ((in[32] & 0x7FFFF) << 34)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[32] >> 19) | ((in[33] & 0xFF) << 45))) & 1))^((((in[32] >> 19) | ((in[33] & 0xFF) << 45)))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[33] >> 8) & 0x1FFFFFFFFFFFFF) & 1))^(((in[33] >> 8) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFFFFF) << 3))) & 1))^((((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFFFFF) << 3)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[34] >> 50) | ((in[35] & 0x7FFFFFFFFF) << 14))) & 1))^((((in[34] >> 50) | ((in[35] & 0x7FFFFFFFFF) << 14)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[35] >> 39) | ((in[36] & 0xFFFFFFF) << 25))) & 1))^((((in[35] >> 39) | ((in[36] & 0xFFFFFFF) << 25)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[36] >> 28) | ((in[37] & 0x1FFFF) << 36))) & 1))^((((in[36] >> 28) | ((in[37] & 0x1FFFF) << 36)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[37] >> 17) | ((in[38] & 0x3F) << 47))) & 1))^((((in[37] >> 17) | ((in[38] & 0x3F) << 47)))>>1))) << ntz + out[44] + out[46] = int64(((-(((in[38] >> 6) & 0x1FFFFFFFFFFFFF) & 1))^(((in[38] >> 6) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[45] + out[47] = int64(((-((((in[38] >> 59) | ((in[39] & 0xFFFFFFFFFFFF) << 5))) & 1))^((((in[38] >> 59) | ((in[39] & 0xFFFFFFFFFFFF) << 5)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[39] >> 48) | ((in[40] & 0x1FFFFFFFFF) << 16))) & 1))^((((in[39] >> 48) | ((in[40] & 0x1FFFFFFFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[40] >> 37) | ((in[41] & 0x3FFFFFF) << 27))) & 1))^((((in[40] >> 37) | ((in[41] & 0x3FFFFFF) << 27)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[41] >> 26) | ((in[42] & 0x7FFF) << 38))) & 1))^((((in[41] >> 26) | ((in[42] & 0x7FFF) << 38)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[42] >> 15) | ((in[43] & 0xF) << 49))) & 1))^((((in[42] >> 15) | ((in[43] & 0xF) << 49)))>>1))) << ntz + out[50] + out[52] = int64(((-(((in[43] >> 4) & 0x1FFFFFFFFFFFFF) & 1))^(((in[43] >> 4) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[51] + out[53] = int64(((-((((in[43] >> 57) | ((in[44] & 0x3FFFFFFFFFFF) << 7))) & 1))^((((in[43] >> 57) | ((in[44] & 0x3FFFFFFFFFFF) << 7)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[44] >> 46) | ((in[45] & 0x7FFFFFFFF) << 18))) & 1))^((((in[44] >> 46) | ((in[45] & 0x7FFFFFFFF) << 18)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[45] >> 35) | ((in[46] & 0xFFFFFF) << 29))) & 1))^((((in[45] >> 35) | ((in[46] & 0xFFFFFF) << 29)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[46] >> 24) | ((in[47] & 0x1FFF) << 40))) & 1))^((((in[46] >> 24) | ((in[47] & 0x1FFF) << 40)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[47] >> 13) | ((in[48] & 0x3) << 51))) & 1))^((((in[47] >> 13) | ((in[48] & 0x3) << 51)))>>1))) << ntz + out[56] + out[58] = int64(((-(((in[48] >> 2) & 0x1FFFFFFFFFFFFF) & 1))^(((in[48] >> 2) & 0x1FFFFFFFFFFFFF)>>1))) << ntz + out[57] + out[59] = int64(((-((((in[48] >> 55) | ((in[49] & 0xFFFFFFFFFFF) << 9))) & 1))^((((in[48] >> 55) | ((in[49] & 0xFFFFFFFFFFF) << 9)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[49] >> 44) | ((in[50] & 0x1FFFFFFFF) << 20))) & 1))^((((in[49] >> 44) | ((in[50] & 0x1FFFFFFFF) << 20)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[50] >> 33) | ((in[51] & 0x3FFFFF) << 31))) & 1))^((((in[50] >> 33) | ((in[51] & 0x3FFFFF) << 31)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[51] >> 22) | ((in[52] & 0x7FF) << 42))) & 1))^((((in[51] >> 22) | ((in[52] & 0x7FF) << 42)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[52] >> 11)) & 1))^(((in[52] >> 11))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_54(initoffset int64, in *[54]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 54) | ((in[1] & 0xFFFFFFFFFFF) << 10))) & 1))^((((in[0] >> 54) | ((in[1] & 0xFFFFFFFFFFF) << 10)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 44) | ((in[2] & 0x3FFFFFFFF) << 20))) & 1))^((((in[1] >> 44) | ((in[2] & 0x3FFFFFFFF) << 20)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 34) | ((in[3] & 0xFFFFFF) << 30))) & 1))^((((in[2] >> 34) | ((in[3] & 0xFFFFFF) << 30)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 24) | ((in[4] & 0x3FFF) << 40))) & 1))^((((in[3] >> 24) | ((in[4] & 0x3FFF) << 40)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 14) | ((in[5] & 0xF) << 50))) & 1))^((((in[4] >> 14) | ((in[5] & 0xF) << 50)))>>1))) << ntz + out[4] + out[6] = int64(((-(((in[5] >> 4) & 0x3FFFFFFFFFFFFF) & 1))^(((in[5] >> 4) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[5] + out[7] = int64(((-((((in[5] >> 58) | ((in[6] & 0xFFFFFFFFFFFF) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0xFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[6] >> 48) | ((in[7] & 0x3FFFFFFFFF) << 16))) & 1))^((((in[6] >> 48) | ((in[7] & 0x3FFFFFFFFF) << 16)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[7] >> 38) | ((in[8] & 0xFFFFFFF) << 26))) & 1))^((((in[7] >> 38) | ((in[8] & 0xFFFFFFF) << 26)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[8] >> 28) | ((in[9] & 0x3FFFF) << 36))) & 1))^((((in[8] >> 28) | ((in[9] & 0x3FFFF) << 36)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[9] >> 18) | ((in[10] & 0xFF) << 46))) & 1))^((((in[9] >> 18) | ((in[10] & 0xFF) << 46)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[10] >> 8) & 0x3FFFFFFFFFFFFF) & 1))^(((in[10] >> 8) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[10] >> 62) | ((in[11] & 0xFFFFFFFFFFFFF) << 2))) & 1))^((((in[10] >> 62) | ((in[11] & 0xFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[11] >> 52) | ((in[12] & 0x3FFFFFFFFFF) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0x3FFFFFFFFFF) << 12)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[12] >> 42) | ((in[13] & 0xFFFFFFFF) << 22))) & 1))^((((in[12] >> 42) | ((in[13] & 0xFFFFFFFF) << 22)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[13] >> 32) | ((in[14] & 0x3FFFFF) << 32))) & 1))^((((in[13] >> 32) | ((in[14] & 0x3FFFFF) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[14] >> 22) | ((in[15] & 0xFFF) << 42))) & 1))^((((in[14] >> 22) | ((in[15] & 0xFFF) << 42)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[15] >> 12) | ((in[16] & 0x3) << 52))) & 1))^((((in[15] >> 12) | ((in[16] & 0x3) << 52)))>>1))) << ntz + out[17] + out[19] = int64(((-(((in[16] >> 2) & 0x3FFFFFFFFFFFFF) & 1))^(((in[16] >> 2) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[18] + out[20] = int64(((-((((in[16] >> 56) | ((in[17] & 0x3FFFFFFFFFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0x3FFFFFFFFFFF) << 8)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[17] >> 46) | ((in[18] & 0xFFFFFFFFF) << 18))) & 1))^((((in[17] >> 46) | ((in[18] & 0xFFFFFFFFF) << 18)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[18] >> 36) | ((in[19] & 0x3FFFFFF) << 28))) & 1))^((((in[18] >> 36) | ((in[19] & 0x3FFFFFF) << 28)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[19] >> 26) | ((in[20] & 0xFFFF) << 38))) & 1))^((((in[19] >> 26) | ((in[20] & 0xFFFF) << 38)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[20] >> 16) | ((in[21] & 0x3F) << 48))) & 1))^((((in[20] >> 16) | ((in[21] & 0x3F) << 48)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[21] >> 6) & 0x3FFFFFFFFFFFFF) & 1))^(((in[21] >> 6) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[21] >> 60) | ((in[22] & 0x3FFFFFFFFFFFF) << 4))) & 1))^((((in[21] >> 60) | ((in[22] & 0x3FFFFFFFFFFFF) << 4)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[22] >> 50) | ((in[23] & 0xFFFFFFFFFF) << 14))) & 1))^((((in[22] >> 50) | ((in[23] & 0xFFFFFFFFFF) << 14)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[23] >> 40) | ((in[24] & 0x3FFFFFFF) << 24))) & 1))^((((in[23] >> 40) | ((in[24] & 0x3FFFFFFF) << 24)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[24] >> 30) | ((in[25] & 0xFFFFF) << 34))) & 1))^((((in[24] >> 30) | ((in[25] & 0xFFFFF) << 34)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[25] >> 20) | ((in[26] & 0x3FF) << 44))) & 1))^((((in[25] >> 20) | ((in[26] & 0x3FF) << 44)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[26] >> 10)) & 1))^(((in[26] >> 10))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[27] >> 0) & 0x3FFFFFFFFFFFFF) & 1))^(((in[27] >> 0) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[27] >> 54) | ((in[28] & 0xFFFFFFFFFFF) << 10))) & 1))^((((in[27] >> 54) | ((in[28] & 0xFFFFFFFFFFF) << 10)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[28] >> 44) | ((in[29] & 0x3FFFFFFFF) << 20))) & 1))^((((in[28] >> 44) | ((in[29] & 0x3FFFFFFFF) << 20)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[29] >> 34) | ((in[30] & 0xFFFFFF) << 30))) & 1))^((((in[29] >> 34) | ((in[30] & 0xFFFFFF) << 30)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[30] >> 24) | ((in[31] & 0x3FFF) << 40))) & 1))^((((in[30] >> 24) | ((in[31] & 0x3FFF) << 40)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[31] >> 14) | ((in[32] & 0xF) << 50))) & 1))^((((in[31] >> 14) | ((in[32] & 0xF) << 50)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[32] >> 4) & 0x3FFFFFFFFFFFFF) & 1))^(((in[32] >> 4) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[32] >> 58) | ((in[33] & 0xFFFFFFFFFFFF) << 6))) & 1))^((((in[32] >> 58) | ((in[33] & 0xFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[33] >> 48) | ((in[34] & 0x3FFFFFFFFF) << 16))) & 1))^((((in[33] >> 48) | ((in[34] & 0x3FFFFFFFFF) << 16)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[34] >> 38) | ((in[35] & 0xFFFFFFF) << 26))) & 1))^((((in[34] >> 38) | ((in[35] & 0xFFFFFFF) << 26)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[35] >> 28) | ((in[36] & 0x3FFFF) << 36))) & 1))^((((in[35] >> 28) | ((in[36] & 0x3FFFF) << 36)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[36] >> 18) | ((in[37] & 0xFF) << 46))) & 1))^((((in[36] >> 18) | ((in[37] & 0xFF) << 46)))>>1))) << ntz + out[42] + out[44] = int64(((-(((in[37] >> 8) & 0x3FFFFFFFFFFFFF) & 1))^(((in[37] >> 8) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[43] + out[45] = int64(((-((((in[37] >> 62) | ((in[38] & 0xFFFFFFFFFFFFF) << 2))) & 1))^((((in[37] >> 62) | ((in[38] & 0xFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[38] >> 52) | ((in[39] & 0x3FFFFFFFFFF) << 12))) & 1))^((((in[38] >> 52) | ((in[39] & 0x3FFFFFFFFFF) << 12)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[39] >> 42) | ((in[40] & 0xFFFFFFFF) << 22))) & 1))^((((in[39] >> 42) | ((in[40] & 0xFFFFFFFF) << 22)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[40] >> 32) | ((in[41] & 0x3FFFFF) << 32))) & 1))^((((in[40] >> 32) | ((in[41] & 0x3FFFFF) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[41] >> 22) | ((in[42] & 0xFFF) << 42))) & 1))^((((in[41] >> 22) | ((in[42] & 0xFFF) << 42)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[42] >> 12) | ((in[43] & 0x3) << 52))) & 1))^((((in[42] >> 12) | ((in[43] & 0x3) << 52)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[43] >> 2) & 0x3FFFFFFFFFFFFF) & 1))^(((in[43] >> 2) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[43] >> 56) | ((in[44] & 0x3FFFFFFFFFFF) << 8))) & 1))^((((in[43] >> 56) | ((in[44] & 0x3FFFFFFFFFFF) << 8)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[44] >> 46) | ((in[45] & 0xFFFFFFFFF) << 18))) & 1))^((((in[44] >> 46) | ((in[45] & 0xFFFFFFFFF) << 18)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[45] >> 36) | ((in[46] & 0x3FFFFFF) << 28))) & 1))^((((in[45] >> 36) | ((in[46] & 0x3FFFFFF) << 28)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[46] >> 26) | ((in[47] & 0xFFFF) << 38))) & 1))^((((in[46] >> 26) | ((in[47] & 0xFFFF) << 38)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[47] >> 16) | ((in[48] & 0x3F) << 48))) & 1))^((((in[47] >> 16) | ((in[48] & 0x3F) << 48)))>>1))) << ntz + out[55] + out[57] = int64(((-(((in[48] >> 6) & 0x3FFFFFFFFFFFFF) & 1))^(((in[48] >> 6) & 0x3FFFFFFFFFFFFF)>>1))) << ntz + out[56] + out[58] = int64(((-((((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFF) << 4))) & 1))^((((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFF) << 4)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[49] >> 50) | ((in[50] & 0xFFFFFFFFFF) << 14))) & 1))^((((in[49] >> 50) | ((in[50] & 0xFFFFFFFFFF) << 14)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[50] >> 40) | ((in[51] & 0x3FFFFFFF) << 24))) & 1))^((((in[50] >> 40) | ((in[51] & 0x3FFFFFFF) << 24)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[51] >> 30) | ((in[52] & 0xFFFFF) << 34))) & 1))^((((in[51] >> 30) | ((in[52] & 0xFFFFF) << 34)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[52] >> 20) | ((in[53] & 0x3FF) << 44))) & 1))^((((in[52] >> 20) | ((in[53] & 0x3FF) << 44)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[53] >> 10)) & 1))^(((in[53] >> 10))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_55(initoffset int64, in *[55]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 55) | ((in[1] & 0x3FFFFFFFFFFF) << 9))) & 1))^((((in[0] >> 55) | ((in[1] & 0x3FFFFFFFFFFF) << 9)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 46) | ((in[2] & 0x1FFFFFFFFF) << 18))) & 1))^((((in[1] >> 46) | ((in[2] & 0x1FFFFFFFFF) << 18)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 37) | ((in[3] & 0xFFFFFFF) << 27))) & 1))^((((in[2] >> 37) | ((in[3] & 0xFFFFFFF) << 27)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 28) | ((in[4] & 0x7FFFF) << 36))) & 1))^((((in[3] >> 28) | ((in[4] & 0x7FFFF) << 36)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 19) | ((in[5] & 0x3FF) << 45))) & 1))^((((in[4] >> 19) | ((in[5] & 0x3FF) << 45)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 10) | ((in[6] & 0x1) << 54))) & 1))^((((in[5] >> 10) | ((in[6] & 0x1) << 54)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[6] >> 1) & 0x7FFFFFFFFFFFFF) & 1))^(((in[6] >> 1) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[6] + out[8] = int64(((-((((in[6] >> 56) | ((in[7] & 0x7FFFFFFFFFFF) << 8))) & 1))^((((in[6] >> 56) | ((in[7] & 0x7FFFFFFFFFFF) << 8)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[7] >> 47) | ((in[8] & 0x3FFFFFFFFF) << 17))) & 1))^((((in[7] >> 47) | ((in[8] & 0x3FFFFFFFFF) << 17)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[8] >> 38) | ((in[9] & 0x1FFFFFFF) << 26))) & 1))^((((in[8] >> 38) | ((in[9] & 0x1FFFFFFF) << 26)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[9] >> 29) | ((in[10] & 0xFFFFF) << 35))) & 1))^((((in[9] >> 29) | ((in[10] & 0xFFFFF) << 35)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[10] >> 20) | ((in[11] & 0x7FF) << 44))) & 1))^((((in[10] >> 20) | ((in[11] & 0x7FF) << 44)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[11] >> 11) | ((in[12] & 0x3) << 53))) & 1))^((((in[11] >> 11) | ((in[12] & 0x3) << 53)))>>1))) << ntz + out[12] + out[14] = int64(((-(((in[12] >> 2) & 0x7FFFFFFFFFFFFF) & 1))^(((in[12] >> 2) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[13] + out[15] = int64(((-((((in[12] >> 57) | ((in[13] & 0xFFFFFFFFFFFF) << 7))) & 1))^((((in[12] >> 57) | ((in[13] & 0xFFFFFFFFFFFF) << 7)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[13] >> 48) | ((in[14] & 0x7FFFFFFFFF) << 16))) & 1))^((((in[13] >> 48) | ((in[14] & 0x7FFFFFFFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[14] >> 39) | ((in[15] & 0x3FFFFFFF) << 25))) & 1))^((((in[14] >> 39) | ((in[15] & 0x3FFFFFFF) << 25)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[15] >> 30) | ((in[16] & 0x1FFFFF) << 34))) & 1))^((((in[15] >> 30) | ((in[16] & 0x1FFFFF) << 34)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[16] >> 21) | ((in[17] & 0xFFF) << 43))) & 1))^((((in[16] >> 21) | ((in[17] & 0xFFF) << 43)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[17] >> 12) | ((in[18] & 0x7) << 52))) & 1))^((((in[17] >> 12) | ((in[18] & 0x7) << 52)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[18] >> 3) & 0x7FFFFFFFFFFFFF) & 1))^(((in[18] >> 3) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[18] >> 58) | ((in[19] & 0x1FFFFFFFFFFFF) << 6))) & 1))^((((in[18] >> 58) | ((in[19] & 0x1FFFFFFFFFFFF) << 6)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[19] >> 49) | ((in[20] & 0xFFFFFFFFFF) << 15))) & 1))^((((in[19] >> 49) | ((in[20] & 0xFFFFFFFFFF) << 15)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[20] >> 40) | ((in[21] & 0x7FFFFFFF) << 24))) & 1))^((((in[20] >> 40) | ((in[21] & 0x7FFFFFFF) << 24)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[21] >> 31) | ((in[22] & 0x3FFFFF) << 33))) & 1))^((((in[21] >> 31) | ((in[22] & 0x3FFFFF) << 33)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[22] >> 22) | ((in[23] & 0x1FFF) << 42))) & 1))^((((in[22] >> 22) | ((in[23] & 0x1FFF) << 42)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[23] >> 13) | ((in[24] & 0xF) << 51))) & 1))^((((in[23] >> 13) | ((in[24] & 0xF) << 51)))>>1))) << ntz + out[26] + out[28] = int64(((-(((in[24] >> 4) & 0x7FFFFFFFFFFFFF) & 1))^(((in[24] >> 4) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[27] + out[29] = int64(((-((((in[24] >> 59) | ((in[25] & 0x3FFFFFFFFFFFF) << 5))) & 1))^((((in[24] >> 59) | ((in[25] & 0x3FFFFFFFFFFFF) << 5)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[25] >> 50) | ((in[26] & 0x1FFFFFFFFFF) << 14))) & 1))^((((in[25] >> 50) | ((in[26] & 0x1FFFFFFFFFF) << 14)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[26] >> 41) | ((in[27] & 0xFFFFFFFF) << 23))) & 1))^((((in[26] >> 41) | ((in[27] & 0xFFFFFFFF) << 23)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[27] >> 32) | ((in[28] & 0x7FFFFF) << 32))) & 1))^((((in[27] >> 32) | ((in[28] & 0x7FFFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[28] >> 23) | ((in[29] & 0x3FFF) << 41))) & 1))^((((in[28] >> 23) | ((in[29] & 0x3FFF) << 41)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[29] >> 14) | ((in[30] & 0x1F) << 50))) & 1))^((((in[29] >> 14) | ((in[30] & 0x1F) << 50)))>>1))) << ntz + out[33] + out[35] = int64(((-(((in[30] >> 5) & 0x7FFFFFFFFFFFFF) & 1))^(((in[30] >> 5) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[34] + out[36] = int64(((-((((in[30] >> 60) | ((in[31] & 0x7FFFFFFFFFFFF) << 4))) & 1))^((((in[30] >> 60) | ((in[31] & 0x7FFFFFFFFFFFF) << 4)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[31] >> 51) | ((in[32] & 0x3FFFFFFFFFF) << 13))) & 1))^((((in[31] >> 51) | ((in[32] & 0x3FFFFFFFFFF) << 13)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[32] >> 42) | ((in[33] & 0x1FFFFFFFF) << 22))) & 1))^((((in[32] >> 42) | ((in[33] & 0x1FFFFFFFF) << 22)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[33] >> 33) | ((in[34] & 0xFFFFFF) << 31))) & 1))^((((in[33] >> 33) | ((in[34] & 0xFFFFFF) << 31)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[34] >> 24) | ((in[35] & 0x7FFF) << 40))) & 1))^((((in[34] >> 24) | ((in[35] & 0x7FFF) << 40)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[35] >> 15) | ((in[36] & 0x3F) << 49))) & 1))^((((in[35] >> 15) | ((in[36] & 0x3F) << 49)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[36] >> 6) & 0x7FFFFFFFFFFFFF) & 1))^(((in[36] >> 6) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFFFFF) << 3))) & 1))^((((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFFFFF) << 3)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[37] >> 52) | ((in[38] & 0x7FFFFFFFFFF) << 12))) & 1))^((((in[37] >> 52) | ((in[38] & 0x7FFFFFFFFFF) << 12)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[38] >> 43) | ((in[39] & 0x3FFFFFFFF) << 21))) & 1))^((((in[38] >> 43) | ((in[39] & 0x3FFFFFFFF) << 21)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[39] >> 34) | ((in[40] & 0x1FFFFFF) << 30))) & 1))^((((in[39] >> 34) | ((in[40] & 0x1FFFFFF) << 30)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[40] >> 25) | ((in[41] & 0xFFFF) << 39))) & 1))^((((in[40] >> 25) | ((in[41] & 0xFFFF) << 39)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[41] >> 16) | ((in[42] & 0x7F) << 48))) & 1))^((((in[41] >> 16) | ((in[42] & 0x7F) << 48)))>>1))) << ntz + out[47] + out[49] = int64(((-(((in[42] >> 7) & 0x7FFFFFFFFFFFFF) & 1))^(((in[42] >> 7) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[48] + out[50] = int64(((-((((in[42] >> 62) | ((in[43] & 0x1FFFFFFFFFFFFF) << 2))) & 1))^((((in[42] >> 62) | ((in[43] & 0x1FFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFFF) << 11))) & 1))^((((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFFF) << 11)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[44] >> 44) | ((in[45] & 0x7FFFFFFFF) << 20))) & 1))^((((in[44] >> 44) | ((in[45] & 0x7FFFFFFFF) << 20)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[45] >> 35) | ((in[46] & 0x3FFFFFF) << 29))) & 1))^((((in[45] >> 35) | ((in[46] & 0x3FFFFFF) << 29)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[46] >> 26) | ((in[47] & 0x1FFFF) << 38))) & 1))^((((in[46] >> 26) | ((in[47] & 0x1FFFF) << 38)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[47] >> 17) | ((in[48] & 0xFF) << 47))) & 1))^((((in[47] >> 17) | ((in[48] & 0xFF) << 47)))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[48] >> 8) & 0x7FFFFFFFFFFFFF) & 1))^(((in[48] >> 8) & 0x7FFFFFFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[48] >> 63) | ((in[49] & 0x3FFFFFFFFFFFFF) << 1))) & 1))^((((in[48] >> 63) | ((in[49] & 0x3FFFFFFFFFFFFF) << 1)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[49] >> 54) | ((in[50] & 0x1FFFFFFFFFFF) << 10))) & 1))^((((in[49] >> 54) | ((in[50] & 0x1FFFFFFFFFFF) << 10)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[50] >> 45) | ((in[51] & 0xFFFFFFFFF) << 19))) & 1))^((((in[50] >> 45) | ((in[51] & 0xFFFFFFFFF) << 19)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[51] >> 36) | ((in[52] & 0x7FFFFFF) << 28))) & 1))^((((in[51] >> 36) | ((in[52] & 0x7FFFFFF) << 28)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[52] >> 27) | ((in[53] & 0x3FFFF) << 37))) & 1))^((((in[52] >> 27) | ((in[53] & 0x3FFFF) << 37)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[53] >> 18) | ((in[54] & 0x1FF) << 46))) & 1))^((((in[53] >> 18) | ((in[54] & 0x1FF) << 46)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[54] >> 9)) & 1))^(((in[54] >> 9))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_56(initoffset int64, in *[56]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 56) | ((in[1] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[0] >> 56) | ((in[1] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 48) | ((in[2] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[1] >> 48) | ((in[2] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 40) | ((in[3] & 0xFFFFFFFF) << 24))) & 1))^((((in[2] >> 40) | ((in[3] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 32) | ((in[4] & 0xFFFFFF) << 32))) & 1))^((((in[3] >> 32) | ((in[4] & 0xFFFFFF) << 32)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 24) | ((in[5] & 0xFFFF) << 40))) & 1))^((((in[4] >> 24) | ((in[5] & 0xFFFF) << 40)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 16) | ((in[6] & 0xFF) << 48))) & 1))^((((in[5] >> 16) | ((in[6] & 0xFF) << 48)))>>1))) << ntz + out[5] + out[7] = int64(((-(((in[6] >> 8)) & 1))^(((in[6] >> 8))>>1))) << ntz + out[6] + out[8] = int64(((-(((in[7] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[7] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + out[7] + out[9] = int64(((-((((in[7] >> 56) | ((in[8] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[8] >> 48) | ((in[9] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[8] >> 48) | ((in[9] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[9] >> 40) | ((in[10] & 0xFFFFFFFF) << 24))) & 1))^((((in[9] >> 40) | ((in[10] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[10] >> 32) | ((in[11] & 0xFFFFFF) << 32))) & 1))^((((in[10] >> 32) | ((in[11] & 0xFFFFFF) << 32)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[11] >> 24) | ((in[12] & 0xFFFF) << 40))) & 1))^((((in[11] >> 24) | ((in[12] & 0xFFFF) << 40)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[12] >> 16) | ((in[13] & 0xFF) << 48))) & 1))^((((in[12] >> 16) | ((in[13] & 0xFF) << 48)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[13] >> 8)) & 1))^(((in[13] >> 8))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[14] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[14] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[14] >> 56) | ((in[15] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[14] >> 56) | ((in[15] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[15] >> 48) | ((in[16] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[16] >> 40) | ((in[17] & 0xFFFFFFFF) << 24))) & 1))^((((in[16] >> 40) | ((in[17] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[17] >> 32) | ((in[18] & 0xFFFFFF) << 32))) & 1))^((((in[17] >> 32) | ((in[18] & 0xFFFFFF) << 32)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[18] >> 24) | ((in[19] & 0xFFFF) << 40))) & 1))^((((in[18] >> 24) | ((in[19] & 0xFFFF) << 40)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[19] >> 16) | ((in[20] & 0xFF) << 48))) & 1))^((((in[19] >> 16) | ((in[20] & 0xFF) << 48)))>>1))) << ntz + out[21] + out[23] = int64(((-(((in[20] >> 8)) & 1))^(((in[20] >> 8))>>1))) << ntz + out[22] + out[24] = int64(((-(((in[21] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[21] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + out[23] + out[25] = int64(((-((((in[21] >> 56) | ((in[22] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[21] >> 56) | ((in[22] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[22] >> 48) | ((in[23] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[22] >> 48) | ((in[23] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[23] >> 40) | ((in[24] & 0xFFFFFFFF) << 24))) & 1))^((((in[23] >> 40) | ((in[24] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[24] >> 32) | ((in[25] & 0xFFFFFF) << 32))) & 1))^((((in[24] >> 32) | ((in[25] & 0xFFFFFF) << 32)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[25] >> 24) | ((in[26] & 0xFFFF) << 40))) & 1))^((((in[25] >> 24) | ((in[26] & 0xFFFF) << 40)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[26] >> 16) | ((in[27] & 0xFF) << 48))) & 1))^((((in[26] >> 16) | ((in[27] & 0xFF) << 48)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[27] >> 8)) & 1))^(((in[27] >> 8))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[28] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[28] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[28] >> 56) | ((in[29] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[28] >> 56) | ((in[29] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[29] >> 48) | ((in[30] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[29] >> 48) | ((in[30] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[30] >> 40) | ((in[31] & 0xFFFFFFFF) << 24))) & 1))^((((in[30] >> 40) | ((in[31] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[31] >> 32) | ((in[32] & 0xFFFFFF) << 32))) & 1))^((((in[31] >> 32) | ((in[32] & 0xFFFFFF) << 32)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[32] >> 24) | ((in[33] & 0xFFFF) << 40))) & 1))^((((in[32] >> 24) | ((in[33] & 0xFFFF) << 40)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[33] >> 16) | ((in[34] & 0xFF) << 48))) & 1))^((((in[33] >> 16) | ((in[34] & 0xFF) << 48)))>>1))) << ntz + out[37] + out[39] = int64(((-(((in[34] >> 8)) & 1))^(((in[34] >> 8))>>1))) << ntz + out[38] + out[40] = int64(((-(((in[35] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[35] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + out[39] + out[41] = int64(((-((((in[35] >> 56) | ((in[36] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[35] >> 56) | ((in[36] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[36] >> 48) | ((in[37] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[36] >> 48) | ((in[37] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[37] >> 40) | ((in[38] & 0xFFFFFFFF) << 24))) & 1))^((((in[37] >> 40) | ((in[38] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[38] >> 32) | ((in[39] & 0xFFFFFF) << 32))) & 1))^((((in[38] >> 32) | ((in[39] & 0xFFFFFF) << 32)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[39] >> 24) | ((in[40] & 0xFFFF) << 40))) & 1))^((((in[39] >> 24) | ((in[40] & 0xFFFF) << 40)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[40] >> 16) | ((in[41] & 0xFF) << 48))) & 1))^((((in[40] >> 16) | ((in[41] & 0xFF) << 48)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[41] >> 8)) & 1))^(((in[41] >> 8))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[42] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[42] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[42] >> 56) | ((in[43] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[42] >> 56) | ((in[43] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[43] >> 48) | ((in[44] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[43] >> 48) | ((in[44] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[44] >> 40) | ((in[45] & 0xFFFFFFFF) << 24))) & 1))^((((in[44] >> 40) | ((in[45] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[45] >> 32) | ((in[46] & 0xFFFFFF) << 32))) & 1))^((((in[45] >> 32) | ((in[46] & 0xFFFFFF) << 32)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[46] >> 24) | ((in[47] & 0xFFFF) << 40))) & 1))^((((in[46] >> 24) | ((in[47] & 0xFFFF) << 40)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[47] >> 16) | ((in[48] & 0xFF) << 48))) & 1))^((((in[47] >> 16) | ((in[48] & 0xFF) << 48)))>>1))) << ntz + out[53] + out[55] = int64(((-(((in[48] >> 8)) & 1))^(((in[48] >> 8))>>1))) << ntz + out[54] + out[56] = int64(((-(((in[49] >> 0) & 0xFFFFFFFFFFFFFF) & 1))^(((in[49] >> 0) & 0xFFFFFFFFFFFFFF)>>1))) << ntz + out[55] + out[57] = int64(((-((((in[49] >> 56) | ((in[50] & 0xFFFFFFFFFFFF) << 8))) & 1))^((((in[49] >> 56) | ((in[50] & 0xFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[50] >> 48) | ((in[51] & 0xFFFFFFFFFF) << 16))) & 1))^((((in[50] >> 48) | ((in[51] & 0xFFFFFFFFFF) << 16)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[51] >> 40) | ((in[52] & 0xFFFFFFFF) << 24))) & 1))^((((in[51] >> 40) | ((in[52] & 0xFFFFFFFF) << 24)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[52] >> 32) | ((in[53] & 0xFFFFFF) << 32))) & 1))^((((in[52] >> 32) | ((in[53] & 0xFFFFFF) << 32)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[53] >> 24) | ((in[54] & 0xFFFF) << 40))) & 1))^((((in[53] >> 24) | ((in[54] & 0xFFFF) << 40)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[54] >> 16) | ((in[55] & 0xFF) << 48))) & 1))^((((in[54] >> 16) | ((in[55] & 0xFF) << 48)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[55] >> 8)) & 1))^(((in[55] >> 8))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_57(initoffset int64, in *[57]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 57) | ((in[1] & 0x3FFFFFFFFFFFF) << 7))) & 1))^((((in[0] >> 57) | ((in[1] & 0x3FFFFFFFFFFFF) << 7)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 50) | ((in[2] & 0x7FFFFFFFFFF) << 14))) & 1))^((((in[1] >> 50) | ((in[2] & 0x7FFFFFFFFFF) << 14)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 43) | ((in[3] & 0xFFFFFFFFF) << 21))) & 1))^((((in[2] >> 43) | ((in[3] & 0xFFFFFFFFF) << 21)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 36) | ((in[4] & 0x1FFFFFFF) << 28))) & 1))^((((in[3] >> 36) | ((in[4] & 0x1FFFFFFF) << 28)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 29) | ((in[5] & 0x3FFFFF) << 35))) & 1))^((((in[4] >> 29) | ((in[5] & 0x3FFFFF) << 35)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 22) | ((in[6] & 0x7FFF) << 42))) & 1))^((((in[5] >> 22) | ((in[6] & 0x7FFF) << 42)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[6] >> 15) | ((in[7] & 0xFF) << 49))) & 1))^((((in[6] >> 15) | ((in[7] & 0xFF) << 49)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[7] >> 8) | ((in[8] & 0x1) << 56))) & 1))^((((in[7] >> 8) | ((in[8] & 0x1) << 56)))>>1))) << ntz + out[7] + out[9] = int64(((-(((in[8] >> 1) & 0x1FFFFFFFFFFFFFF) & 1))^(((in[8] >> 1) & 0x1FFFFFFFFFFFFFF)>>1))) << ntz + out[8] + out[10] = int64(((-((((in[8] >> 58) | ((in[9] & 0x7FFFFFFFFFFFF) << 6))) & 1))^((((in[8] >> 58) | ((in[9] & 0x7FFFFFFFFFFFF) << 6)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[9] >> 51) | ((in[10] & 0xFFFFFFFFFFF) << 13))) & 1))^((((in[9] >> 51) | ((in[10] & 0xFFFFFFFFFFF) << 13)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[10] >> 44) | ((in[11] & 0x1FFFFFFFFF) << 20))) & 1))^((((in[10] >> 44) | ((in[11] & 0x1FFFFFFFFF) << 20)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[11] >> 37) | ((in[12] & 0x3FFFFFFF) << 27))) & 1))^((((in[11] >> 37) | ((in[12] & 0x3FFFFFFF) << 27)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[12] >> 30) | ((in[13] & 0x7FFFFF) << 34))) & 1))^((((in[12] >> 30) | ((in[13] & 0x7FFFFF) << 34)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[13] >> 23) | ((in[14] & 0xFFFF) << 41))) & 1))^((((in[13] >> 23) | ((in[14] & 0xFFFF) << 41)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[14] >> 16) | ((in[15] & 0x1FF) << 48))) & 1))^((((in[14] >> 16) | ((in[15] & 0x1FF) << 48)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[15] >> 9) | ((in[16] & 0x3) << 55))) & 1))^((((in[15] >> 9) | ((in[16] & 0x3) << 55)))>>1))) << ntz + out[16] + out[18] = int64(((-(((in[16] >> 2) & 0x1FFFFFFFFFFFFFF) & 1))^(((in[16] >> 2) & 0x1FFFFFFFFFFFFFF)>>1))) << ntz + out[17] + out[19] = int64(((-((((in[16] >> 59) | ((in[17] & 0xFFFFFFFFFFFFF) << 5))) & 1))^((((in[16] >> 59) | ((in[17] & 0xFFFFFFFFFFFFF) << 5)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[17] >> 52) | ((in[18] & 0x1FFFFFFFFFFF) << 12))) & 1))^((((in[17] >> 52) | ((in[18] & 0x1FFFFFFFFFFF) << 12)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[18] >> 45) | ((in[19] & 0x3FFFFFFFFF) << 19))) & 1))^((((in[18] >> 45) | ((in[19] & 0x3FFFFFFFFF) << 19)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[19] >> 38) | ((in[20] & 0x7FFFFFFF) << 26))) & 1))^((((in[19] >> 38) | ((in[20] & 0x7FFFFFFF) << 26)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[20] >> 31) | ((in[21] & 0xFFFFFF) << 33))) & 1))^((((in[20] >> 31) | ((in[21] & 0xFFFFFF) << 33)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[21] >> 24) | ((in[22] & 0x1FFFF) << 40))) & 1))^((((in[21] >> 24) | ((in[22] & 0x1FFFF) << 40)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[22] >> 17) | ((in[23] & 0x3FF) << 47))) & 1))^((((in[22] >> 17) | ((in[23] & 0x3FF) << 47)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[23] >> 10) | ((in[24] & 0x7) << 54))) & 1))^((((in[23] >> 10) | ((in[24] & 0x7) << 54)))>>1))) << ntz + out[25] + out[27] = int64(((-(((in[24] >> 3) & 0x1FFFFFFFFFFFFFF) & 1))^(((in[24] >> 3) & 0x1FFFFFFFFFFFFFF)>>1))) << ntz + out[26] + out[28] = int64(((-((((in[24] >> 60) | ((in[25] & 0x1FFFFFFFFFFFFF) << 4))) & 1))^((((in[24] >> 60) | ((in[25] & 0x1FFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[25] >> 53) | ((in[26] & 0x3FFFFFFFFFFF) << 11))) & 1))^((((in[25] >> 53) | ((in[26] & 0x3FFFFFFFFFFF) << 11)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[26] >> 46) | ((in[27] & 0x7FFFFFFFFF) << 18))) & 1))^((((in[26] >> 46) | ((in[27] & 0x7FFFFFFFFF) << 18)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[27] >> 39) | ((in[28] & 0xFFFFFFFF) << 25))) & 1))^((((in[27] >> 39) | ((in[28] & 0xFFFFFFFF) << 25)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[28] >> 32) | ((in[29] & 0x1FFFFFF) << 32))) & 1))^((((in[28] >> 32) | ((in[29] & 0x1FFFFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[29] >> 25) | ((in[30] & 0x3FFFF) << 39))) & 1))^((((in[29] >> 25) | ((in[30] & 0x3FFFF) << 39)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[30] >> 18) | ((in[31] & 0x7FF) << 46))) & 1))^((((in[30] >> 18) | ((in[31] & 0x7FF) << 46)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[31] >> 11) | ((in[32] & 0xF) << 53))) & 1))^((((in[31] >> 11) | ((in[32] & 0xF) << 53)))>>1))) << ntz + out[34] + out[36] = int64(((-(((in[32] >> 4) & 0x1FFFFFFFFFFFFFF) & 1))^(((in[32] >> 4) & 0x1FFFFFFFFFFFFFF)>>1))) << ntz + out[35] + out[37] = int64(((-((((in[32] >> 61) | ((in[33] & 0x3FFFFFFFFFFFFF) << 3))) & 1))^((((in[32] >> 61) | ((in[33] & 0x3FFFFFFFFFFFFF) << 3)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[33] >> 54) | ((in[34] & 0x7FFFFFFFFFFF) << 10))) & 1))^((((in[33] >> 54) | ((in[34] & 0x7FFFFFFFFFFF) << 10)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[34] >> 47) | ((in[35] & 0xFFFFFFFFFF) << 17))) & 1))^((((in[34] >> 47) | ((in[35] & 0xFFFFFFFFFF) << 17)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[35] >> 40) | ((in[36] & 0x1FFFFFFFF) << 24))) & 1))^((((in[35] >> 40) | ((in[36] & 0x1FFFFFFFF) << 24)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[36] >> 33) | ((in[37] & 0x3FFFFFF) << 31))) & 1))^((((in[36] >> 33) | ((in[37] & 0x3FFFFFF) << 31)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[37] >> 26) | ((in[38] & 0x7FFFF) << 38))) & 1))^((((in[37] >> 26) | ((in[38] & 0x7FFFF) << 38)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[38] >> 19) | ((in[39] & 0xFFF) << 45))) & 1))^((((in[38] >> 19) | ((in[39] & 0xFFF) << 45)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[39] >> 12) | ((in[40] & 0x1F) << 52))) & 1))^((((in[39] >> 12) | ((in[40] & 0x1F) << 52)))>>1))) << ntz + out[43] + out[45] = int64(((-(((in[40] >> 5) & 0x1FFFFFFFFFFFFFF) & 1))^(((in[40] >> 5) & 0x1FFFFFFFFFFFFFF)>>1))) << ntz + out[44] + out[46] = int64(((-((((in[40] >> 62) | ((in[41] & 0x7FFFFFFFFFFFFF) << 2))) & 1))^((((in[40] >> 62) | ((in[41] & 0x7FFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[41] >> 55) | ((in[42] & 0xFFFFFFFFFFFF) << 9))) & 1))^((((in[41] >> 55) | ((in[42] & 0xFFFFFFFFFFFF) << 9)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[42] >> 48) | ((in[43] & 0x1FFFFFFFFFF) << 16))) & 1))^((((in[42] >> 48) | ((in[43] & 0x1FFFFFFFFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[43] >> 41) | ((in[44] & 0x3FFFFFFFF) << 23))) & 1))^((((in[43] >> 41) | ((in[44] & 0x3FFFFFFFF) << 23)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[44] >> 34) | ((in[45] & 0x7FFFFFF) << 30))) & 1))^((((in[44] >> 34) | ((in[45] & 0x7FFFFFF) << 30)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[45] >> 27) | ((in[46] & 0xFFFFF) << 37))) & 1))^((((in[45] >> 27) | ((in[46] & 0xFFFFF) << 37)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[46] >> 20) | ((in[47] & 0x1FFF) << 44))) & 1))^((((in[46] >> 20) | ((in[47] & 0x1FFF) << 44)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[47] >> 13) | ((in[48] & 0x3F) << 51))) & 1))^((((in[47] >> 13) | ((in[48] & 0x3F) << 51)))>>1))) << ntz + out[52] + out[54] = int64(((-(((in[48] >> 6) & 0x1FFFFFFFFFFFFFF) & 1))^(((in[48] >> 6) & 0x1FFFFFFFFFFFFFF)>>1))) << ntz + out[53] + out[55] = int64(((-((((in[48] >> 63) | ((in[49] & 0xFFFFFFFFFFFFFF) << 1))) & 1))^((((in[48] >> 63) | ((in[49] & 0xFFFFFFFFFFFFFF) << 1)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[49] >> 56) | ((in[50] & 0x1FFFFFFFFFFFF) << 8))) & 1))^((((in[49] >> 56) | ((in[50] & 0x1FFFFFFFFFFFF) << 8)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[50] >> 49) | ((in[51] & 0x3FFFFFFFFFF) << 15))) & 1))^((((in[50] >> 49) | ((in[51] & 0x3FFFFFFFFFF) << 15)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[51] >> 42) | ((in[52] & 0x7FFFFFFFF) << 22))) & 1))^((((in[51] >> 42) | ((in[52] & 0x7FFFFFFFF) << 22)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[52] >> 35) | ((in[53] & 0xFFFFFFF) << 29))) & 1))^((((in[52] >> 35) | ((in[53] & 0xFFFFFFF) << 29)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[53] >> 28) | ((in[54] & 0x1FFFFF) << 36))) & 1))^((((in[53] >> 28) | ((in[54] & 0x1FFFFF) << 36)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[54] >> 21) | ((in[55] & 0x3FFF) << 43))) & 1))^((((in[54] >> 21) | ((in[55] & 0x3FFF) << 43)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[55] >> 14) | ((in[56] & 0x7F) << 50))) & 1))^((((in[55] >> 14) | ((in[56] & 0x7F) << 50)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[56] >> 7)) & 1))^(((in[56] >> 7))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_58(initoffset int64, in *[58]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 58) | ((in[1] & 0xFFFFFFFFFFFFF) << 6))) & 1))^((((in[0] >> 58) | ((in[1] & 0xFFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 52) | ((in[2] & 0x3FFFFFFFFFFF) << 12))) & 1))^((((in[1] >> 52) | ((in[2] & 0x3FFFFFFFFFFF) << 12)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 46) | ((in[3] & 0xFFFFFFFFFF) << 18))) & 1))^((((in[2] >> 46) | ((in[3] & 0xFFFFFFFFFF) << 18)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 40) | ((in[4] & 0x3FFFFFFFF) << 24))) & 1))^((((in[3] >> 40) | ((in[4] & 0x3FFFFFFFF) << 24)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 34) | ((in[5] & 0xFFFFFFF) << 30))) & 1))^((((in[4] >> 34) | ((in[5] & 0xFFFFFFF) << 30)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 28) | ((in[6] & 0x3FFFFF) << 36))) & 1))^((((in[5] >> 28) | ((in[6] & 0x3FFFFF) << 36)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[6] >> 22) | ((in[7] & 0xFFFF) << 42))) & 1))^((((in[6] >> 22) | ((in[7] & 0xFFFF) << 42)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[7] >> 16) | ((in[8] & 0x3FF) << 48))) & 1))^((((in[7] >> 16) | ((in[8] & 0x3FF) << 48)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[8] >> 10) | ((in[9] & 0xF) << 54))) & 1))^((((in[8] >> 10) | ((in[9] & 0xF) << 54)))>>1))) << ntz + out[8] + out[10] = int64(((-(((in[9] >> 4) & 0x3FFFFFFFFFFFFFF) & 1))^(((in[9] >> 4) & 0x3FFFFFFFFFFFFFF)>>1))) << ntz + out[9] + out[11] = int64(((-((((in[9] >> 62) | ((in[10] & 0xFFFFFFFFFFFFFF) << 2))) & 1))^((((in[9] >> 62) | ((in[10] & 0xFFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[10] >> 56) | ((in[11] & 0x3FFFFFFFFFFFF) << 8))) & 1))^((((in[10] >> 56) | ((in[11] & 0x3FFFFFFFFFFFF) << 8)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[11] >> 50) | ((in[12] & 0xFFFFFFFFFFF) << 14))) & 1))^((((in[11] >> 50) | ((in[12] & 0xFFFFFFFFFFF) << 14)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[12] >> 44) | ((in[13] & 0x3FFFFFFFFF) << 20))) & 1))^((((in[12] >> 44) | ((in[13] & 0x3FFFFFFFFF) << 20)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[13] >> 38) | ((in[14] & 0xFFFFFFFF) << 26))) & 1))^((((in[13] >> 38) | ((in[14] & 0xFFFFFFFF) << 26)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[14] >> 32) | ((in[15] & 0x3FFFFFF) << 32))) & 1))^((((in[14] >> 32) | ((in[15] & 0x3FFFFFF) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[15] >> 26) | ((in[16] & 0xFFFFF) << 38))) & 1))^((((in[15] >> 26) | ((in[16] & 0xFFFFF) << 38)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[16] >> 20) | ((in[17] & 0x3FFF) << 44))) & 1))^((((in[16] >> 20) | ((in[17] & 0x3FFF) << 44)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[17] >> 14) | ((in[18] & 0xFF) << 50))) & 1))^((((in[17] >> 14) | ((in[18] & 0xFF) << 50)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[18] >> 8) | ((in[19] & 0x3) << 56))) & 1))^((((in[18] >> 8) | ((in[19] & 0x3) << 56)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[19] >> 2) & 0x3FFFFFFFFFFFFFF) & 1))^(((in[19] >> 2) & 0x3FFFFFFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[19] >> 60) | ((in[20] & 0x3FFFFFFFFFFFFF) << 4))) & 1))^((((in[19] >> 60) | ((in[20] & 0x3FFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[20] >> 54) | ((in[21] & 0xFFFFFFFFFFFF) << 10))) & 1))^((((in[20] >> 54) | ((in[21] & 0xFFFFFFFFFFFF) << 10)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[21] >> 48) | ((in[22] & 0x3FFFFFFFFFF) << 16))) & 1))^((((in[21] >> 48) | ((in[22] & 0x3FFFFFFFFFF) << 16)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[22] >> 42) | ((in[23] & 0xFFFFFFFFF) << 22))) & 1))^((((in[22] >> 42) | ((in[23] & 0xFFFFFFFFF) << 22)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[23] >> 36) | ((in[24] & 0x3FFFFFFF) << 28))) & 1))^((((in[23] >> 36) | ((in[24] & 0x3FFFFFFF) << 28)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[24] >> 30) | ((in[25] & 0xFFFFFF) << 34))) & 1))^((((in[24] >> 30) | ((in[25] & 0xFFFFFF) << 34)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[25] >> 24) | ((in[26] & 0x3FFFF) << 40))) & 1))^((((in[25] >> 24) | ((in[26] & 0x3FFFF) << 40)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[26] >> 18) | ((in[27] & 0xFFF) << 46))) & 1))^((((in[26] >> 18) | ((in[27] & 0xFFF) << 46)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[27] >> 12) | ((in[28] & 0x3F) << 52))) & 1))^((((in[27] >> 12) | ((in[28] & 0x3F) << 52)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[28] >> 6)) & 1))^(((in[28] >> 6))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[29] >> 0) & 0x3FFFFFFFFFFFFFF) & 1))^(((in[29] >> 0) & 0x3FFFFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[29] >> 58) | ((in[30] & 0xFFFFFFFFFFFFF) << 6))) & 1))^((((in[29] >> 58) | ((in[30] & 0xFFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[30] >> 52) | ((in[31] & 0x3FFFFFFFFFFF) << 12))) & 1))^((((in[30] >> 52) | ((in[31] & 0x3FFFFFFFFFFF) << 12)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[31] >> 46) | ((in[32] & 0xFFFFFFFFFF) << 18))) & 1))^((((in[31] >> 46) | ((in[32] & 0xFFFFFFFFFF) << 18)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[32] >> 40) | ((in[33] & 0x3FFFFFFFF) << 24))) & 1))^((((in[32] >> 40) | ((in[33] & 0x3FFFFFFFF) << 24)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[33] >> 34) | ((in[34] & 0xFFFFFFF) << 30))) & 1))^((((in[33] >> 34) | ((in[34] & 0xFFFFFFF) << 30)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[34] >> 28) | ((in[35] & 0x3FFFFF) << 36))) & 1))^((((in[34] >> 28) | ((in[35] & 0x3FFFFF) << 36)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[35] >> 22) | ((in[36] & 0xFFFF) << 42))) & 1))^((((in[35] >> 22) | ((in[36] & 0xFFFF) << 42)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[36] >> 16) | ((in[37] & 0x3FF) << 48))) & 1))^((((in[36] >> 16) | ((in[37] & 0x3FF) << 48)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[37] >> 10) | ((in[38] & 0xF) << 54))) & 1))^((((in[37] >> 10) | ((in[38] & 0xF) << 54)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[38] >> 4) & 0x3FFFFFFFFFFFFFF) & 1))^(((in[38] >> 4) & 0x3FFFFFFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[38] >> 62) | ((in[39] & 0xFFFFFFFFFFFFFF) << 2))) & 1))^((((in[38] >> 62) | ((in[39] & 0xFFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[39] >> 56) | ((in[40] & 0x3FFFFFFFFFFFF) << 8))) & 1))^((((in[39] >> 56) | ((in[40] & 0x3FFFFFFFFFFFF) << 8)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[40] >> 50) | ((in[41] & 0xFFFFFFFFFFF) << 14))) & 1))^((((in[40] >> 50) | ((in[41] & 0xFFFFFFFFFFF) << 14)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[41] >> 44) | ((in[42] & 0x3FFFFFFFFF) << 20))) & 1))^((((in[41] >> 44) | ((in[42] & 0x3FFFFFFFFF) << 20)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[42] >> 38) | ((in[43] & 0xFFFFFFFF) << 26))) & 1))^((((in[42] >> 38) | ((in[43] & 0xFFFFFFFF) << 26)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[43] >> 32) | ((in[44] & 0x3FFFFFF) << 32))) & 1))^((((in[43] >> 32) | ((in[44] & 0x3FFFFFF) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[44] >> 26) | ((in[45] & 0xFFFFF) << 38))) & 1))^((((in[44] >> 26) | ((in[45] & 0xFFFFF) << 38)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[45] >> 20) | ((in[46] & 0x3FFF) << 44))) & 1))^((((in[45] >> 20) | ((in[46] & 0x3FFF) << 44)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[46] >> 14) | ((in[47] & 0xFF) << 50))) & 1))^((((in[46] >> 14) | ((in[47] & 0xFF) << 50)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[47] >> 8) | ((in[48] & 0x3) << 56))) & 1))^((((in[47] >> 8) | ((in[48] & 0x3) << 56)))>>1))) << ntz + out[51] + out[53] = int64(((-(((in[48] >> 2) & 0x3FFFFFFFFFFFFFF) & 1))^(((in[48] >> 2) & 0x3FFFFFFFFFFFFFF)>>1))) << ntz + out[52] + out[54] = int64(((-((((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFFF) << 4))) & 1))^((((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[49] >> 54) | ((in[50] & 0xFFFFFFFFFFFF) << 10))) & 1))^((((in[49] >> 54) | ((in[50] & 0xFFFFFFFFFFFF) << 10)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[50] >> 48) | ((in[51] & 0x3FFFFFFFFFF) << 16))) & 1))^((((in[50] >> 48) | ((in[51] & 0x3FFFFFFFFFF) << 16)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[51] >> 42) | ((in[52] & 0xFFFFFFFFF) << 22))) & 1))^((((in[51] >> 42) | ((in[52] & 0xFFFFFFFFF) << 22)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[52] >> 36) | ((in[53] & 0x3FFFFFFF) << 28))) & 1))^((((in[52] >> 36) | ((in[53] & 0x3FFFFFFF) << 28)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[53] >> 30) | ((in[54] & 0xFFFFFF) << 34))) & 1))^((((in[53] >> 30) | ((in[54] & 0xFFFFFF) << 34)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[54] >> 24) | ((in[55] & 0x3FFFF) << 40))) & 1))^((((in[54] >> 24) | ((in[55] & 0x3FFFF) << 40)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[55] >> 18) | ((in[56] & 0xFFF) << 46))) & 1))^((((in[55] >> 18) | ((in[56] & 0xFFF) << 46)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[56] >> 12) | ((in[57] & 0x3F) << 52))) & 1))^((((in[56] >> 12) | ((in[57] & 0x3F) << 52)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[57] >> 6)) & 1))^(((in[57] >> 6))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_59(initoffset int64, in *[59]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 59) | ((in[1] & 0x3FFFFFFFFFFFFF) << 5))) & 1))^((((in[0] >> 59) | ((in[1] & 0x3FFFFFFFFFFFFF) << 5)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 54) | ((in[2] & 0x1FFFFFFFFFFFF) << 10))) & 1))^((((in[1] >> 54) | ((in[2] & 0x1FFFFFFFFFFFF) << 10)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 49) | ((in[3] & 0xFFFFFFFFFFF) << 15))) & 1))^((((in[2] >> 49) | ((in[3] & 0xFFFFFFFFFFF) << 15)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 44) | ((in[4] & 0x7FFFFFFFFF) << 20))) & 1))^((((in[3] >> 44) | ((in[4] & 0x7FFFFFFFFF) << 20)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 39) | ((in[5] & 0x3FFFFFFFF) << 25))) & 1))^((((in[4] >> 39) | ((in[5] & 0x3FFFFFFFF) << 25)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 34) | ((in[6] & 0x1FFFFFFF) << 30))) & 1))^((((in[5] >> 34) | ((in[6] & 0x1FFFFFFF) << 30)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[6] >> 29) | ((in[7] & 0xFFFFFF) << 35))) & 1))^((((in[6] >> 29) | ((in[7] & 0xFFFFFF) << 35)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[7] >> 24) | ((in[8] & 0x7FFFF) << 40))) & 1))^((((in[7] >> 24) | ((in[8] & 0x7FFFF) << 40)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[8] >> 19) | ((in[9] & 0x3FFF) << 45))) & 1))^((((in[8] >> 19) | ((in[9] & 0x3FFF) << 45)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[9] >> 14) | ((in[10] & 0x1FF) << 50))) & 1))^((((in[9] >> 14) | ((in[10] & 0x1FF) << 50)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[10] >> 9) | ((in[11] & 0xF) << 55))) & 1))^((((in[10] >> 9) | ((in[11] & 0xF) << 55)))>>1))) << ntz + out[10] + out[12] = int64(((-(((in[11] >> 4) & 0x7FFFFFFFFFFFFFF) & 1))^(((in[11] >> 4) & 0x7FFFFFFFFFFFFFF)>>1))) << ntz + out[11] + out[13] = int64(((-((((in[11] >> 63) | ((in[12] & 0x3FFFFFFFFFFFFFF) << 1))) & 1))^((((in[11] >> 63) | ((in[12] & 0x3FFFFFFFFFFFFFF) << 1)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[12] >> 58) | ((in[13] & 0x1FFFFFFFFFFFFF) << 6))) & 1))^((((in[12] >> 58) | ((in[13] & 0x1FFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[13] >> 53) | ((in[14] & 0xFFFFFFFFFFFF) << 11))) & 1))^((((in[13] >> 53) | ((in[14] & 0xFFFFFFFFFFFF) << 11)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[14] >> 48) | ((in[15] & 0x7FFFFFFFFFF) << 16))) & 1))^((((in[14] >> 48) | ((in[15] & 0x7FFFFFFFFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[15] >> 43) | ((in[16] & 0x3FFFFFFFFF) << 21))) & 1))^((((in[15] >> 43) | ((in[16] & 0x3FFFFFFFFF) << 21)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[16] >> 38) | ((in[17] & 0x1FFFFFFFF) << 26))) & 1))^((((in[16] >> 38) | ((in[17] & 0x1FFFFFFFF) << 26)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[17] >> 33) | ((in[18] & 0xFFFFFFF) << 31))) & 1))^((((in[17] >> 33) | ((in[18] & 0xFFFFFFF) << 31)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[18] >> 28) | ((in[19] & 0x7FFFFF) << 36))) & 1))^((((in[18] >> 28) | ((in[19] & 0x7FFFFF) << 36)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[19] >> 23) | ((in[20] & 0x3FFFF) << 41))) & 1))^((((in[19] >> 23) | ((in[20] & 0x3FFFF) << 41)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[20] >> 18) | ((in[21] & 0x1FFF) << 46))) & 1))^((((in[20] >> 18) | ((in[21] & 0x1FFF) << 46)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[21] >> 13) | ((in[22] & 0xFF) << 51))) & 1))^((((in[21] >> 13) | ((in[22] & 0xFF) << 51)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[22] >> 8) | ((in[23] & 0x7) << 56))) & 1))^((((in[22] >> 8) | ((in[23] & 0x7) << 56)))>>1))) << ntz + out[23] + out[25] = int64(((-(((in[23] >> 3) & 0x7FFFFFFFFFFFFFF) & 1))^(((in[23] >> 3) & 0x7FFFFFFFFFFFFFF)>>1))) << ntz + out[24] + out[26] = int64(((-((((in[23] >> 62) | ((in[24] & 0x1FFFFFFFFFFFFFF) << 2))) & 1))^((((in[23] >> 62) | ((in[24] & 0x1FFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[24] >> 57) | ((in[25] & 0xFFFFFFFFFFFFF) << 7))) & 1))^((((in[24] >> 57) | ((in[25] & 0xFFFFFFFFFFFFF) << 7)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[25] >> 52) | ((in[26] & 0x7FFFFFFFFFFF) << 12))) & 1))^((((in[25] >> 52) | ((in[26] & 0x7FFFFFFFFFFF) << 12)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[26] >> 47) | ((in[27] & 0x3FFFFFFFFFF) << 17))) & 1))^((((in[26] >> 47) | ((in[27] & 0x3FFFFFFFFFF) << 17)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[27] >> 42) | ((in[28] & 0x1FFFFFFFFF) << 22))) & 1))^((((in[27] >> 42) | ((in[28] & 0x1FFFFFFFFF) << 22)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[28] >> 37) | ((in[29] & 0xFFFFFFFF) << 27))) & 1))^((((in[28] >> 37) | ((in[29] & 0xFFFFFFFF) << 27)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[29] >> 32) | ((in[30] & 0x7FFFFFF) << 32))) & 1))^((((in[29] >> 32) | ((in[30] & 0x7FFFFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[30] >> 27) | ((in[31] & 0x3FFFFF) << 37))) & 1))^((((in[30] >> 27) | ((in[31] & 0x3FFFFF) << 37)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[31] >> 22) | ((in[32] & 0x1FFFF) << 42))) & 1))^((((in[31] >> 22) | ((in[32] & 0x1FFFF) << 42)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[32] >> 17) | ((in[33] & 0xFFF) << 47))) & 1))^((((in[32] >> 17) | ((in[33] & 0xFFF) << 47)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[33] >> 12) | ((in[34] & 0x7F) << 52))) & 1))^((((in[33] >> 12) | ((in[34] & 0x7F) << 52)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[34] >> 7) | ((in[35] & 0x3) << 57))) & 1))^((((in[34] >> 7) | ((in[35] & 0x3) << 57)))>>1))) << ntz + out[36] + out[38] = int64(((-(((in[35] >> 2) & 0x7FFFFFFFFFFFFFF) & 1))^(((in[35] >> 2) & 0x7FFFFFFFFFFFFFF)>>1))) << ntz + out[37] + out[39] = int64(((-((((in[35] >> 61) | ((in[36] & 0xFFFFFFFFFFFFFF) << 3))) & 1))^((((in[35] >> 61) | ((in[36] & 0xFFFFFFFFFFFFFF) << 3)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[36] >> 56) | ((in[37] & 0x7FFFFFFFFFFFF) << 8))) & 1))^((((in[36] >> 56) | ((in[37] & 0x7FFFFFFFFFFFF) << 8)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[37] >> 51) | ((in[38] & 0x3FFFFFFFFFFF) << 13))) & 1))^((((in[37] >> 51) | ((in[38] & 0x3FFFFFFFFFFF) << 13)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[38] >> 46) | ((in[39] & 0x1FFFFFFFFFF) << 18))) & 1))^((((in[38] >> 46) | ((in[39] & 0x1FFFFFFFFFF) << 18)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[39] >> 41) | ((in[40] & 0xFFFFFFFFF) << 23))) & 1))^((((in[39] >> 41) | ((in[40] & 0xFFFFFFFFF) << 23)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[40] >> 36) | ((in[41] & 0x7FFFFFFF) << 28))) & 1))^((((in[40] >> 36) | ((in[41] & 0x7FFFFFFF) << 28)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[41] >> 31) | ((in[42] & 0x3FFFFFF) << 33))) & 1))^((((in[41] >> 31) | ((in[42] & 0x3FFFFFF) << 33)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[42] >> 26) | ((in[43] & 0x1FFFFF) << 38))) & 1))^((((in[42] >> 26) | ((in[43] & 0x1FFFFF) << 38)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[43] >> 21) | ((in[44] & 0xFFFF) << 43))) & 1))^((((in[43] >> 21) | ((in[44] & 0xFFFF) << 43)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[44] >> 16) | ((in[45] & 0x7FF) << 48))) & 1))^((((in[44] >> 16) | ((in[45] & 0x7FF) << 48)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[45] >> 11) | ((in[46] & 0x3F) << 53))) & 1))^((((in[45] >> 11) | ((in[46] & 0x3F) << 53)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[46] >> 6) | ((in[47] & 0x1) << 58))) & 1))^((((in[46] >> 6) | ((in[47] & 0x1) << 58)))>>1))) << ntz + out[49] + out[51] = int64(((-(((in[47] >> 1) & 0x7FFFFFFFFFFFFFF) & 1))^(((in[47] >> 1) & 0x7FFFFFFFFFFFFFF)>>1))) << ntz + out[50] + out[52] = int64(((-((((in[47] >> 60) | ((in[48] & 0x7FFFFFFFFFFFFF) << 4))) & 1))^((((in[47] >> 60) | ((in[48] & 0x7FFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[48] >> 55) | ((in[49] & 0x3FFFFFFFFFFFF) << 9))) & 1))^((((in[48] >> 55) | ((in[49] & 0x3FFFFFFFFFFFF) << 9)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[49] >> 50) | ((in[50] & 0x1FFFFFFFFFFF) << 14))) & 1))^((((in[49] >> 50) | ((in[50] & 0x1FFFFFFFFFFF) << 14)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[50] >> 45) | ((in[51] & 0xFFFFFFFFFF) << 19))) & 1))^((((in[50] >> 45) | ((in[51] & 0xFFFFFFFFFF) << 19)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[51] >> 40) | ((in[52] & 0x7FFFFFFFF) << 24))) & 1))^((((in[51] >> 40) | ((in[52] & 0x7FFFFFFFF) << 24)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[52] >> 35) | ((in[53] & 0x3FFFFFFF) << 29))) & 1))^((((in[52] >> 35) | ((in[53] & 0x3FFFFFFF) << 29)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[53] >> 30) | ((in[54] & 0x1FFFFFF) << 34))) & 1))^((((in[53] >> 30) | ((in[54] & 0x1FFFFFF) << 34)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[54] >> 25) | ((in[55] & 0xFFFFF) << 39))) & 1))^((((in[54] >> 25) | ((in[55] & 0xFFFFF) << 39)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[55] >> 20) | ((in[56] & 0x7FFF) << 44))) & 1))^((((in[55] >> 20) | ((in[56] & 0x7FFF) << 44)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[56] >> 15) | ((in[57] & 0x3FF) << 49))) & 1))^((((in[56] >> 15) | ((in[57] & 0x3FF) << 49)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[57] >> 10) | ((in[58] & 0x1F) << 54))) & 1))^((((in[57] >> 10) | ((in[58] & 0x1F) << 54)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[58] >> 5)) & 1))^(((in[58] >> 5))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_60(initoffset int64, in *[60]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0xFFFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0xFFFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 60) | ((in[1] & 0xFFFFFFFFFFFFFF) << 4))) & 1))^((((in[0] >> 60) | ((in[1] & 0xFFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 56) | ((in[2] & 0xFFFFFFFFFFFFF) << 8))) & 1))^((((in[1] >> 56) | ((in[2] & 0xFFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 52) | ((in[3] & 0xFFFFFFFFFFFF) << 12))) & 1))^((((in[2] >> 52) | ((in[3] & 0xFFFFFFFFFFFF) << 12)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 48) | ((in[4] & 0xFFFFFFFFFFF) << 16))) & 1))^((((in[3] >> 48) | ((in[4] & 0xFFFFFFFFFFF) << 16)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 44) | ((in[5] & 0xFFFFFFFFFF) << 20))) & 1))^((((in[4] >> 44) | ((in[5] & 0xFFFFFFFFFF) << 20)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 40) | ((in[6] & 0xFFFFFFFFF) << 24))) & 1))^((((in[5] >> 40) | ((in[6] & 0xFFFFFFFFF) << 24)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[6] >> 36) | ((in[7] & 0xFFFFFFFF) << 28))) & 1))^((((in[6] >> 36) | ((in[7] & 0xFFFFFFFF) << 28)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[7] >> 32) | ((in[8] & 0xFFFFFFF) << 32))) & 1))^((((in[7] >> 32) | ((in[8] & 0xFFFFFFF) << 32)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[8] >> 28) | ((in[9] & 0xFFFFFF) << 36))) & 1))^((((in[8] >> 28) | ((in[9] & 0xFFFFFF) << 36)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[9] >> 24) | ((in[10] & 0xFFFFF) << 40))) & 1))^((((in[9] >> 24) | ((in[10] & 0xFFFFF) << 40)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[10] >> 20) | ((in[11] & 0xFFFF) << 44))) & 1))^((((in[10] >> 20) | ((in[11] & 0xFFFF) << 44)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[11] >> 16) | ((in[12] & 0xFFF) << 48))) & 1))^((((in[11] >> 16) | ((in[12] & 0xFFF) << 48)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[12] >> 12) | ((in[13] & 0xFF) << 52))) & 1))^((((in[12] >> 12) | ((in[13] & 0xFF) << 52)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[13] >> 8) | ((in[14] & 0xF) << 56))) & 1))^((((in[13] >> 8) | ((in[14] & 0xF) << 56)))>>1))) << ntz + out[13] + out[15] = int64(((-(((in[14] >> 4)) & 1))^(((in[14] >> 4))>>1))) << ntz + out[14] + out[16] = int64(((-(((in[15] >> 0) & 0xFFFFFFFFFFFFFFF) & 1))^(((in[15] >> 0) & 0xFFFFFFFFFFFFFFF)>>1))) << ntz + out[15] + out[17] = int64(((-((((in[15] >> 60) | ((in[16] & 0xFFFFFFFFFFFFFF) << 4))) & 1))^((((in[15] >> 60) | ((in[16] & 0xFFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[16] >> 56) | ((in[17] & 0xFFFFFFFFFFFFF) << 8))) & 1))^((((in[16] >> 56) | ((in[17] & 0xFFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[17] >> 52) | ((in[18] & 0xFFFFFFFFFFFF) << 12))) & 1))^((((in[17] >> 52) | ((in[18] & 0xFFFFFFFFFFFF) << 12)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[18] >> 48) | ((in[19] & 0xFFFFFFFFFFF) << 16))) & 1))^((((in[18] >> 48) | ((in[19] & 0xFFFFFFFFFFF) << 16)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[19] >> 44) | ((in[20] & 0xFFFFFFFFFF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0xFFFFFFFFFF) << 20)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[20] >> 40) | ((in[21] & 0xFFFFFFFFF) << 24))) & 1))^((((in[20] >> 40) | ((in[21] & 0xFFFFFFFFF) << 24)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[21] >> 36) | ((in[22] & 0xFFFFFFFF) << 28))) & 1))^((((in[21] >> 36) | ((in[22] & 0xFFFFFFFF) << 28)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[22] >> 32) | ((in[23] & 0xFFFFFFF) << 32))) & 1))^((((in[22] >> 32) | ((in[23] & 0xFFFFFFF) << 32)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[23] >> 28) | ((in[24] & 0xFFFFFF) << 36))) & 1))^((((in[23] >> 28) | ((in[24] & 0xFFFFFF) << 36)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[24] >> 24) | ((in[25] & 0xFFFFF) << 40))) & 1))^((((in[24] >> 24) | ((in[25] & 0xFFFFF) << 40)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[25] >> 20) | ((in[26] & 0xFFFF) << 44))) & 1))^((((in[25] >> 20) | ((in[26] & 0xFFFF) << 44)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[26] >> 16) | ((in[27] & 0xFFF) << 48))) & 1))^((((in[26] >> 16) | ((in[27] & 0xFFF) << 48)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[27] >> 12) | ((in[28] & 0xFF) << 52))) & 1))^((((in[27] >> 12) | ((in[28] & 0xFF) << 52)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[28] >> 8) | ((in[29] & 0xF) << 56))) & 1))^((((in[28] >> 8) | ((in[29] & 0xF) << 56)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[29] >> 4)) & 1))^(((in[29] >> 4))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[30] >> 0) & 0xFFFFFFFFFFFFFFF) & 1))^(((in[30] >> 0) & 0xFFFFFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFFFFFF) << 4))) & 1))^((((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[31] >> 56) | ((in[32] & 0xFFFFFFFFFFFFF) << 8))) & 1))^((((in[31] >> 56) | ((in[32] & 0xFFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[32] >> 52) | ((in[33] & 0xFFFFFFFFFFFF) << 12))) & 1))^((((in[32] >> 52) | ((in[33] & 0xFFFFFFFFFFFF) << 12)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[33] >> 48) | ((in[34] & 0xFFFFFFFFFFF) << 16))) & 1))^((((in[33] >> 48) | ((in[34] & 0xFFFFFFFFFFF) << 16)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[34] >> 44) | ((in[35] & 0xFFFFFFFFFF) << 20))) & 1))^((((in[34] >> 44) | ((in[35] & 0xFFFFFFFFFF) << 20)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[35] >> 40) | ((in[36] & 0xFFFFFFFFF) << 24))) & 1))^((((in[35] >> 40) | ((in[36] & 0xFFFFFFFFF) << 24)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[36] >> 36) | ((in[37] & 0xFFFFFFFF) << 28))) & 1))^((((in[36] >> 36) | ((in[37] & 0xFFFFFFFF) << 28)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[37] >> 32) | ((in[38] & 0xFFFFFFF) << 32))) & 1))^((((in[37] >> 32) | ((in[38] & 0xFFFFFFF) << 32)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[38] >> 28) | ((in[39] & 0xFFFFFF) << 36))) & 1))^((((in[38] >> 28) | ((in[39] & 0xFFFFFF) << 36)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[39] >> 24) | ((in[40] & 0xFFFFF) << 40))) & 1))^((((in[39] >> 24) | ((in[40] & 0xFFFFF) << 40)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[40] >> 20) | ((in[41] & 0xFFFF) << 44))) & 1))^((((in[40] >> 20) | ((in[41] & 0xFFFF) << 44)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[41] >> 16) | ((in[42] & 0xFFF) << 48))) & 1))^((((in[41] >> 16) | ((in[42] & 0xFFF) << 48)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[42] >> 12) | ((in[43] & 0xFF) << 52))) & 1))^((((in[42] >> 12) | ((in[43] & 0xFF) << 52)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[43] >> 8) | ((in[44] & 0xF) << 56))) & 1))^((((in[43] >> 8) | ((in[44] & 0xF) << 56)))>>1))) << ntz + out[45] + out[47] = int64(((-(((in[44] >> 4)) & 1))^(((in[44] >> 4))>>1))) << ntz + out[46] + out[48] = int64(((-(((in[45] >> 0) & 0xFFFFFFFFFFFFFFF) & 1))^(((in[45] >> 0) & 0xFFFFFFFFFFFFFFF)>>1))) << ntz + out[47] + out[49] = int64(((-((((in[45] >> 60) | ((in[46] & 0xFFFFFFFFFFFFFF) << 4))) & 1))^((((in[45] >> 60) | ((in[46] & 0xFFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[46] >> 56) | ((in[47] & 0xFFFFFFFFFFFFF) << 8))) & 1))^((((in[46] >> 56) | ((in[47] & 0xFFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[47] >> 52) | ((in[48] & 0xFFFFFFFFFFFF) << 12))) & 1))^((((in[47] >> 52) | ((in[48] & 0xFFFFFFFFFFFF) << 12)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[48] >> 48) | ((in[49] & 0xFFFFFFFFFFF) << 16))) & 1))^((((in[48] >> 48) | ((in[49] & 0xFFFFFFFFFFF) << 16)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[49] >> 44) | ((in[50] & 0xFFFFFFFFFF) << 20))) & 1))^((((in[49] >> 44) | ((in[50] & 0xFFFFFFFFFF) << 20)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[50] >> 40) | ((in[51] & 0xFFFFFFFFF) << 24))) & 1))^((((in[50] >> 40) | ((in[51] & 0xFFFFFFFFF) << 24)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[51] >> 36) | ((in[52] & 0xFFFFFFFF) << 28))) & 1))^((((in[51] >> 36) | ((in[52] & 0xFFFFFFFF) << 28)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[52] >> 32) | ((in[53] & 0xFFFFFFF) << 32))) & 1))^((((in[52] >> 32) | ((in[53] & 0xFFFFFFF) << 32)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[53] >> 28) | ((in[54] & 0xFFFFFF) << 36))) & 1))^((((in[53] >> 28) | ((in[54] & 0xFFFFFF) << 36)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[54] >> 24) | ((in[55] & 0xFFFFF) << 40))) & 1))^((((in[54] >> 24) | ((in[55] & 0xFFFFF) << 40)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[55] >> 20) | ((in[56] & 0xFFFF) << 44))) & 1))^((((in[55] >> 20) | ((in[56] & 0xFFFF) << 44)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[56] >> 16) | ((in[57] & 0xFFF) << 48))) & 1))^((((in[56] >> 16) | ((in[57] & 0xFFF) << 48)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[57] >> 12) | ((in[58] & 0xFF) << 52))) & 1))^((((in[57] >> 12) | ((in[58] & 0xFF) << 52)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[58] >> 8) | ((in[59] & 0xF) << 56))) & 1))^((((in[58] >> 8) | ((in[59] & 0xF) << 56)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[59] >> 4)) & 1))^(((in[59] >> 4))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_61(initoffset int64, in *[61]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x1FFFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x1FFFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 61) | ((in[1] & 0x3FFFFFFFFFFFFFF) << 3))) & 1))^((((in[0] >> 61) | ((in[1] & 0x3FFFFFFFFFFFFFF) << 3)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 58) | ((in[2] & 0x7FFFFFFFFFFFFF) << 6))) & 1))^((((in[1] >> 58) | ((in[2] & 0x7FFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 55) | ((in[3] & 0xFFFFFFFFFFFFF) << 9))) & 1))^((((in[2] >> 55) | ((in[3] & 0xFFFFFFFFFFFFF) << 9)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 52) | ((in[4] & 0x1FFFFFFFFFFFF) << 12))) & 1))^((((in[3] >> 52) | ((in[4] & 0x1FFFFFFFFFFFF) << 12)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 49) | ((in[5] & 0x3FFFFFFFFFFF) << 15))) & 1))^((((in[4] >> 49) | ((in[5] & 0x3FFFFFFFFFFF) << 15)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 46) | ((in[6] & 0x7FFFFFFFFFF) << 18))) & 1))^((((in[5] >> 46) | ((in[6] & 0x7FFFFFFFFFF) << 18)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[6] >> 43) | ((in[7] & 0xFFFFFFFFFF) << 21))) & 1))^((((in[6] >> 43) | ((in[7] & 0xFFFFFFFFFF) << 21)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[7] >> 40) | ((in[8] & 0x1FFFFFFFFF) << 24))) & 1))^((((in[7] >> 40) | ((in[8] & 0x1FFFFFFFFF) << 24)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[8] >> 37) | ((in[9] & 0x3FFFFFFFF) << 27))) & 1))^((((in[8] >> 37) | ((in[9] & 0x3FFFFFFFF) << 27)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[9] >> 34) | ((in[10] & 0x7FFFFFFF) << 30))) & 1))^((((in[9] >> 34) | ((in[10] & 0x7FFFFFFF) << 30)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[10] >> 31) | ((in[11] & 0xFFFFFFF) << 33))) & 1))^((((in[10] >> 31) | ((in[11] & 0xFFFFFFF) << 33)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[11] >> 28) | ((in[12] & 0x1FFFFFF) << 36))) & 1))^((((in[11] >> 28) | ((in[12] & 0x1FFFFFF) << 36)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[12] >> 25) | ((in[13] & 0x3FFFFF) << 39))) & 1))^((((in[12] >> 25) | ((in[13] & 0x3FFFFF) << 39)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[13] >> 22) | ((in[14] & 0x7FFFF) << 42))) & 1))^((((in[13] >> 22) | ((in[14] & 0x7FFFF) << 42)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[14] >> 19) | ((in[15] & 0xFFFF) << 45))) & 1))^((((in[14] >> 19) | ((in[15] & 0xFFFF) << 45)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[15] >> 16) | ((in[16] & 0x1FFF) << 48))) & 1))^((((in[15] >> 16) | ((in[16] & 0x1FFF) << 48)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[16] >> 13) | ((in[17] & 0x3FF) << 51))) & 1))^((((in[16] >> 13) | ((in[17] & 0x3FF) << 51)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[17] >> 10) | ((in[18] & 0x7F) << 54))) & 1))^((((in[17] >> 10) | ((in[18] & 0x7F) << 54)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[18] >> 7) | ((in[19] & 0xF) << 57))) & 1))^((((in[18] >> 7) | ((in[19] & 0xF) << 57)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[19] >> 4) | ((in[20] & 0x1) << 60))) & 1))^((((in[19] >> 4) | ((in[20] & 0x1) << 60)))>>1))) << ntz + out[19] + out[21] = int64(((-(((in[20] >> 1) & 0x1FFFFFFFFFFFFFFF) & 1))^(((in[20] >> 1) & 0x1FFFFFFFFFFFFFFF)>>1))) << ntz + out[20] + out[22] = int64(((-((((in[20] >> 62) | ((in[21] & 0x7FFFFFFFFFFFFFF) << 2))) & 1))^((((in[20] >> 62) | ((in[21] & 0x7FFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[21] >> 59) | ((in[22] & 0xFFFFFFFFFFFFFF) << 5))) & 1))^((((in[21] >> 59) | ((in[22] & 0xFFFFFFFFFFFFFF) << 5)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[22] >> 56) | ((in[23] & 0x1FFFFFFFFFFFFF) << 8))) & 1))^((((in[22] >> 56) | ((in[23] & 0x1FFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[23] >> 53) | ((in[24] & 0x3FFFFFFFFFFFF) << 11))) & 1))^((((in[23] >> 53) | ((in[24] & 0x3FFFFFFFFFFFF) << 11)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[24] >> 50) | ((in[25] & 0x7FFFFFFFFFFF) << 14))) & 1))^((((in[24] >> 50) | ((in[25] & 0x7FFFFFFFFFFF) << 14)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[25] >> 47) | ((in[26] & 0xFFFFFFFFFFF) << 17))) & 1))^((((in[25] >> 47) | ((in[26] & 0xFFFFFFFFFFF) << 17)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[26] >> 44) | ((in[27] & 0x1FFFFFFFFFF) << 20))) & 1))^((((in[26] >> 44) | ((in[27] & 0x1FFFFFFFFFF) << 20)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[27] >> 41) | ((in[28] & 0x3FFFFFFFFF) << 23))) & 1))^((((in[27] >> 41) | ((in[28] & 0x3FFFFFFFFF) << 23)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[28] >> 38) | ((in[29] & 0x7FFFFFFFF) << 26))) & 1))^((((in[28] >> 38) | ((in[29] & 0x7FFFFFFFF) << 26)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[29] >> 35) | ((in[30] & 0xFFFFFFFF) << 29))) & 1))^((((in[29] >> 35) | ((in[30] & 0xFFFFFFFF) << 29)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[30] >> 32) | ((in[31] & 0x1FFFFFFF) << 32))) & 1))^((((in[30] >> 32) | ((in[31] & 0x1FFFFFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[31] >> 29) | ((in[32] & 0x3FFFFFF) << 35))) & 1))^((((in[31] >> 29) | ((in[32] & 0x3FFFFFF) << 35)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[32] >> 26) | ((in[33] & 0x7FFFFF) << 38))) & 1))^((((in[32] >> 26) | ((in[33] & 0x7FFFFF) << 38)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[33] >> 23) | ((in[34] & 0xFFFFF) << 41))) & 1))^((((in[33] >> 23) | ((in[34] & 0xFFFFF) << 41)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[34] >> 20) | ((in[35] & 0x1FFFF) << 44))) & 1))^((((in[34] >> 20) | ((in[35] & 0x1FFFF) << 44)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[35] >> 17) | ((in[36] & 0x3FFF) << 47))) & 1))^((((in[35] >> 17) | ((in[36] & 0x3FFF) << 47)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[36] >> 14) | ((in[37] & 0x7FF) << 50))) & 1))^((((in[36] >> 14) | ((in[37] & 0x7FF) << 50)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[37] >> 11) | ((in[38] & 0xFF) << 53))) & 1))^((((in[37] >> 11) | ((in[38] & 0xFF) << 53)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[38] >> 8) | ((in[39] & 0x1F) << 56))) & 1))^((((in[38] >> 8) | ((in[39] & 0x1F) << 56)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[39] >> 5) | ((in[40] & 0x3) << 59))) & 1))^((((in[39] >> 5) | ((in[40] & 0x3) << 59)))>>1))) << ntz + out[40] + out[42] = int64(((-(((in[40] >> 2) & 0x1FFFFFFFFFFFFFFF) & 1))^(((in[40] >> 2) & 0x1FFFFFFFFFFFFFFF)>>1))) << ntz + out[41] + out[43] = int64(((-((((in[40] >> 63) | ((in[41] & 0xFFFFFFFFFFFFFFF) << 1))) & 1))^((((in[40] >> 63) | ((in[41] & 0xFFFFFFFFFFFFFFF) << 1)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[41] >> 60) | ((in[42] & 0x1FFFFFFFFFFFFFF) << 4))) & 1))^((((in[41] >> 60) | ((in[42] & 0x1FFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFFFFFF) << 7))) & 1))^((((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFFFFFF) << 7)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[43] >> 54) | ((in[44] & 0x7FFFFFFFFFFFF) << 10))) & 1))^((((in[43] >> 54) | ((in[44] & 0x7FFFFFFFFFFFF) << 10)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[44] >> 51) | ((in[45] & 0xFFFFFFFFFFFF) << 13))) & 1))^((((in[44] >> 51) | ((in[45] & 0xFFFFFFFFFFFF) << 13)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[45] >> 48) | ((in[46] & 0x1FFFFFFFFFFF) << 16))) & 1))^((((in[45] >> 48) | ((in[46] & 0x1FFFFFFFFFFF) << 16)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[46] >> 45) | ((in[47] & 0x3FFFFFFFFFF) << 19))) & 1))^((((in[46] >> 45) | ((in[47] & 0x3FFFFFFFFFF) << 19)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[47] >> 42) | ((in[48] & 0x7FFFFFFFFF) << 22))) & 1))^((((in[47] >> 42) | ((in[48] & 0x7FFFFFFFFF) << 22)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[48] >> 39) | ((in[49] & 0xFFFFFFFFF) << 25))) & 1))^((((in[48] >> 39) | ((in[49] & 0xFFFFFFFFF) << 25)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[49] >> 36) | ((in[50] & 0x1FFFFFFFF) << 28))) & 1))^((((in[49] >> 36) | ((in[50] & 0x1FFFFFFFF) << 28)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[50] >> 33) | ((in[51] & 0x3FFFFFFF) << 31))) & 1))^((((in[50] >> 33) | ((in[51] & 0x3FFFFFFF) << 31)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[51] >> 30) | ((in[52] & 0x7FFFFFF) << 34))) & 1))^((((in[51] >> 30) | ((in[52] & 0x7FFFFFF) << 34)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[52] >> 27) | ((in[53] & 0xFFFFFF) << 37))) & 1))^((((in[52] >> 27) | ((in[53] & 0xFFFFFF) << 37)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[53] >> 24) | ((in[54] & 0x1FFFFF) << 40))) & 1))^((((in[53] >> 24) | ((in[54] & 0x1FFFFF) << 40)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[54] >> 21) | ((in[55] & 0x3FFFF) << 43))) & 1))^((((in[54] >> 21) | ((in[55] & 0x3FFFF) << 43)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[55] >> 18) | ((in[56] & 0x7FFF) << 46))) & 1))^((((in[55] >> 18) | ((in[56] & 0x7FFF) << 46)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[56] >> 15) | ((in[57] & 0xFFF) << 49))) & 1))^((((in[56] >> 15) | ((in[57] & 0xFFF) << 49)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[57] >> 12) | ((in[58] & 0x1FF) << 52))) & 1))^((((in[57] >> 12) | ((in[58] & 0x1FF) << 52)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[58] >> 9) | ((in[59] & 0x3F) << 55))) & 1))^((((in[58] >> 9) | ((in[59] & 0x3F) << 55)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[59] >> 6) | ((in[60] & 0x7) << 58))) & 1))^((((in[59] >> 6) | ((in[60] & 0x7) << 58)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[60] >> 3)) & 1))^(((in[60] >> 3))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_62(initoffset int64, in *[62]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x3FFFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x3FFFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 62) | ((in[1] & 0xFFFFFFFFFFFFFFF) << 2))) & 1))^((((in[0] >> 62) | ((in[1] & 0xFFFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 60) | ((in[2] & 0x3FFFFFFFFFFFFFF) << 4))) & 1))^((((in[1] >> 60) | ((in[2] & 0x3FFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 58) | ((in[3] & 0xFFFFFFFFFFFFFF) << 6))) & 1))^((((in[2] >> 58) | ((in[3] & 0xFFFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 56) | ((in[4] & 0x3FFFFFFFFFFFFF) << 8))) & 1))^((((in[3] >> 56) | ((in[4] & 0x3FFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 54) | ((in[5] & 0xFFFFFFFFFFFFF) << 10))) & 1))^((((in[4] >> 54) | ((in[5] & 0xFFFFFFFFFFFFF) << 10)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 52) | ((in[6] & 0x3FFFFFFFFFFFF) << 12))) & 1))^((((in[5] >> 52) | ((in[6] & 0x3FFFFFFFFFFFF) << 12)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[6] >> 50) | ((in[7] & 0xFFFFFFFFFFFF) << 14))) & 1))^((((in[6] >> 50) | ((in[7] & 0xFFFFFFFFFFFF) << 14)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[7] >> 48) | ((in[8] & 0x3FFFFFFFFFFF) << 16))) & 1))^((((in[7] >> 48) | ((in[8] & 0x3FFFFFFFFFFF) << 16)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[8] >> 46) | ((in[9] & 0xFFFFFFFFFFF) << 18))) & 1))^((((in[8] >> 46) | ((in[9] & 0xFFFFFFFFFFF) << 18)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[9] >> 44) | ((in[10] & 0x3FFFFFFFFFF) << 20))) & 1))^((((in[9] >> 44) | ((in[10] & 0x3FFFFFFFFFF) << 20)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[10] >> 42) | ((in[11] & 0xFFFFFFFFFF) << 22))) & 1))^((((in[10] >> 42) | ((in[11] & 0xFFFFFFFFFF) << 22)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[11] >> 40) | ((in[12] & 0x3FFFFFFFFF) << 24))) & 1))^((((in[11] >> 40) | ((in[12] & 0x3FFFFFFFFF) << 24)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[12] >> 38) | ((in[13] & 0xFFFFFFFFF) << 26))) & 1))^((((in[12] >> 38) | ((in[13] & 0xFFFFFFFFF) << 26)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[13] >> 36) | ((in[14] & 0x3FFFFFFFF) << 28))) & 1))^((((in[13] >> 36) | ((in[14] & 0x3FFFFFFFF) << 28)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[14] >> 34) | ((in[15] & 0xFFFFFFFF) << 30))) & 1))^((((in[14] >> 34) | ((in[15] & 0xFFFFFFFF) << 30)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[15] >> 32) | ((in[16] & 0x3FFFFFFF) << 32))) & 1))^((((in[15] >> 32) | ((in[16] & 0x3FFFFFFF) << 32)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[16] >> 30) | ((in[17] & 0xFFFFFFF) << 34))) & 1))^((((in[16] >> 30) | ((in[17] & 0xFFFFFFF) << 34)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[17] >> 28) | ((in[18] & 0x3FFFFFF) << 36))) & 1))^((((in[17] >> 28) | ((in[18] & 0x3FFFFFF) << 36)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[18] >> 26) | ((in[19] & 0xFFFFFF) << 38))) & 1))^((((in[18] >> 26) | ((in[19] & 0xFFFFFF) << 38)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[19] >> 24) | ((in[20] & 0x3FFFFF) << 40))) & 1))^((((in[19] >> 24) | ((in[20] & 0x3FFFFF) << 40)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[20] >> 22) | ((in[21] & 0xFFFFF) << 42))) & 1))^((((in[20] >> 22) | ((in[21] & 0xFFFFF) << 42)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[21] >> 20) | ((in[22] & 0x3FFFF) << 44))) & 1))^((((in[21] >> 20) | ((in[22] & 0x3FFFF) << 44)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[22] >> 18) | ((in[23] & 0xFFFF) << 46))) & 1))^((((in[22] >> 18) | ((in[23] & 0xFFFF) << 46)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[23] >> 16) | ((in[24] & 0x3FFF) << 48))) & 1))^((((in[23] >> 16) | ((in[24] & 0x3FFF) << 48)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[24] >> 14) | ((in[25] & 0xFFF) << 50))) & 1))^((((in[24] >> 14) | ((in[25] & 0xFFF) << 50)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[25] >> 12) | ((in[26] & 0x3FF) << 52))) & 1))^((((in[25] >> 12) | ((in[26] & 0x3FF) << 52)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[26] >> 10) | ((in[27] & 0xFF) << 54))) & 1))^((((in[26] >> 10) | ((in[27] & 0xFF) << 54)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[27] >> 8) | ((in[28] & 0x3F) << 56))) & 1))^((((in[27] >> 8) | ((in[28] & 0x3F) << 56)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[28] >> 6) | ((in[29] & 0xF) << 58))) & 1))^((((in[28] >> 6) | ((in[29] & 0xF) << 58)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[29] >> 4) | ((in[30] & 0x3) << 60))) & 1))^((((in[29] >> 4) | ((in[30] & 0x3) << 60)))>>1))) << ntz + out[29] + out[31] = int64(((-(((in[30] >> 2)) & 1))^(((in[30] >> 2))>>1))) << ntz + out[30] + out[32] = int64(((-(((in[31] >> 0) & 0x3FFFFFFFFFFFFFFF) & 1))^(((in[31] >> 0) & 0x3FFFFFFFFFFFFFFF)>>1))) << ntz + out[31] + out[33] = int64(((-((((in[31] >> 62) | ((in[32] & 0xFFFFFFFFFFFFFFF) << 2))) & 1))^((((in[31] >> 62) | ((in[32] & 0xFFFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[32] >> 60) | ((in[33] & 0x3FFFFFFFFFFFFFF) << 4))) & 1))^((((in[32] >> 60) | ((in[33] & 0x3FFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[33] >> 58) | ((in[34] & 0xFFFFFFFFFFFFFF) << 6))) & 1))^((((in[33] >> 58) | ((in[34] & 0xFFFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[34] >> 56) | ((in[35] & 0x3FFFFFFFFFFFFF) << 8))) & 1))^((((in[34] >> 56) | ((in[35] & 0x3FFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[35] >> 54) | ((in[36] & 0xFFFFFFFFFFFFF) << 10))) & 1))^((((in[35] >> 54) | ((in[36] & 0xFFFFFFFFFFFFF) << 10)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[36] >> 52) | ((in[37] & 0x3FFFFFFFFFFFF) << 12))) & 1))^((((in[36] >> 52) | ((in[37] & 0x3FFFFFFFFFFFF) << 12)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[37] >> 50) | ((in[38] & 0xFFFFFFFFFFFF) << 14))) & 1))^((((in[37] >> 50) | ((in[38] & 0xFFFFFFFFFFFF) << 14)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[38] >> 48) | ((in[39] & 0x3FFFFFFFFFFF) << 16))) & 1))^((((in[38] >> 48) | ((in[39] & 0x3FFFFFFFFFFF) << 16)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[39] >> 46) | ((in[40] & 0xFFFFFFFFFFF) << 18))) & 1))^((((in[39] >> 46) | ((in[40] & 0xFFFFFFFFFFF) << 18)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[40] >> 44) | ((in[41] & 0x3FFFFFFFFFF) << 20))) & 1))^((((in[40] >> 44) | ((in[41] & 0x3FFFFFFFFFF) << 20)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[41] >> 42) | ((in[42] & 0xFFFFFFFFFF) << 22))) & 1))^((((in[41] >> 42) | ((in[42] & 0xFFFFFFFFFF) << 22)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[42] >> 40) | ((in[43] & 0x3FFFFFFFFF) << 24))) & 1))^((((in[42] >> 40) | ((in[43] & 0x3FFFFFFFFF) << 24)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[43] >> 38) | ((in[44] & 0xFFFFFFFFF) << 26))) & 1))^((((in[43] >> 38) | ((in[44] & 0xFFFFFFFFF) << 26)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[44] >> 36) | ((in[45] & 0x3FFFFFFFF) << 28))) & 1))^((((in[44] >> 36) | ((in[45] & 0x3FFFFFFFF) << 28)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[45] >> 34) | ((in[46] & 0xFFFFFFFF) << 30))) & 1))^((((in[45] >> 34) | ((in[46] & 0xFFFFFFFF) << 30)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[46] >> 32) | ((in[47] & 0x3FFFFFFF) << 32))) & 1))^((((in[46] >> 32) | ((in[47] & 0x3FFFFFFF) << 32)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[47] >> 30) | ((in[48] & 0xFFFFFFF) << 34))) & 1))^((((in[47] >> 30) | ((in[48] & 0xFFFFFFF) << 34)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[48] >> 28) | ((in[49] & 0x3FFFFFF) << 36))) & 1))^((((in[48] >> 28) | ((in[49] & 0x3FFFFFF) << 36)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[49] >> 26) | ((in[50] & 0xFFFFFF) << 38))) & 1))^((((in[49] >> 26) | ((in[50] & 0xFFFFFF) << 38)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[50] >> 24) | ((in[51] & 0x3FFFFF) << 40))) & 1))^((((in[50] >> 24) | ((in[51] & 0x3FFFFF) << 40)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[51] >> 22) | ((in[52] & 0xFFFFF) << 42))) & 1))^((((in[51] >> 22) | ((in[52] & 0xFFFFF) << 42)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[52] >> 20) | ((in[53] & 0x3FFFF) << 44))) & 1))^((((in[52] >> 20) | ((in[53] & 0x3FFFF) << 44)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[53] >> 18) | ((in[54] & 0xFFFF) << 46))) & 1))^((((in[53] >> 18) | ((in[54] & 0xFFFF) << 46)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[54] >> 16) | ((in[55] & 0x3FFF) << 48))) & 1))^((((in[54] >> 16) | ((in[55] & 0x3FFF) << 48)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[55] >> 14) | ((in[56] & 0xFFF) << 50))) & 1))^((((in[55] >> 14) | ((in[56] & 0xFFF) << 50)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[56] >> 12) | ((in[57] & 0x3FF) << 52))) & 1))^((((in[56] >> 12) | ((in[57] & 0x3FF) << 52)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[57] >> 10) | ((in[58] & 0xFF) << 54))) & 1))^((((in[57] >> 10) | ((in[58] & 0xFF) << 54)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[58] >> 8) | ((in[59] & 0x3F) << 56))) & 1))^((((in[58] >> 8) | ((in[59] & 0x3F) << 56)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[59] >> 6) | ((in[60] & 0xF) << 58))) & 1))^((((in[59] >> 6) | ((in[60] & 0xF) << 58)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[60] >> 4) | ((in[61] & 0x3) << 60))) & 1))^((((in[60] >> 4) | ((in[61] & 0x3) << 60)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[61] >> 2)) & 1))^(((in[61] >> 2))>>1))) << ntz + out[62] +} + +func deltaunpackzigzag_int64_63(initoffset int64, in *[63]uint64, out *[64]int64, ntz int) { + out[0] = int64(((-(((in[0] >> 0) & 0x7FFFFFFFFFFFFFFF) & 1))^(((in[0] >> 0) & 0x7FFFFFFFFFFFFFFF)>>1))) << ntz + initoffset + out[1] = int64(((-((((in[0] >> 63) | ((in[1] & 0x3FFFFFFFFFFFFFFF) << 1))) & 1))^((((in[0] >> 63) | ((in[1] & 0x3FFFFFFFFFFFFFFF) << 1)))>>1))) << ntz + out[0] + out[2] = int64(((-((((in[1] >> 62) | ((in[2] & 0x1FFFFFFFFFFFFFFF) << 2))) & 1))^((((in[1] >> 62) | ((in[2] & 0x1FFFFFFFFFFFFFFF) << 2)))>>1))) << ntz + out[1] + out[3] = int64(((-((((in[2] >> 61) | ((in[3] & 0xFFFFFFFFFFFFFFF) << 3))) & 1))^((((in[2] >> 61) | ((in[3] & 0xFFFFFFFFFFFFFFF) << 3)))>>1))) << ntz + out[2] + out[4] = int64(((-((((in[3] >> 60) | ((in[4] & 0x7FFFFFFFFFFFFFF) << 4))) & 1))^((((in[3] >> 60) | ((in[4] & 0x7FFFFFFFFFFFFFF) << 4)))>>1))) << ntz + out[3] + out[5] = int64(((-((((in[4] >> 59) | ((in[5] & 0x3FFFFFFFFFFFFFF) << 5))) & 1))^((((in[4] >> 59) | ((in[5] & 0x3FFFFFFFFFFFFFF) << 5)))>>1))) << ntz + out[4] + out[6] = int64(((-((((in[5] >> 58) | ((in[6] & 0x1FFFFFFFFFFFFFF) << 6))) & 1))^((((in[5] >> 58) | ((in[6] & 0x1FFFFFFFFFFFFFF) << 6)))>>1))) << ntz + out[5] + out[7] = int64(((-((((in[6] >> 57) | ((in[7] & 0xFFFFFFFFFFFFFF) << 7))) & 1))^((((in[6] >> 57) | ((in[7] & 0xFFFFFFFFFFFFFF) << 7)))>>1))) << ntz + out[6] + out[8] = int64(((-((((in[7] >> 56) | ((in[8] & 0x7FFFFFFFFFFFFF) << 8))) & 1))^((((in[7] >> 56) | ((in[8] & 0x7FFFFFFFFFFFFF) << 8)))>>1))) << ntz + out[7] + out[9] = int64(((-((((in[8] >> 55) | ((in[9] & 0x3FFFFFFFFFFFFF) << 9))) & 1))^((((in[8] >> 55) | ((in[9] & 0x3FFFFFFFFFFFFF) << 9)))>>1))) << ntz + out[8] + out[10] = int64(((-((((in[9] >> 54) | ((in[10] & 0x1FFFFFFFFFFFFF) << 10))) & 1))^((((in[9] >> 54) | ((in[10] & 0x1FFFFFFFFFFFFF) << 10)))>>1))) << ntz + out[9] + out[11] = int64(((-((((in[10] >> 53) | ((in[11] & 0xFFFFFFFFFFFFF) << 11))) & 1))^((((in[10] >> 53) | ((in[11] & 0xFFFFFFFFFFFFF) << 11)))>>1))) << ntz + out[10] + out[12] = int64(((-((((in[11] >> 52) | ((in[12] & 0x7FFFFFFFFFFFF) << 12))) & 1))^((((in[11] >> 52) | ((in[12] & 0x7FFFFFFFFFFFF) << 12)))>>1))) << ntz + out[11] + out[13] = int64(((-((((in[12] >> 51) | ((in[13] & 0x3FFFFFFFFFFFF) << 13))) & 1))^((((in[12] >> 51) | ((in[13] & 0x3FFFFFFFFFFFF) << 13)))>>1))) << ntz + out[12] + out[14] = int64(((-((((in[13] >> 50) | ((in[14] & 0x1FFFFFFFFFFFF) << 14))) & 1))^((((in[13] >> 50) | ((in[14] & 0x1FFFFFFFFFFFF) << 14)))>>1))) << ntz + out[13] + out[15] = int64(((-((((in[14] >> 49) | ((in[15] & 0xFFFFFFFFFFFF) << 15))) & 1))^((((in[14] >> 49) | ((in[15] & 0xFFFFFFFFFFFF) << 15)))>>1))) << ntz + out[14] + out[16] = int64(((-((((in[15] >> 48) | ((in[16] & 0x7FFFFFFFFFFF) << 16))) & 1))^((((in[15] >> 48) | ((in[16] & 0x7FFFFFFFFFFF) << 16)))>>1))) << ntz + out[15] + out[17] = int64(((-((((in[16] >> 47) | ((in[17] & 0x3FFFFFFFFFFF) << 17))) & 1))^((((in[16] >> 47) | ((in[17] & 0x3FFFFFFFFFFF) << 17)))>>1))) << ntz + out[16] + out[18] = int64(((-((((in[17] >> 46) | ((in[18] & 0x1FFFFFFFFFFF) << 18))) & 1))^((((in[17] >> 46) | ((in[18] & 0x1FFFFFFFFFFF) << 18)))>>1))) << ntz + out[17] + out[19] = int64(((-((((in[18] >> 45) | ((in[19] & 0xFFFFFFFFFFF) << 19))) & 1))^((((in[18] >> 45) | ((in[19] & 0xFFFFFFFFFFF) << 19)))>>1))) << ntz + out[18] + out[20] = int64(((-((((in[19] >> 44) | ((in[20] & 0x7FFFFFFFFFF) << 20))) & 1))^((((in[19] >> 44) | ((in[20] & 0x7FFFFFFFFFF) << 20)))>>1))) << ntz + out[19] + out[21] = int64(((-((((in[20] >> 43) | ((in[21] & 0x3FFFFFFFFFF) << 21))) & 1))^((((in[20] >> 43) | ((in[21] & 0x3FFFFFFFFFF) << 21)))>>1))) << ntz + out[20] + out[22] = int64(((-((((in[21] >> 42) | ((in[22] & 0x1FFFFFFFFFF) << 22))) & 1))^((((in[21] >> 42) | ((in[22] & 0x1FFFFFFFFFF) << 22)))>>1))) << ntz + out[21] + out[23] = int64(((-((((in[22] >> 41) | ((in[23] & 0xFFFFFFFFFF) << 23))) & 1))^((((in[22] >> 41) | ((in[23] & 0xFFFFFFFFFF) << 23)))>>1))) << ntz + out[22] + out[24] = int64(((-((((in[23] >> 40) | ((in[24] & 0x7FFFFFFFFF) << 24))) & 1))^((((in[23] >> 40) | ((in[24] & 0x7FFFFFFFFF) << 24)))>>1))) << ntz + out[23] + out[25] = int64(((-((((in[24] >> 39) | ((in[25] & 0x3FFFFFFFFF) << 25))) & 1))^((((in[24] >> 39) | ((in[25] & 0x3FFFFFFFFF) << 25)))>>1))) << ntz + out[24] + out[26] = int64(((-((((in[25] >> 38) | ((in[26] & 0x1FFFFFFFFF) << 26))) & 1))^((((in[25] >> 38) | ((in[26] & 0x1FFFFFFFFF) << 26)))>>1))) << ntz + out[25] + out[27] = int64(((-((((in[26] >> 37) | ((in[27] & 0xFFFFFFFFF) << 27))) & 1))^((((in[26] >> 37) | ((in[27] & 0xFFFFFFFFF) << 27)))>>1))) << ntz + out[26] + out[28] = int64(((-((((in[27] >> 36) | ((in[28] & 0x7FFFFFFFF) << 28))) & 1))^((((in[27] >> 36) | ((in[28] & 0x7FFFFFFFF) << 28)))>>1))) << ntz + out[27] + out[29] = int64(((-((((in[28] >> 35) | ((in[29] & 0x3FFFFFFFF) << 29))) & 1))^((((in[28] >> 35) | ((in[29] & 0x3FFFFFFFF) << 29)))>>1))) << ntz + out[28] + out[30] = int64(((-((((in[29] >> 34) | ((in[30] & 0x1FFFFFFFF) << 30))) & 1))^((((in[29] >> 34) | ((in[30] & 0x1FFFFFFFF) << 30)))>>1))) << ntz + out[29] + out[31] = int64(((-((((in[30] >> 33) | ((in[31] & 0xFFFFFFFF) << 31))) & 1))^((((in[30] >> 33) | ((in[31] & 0xFFFFFFFF) << 31)))>>1))) << ntz + out[30] + out[32] = int64(((-((((in[31] >> 32) | ((in[32] & 0x7FFFFFFF) << 32))) & 1))^((((in[31] >> 32) | ((in[32] & 0x7FFFFFFF) << 32)))>>1))) << ntz + out[31] + out[33] = int64(((-((((in[32] >> 31) | ((in[33] & 0x3FFFFFFF) << 33))) & 1))^((((in[32] >> 31) | ((in[33] & 0x3FFFFFFF) << 33)))>>1))) << ntz + out[32] + out[34] = int64(((-((((in[33] >> 30) | ((in[34] & 0x1FFFFFFF) << 34))) & 1))^((((in[33] >> 30) | ((in[34] & 0x1FFFFFFF) << 34)))>>1))) << ntz + out[33] + out[35] = int64(((-((((in[34] >> 29) | ((in[35] & 0xFFFFFFF) << 35))) & 1))^((((in[34] >> 29) | ((in[35] & 0xFFFFFFF) << 35)))>>1))) << ntz + out[34] + out[36] = int64(((-((((in[35] >> 28) | ((in[36] & 0x7FFFFFF) << 36))) & 1))^((((in[35] >> 28) | ((in[36] & 0x7FFFFFF) << 36)))>>1))) << ntz + out[35] + out[37] = int64(((-((((in[36] >> 27) | ((in[37] & 0x3FFFFFF) << 37))) & 1))^((((in[36] >> 27) | ((in[37] & 0x3FFFFFF) << 37)))>>1))) << ntz + out[36] + out[38] = int64(((-((((in[37] >> 26) | ((in[38] & 0x1FFFFFF) << 38))) & 1))^((((in[37] >> 26) | ((in[38] & 0x1FFFFFF) << 38)))>>1))) << ntz + out[37] + out[39] = int64(((-((((in[38] >> 25) | ((in[39] & 0xFFFFFF) << 39))) & 1))^((((in[38] >> 25) | ((in[39] & 0xFFFFFF) << 39)))>>1))) << ntz + out[38] + out[40] = int64(((-((((in[39] >> 24) | ((in[40] & 0x7FFFFF) << 40))) & 1))^((((in[39] >> 24) | ((in[40] & 0x7FFFFF) << 40)))>>1))) << ntz + out[39] + out[41] = int64(((-((((in[40] >> 23) | ((in[41] & 0x3FFFFF) << 41))) & 1))^((((in[40] >> 23) | ((in[41] & 0x3FFFFF) << 41)))>>1))) << ntz + out[40] + out[42] = int64(((-((((in[41] >> 22) | ((in[42] & 0x1FFFFF) << 42))) & 1))^((((in[41] >> 22) | ((in[42] & 0x1FFFFF) << 42)))>>1))) << ntz + out[41] + out[43] = int64(((-((((in[42] >> 21) | ((in[43] & 0xFFFFF) << 43))) & 1))^((((in[42] >> 21) | ((in[43] & 0xFFFFF) << 43)))>>1))) << ntz + out[42] + out[44] = int64(((-((((in[43] >> 20) | ((in[44] & 0x7FFFF) << 44))) & 1))^((((in[43] >> 20) | ((in[44] & 0x7FFFF) << 44)))>>1))) << ntz + out[43] + out[45] = int64(((-((((in[44] >> 19) | ((in[45] & 0x3FFFF) << 45))) & 1))^((((in[44] >> 19) | ((in[45] & 0x3FFFF) << 45)))>>1))) << ntz + out[44] + out[46] = int64(((-((((in[45] >> 18) | ((in[46] & 0x1FFFF) << 46))) & 1))^((((in[45] >> 18) | ((in[46] & 0x1FFFF) << 46)))>>1))) << ntz + out[45] + out[47] = int64(((-((((in[46] >> 17) | ((in[47] & 0xFFFF) << 47))) & 1))^((((in[46] >> 17) | ((in[47] & 0xFFFF) << 47)))>>1))) << ntz + out[46] + out[48] = int64(((-((((in[47] >> 16) | ((in[48] & 0x7FFF) << 48))) & 1))^((((in[47] >> 16) | ((in[48] & 0x7FFF) << 48)))>>1))) << ntz + out[47] + out[49] = int64(((-((((in[48] >> 15) | ((in[49] & 0x3FFF) << 49))) & 1))^((((in[48] >> 15) | ((in[49] & 0x3FFF) << 49)))>>1))) << ntz + out[48] + out[50] = int64(((-((((in[49] >> 14) | ((in[50] & 0x1FFF) << 50))) & 1))^((((in[49] >> 14) | ((in[50] & 0x1FFF) << 50)))>>1))) << ntz + out[49] + out[51] = int64(((-((((in[50] >> 13) | ((in[51] & 0xFFF) << 51))) & 1))^((((in[50] >> 13) | ((in[51] & 0xFFF) << 51)))>>1))) << ntz + out[50] + out[52] = int64(((-((((in[51] >> 12) | ((in[52] & 0x7FF) << 52))) & 1))^((((in[51] >> 12) | ((in[52] & 0x7FF) << 52)))>>1))) << ntz + out[51] + out[53] = int64(((-((((in[52] >> 11) | ((in[53] & 0x3FF) << 53))) & 1))^((((in[52] >> 11) | ((in[53] & 0x3FF) << 53)))>>1))) << ntz + out[52] + out[54] = int64(((-((((in[53] >> 10) | ((in[54] & 0x1FF) << 54))) & 1))^((((in[53] >> 10) | ((in[54] & 0x1FF) << 54)))>>1))) << ntz + out[53] + out[55] = int64(((-((((in[54] >> 9) | ((in[55] & 0xFF) << 55))) & 1))^((((in[54] >> 9) | ((in[55] & 0xFF) << 55)))>>1))) << ntz + out[54] + out[56] = int64(((-((((in[55] >> 8) | ((in[56] & 0x7F) << 56))) & 1))^((((in[55] >> 8) | ((in[56] & 0x7F) << 56)))>>1))) << ntz + out[55] + out[57] = int64(((-((((in[56] >> 7) | ((in[57] & 0x3F) << 57))) & 1))^((((in[56] >> 7) | ((in[57] & 0x3F) << 57)))>>1))) << ntz + out[56] + out[58] = int64(((-((((in[57] >> 6) | ((in[58] & 0x1F) << 58))) & 1))^((((in[57] >> 6) | ((in[58] & 0x1F) << 58)))>>1))) << ntz + out[57] + out[59] = int64(((-((((in[58] >> 5) | ((in[59] & 0xF) << 59))) & 1))^((((in[58] >> 5) | ((in[59] & 0xF) << 59)))>>1))) << ntz + out[58] + out[60] = int64(((-((((in[59] >> 4) | ((in[60] & 0x7) << 60))) & 1))^((((in[59] >> 4) | ((in[60] & 0x7) << 60)))>>1))) << ntz + out[59] + out[61] = int64(((-((((in[60] >> 3) | ((in[61] & 0x3) << 61))) & 1))^((((in[60] >> 3) | ((in[61] & 0x3) << 61)))>>1))) << ntz + out[60] + out[62] = int64(((-((((in[61] >> 2) | ((in[62] & 0x1) << 62))) & 1))^((((in[61] >> 2) | ((in[62] & 0x1) << 62)))>>1))) << ntz + out[61] + out[63] = int64(((-(((in[62] >> 1)) & 1))^(((in[62] >> 1))>>1))) << ntz + out[62] +} + +// deltaPack_uint64 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first. +// Caller must give the proper `bitlen` of the block +func deltaPack_uint64(initoffset uint64, in []uint64, out []uint64, bitlen int) { + switch bitlen { + case 0: + deltapack_uint64_0(initoffset, (*[64]uint64)(in), (*[0]uint64)(out)) + case 1: + deltapack_uint64_1(initoffset, (*[64]uint64)(in), (*[1]uint64)(out)) + case 2: + deltapack_uint64_2(initoffset, (*[64]uint64)(in), (*[2]uint64)(out)) + case 3: + deltapack_uint64_3(initoffset, (*[64]uint64)(in), (*[3]uint64)(out)) + case 4: + deltapack_uint64_4(initoffset, (*[64]uint64)(in), (*[4]uint64)(out)) + case 5: + deltapack_uint64_5(initoffset, (*[64]uint64)(in), (*[5]uint64)(out)) + case 6: + deltapack_uint64_6(initoffset, (*[64]uint64)(in), (*[6]uint64)(out)) + case 7: + deltapack_uint64_7(initoffset, (*[64]uint64)(in), (*[7]uint64)(out)) + case 8: + deltapack_uint64_8(initoffset, (*[64]uint64)(in), (*[8]uint64)(out)) + case 9: + deltapack_uint64_9(initoffset, (*[64]uint64)(in), (*[9]uint64)(out)) + case 10: + deltapack_uint64_10(initoffset, (*[64]uint64)(in), (*[10]uint64)(out)) + case 11: + deltapack_uint64_11(initoffset, (*[64]uint64)(in), (*[11]uint64)(out)) + case 12: + deltapack_uint64_12(initoffset, (*[64]uint64)(in), (*[12]uint64)(out)) + case 13: + deltapack_uint64_13(initoffset, (*[64]uint64)(in), (*[13]uint64)(out)) + case 14: + deltapack_uint64_14(initoffset, (*[64]uint64)(in), (*[14]uint64)(out)) + case 15: + deltapack_uint64_15(initoffset, (*[64]uint64)(in), (*[15]uint64)(out)) + case 16: + deltapack_uint64_16(initoffset, (*[64]uint64)(in), (*[16]uint64)(out)) + case 17: + deltapack_uint64_17(initoffset, (*[64]uint64)(in), (*[17]uint64)(out)) + case 18: + deltapack_uint64_18(initoffset, (*[64]uint64)(in), (*[18]uint64)(out)) + case 19: + deltapack_uint64_19(initoffset, (*[64]uint64)(in), (*[19]uint64)(out)) + case 20: + deltapack_uint64_20(initoffset, (*[64]uint64)(in), (*[20]uint64)(out)) + case 21: + deltapack_uint64_21(initoffset, (*[64]uint64)(in), (*[21]uint64)(out)) + case 22: + deltapack_uint64_22(initoffset, (*[64]uint64)(in), (*[22]uint64)(out)) + case 23: + deltapack_uint64_23(initoffset, (*[64]uint64)(in), (*[23]uint64)(out)) + case 24: + deltapack_uint64_24(initoffset, (*[64]uint64)(in), (*[24]uint64)(out)) + case 25: + deltapack_uint64_25(initoffset, (*[64]uint64)(in), (*[25]uint64)(out)) + case 26: + deltapack_uint64_26(initoffset, (*[64]uint64)(in), (*[26]uint64)(out)) + case 27: + deltapack_uint64_27(initoffset, (*[64]uint64)(in), (*[27]uint64)(out)) + case 28: + deltapack_uint64_28(initoffset, (*[64]uint64)(in), (*[28]uint64)(out)) + case 29: + deltapack_uint64_29(initoffset, (*[64]uint64)(in), (*[29]uint64)(out)) + case 30: + deltapack_uint64_30(initoffset, (*[64]uint64)(in), (*[30]uint64)(out)) + case 31: + deltapack_uint64_31(initoffset, (*[64]uint64)(in), (*[31]uint64)(out)) + case 32: + deltapack_uint64_32(initoffset, (*[64]uint64)(in), (*[32]uint64)(out)) + case 33: + deltapack_uint64_33(initoffset, (*[64]uint64)(in), (*[33]uint64)(out)) + case 34: + deltapack_uint64_34(initoffset, (*[64]uint64)(in), (*[34]uint64)(out)) + case 35: + deltapack_uint64_35(initoffset, (*[64]uint64)(in), (*[35]uint64)(out)) + case 36: + deltapack_uint64_36(initoffset, (*[64]uint64)(in), (*[36]uint64)(out)) + case 37: + deltapack_uint64_37(initoffset, (*[64]uint64)(in), (*[37]uint64)(out)) + case 38: + deltapack_uint64_38(initoffset, (*[64]uint64)(in), (*[38]uint64)(out)) + case 39: + deltapack_uint64_39(initoffset, (*[64]uint64)(in), (*[39]uint64)(out)) + case 40: + deltapack_uint64_40(initoffset, (*[64]uint64)(in), (*[40]uint64)(out)) + case 41: + deltapack_uint64_41(initoffset, (*[64]uint64)(in), (*[41]uint64)(out)) + case 42: + deltapack_uint64_42(initoffset, (*[64]uint64)(in), (*[42]uint64)(out)) + case 43: + deltapack_uint64_43(initoffset, (*[64]uint64)(in), (*[43]uint64)(out)) + case 44: + deltapack_uint64_44(initoffset, (*[64]uint64)(in), (*[44]uint64)(out)) + case 45: + deltapack_uint64_45(initoffset, (*[64]uint64)(in), (*[45]uint64)(out)) + case 46: + deltapack_uint64_46(initoffset, (*[64]uint64)(in), (*[46]uint64)(out)) + case 47: + deltapack_uint64_47(initoffset, (*[64]uint64)(in), (*[47]uint64)(out)) + case 48: + deltapack_uint64_48(initoffset, (*[64]uint64)(in), (*[48]uint64)(out)) + case 49: + deltapack_uint64_49(initoffset, (*[64]uint64)(in), (*[49]uint64)(out)) + case 50: + deltapack_uint64_50(initoffset, (*[64]uint64)(in), (*[50]uint64)(out)) + case 51: + deltapack_uint64_51(initoffset, (*[64]uint64)(in), (*[51]uint64)(out)) + case 52: + deltapack_uint64_52(initoffset, (*[64]uint64)(in), (*[52]uint64)(out)) + case 53: + deltapack_uint64_53(initoffset, (*[64]uint64)(in), (*[53]uint64)(out)) + case 54: + deltapack_uint64_54(initoffset, (*[64]uint64)(in), (*[54]uint64)(out)) + case 55: + deltapack_uint64_55(initoffset, (*[64]uint64)(in), (*[55]uint64)(out)) + case 56: + deltapack_uint64_56(initoffset, (*[64]uint64)(in), (*[56]uint64)(out)) + case 57: + deltapack_uint64_57(initoffset, (*[64]uint64)(in), (*[57]uint64)(out)) + case 58: + deltapack_uint64_58(initoffset, (*[64]uint64)(in), (*[58]uint64)(out)) + case 59: + deltapack_uint64_59(initoffset, (*[64]uint64)(in), (*[59]uint64)(out)) + case 60: + deltapack_uint64_60(initoffset, (*[64]uint64)(in), (*[60]uint64)(out)) + case 61: + deltapack_uint64_61(initoffset, (*[64]uint64)(in), (*[61]uint64)(out)) + case 62: + deltapack_uint64_62(initoffset, (*[64]uint64)(in), (*[62]uint64)(out)) + case 63: + deltapack_uint64_63(initoffset, (*[64]uint64)(in), (*[63]uint64)(out)) + case 64: + *(*[64]uint64)(out) = *((*[64]uint64)(unsafe.Pointer((*[64]uint64)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpack_uint64 Decoding operation for DeltaPack_uint64 +func deltaUnpack_uint64(initoffset uint64, in []uint64, out []uint64, bitlen int) { + switch bitlen { + case 0: + deltaunpack_uint64_0(initoffset, (*[0]uint64)(in), (*[64]uint64)(out)) + case 1: + deltaunpack_uint64_1(initoffset, (*[1]uint64)(in), (*[64]uint64)(out)) + case 2: + deltaunpack_uint64_2(initoffset, (*[2]uint64)(in), (*[64]uint64)(out)) + case 3: + deltaunpack_uint64_3(initoffset, (*[3]uint64)(in), (*[64]uint64)(out)) + case 4: + deltaunpack_uint64_4(initoffset, (*[4]uint64)(in), (*[64]uint64)(out)) + case 5: + deltaunpack_uint64_5(initoffset, (*[5]uint64)(in), (*[64]uint64)(out)) + case 6: + deltaunpack_uint64_6(initoffset, (*[6]uint64)(in), (*[64]uint64)(out)) + case 7: + deltaunpack_uint64_7(initoffset, (*[7]uint64)(in), (*[64]uint64)(out)) + case 8: + deltaunpack_uint64_8(initoffset, (*[8]uint64)(in), (*[64]uint64)(out)) + case 9: + deltaunpack_uint64_9(initoffset, (*[9]uint64)(in), (*[64]uint64)(out)) + case 10: + deltaunpack_uint64_10(initoffset, (*[10]uint64)(in), (*[64]uint64)(out)) + case 11: + deltaunpack_uint64_11(initoffset, (*[11]uint64)(in), (*[64]uint64)(out)) + case 12: + deltaunpack_uint64_12(initoffset, (*[12]uint64)(in), (*[64]uint64)(out)) + case 13: + deltaunpack_uint64_13(initoffset, (*[13]uint64)(in), (*[64]uint64)(out)) + case 14: + deltaunpack_uint64_14(initoffset, (*[14]uint64)(in), (*[64]uint64)(out)) + case 15: + deltaunpack_uint64_15(initoffset, (*[15]uint64)(in), (*[64]uint64)(out)) + case 16: + deltaunpack_uint64_16(initoffset, (*[16]uint64)(in), (*[64]uint64)(out)) + case 17: + deltaunpack_uint64_17(initoffset, (*[17]uint64)(in), (*[64]uint64)(out)) + case 18: + deltaunpack_uint64_18(initoffset, (*[18]uint64)(in), (*[64]uint64)(out)) + case 19: + deltaunpack_uint64_19(initoffset, (*[19]uint64)(in), (*[64]uint64)(out)) + case 20: + deltaunpack_uint64_20(initoffset, (*[20]uint64)(in), (*[64]uint64)(out)) + case 21: + deltaunpack_uint64_21(initoffset, (*[21]uint64)(in), (*[64]uint64)(out)) + case 22: + deltaunpack_uint64_22(initoffset, (*[22]uint64)(in), (*[64]uint64)(out)) + case 23: + deltaunpack_uint64_23(initoffset, (*[23]uint64)(in), (*[64]uint64)(out)) + case 24: + deltaunpack_uint64_24(initoffset, (*[24]uint64)(in), (*[64]uint64)(out)) + case 25: + deltaunpack_uint64_25(initoffset, (*[25]uint64)(in), (*[64]uint64)(out)) + case 26: + deltaunpack_uint64_26(initoffset, (*[26]uint64)(in), (*[64]uint64)(out)) + case 27: + deltaunpack_uint64_27(initoffset, (*[27]uint64)(in), (*[64]uint64)(out)) + case 28: + deltaunpack_uint64_28(initoffset, (*[28]uint64)(in), (*[64]uint64)(out)) + case 29: + deltaunpack_uint64_29(initoffset, (*[29]uint64)(in), (*[64]uint64)(out)) + case 30: + deltaunpack_uint64_30(initoffset, (*[30]uint64)(in), (*[64]uint64)(out)) + case 31: + deltaunpack_uint64_31(initoffset, (*[31]uint64)(in), (*[64]uint64)(out)) + case 32: + deltaunpack_uint64_32(initoffset, (*[32]uint64)(in), (*[64]uint64)(out)) + case 33: + deltaunpack_uint64_33(initoffset, (*[33]uint64)(in), (*[64]uint64)(out)) + case 34: + deltaunpack_uint64_34(initoffset, (*[34]uint64)(in), (*[64]uint64)(out)) + case 35: + deltaunpack_uint64_35(initoffset, (*[35]uint64)(in), (*[64]uint64)(out)) + case 36: + deltaunpack_uint64_36(initoffset, (*[36]uint64)(in), (*[64]uint64)(out)) + case 37: + deltaunpack_uint64_37(initoffset, (*[37]uint64)(in), (*[64]uint64)(out)) + case 38: + deltaunpack_uint64_38(initoffset, (*[38]uint64)(in), (*[64]uint64)(out)) + case 39: + deltaunpack_uint64_39(initoffset, (*[39]uint64)(in), (*[64]uint64)(out)) + case 40: + deltaunpack_uint64_40(initoffset, (*[40]uint64)(in), (*[64]uint64)(out)) + case 41: + deltaunpack_uint64_41(initoffset, (*[41]uint64)(in), (*[64]uint64)(out)) + case 42: + deltaunpack_uint64_42(initoffset, (*[42]uint64)(in), (*[64]uint64)(out)) + case 43: + deltaunpack_uint64_43(initoffset, (*[43]uint64)(in), (*[64]uint64)(out)) + case 44: + deltaunpack_uint64_44(initoffset, (*[44]uint64)(in), (*[64]uint64)(out)) + case 45: + deltaunpack_uint64_45(initoffset, (*[45]uint64)(in), (*[64]uint64)(out)) + case 46: + deltaunpack_uint64_46(initoffset, (*[46]uint64)(in), (*[64]uint64)(out)) + case 47: + deltaunpack_uint64_47(initoffset, (*[47]uint64)(in), (*[64]uint64)(out)) + case 48: + deltaunpack_uint64_48(initoffset, (*[48]uint64)(in), (*[64]uint64)(out)) + case 49: + deltaunpack_uint64_49(initoffset, (*[49]uint64)(in), (*[64]uint64)(out)) + case 50: + deltaunpack_uint64_50(initoffset, (*[50]uint64)(in), (*[64]uint64)(out)) + case 51: + deltaunpack_uint64_51(initoffset, (*[51]uint64)(in), (*[64]uint64)(out)) + case 52: + deltaunpack_uint64_52(initoffset, (*[52]uint64)(in), (*[64]uint64)(out)) + case 53: + deltaunpack_uint64_53(initoffset, (*[53]uint64)(in), (*[64]uint64)(out)) + case 54: + deltaunpack_uint64_54(initoffset, (*[54]uint64)(in), (*[64]uint64)(out)) + case 55: + deltaunpack_uint64_55(initoffset, (*[55]uint64)(in), (*[64]uint64)(out)) + case 56: + deltaunpack_uint64_56(initoffset, (*[56]uint64)(in), (*[64]uint64)(out)) + case 57: + deltaunpack_uint64_57(initoffset, (*[57]uint64)(in), (*[64]uint64)(out)) + case 58: + deltaunpack_uint64_58(initoffset, (*[58]uint64)(in), (*[64]uint64)(out)) + case 59: + deltaunpack_uint64_59(initoffset, (*[59]uint64)(in), (*[64]uint64)(out)) + case 60: + deltaunpack_uint64_60(initoffset, (*[60]uint64)(in), (*[64]uint64)(out)) + case 61: + deltaunpack_uint64_61(initoffset, (*[61]uint64)(in), (*[64]uint64)(out)) + case 62: + deltaunpack_uint64_62(initoffset, (*[62]uint64)(in), (*[64]uint64)(out)) + case 63: + deltaunpack_uint64_63(initoffset, (*[63]uint64)(in), (*[64]uint64)(out)) + case 64: + *(*[64]uint64)(out) = *(*[64]uint64)(unsafe.Pointer((*[64]uint64)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapack_uint64_0(initoffset uint64, in *[64]uint64, out *[0]uint64) { +} + +func deltapack_uint64_1(initoffset uint64, in *[64]uint64, out *[1]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 1) | + ((in[2] - in[1]) << 2) | + ((in[3] - in[2]) << 3) | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 5) | + ((in[6] - in[5]) << 6) | + ((in[7] - in[6]) << 7) | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 9) | + ((in[10] - in[9]) << 10) | + ((in[11] - in[10]) << 11) | + ((in[12] - in[11]) << 12) | + ((in[13] - in[12]) << 13) | + ((in[14] - in[13]) << 14) | + ((in[15] - in[14]) << 15) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 17) | + ((in[18] - in[17]) << 18) | + ((in[19] - in[18]) << 19) | + ((in[20] - in[19]) << 20) | + ((in[21] - in[20]) << 21) | + ((in[22] - in[21]) << 22) | + ((in[23] - in[22]) << 23) | + ((in[24] - in[23]) << 24) | + ((in[25] - in[24]) << 25) | + ((in[26] - in[25]) << 26) | + ((in[27] - in[26]) << 27) | + ((in[28] - in[27]) << 28) | + ((in[29] - in[28]) << 29) | + ((in[30] - in[29]) << 30) | + ((in[31] - in[30]) << 31) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 33) | + ((in[34] - in[33]) << 34) | + ((in[35] - in[34]) << 35) | + ((in[36] - in[35]) << 36) | + ((in[37] - in[36]) << 37) | + ((in[38] - in[37]) << 38) | + ((in[39] - in[38]) << 39) | + ((in[40] - in[39]) << 40) | + ((in[41] - in[40]) << 41) | + ((in[42] - in[41]) << 42) | + ((in[43] - in[42]) << 43) | + ((in[44] - in[43]) << 44) | + ((in[45] - in[44]) << 45) | + ((in[46] - in[45]) << 46) | + ((in[47] - in[46]) << 47) | + ((in[48] - in[47]) << 48) | + ((in[49] - in[48]) << 49) | + ((in[50] - in[49]) << 50) | + ((in[51] - in[50]) << 51) | + ((in[52] - in[51]) << 52) | + ((in[53] - in[52]) << 53) | + ((in[54] - in[53]) << 54) | + ((in[55] - in[54]) << 55) | + ((in[56] - in[55]) << 56) | + ((in[57] - in[56]) << 57) | + ((in[58] - in[57]) << 58) | + ((in[59] - in[58]) << 59) | + ((in[60] - in[59]) << 60) | + ((in[61] - in[60]) << 61) | + ((in[62] - in[61]) << 62) | + ((in[63] - in[62]) << 63) +} + +func deltapack_uint64_2(initoffset uint64, in *[64]uint64, out *[2]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 2) | + ((in[2] - in[1]) << 4) | + ((in[3] - in[2]) << 6) | + ((in[4] - in[3]) << 8) | + ((in[5] - in[4]) << 10) | + ((in[6] - in[5]) << 12) | + ((in[7] - in[6]) << 14) | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 18) | + ((in[10] - in[9]) << 20) | + ((in[11] - in[10]) << 22) | + ((in[12] - in[11]) << 24) | + ((in[13] - in[12]) << 26) | + ((in[14] - in[13]) << 28) | + ((in[15] - in[14]) << 30) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 34) | + ((in[18] - in[17]) << 36) | + ((in[19] - in[18]) << 38) | + ((in[20] - in[19]) << 40) | + ((in[21] - in[20]) << 42) | + ((in[22] - in[21]) << 44) | + ((in[23] - in[22]) << 46) | + ((in[24] - in[23]) << 48) | + ((in[25] - in[24]) << 50) | + ((in[26] - in[25]) << 52) | + ((in[27] - in[26]) << 54) | + ((in[28] - in[27]) << 56) | + ((in[29] - in[28]) << 58) | + ((in[30] - in[29]) << 60) | + ((in[31] - in[30]) << 62) + out[1] = + in[32] - in[31] | + ((in[33] - in[32]) << 2) | + ((in[34] - in[33]) << 4) | + ((in[35] - in[34]) << 6) | + ((in[36] - in[35]) << 8) | + ((in[37] - in[36]) << 10) | + ((in[38] - in[37]) << 12) | + ((in[39] - in[38]) << 14) | + ((in[40] - in[39]) << 16) | + ((in[41] - in[40]) << 18) | + ((in[42] - in[41]) << 20) | + ((in[43] - in[42]) << 22) | + ((in[44] - in[43]) << 24) | + ((in[45] - in[44]) << 26) | + ((in[46] - in[45]) << 28) | + ((in[47] - in[46]) << 30) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 34) | + ((in[50] - in[49]) << 36) | + ((in[51] - in[50]) << 38) | + ((in[52] - in[51]) << 40) | + ((in[53] - in[52]) << 42) | + ((in[54] - in[53]) << 44) | + ((in[55] - in[54]) << 46) | + ((in[56] - in[55]) << 48) | + ((in[57] - in[56]) << 50) | + ((in[58] - in[57]) << 52) | + ((in[59] - in[58]) << 54) | + ((in[60] - in[59]) << 56) | + ((in[61] - in[60]) << 58) | + ((in[62] - in[61]) << 60) | + ((in[63] - in[62]) << 62) +} + +func deltapack_uint64_3(initoffset uint64, in *[64]uint64, out *[3]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 3) | + ((in[2] - in[1]) << 6) | + ((in[3] - in[2]) << 9) | + ((in[4] - in[3]) << 12) | + ((in[5] - in[4]) << 15) | + ((in[6] - in[5]) << 18) | + ((in[7] - in[6]) << 21) | + ((in[8] - in[7]) << 24) | + ((in[9] - in[8]) << 27) | + ((in[10] - in[9]) << 30) | + ((in[11] - in[10]) << 33) | + ((in[12] - in[11]) << 36) | + ((in[13] - in[12]) << 39) | + ((in[14] - in[13]) << 42) | + ((in[15] - in[14]) << 45) | + ((in[16] - in[15]) << 48) | + ((in[17] - in[16]) << 51) | + ((in[18] - in[17]) << 54) | + ((in[19] - in[18]) << 57) | + ((in[20] - in[19]) << 60) | + ((in[21] - in[20]) << 63) + out[1] = + (in[21] - in[20]) >> 1 | + ((in[22] - in[21]) << 2) | + ((in[23] - in[22]) << 5) | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 11) | + ((in[26] - in[25]) << 14) | + ((in[27] - in[26]) << 17) | + ((in[28] - in[27]) << 20) | + ((in[29] - in[28]) << 23) | + ((in[30] - in[29]) << 26) | + ((in[31] - in[30]) << 29) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 35) | + ((in[34] - in[33]) << 38) | + ((in[35] - in[34]) << 41) | + ((in[36] - in[35]) << 44) | + ((in[37] - in[36]) << 47) | + ((in[38] - in[37]) << 50) | + ((in[39] - in[38]) << 53) | + ((in[40] - in[39]) << 56) | + ((in[41] - in[40]) << 59) | + ((in[42] - in[41]) << 62) + out[2] = + (in[42] - in[41]) >> 2 | + ((in[43] - in[42]) << 1) | + ((in[44] - in[43]) << 4) | + ((in[45] - in[44]) << 7) | + ((in[46] - in[45]) << 10) | + ((in[47] - in[46]) << 13) | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 19) | + ((in[50] - in[49]) << 22) | + ((in[51] - in[50]) << 25) | + ((in[52] - in[51]) << 28) | + ((in[53] - in[52]) << 31) | + ((in[54] - in[53]) << 34) | + ((in[55] - in[54]) << 37) | + ((in[56] - in[55]) << 40) | + ((in[57] - in[56]) << 43) | + ((in[58] - in[57]) << 46) | + ((in[59] - in[58]) << 49) | + ((in[60] - in[59]) << 52) | + ((in[61] - in[60]) << 55) | + ((in[62] - in[61]) << 58) | + ((in[63] - in[62]) << 61) +} + +func deltapack_uint64_4(initoffset uint64, in *[64]uint64, out *[4]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 4) | + ((in[2] - in[1]) << 8) | + ((in[3] - in[2]) << 12) | + ((in[4] - in[3]) << 16) | + ((in[5] - in[4]) << 20) | + ((in[6] - in[5]) << 24) | + ((in[7] - in[6]) << 28) | + ((in[8] - in[7]) << 32) | + ((in[9] - in[8]) << 36) | + ((in[10] - in[9]) << 40) | + ((in[11] - in[10]) << 44) | + ((in[12] - in[11]) << 48) | + ((in[13] - in[12]) << 52) | + ((in[14] - in[13]) << 56) | + ((in[15] - in[14]) << 60) + out[1] = + in[16] - in[15] | + ((in[17] - in[16]) << 4) | + ((in[18] - in[17]) << 8) | + ((in[19] - in[18]) << 12) | + ((in[20] - in[19]) << 16) | + ((in[21] - in[20]) << 20) | + ((in[22] - in[21]) << 24) | + ((in[23] - in[22]) << 28) | + ((in[24] - in[23]) << 32) | + ((in[25] - in[24]) << 36) | + ((in[26] - in[25]) << 40) | + ((in[27] - in[26]) << 44) | + ((in[28] - in[27]) << 48) | + ((in[29] - in[28]) << 52) | + ((in[30] - in[29]) << 56) | + ((in[31] - in[30]) << 60) + out[2] = + in[32] - in[31] | + ((in[33] - in[32]) << 4) | + ((in[34] - in[33]) << 8) | + ((in[35] - in[34]) << 12) | + ((in[36] - in[35]) << 16) | + ((in[37] - in[36]) << 20) | + ((in[38] - in[37]) << 24) | + ((in[39] - in[38]) << 28) | + ((in[40] - in[39]) << 32) | + ((in[41] - in[40]) << 36) | + ((in[42] - in[41]) << 40) | + ((in[43] - in[42]) << 44) | + ((in[44] - in[43]) << 48) | + ((in[45] - in[44]) << 52) | + ((in[46] - in[45]) << 56) | + ((in[47] - in[46]) << 60) + out[3] = + in[48] - in[47] | + ((in[49] - in[48]) << 4) | + ((in[50] - in[49]) << 8) | + ((in[51] - in[50]) << 12) | + ((in[52] - in[51]) << 16) | + ((in[53] - in[52]) << 20) | + ((in[54] - in[53]) << 24) | + ((in[55] - in[54]) << 28) | + ((in[56] - in[55]) << 32) | + ((in[57] - in[56]) << 36) | + ((in[58] - in[57]) << 40) | + ((in[59] - in[58]) << 44) | + ((in[60] - in[59]) << 48) | + ((in[61] - in[60]) << 52) | + ((in[62] - in[61]) << 56) | + ((in[63] - in[62]) << 60) +} + +func deltapack_uint64_5(initoffset uint64, in *[64]uint64, out *[5]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 5) | + ((in[2] - in[1]) << 10) | + ((in[3] - in[2]) << 15) | + ((in[4] - in[3]) << 20) | + ((in[5] - in[4]) << 25) | + ((in[6] - in[5]) << 30) | + ((in[7] - in[6]) << 35) | + ((in[8] - in[7]) << 40) | + ((in[9] - in[8]) << 45) | + ((in[10] - in[9]) << 50) | + ((in[11] - in[10]) << 55) | + ((in[12] - in[11]) << 60) + out[1] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 1) | + ((in[14] - in[13]) << 6) | + ((in[15] - in[14]) << 11) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 21) | + ((in[18] - in[17]) << 26) | + ((in[19] - in[18]) << 31) | + ((in[20] - in[19]) << 36) | + ((in[21] - in[20]) << 41) | + ((in[22] - in[21]) << 46) | + ((in[23] - in[22]) << 51) | + ((in[24] - in[23]) << 56) | + ((in[25] - in[24]) << 61) + out[2] = + (in[25] - in[24]) >> 3 | + ((in[26] - in[25]) << 2) | + ((in[27] - in[26]) << 7) | + ((in[28] - in[27]) << 12) | + ((in[29] - in[28]) << 17) | + ((in[30] - in[29]) << 22) | + ((in[31] - in[30]) << 27) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 37) | + ((in[34] - in[33]) << 42) | + ((in[35] - in[34]) << 47) | + ((in[36] - in[35]) << 52) | + ((in[37] - in[36]) << 57) | + ((in[38] - in[37]) << 62) + out[3] = + (in[38] - in[37]) >> 2 | + ((in[39] - in[38]) << 3) | + ((in[40] - in[39]) << 8) | + ((in[41] - in[40]) << 13) | + ((in[42] - in[41]) << 18) | + ((in[43] - in[42]) << 23) | + ((in[44] - in[43]) << 28) | + ((in[45] - in[44]) << 33) | + ((in[46] - in[45]) << 38) | + ((in[47] - in[46]) << 43) | + ((in[48] - in[47]) << 48) | + ((in[49] - in[48]) << 53) | + ((in[50] - in[49]) << 58) | + ((in[51] - in[50]) << 63) + out[4] = + (in[51] - in[50]) >> 1 | + ((in[52] - in[51]) << 4) | + ((in[53] - in[52]) << 9) | + ((in[54] - in[53]) << 14) | + ((in[55] - in[54]) << 19) | + ((in[56] - in[55]) << 24) | + ((in[57] - in[56]) << 29) | + ((in[58] - in[57]) << 34) | + ((in[59] - in[58]) << 39) | + ((in[60] - in[59]) << 44) | + ((in[61] - in[60]) << 49) | + ((in[62] - in[61]) << 54) | + ((in[63] - in[62]) << 59) +} + +func deltapack_uint64_6(initoffset uint64, in *[64]uint64, out *[6]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 6) | + ((in[2] - in[1]) << 12) | + ((in[3] - in[2]) << 18) | + ((in[4] - in[3]) << 24) | + ((in[5] - in[4]) << 30) | + ((in[6] - in[5]) << 36) | + ((in[7] - in[6]) << 42) | + ((in[8] - in[7]) << 48) | + ((in[9] - in[8]) << 54) | + ((in[10] - in[9]) << 60) + out[1] = + (in[10] - in[9]) >> 4 | + ((in[11] - in[10]) << 2) | + ((in[12] - in[11]) << 8) | + ((in[13] - in[12]) << 14) | + ((in[14] - in[13]) << 20) | + ((in[15] - in[14]) << 26) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 38) | + ((in[18] - in[17]) << 44) | + ((in[19] - in[18]) << 50) | + ((in[20] - in[19]) << 56) | + ((in[21] - in[20]) << 62) + out[2] = + (in[21] - in[20]) >> 2 | + ((in[22] - in[21]) << 4) | + ((in[23] - in[22]) << 10) | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 22) | + ((in[26] - in[25]) << 28) | + ((in[27] - in[26]) << 34) | + ((in[28] - in[27]) << 40) | + ((in[29] - in[28]) << 46) | + ((in[30] - in[29]) << 52) | + ((in[31] - in[30]) << 58) + out[3] = + in[32] - in[31] | + ((in[33] - in[32]) << 6) | + ((in[34] - in[33]) << 12) | + ((in[35] - in[34]) << 18) | + ((in[36] - in[35]) << 24) | + ((in[37] - in[36]) << 30) | + ((in[38] - in[37]) << 36) | + ((in[39] - in[38]) << 42) | + ((in[40] - in[39]) << 48) | + ((in[41] - in[40]) << 54) | + ((in[42] - in[41]) << 60) + out[4] = + (in[42] - in[41]) >> 4 | + ((in[43] - in[42]) << 2) | + ((in[44] - in[43]) << 8) | + ((in[45] - in[44]) << 14) | + ((in[46] - in[45]) << 20) | + ((in[47] - in[46]) << 26) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 38) | + ((in[50] - in[49]) << 44) | + ((in[51] - in[50]) << 50) | + ((in[52] - in[51]) << 56) | + ((in[53] - in[52]) << 62) + out[5] = + (in[53] - in[52]) >> 2 | + ((in[54] - in[53]) << 4) | + ((in[55] - in[54]) << 10) | + ((in[56] - in[55]) << 16) | + ((in[57] - in[56]) << 22) | + ((in[58] - in[57]) << 28) | + ((in[59] - in[58]) << 34) | + ((in[60] - in[59]) << 40) | + ((in[61] - in[60]) << 46) | + ((in[62] - in[61]) << 52) | + ((in[63] - in[62]) << 58) +} + +func deltapack_uint64_7(initoffset uint64, in *[64]uint64, out *[7]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 7) | + ((in[2] - in[1]) << 14) | + ((in[3] - in[2]) << 21) | + ((in[4] - in[3]) << 28) | + ((in[5] - in[4]) << 35) | + ((in[6] - in[5]) << 42) | + ((in[7] - in[6]) << 49) | + ((in[8] - in[7]) << 56) | + ((in[9] - in[8]) << 63) + out[1] = + (in[9] - in[8]) >> 1 | + ((in[10] - in[9]) << 6) | + ((in[11] - in[10]) << 13) | + ((in[12] - in[11]) << 20) | + ((in[13] - in[12]) << 27) | + ((in[14] - in[13]) << 34) | + ((in[15] - in[14]) << 41) | + ((in[16] - in[15]) << 48) | + ((in[17] - in[16]) << 55) | + ((in[18] - in[17]) << 62) + out[2] = + (in[18] - in[17]) >> 2 | + ((in[19] - in[18]) << 5) | + ((in[20] - in[19]) << 12) | + ((in[21] - in[20]) << 19) | + ((in[22] - in[21]) << 26) | + ((in[23] - in[22]) << 33) | + ((in[24] - in[23]) << 40) | + ((in[25] - in[24]) << 47) | + ((in[26] - in[25]) << 54) | + ((in[27] - in[26]) << 61) + out[3] = + (in[27] - in[26]) >> 3 | + ((in[28] - in[27]) << 4) | + ((in[29] - in[28]) << 11) | + ((in[30] - in[29]) << 18) | + ((in[31] - in[30]) << 25) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 39) | + ((in[34] - in[33]) << 46) | + ((in[35] - in[34]) << 53) | + ((in[36] - in[35]) << 60) + out[4] = + (in[36] - in[35]) >> 4 | + ((in[37] - in[36]) << 3) | + ((in[38] - in[37]) << 10) | + ((in[39] - in[38]) << 17) | + ((in[40] - in[39]) << 24) | + ((in[41] - in[40]) << 31) | + ((in[42] - in[41]) << 38) | + ((in[43] - in[42]) << 45) | + ((in[44] - in[43]) << 52) | + ((in[45] - in[44]) << 59) + out[5] = + (in[45] - in[44]) >> 5 | + ((in[46] - in[45]) << 2) | + ((in[47] - in[46]) << 9) | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 23) | + ((in[50] - in[49]) << 30) | + ((in[51] - in[50]) << 37) | + ((in[52] - in[51]) << 44) | + ((in[53] - in[52]) << 51) | + ((in[54] - in[53]) << 58) + out[6] = + (in[54] - in[53]) >> 6 | + ((in[55] - in[54]) << 1) | + ((in[56] - in[55]) << 8) | + ((in[57] - in[56]) << 15) | + ((in[58] - in[57]) << 22) | + ((in[59] - in[58]) << 29) | + ((in[60] - in[59]) << 36) | + ((in[61] - in[60]) << 43) | + ((in[62] - in[61]) << 50) | + ((in[63] - in[62]) << 57) +} + +func deltapack_uint64_8(initoffset uint64, in *[64]uint64, out *[8]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 8) | + ((in[2] - in[1]) << 16) | + ((in[3] - in[2]) << 24) | + ((in[4] - in[3]) << 32) | + ((in[5] - in[4]) << 40) | + ((in[6] - in[5]) << 48) | + ((in[7] - in[6]) << 56) + out[1] = + in[8] - in[7] | + ((in[9] - in[8]) << 8) | + ((in[10] - in[9]) << 16) | + ((in[11] - in[10]) << 24) | + ((in[12] - in[11]) << 32) | + ((in[13] - in[12]) << 40) | + ((in[14] - in[13]) << 48) | + ((in[15] - in[14]) << 56) + out[2] = + in[16] - in[15] | + ((in[17] - in[16]) << 8) | + ((in[18] - in[17]) << 16) | + ((in[19] - in[18]) << 24) | + ((in[20] - in[19]) << 32) | + ((in[21] - in[20]) << 40) | + ((in[22] - in[21]) << 48) | + ((in[23] - in[22]) << 56) + out[3] = + in[24] - in[23] | + ((in[25] - in[24]) << 8) | + ((in[26] - in[25]) << 16) | + ((in[27] - in[26]) << 24) | + ((in[28] - in[27]) << 32) | + ((in[29] - in[28]) << 40) | + ((in[30] - in[29]) << 48) | + ((in[31] - in[30]) << 56) + out[4] = + in[32] - in[31] | + ((in[33] - in[32]) << 8) | + ((in[34] - in[33]) << 16) | + ((in[35] - in[34]) << 24) | + ((in[36] - in[35]) << 32) | + ((in[37] - in[36]) << 40) | + ((in[38] - in[37]) << 48) | + ((in[39] - in[38]) << 56) + out[5] = + in[40] - in[39] | + ((in[41] - in[40]) << 8) | + ((in[42] - in[41]) << 16) | + ((in[43] - in[42]) << 24) | + ((in[44] - in[43]) << 32) | + ((in[45] - in[44]) << 40) | + ((in[46] - in[45]) << 48) | + ((in[47] - in[46]) << 56) + out[6] = + in[48] - in[47] | + ((in[49] - in[48]) << 8) | + ((in[50] - in[49]) << 16) | + ((in[51] - in[50]) << 24) | + ((in[52] - in[51]) << 32) | + ((in[53] - in[52]) << 40) | + ((in[54] - in[53]) << 48) | + ((in[55] - in[54]) << 56) + out[7] = + in[56] - in[55] | + ((in[57] - in[56]) << 8) | + ((in[58] - in[57]) << 16) | + ((in[59] - in[58]) << 24) | + ((in[60] - in[59]) << 32) | + ((in[61] - in[60]) << 40) | + ((in[62] - in[61]) << 48) | + ((in[63] - in[62]) << 56) +} + +func deltapack_uint64_9(initoffset uint64, in *[64]uint64, out *[9]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 9) | + ((in[2] - in[1]) << 18) | + ((in[3] - in[2]) << 27) | + ((in[4] - in[3]) << 36) | + ((in[5] - in[4]) << 45) | + ((in[6] - in[5]) << 54) | + ((in[7] - in[6]) << 63) + out[1] = + (in[7] - in[6]) >> 1 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 17) | + ((in[10] - in[9]) << 26) | + ((in[11] - in[10]) << 35) | + ((in[12] - in[11]) << 44) | + ((in[13] - in[12]) << 53) | + ((in[14] - in[13]) << 62) + out[2] = + (in[14] - in[13]) >> 2 | + ((in[15] - in[14]) << 7) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 25) | + ((in[18] - in[17]) << 34) | + ((in[19] - in[18]) << 43) | + ((in[20] - in[19]) << 52) | + ((in[21] - in[20]) << 61) + out[3] = + (in[21] - in[20]) >> 3 | + ((in[22] - in[21]) << 6) | + ((in[23] - in[22]) << 15) | + ((in[24] - in[23]) << 24) | + ((in[25] - in[24]) << 33) | + ((in[26] - in[25]) << 42) | + ((in[27] - in[26]) << 51) | + ((in[28] - in[27]) << 60) + out[4] = + (in[28] - in[27]) >> 4 | + ((in[29] - in[28]) << 5) | + ((in[30] - in[29]) << 14) | + ((in[31] - in[30]) << 23) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 41) | + ((in[34] - in[33]) << 50) | + ((in[35] - in[34]) << 59) + out[5] = + (in[35] - in[34]) >> 5 | + ((in[36] - in[35]) << 4) | + ((in[37] - in[36]) << 13) | + ((in[38] - in[37]) << 22) | + ((in[39] - in[38]) << 31) | + ((in[40] - in[39]) << 40) | + ((in[41] - in[40]) << 49) | + ((in[42] - in[41]) << 58) + out[6] = + (in[42] - in[41]) >> 6 | + ((in[43] - in[42]) << 3) | + ((in[44] - in[43]) << 12) | + ((in[45] - in[44]) << 21) | + ((in[46] - in[45]) << 30) | + ((in[47] - in[46]) << 39) | + ((in[48] - in[47]) << 48) | + ((in[49] - in[48]) << 57) + out[7] = + (in[49] - in[48]) >> 7 | + ((in[50] - in[49]) << 2) | + ((in[51] - in[50]) << 11) | + ((in[52] - in[51]) << 20) | + ((in[53] - in[52]) << 29) | + ((in[54] - in[53]) << 38) | + ((in[55] - in[54]) << 47) | + ((in[56] - in[55]) << 56) + out[8] = + (in[56] - in[55]) >> 8 | + ((in[57] - in[56]) << 1) | + ((in[58] - in[57]) << 10) | + ((in[59] - in[58]) << 19) | + ((in[60] - in[59]) << 28) | + ((in[61] - in[60]) << 37) | + ((in[62] - in[61]) << 46) | + ((in[63] - in[62]) << 55) +} + +func deltapack_uint64_10(initoffset uint64, in *[64]uint64, out *[10]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 10) | + ((in[2] - in[1]) << 20) | + ((in[3] - in[2]) << 30) | + ((in[4] - in[3]) << 40) | + ((in[5] - in[4]) << 50) | + ((in[6] - in[5]) << 60) + out[1] = + (in[6] - in[5]) >> 4 | + ((in[7] - in[6]) << 6) | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 26) | + ((in[10] - in[9]) << 36) | + ((in[11] - in[10]) << 46) | + ((in[12] - in[11]) << 56) + out[2] = + (in[12] - in[11]) >> 8 | + ((in[13] - in[12]) << 2) | + ((in[14] - in[13]) << 12) | + ((in[15] - in[14]) << 22) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 42) | + ((in[18] - in[17]) << 52) | + ((in[19] - in[18]) << 62) + out[3] = + (in[19] - in[18]) >> 2 | + ((in[20] - in[19]) << 8) | + ((in[21] - in[20]) << 18) | + ((in[22] - in[21]) << 28) | + ((in[23] - in[22]) << 38) | + ((in[24] - in[23]) << 48) | + ((in[25] - in[24]) << 58) + out[4] = + (in[25] - in[24]) >> 6 | + ((in[26] - in[25]) << 4) | + ((in[27] - in[26]) << 14) | + ((in[28] - in[27]) << 24) | + ((in[29] - in[28]) << 34) | + ((in[30] - in[29]) << 44) | + ((in[31] - in[30]) << 54) + out[5] = + in[32] - in[31] | + ((in[33] - in[32]) << 10) | + ((in[34] - in[33]) << 20) | + ((in[35] - in[34]) << 30) | + ((in[36] - in[35]) << 40) | + ((in[37] - in[36]) << 50) | + ((in[38] - in[37]) << 60) + out[6] = + (in[38] - in[37]) >> 4 | + ((in[39] - in[38]) << 6) | + ((in[40] - in[39]) << 16) | + ((in[41] - in[40]) << 26) | + ((in[42] - in[41]) << 36) | + ((in[43] - in[42]) << 46) | + ((in[44] - in[43]) << 56) + out[7] = + (in[44] - in[43]) >> 8 | + ((in[45] - in[44]) << 2) | + ((in[46] - in[45]) << 12) | + ((in[47] - in[46]) << 22) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 42) | + ((in[50] - in[49]) << 52) | + ((in[51] - in[50]) << 62) + out[8] = + (in[51] - in[50]) >> 2 | + ((in[52] - in[51]) << 8) | + ((in[53] - in[52]) << 18) | + ((in[54] - in[53]) << 28) | + ((in[55] - in[54]) << 38) | + ((in[56] - in[55]) << 48) | + ((in[57] - in[56]) << 58) + out[9] = + (in[57] - in[56]) >> 6 | + ((in[58] - in[57]) << 4) | + ((in[59] - in[58]) << 14) | + ((in[60] - in[59]) << 24) | + ((in[61] - in[60]) << 34) | + ((in[62] - in[61]) << 44) | + ((in[63] - in[62]) << 54) +} + +func deltapack_uint64_11(initoffset uint64, in *[64]uint64, out *[11]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 11) | + ((in[2] - in[1]) << 22) | + ((in[3] - in[2]) << 33) | + ((in[4] - in[3]) << 44) | + ((in[5] - in[4]) << 55) + out[1] = + (in[5] - in[4]) >> 9 | + ((in[6] - in[5]) << 2) | + ((in[7] - in[6]) << 13) | + ((in[8] - in[7]) << 24) | + ((in[9] - in[8]) << 35) | + ((in[10] - in[9]) << 46) | + ((in[11] - in[10]) << 57) + out[2] = + (in[11] - in[10]) >> 7 | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 15) | + ((in[14] - in[13]) << 26) | + ((in[15] - in[14]) << 37) | + ((in[16] - in[15]) << 48) | + ((in[17] - in[16]) << 59) + out[3] = + (in[17] - in[16]) >> 5 | + ((in[18] - in[17]) << 6) | + ((in[19] - in[18]) << 17) | + ((in[20] - in[19]) << 28) | + ((in[21] - in[20]) << 39) | + ((in[22] - in[21]) << 50) | + ((in[23] - in[22]) << 61) + out[4] = + (in[23] - in[22]) >> 3 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 19) | + ((in[26] - in[25]) << 30) | + ((in[27] - in[26]) << 41) | + ((in[28] - in[27]) << 52) | + ((in[29] - in[28]) << 63) + out[5] = + (in[29] - in[28]) >> 1 | + ((in[30] - in[29]) << 10) | + ((in[31] - in[30]) << 21) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 43) | + ((in[34] - in[33]) << 54) + out[6] = + (in[34] - in[33]) >> 10 | + ((in[35] - in[34]) << 1) | + ((in[36] - in[35]) << 12) | + ((in[37] - in[36]) << 23) | + ((in[38] - in[37]) << 34) | + ((in[39] - in[38]) << 45) | + ((in[40] - in[39]) << 56) + out[7] = + (in[40] - in[39]) >> 8 | + ((in[41] - in[40]) << 3) | + ((in[42] - in[41]) << 14) | + ((in[43] - in[42]) << 25) | + ((in[44] - in[43]) << 36) | + ((in[45] - in[44]) << 47) | + ((in[46] - in[45]) << 58) + out[8] = + (in[46] - in[45]) >> 6 | + ((in[47] - in[46]) << 5) | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 27) | + ((in[50] - in[49]) << 38) | + ((in[51] - in[50]) << 49) | + ((in[52] - in[51]) << 60) + out[9] = + (in[52] - in[51]) >> 4 | + ((in[53] - in[52]) << 7) | + ((in[54] - in[53]) << 18) | + ((in[55] - in[54]) << 29) | + ((in[56] - in[55]) << 40) | + ((in[57] - in[56]) << 51) | + ((in[58] - in[57]) << 62) + out[10] = + (in[58] - in[57]) >> 2 | + ((in[59] - in[58]) << 9) | + ((in[60] - in[59]) << 20) | + ((in[61] - in[60]) << 31) | + ((in[62] - in[61]) << 42) | + ((in[63] - in[62]) << 53) +} + +func deltapack_uint64_12(initoffset uint64, in *[64]uint64, out *[12]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 12) | + ((in[2] - in[1]) << 24) | + ((in[3] - in[2]) << 36) | + ((in[4] - in[3]) << 48) | + ((in[5] - in[4]) << 60) + out[1] = + (in[5] - in[4]) >> 4 | + ((in[6] - in[5]) << 8) | + ((in[7] - in[6]) << 20) | + ((in[8] - in[7]) << 32) | + ((in[9] - in[8]) << 44) | + ((in[10] - in[9]) << 56) + out[2] = + (in[10] - in[9]) >> 8 | + ((in[11] - in[10]) << 4) | + ((in[12] - in[11]) << 16) | + ((in[13] - in[12]) << 28) | + ((in[14] - in[13]) << 40) | + ((in[15] - in[14]) << 52) + out[3] = + in[16] - in[15] | + ((in[17] - in[16]) << 12) | + ((in[18] - in[17]) << 24) | + ((in[19] - in[18]) << 36) | + ((in[20] - in[19]) << 48) | + ((in[21] - in[20]) << 60) + out[4] = + (in[21] - in[20]) >> 4 | + ((in[22] - in[21]) << 8) | + ((in[23] - in[22]) << 20) | + ((in[24] - in[23]) << 32) | + ((in[25] - in[24]) << 44) | + ((in[26] - in[25]) << 56) + out[5] = + (in[26] - in[25]) >> 8 | + ((in[27] - in[26]) << 4) | + ((in[28] - in[27]) << 16) | + ((in[29] - in[28]) << 28) | + ((in[30] - in[29]) << 40) | + ((in[31] - in[30]) << 52) + out[6] = + in[32] - in[31] | + ((in[33] - in[32]) << 12) | + ((in[34] - in[33]) << 24) | + ((in[35] - in[34]) << 36) | + ((in[36] - in[35]) << 48) | + ((in[37] - in[36]) << 60) + out[7] = + (in[37] - in[36]) >> 4 | + ((in[38] - in[37]) << 8) | + ((in[39] - in[38]) << 20) | + ((in[40] - in[39]) << 32) | + ((in[41] - in[40]) << 44) | + ((in[42] - in[41]) << 56) + out[8] = + (in[42] - in[41]) >> 8 | + ((in[43] - in[42]) << 4) | + ((in[44] - in[43]) << 16) | + ((in[45] - in[44]) << 28) | + ((in[46] - in[45]) << 40) | + ((in[47] - in[46]) << 52) + out[9] = + in[48] - in[47] | + ((in[49] - in[48]) << 12) | + ((in[50] - in[49]) << 24) | + ((in[51] - in[50]) << 36) | + ((in[52] - in[51]) << 48) | + ((in[53] - in[52]) << 60) + out[10] = + (in[53] - in[52]) >> 4 | + ((in[54] - in[53]) << 8) | + ((in[55] - in[54]) << 20) | + ((in[56] - in[55]) << 32) | + ((in[57] - in[56]) << 44) | + ((in[58] - in[57]) << 56) + out[11] = + (in[58] - in[57]) >> 8 | + ((in[59] - in[58]) << 4) | + ((in[60] - in[59]) << 16) | + ((in[61] - in[60]) << 28) | + ((in[62] - in[61]) << 40) | + ((in[63] - in[62]) << 52) +} + +func deltapack_uint64_13(initoffset uint64, in *[64]uint64, out *[13]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 13) | + ((in[2] - in[1]) << 26) | + ((in[3] - in[2]) << 39) | + ((in[4] - in[3]) << 52) + out[1] = + (in[4] - in[3]) >> 12 | + ((in[5] - in[4]) << 1) | + ((in[6] - in[5]) << 14) | + ((in[7] - in[6]) << 27) | + ((in[8] - in[7]) << 40) | + ((in[9] - in[8]) << 53) + out[2] = + (in[9] - in[8]) >> 11 | + ((in[10] - in[9]) << 2) | + ((in[11] - in[10]) << 15) | + ((in[12] - in[11]) << 28) | + ((in[13] - in[12]) << 41) | + ((in[14] - in[13]) << 54) + out[3] = + (in[14] - in[13]) >> 10 | + ((in[15] - in[14]) << 3) | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 29) | + ((in[18] - in[17]) << 42) | + ((in[19] - in[18]) << 55) + out[4] = + (in[19] - in[18]) >> 9 | + ((in[20] - in[19]) << 4) | + ((in[21] - in[20]) << 17) | + ((in[22] - in[21]) << 30) | + ((in[23] - in[22]) << 43) | + ((in[24] - in[23]) << 56) + out[5] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 5) | + ((in[26] - in[25]) << 18) | + ((in[27] - in[26]) << 31) | + ((in[28] - in[27]) << 44) | + ((in[29] - in[28]) << 57) + out[6] = + (in[29] - in[28]) >> 7 | + ((in[30] - in[29]) << 6) | + ((in[31] - in[30]) << 19) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 45) | + ((in[34] - in[33]) << 58) + out[7] = + (in[34] - in[33]) >> 6 | + ((in[35] - in[34]) << 7) | + ((in[36] - in[35]) << 20) | + ((in[37] - in[36]) << 33) | + ((in[38] - in[37]) << 46) | + ((in[39] - in[38]) << 59) + out[8] = + (in[39] - in[38]) >> 5 | + ((in[40] - in[39]) << 8) | + ((in[41] - in[40]) << 21) | + ((in[42] - in[41]) << 34) | + ((in[43] - in[42]) << 47) | + ((in[44] - in[43]) << 60) + out[9] = + (in[44] - in[43]) >> 4 | + ((in[45] - in[44]) << 9) | + ((in[46] - in[45]) << 22) | + ((in[47] - in[46]) << 35) | + ((in[48] - in[47]) << 48) | + ((in[49] - in[48]) << 61) + out[10] = + (in[49] - in[48]) >> 3 | + ((in[50] - in[49]) << 10) | + ((in[51] - in[50]) << 23) | + ((in[52] - in[51]) << 36) | + ((in[53] - in[52]) << 49) | + ((in[54] - in[53]) << 62) + out[11] = + (in[54] - in[53]) >> 2 | + ((in[55] - in[54]) << 11) | + ((in[56] - in[55]) << 24) | + ((in[57] - in[56]) << 37) | + ((in[58] - in[57]) << 50) | + ((in[59] - in[58]) << 63) + out[12] = + (in[59] - in[58]) >> 1 | + ((in[60] - in[59]) << 12) | + ((in[61] - in[60]) << 25) | + ((in[62] - in[61]) << 38) | + ((in[63] - in[62]) << 51) +} + +func deltapack_uint64_14(initoffset uint64, in *[64]uint64, out *[14]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 14) | + ((in[2] - in[1]) << 28) | + ((in[3] - in[2]) << 42) | + ((in[4] - in[3]) << 56) + out[1] = + (in[4] - in[3]) >> 8 | + ((in[5] - in[4]) << 6) | + ((in[6] - in[5]) << 20) | + ((in[7] - in[6]) << 34) | + ((in[8] - in[7]) << 48) | + ((in[9] - in[8]) << 62) + out[2] = + (in[9] - in[8]) >> 2 | + ((in[10] - in[9]) << 12) | + ((in[11] - in[10]) << 26) | + ((in[12] - in[11]) << 40) | + ((in[13] - in[12]) << 54) + out[3] = + (in[13] - in[12]) >> 10 | + ((in[14] - in[13]) << 4) | + ((in[15] - in[14]) << 18) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 46) | + ((in[18] - in[17]) << 60) + out[4] = + (in[18] - in[17]) >> 4 | + ((in[19] - in[18]) << 10) | + ((in[20] - in[19]) << 24) | + ((in[21] - in[20]) << 38) | + ((in[22] - in[21]) << 52) + out[5] = + (in[22] - in[21]) >> 12 | + ((in[23] - in[22]) << 2) | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 30) | + ((in[26] - in[25]) << 44) | + ((in[27] - in[26]) << 58) + out[6] = + (in[27] - in[26]) >> 6 | + ((in[28] - in[27]) << 8) | + ((in[29] - in[28]) << 22) | + ((in[30] - in[29]) << 36) | + ((in[31] - in[30]) << 50) + out[7] = + in[32] - in[31] | + ((in[33] - in[32]) << 14) | + ((in[34] - in[33]) << 28) | + ((in[35] - in[34]) << 42) | + ((in[36] - in[35]) << 56) + out[8] = + (in[36] - in[35]) >> 8 | + ((in[37] - in[36]) << 6) | + ((in[38] - in[37]) << 20) | + ((in[39] - in[38]) << 34) | + ((in[40] - in[39]) << 48) | + ((in[41] - in[40]) << 62) + out[9] = + (in[41] - in[40]) >> 2 | + ((in[42] - in[41]) << 12) | + ((in[43] - in[42]) << 26) | + ((in[44] - in[43]) << 40) | + ((in[45] - in[44]) << 54) + out[10] = + (in[45] - in[44]) >> 10 | + ((in[46] - in[45]) << 4) | + ((in[47] - in[46]) << 18) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 46) | + ((in[50] - in[49]) << 60) + out[11] = + (in[50] - in[49]) >> 4 | + ((in[51] - in[50]) << 10) | + ((in[52] - in[51]) << 24) | + ((in[53] - in[52]) << 38) | + ((in[54] - in[53]) << 52) + out[12] = + (in[54] - in[53]) >> 12 | + ((in[55] - in[54]) << 2) | + ((in[56] - in[55]) << 16) | + ((in[57] - in[56]) << 30) | + ((in[58] - in[57]) << 44) | + ((in[59] - in[58]) << 58) + out[13] = + (in[59] - in[58]) >> 6 | + ((in[60] - in[59]) << 8) | + ((in[61] - in[60]) << 22) | + ((in[62] - in[61]) << 36) | + ((in[63] - in[62]) << 50) +} + +func deltapack_uint64_15(initoffset uint64, in *[64]uint64, out *[15]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 15) | + ((in[2] - in[1]) << 30) | + ((in[3] - in[2]) << 45) | + ((in[4] - in[3]) << 60) + out[1] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 11) | + ((in[6] - in[5]) << 26) | + ((in[7] - in[6]) << 41) | + ((in[8] - in[7]) << 56) + out[2] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 7) | + ((in[10] - in[9]) << 22) | + ((in[11] - in[10]) << 37) | + ((in[12] - in[11]) << 52) + out[3] = + (in[12] - in[11]) >> 12 | + ((in[13] - in[12]) << 3) | + ((in[14] - in[13]) << 18) | + ((in[15] - in[14]) << 33) | + ((in[16] - in[15]) << 48) | + ((in[17] - in[16]) << 63) + out[4] = + (in[17] - in[16]) >> 1 | + ((in[18] - in[17]) << 14) | + ((in[19] - in[18]) << 29) | + ((in[20] - in[19]) << 44) | + ((in[21] - in[20]) << 59) + out[5] = + (in[21] - in[20]) >> 5 | + ((in[22] - in[21]) << 10) | + ((in[23] - in[22]) << 25) | + ((in[24] - in[23]) << 40) | + ((in[25] - in[24]) << 55) + out[6] = + (in[25] - in[24]) >> 9 | + ((in[26] - in[25]) << 6) | + ((in[27] - in[26]) << 21) | + ((in[28] - in[27]) << 36) | + ((in[29] - in[28]) << 51) + out[7] = + (in[29] - in[28]) >> 13 | + ((in[30] - in[29]) << 2) | + ((in[31] - in[30]) << 17) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 47) | + ((in[34] - in[33]) << 62) + out[8] = + (in[34] - in[33]) >> 2 | + ((in[35] - in[34]) << 13) | + ((in[36] - in[35]) << 28) | + ((in[37] - in[36]) << 43) | + ((in[38] - in[37]) << 58) + out[9] = + (in[38] - in[37]) >> 6 | + ((in[39] - in[38]) << 9) | + ((in[40] - in[39]) << 24) | + ((in[41] - in[40]) << 39) | + ((in[42] - in[41]) << 54) + out[10] = + (in[42] - in[41]) >> 10 | + ((in[43] - in[42]) << 5) | + ((in[44] - in[43]) << 20) | + ((in[45] - in[44]) << 35) | + ((in[46] - in[45]) << 50) + out[11] = + (in[46] - in[45]) >> 14 | + ((in[47] - in[46]) << 1) | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 31) | + ((in[50] - in[49]) << 46) | + ((in[51] - in[50]) << 61) + out[12] = + (in[51] - in[50]) >> 3 | + ((in[52] - in[51]) << 12) | + ((in[53] - in[52]) << 27) | + ((in[54] - in[53]) << 42) | + ((in[55] - in[54]) << 57) + out[13] = + (in[55] - in[54]) >> 7 | + ((in[56] - in[55]) << 8) | + ((in[57] - in[56]) << 23) | + ((in[58] - in[57]) << 38) | + ((in[59] - in[58]) << 53) + out[14] = + (in[59] - in[58]) >> 11 | + ((in[60] - in[59]) << 4) | + ((in[61] - in[60]) << 19) | + ((in[62] - in[61]) << 34) | + ((in[63] - in[62]) << 49) +} + +func deltapack_uint64_16(initoffset uint64, in *[64]uint64, out *[16]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 16) | + ((in[2] - in[1]) << 32) | + ((in[3] - in[2]) << 48) + out[1] = + in[4] - in[3] | + ((in[5] - in[4]) << 16) | + ((in[6] - in[5]) << 32) | + ((in[7] - in[6]) << 48) + out[2] = + in[8] - in[7] | + ((in[9] - in[8]) << 16) | + ((in[10] - in[9]) << 32) | + ((in[11] - in[10]) << 48) + out[3] = + in[12] - in[11] | + ((in[13] - in[12]) << 16) | + ((in[14] - in[13]) << 32) | + ((in[15] - in[14]) << 48) + out[4] = + in[16] - in[15] | + ((in[17] - in[16]) << 16) | + ((in[18] - in[17]) << 32) | + ((in[19] - in[18]) << 48) + out[5] = + in[20] - in[19] | + ((in[21] - in[20]) << 16) | + ((in[22] - in[21]) << 32) | + ((in[23] - in[22]) << 48) + out[6] = + in[24] - in[23] | + ((in[25] - in[24]) << 16) | + ((in[26] - in[25]) << 32) | + ((in[27] - in[26]) << 48) + out[7] = + in[28] - in[27] | + ((in[29] - in[28]) << 16) | + ((in[30] - in[29]) << 32) | + ((in[31] - in[30]) << 48) + out[8] = + in[32] - in[31] | + ((in[33] - in[32]) << 16) | + ((in[34] - in[33]) << 32) | + ((in[35] - in[34]) << 48) + out[9] = + in[36] - in[35] | + ((in[37] - in[36]) << 16) | + ((in[38] - in[37]) << 32) | + ((in[39] - in[38]) << 48) + out[10] = + in[40] - in[39] | + ((in[41] - in[40]) << 16) | + ((in[42] - in[41]) << 32) | + ((in[43] - in[42]) << 48) + out[11] = + in[44] - in[43] | + ((in[45] - in[44]) << 16) | + ((in[46] - in[45]) << 32) | + ((in[47] - in[46]) << 48) + out[12] = + in[48] - in[47] | + ((in[49] - in[48]) << 16) | + ((in[50] - in[49]) << 32) | + ((in[51] - in[50]) << 48) + out[13] = + in[52] - in[51] | + ((in[53] - in[52]) << 16) | + ((in[54] - in[53]) << 32) | + ((in[55] - in[54]) << 48) + out[14] = + in[56] - in[55] | + ((in[57] - in[56]) << 16) | + ((in[58] - in[57]) << 32) | + ((in[59] - in[58]) << 48) + out[15] = + in[60] - in[59] | + ((in[61] - in[60]) << 16) | + ((in[62] - in[61]) << 32) | + ((in[63] - in[62]) << 48) +} + +func deltapack_uint64_17(initoffset uint64, in *[64]uint64, out *[17]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 17) | + ((in[2] - in[1]) << 34) | + ((in[3] - in[2]) << 51) + out[1] = + (in[3] - in[2]) >> 13 | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 21) | + ((in[6] - in[5]) << 38) | + ((in[7] - in[6]) << 55) + out[2] = + (in[7] - in[6]) >> 9 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 25) | + ((in[10] - in[9]) << 42) | + ((in[11] - in[10]) << 59) + out[3] = + (in[11] - in[10]) >> 5 | + ((in[12] - in[11]) << 12) | + ((in[13] - in[12]) << 29) | + ((in[14] - in[13]) << 46) | + ((in[15] - in[14]) << 63) + out[4] = + (in[15] - in[14]) >> 1 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 33) | + ((in[18] - in[17]) << 50) + out[5] = + (in[18] - in[17]) >> 14 | + ((in[19] - in[18]) << 3) | + ((in[20] - in[19]) << 20) | + ((in[21] - in[20]) << 37) | + ((in[22] - in[21]) << 54) + out[6] = + (in[22] - in[21]) >> 10 | + ((in[23] - in[22]) << 7) | + ((in[24] - in[23]) << 24) | + ((in[25] - in[24]) << 41) | + ((in[26] - in[25]) << 58) + out[7] = + (in[26] - in[25]) >> 6 | + ((in[27] - in[26]) << 11) | + ((in[28] - in[27]) << 28) | + ((in[29] - in[28]) << 45) | + ((in[30] - in[29]) << 62) + out[8] = + (in[30] - in[29]) >> 2 | + ((in[31] - in[30]) << 15) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 49) + out[9] = + (in[33] - in[32]) >> 15 | + ((in[34] - in[33]) << 2) | + ((in[35] - in[34]) << 19) | + ((in[36] - in[35]) << 36) | + ((in[37] - in[36]) << 53) + out[10] = + (in[37] - in[36]) >> 11 | + ((in[38] - in[37]) << 6) | + ((in[39] - in[38]) << 23) | + ((in[40] - in[39]) << 40) | + ((in[41] - in[40]) << 57) + out[11] = + (in[41] - in[40]) >> 7 | + ((in[42] - in[41]) << 10) | + ((in[43] - in[42]) << 27) | + ((in[44] - in[43]) << 44) | + ((in[45] - in[44]) << 61) + out[12] = + (in[45] - in[44]) >> 3 | + ((in[46] - in[45]) << 14) | + ((in[47] - in[46]) << 31) | + ((in[48] - in[47]) << 48) + out[13] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 1) | + ((in[50] - in[49]) << 18) | + ((in[51] - in[50]) << 35) | + ((in[52] - in[51]) << 52) + out[14] = + (in[52] - in[51]) >> 12 | + ((in[53] - in[52]) << 5) | + ((in[54] - in[53]) << 22) | + ((in[55] - in[54]) << 39) | + ((in[56] - in[55]) << 56) + out[15] = + (in[56] - in[55]) >> 8 | + ((in[57] - in[56]) << 9) | + ((in[58] - in[57]) << 26) | + ((in[59] - in[58]) << 43) | + ((in[60] - in[59]) << 60) + out[16] = + (in[60] - in[59]) >> 4 | + ((in[61] - in[60]) << 13) | + ((in[62] - in[61]) << 30) | + ((in[63] - in[62]) << 47) +} + +func deltapack_uint64_18(initoffset uint64, in *[64]uint64, out *[18]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 18) | + ((in[2] - in[1]) << 36) | + ((in[3] - in[2]) << 54) + out[1] = + (in[3] - in[2]) >> 10 | + ((in[4] - in[3]) << 8) | + ((in[5] - in[4]) << 26) | + ((in[6] - in[5]) << 44) | + ((in[7] - in[6]) << 62) + out[2] = + (in[7] - in[6]) >> 2 | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 34) | + ((in[10] - in[9]) << 52) + out[3] = + (in[10] - in[9]) >> 12 | + ((in[11] - in[10]) << 6) | + ((in[12] - in[11]) << 24) | + ((in[13] - in[12]) << 42) | + ((in[14] - in[13]) << 60) + out[4] = + (in[14] - in[13]) >> 4 | + ((in[15] - in[14]) << 14) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 50) + out[5] = + (in[17] - in[16]) >> 14 | + ((in[18] - in[17]) << 4) | + ((in[19] - in[18]) << 22) | + ((in[20] - in[19]) << 40) | + ((in[21] - in[20]) << 58) + out[6] = + (in[21] - in[20]) >> 6 | + ((in[22] - in[21]) << 12) | + ((in[23] - in[22]) << 30) | + ((in[24] - in[23]) << 48) + out[7] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 2) | + ((in[26] - in[25]) << 20) | + ((in[27] - in[26]) << 38) | + ((in[28] - in[27]) << 56) + out[8] = + (in[28] - in[27]) >> 8 | + ((in[29] - in[28]) << 10) | + ((in[30] - in[29]) << 28) | + ((in[31] - in[30]) << 46) + out[9] = + in[32] - in[31] | + ((in[33] - in[32]) << 18) | + ((in[34] - in[33]) << 36) | + ((in[35] - in[34]) << 54) + out[10] = + (in[35] - in[34]) >> 10 | + ((in[36] - in[35]) << 8) | + ((in[37] - in[36]) << 26) | + ((in[38] - in[37]) << 44) | + ((in[39] - in[38]) << 62) + out[11] = + (in[39] - in[38]) >> 2 | + ((in[40] - in[39]) << 16) | + ((in[41] - in[40]) << 34) | + ((in[42] - in[41]) << 52) + out[12] = + (in[42] - in[41]) >> 12 | + ((in[43] - in[42]) << 6) | + ((in[44] - in[43]) << 24) | + ((in[45] - in[44]) << 42) | + ((in[46] - in[45]) << 60) + out[13] = + (in[46] - in[45]) >> 4 | + ((in[47] - in[46]) << 14) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 50) + out[14] = + (in[49] - in[48]) >> 14 | + ((in[50] - in[49]) << 4) | + ((in[51] - in[50]) << 22) | + ((in[52] - in[51]) << 40) | + ((in[53] - in[52]) << 58) + out[15] = + (in[53] - in[52]) >> 6 | + ((in[54] - in[53]) << 12) | + ((in[55] - in[54]) << 30) | + ((in[56] - in[55]) << 48) + out[16] = + (in[56] - in[55]) >> 16 | + ((in[57] - in[56]) << 2) | + ((in[58] - in[57]) << 20) | + ((in[59] - in[58]) << 38) | + ((in[60] - in[59]) << 56) + out[17] = + (in[60] - in[59]) >> 8 | + ((in[61] - in[60]) << 10) | + ((in[62] - in[61]) << 28) | + ((in[63] - in[62]) << 46) +} + +func deltapack_uint64_19(initoffset uint64, in *[64]uint64, out *[19]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 19) | + ((in[2] - in[1]) << 38) | + ((in[3] - in[2]) << 57) + out[1] = + (in[3] - in[2]) >> 7 | + ((in[4] - in[3]) << 12) | + ((in[5] - in[4]) << 31) | + ((in[6] - in[5]) << 50) + out[2] = + (in[6] - in[5]) >> 14 | + ((in[7] - in[6]) << 5) | + ((in[8] - in[7]) << 24) | + ((in[9] - in[8]) << 43) | + ((in[10] - in[9]) << 62) + out[3] = + (in[10] - in[9]) >> 2 | + ((in[11] - in[10]) << 17) | + ((in[12] - in[11]) << 36) | + ((in[13] - in[12]) << 55) + out[4] = + (in[13] - in[12]) >> 9 | + ((in[14] - in[13]) << 10) | + ((in[15] - in[14]) << 29) | + ((in[16] - in[15]) << 48) + out[5] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 3) | + ((in[18] - in[17]) << 22) | + ((in[19] - in[18]) << 41) | + ((in[20] - in[19]) << 60) + out[6] = + (in[20] - in[19]) >> 4 | + ((in[21] - in[20]) << 15) | + ((in[22] - in[21]) << 34) | + ((in[23] - in[22]) << 53) + out[7] = + (in[23] - in[22]) >> 11 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 27) | + ((in[26] - in[25]) << 46) + out[8] = + (in[26] - in[25]) >> 18 | + ((in[27] - in[26]) << 1) | + ((in[28] - in[27]) << 20) | + ((in[29] - in[28]) << 39) | + ((in[30] - in[29]) << 58) + out[9] = + (in[30] - in[29]) >> 6 | + ((in[31] - in[30]) << 13) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 51) + out[10] = + (in[33] - in[32]) >> 13 | + ((in[34] - in[33]) << 6) | + ((in[35] - in[34]) << 25) | + ((in[36] - in[35]) << 44) | + ((in[37] - in[36]) << 63) + out[11] = + (in[37] - in[36]) >> 1 | + ((in[38] - in[37]) << 18) | + ((in[39] - in[38]) << 37) | + ((in[40] - in[39]) << 56) + out[12] = + (in[40] - in[39]) >> 8 | + ((in[41] - in[40]) << 11) | + ((in[42] - in[41]) << 30) | + ((in[43] - in[42]) << 49) + out[13] = + (in[43] - in[42]) >> 15 | + ((in[44] - in[43]) << 4) | + ((in[45] - in[44]) << 23) | + ((in[46] - in[45]) << 42) | + ((in[47] - in[46]) << 61) + out[14] = + (in[47] - in[46]) >> 3 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 35) | + ((in[50] - in[49]) << 54) + out[15] = + (in[50] - in[49]) >> 10 | + ((in[51] - in[50]) << 9) | + ((in[52] - in[51]) << 28) | + ((in[53] - in[52]) << 47) + out[16] = + (in[53] - in[52]) >> 17 | + ((in[54] - in[53]) << 2) | + ((in[55] - in[54]) << 21) | + ((in[56] - in[55]) << 40) | + ((in[57] - in[56]) << 59) + out[17] = + (in[57] - in[56]) >> 5 | + ((in[58] - in[57]) << 14) | + ((in[59] - in[58]) << 33) | + ((in[60] - in[59]) << 52) + out[18] = + (in[60] - in[59]) >> 12 | + ((in[61] - in[60]) << 7) | + ((in[62] - in[61]) << 26) | + ((in[63] - in[62]) << 45) +} + +func deltapack_uint64_20(initoffset uint64, in *[64]uint64, out *[20]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 20) | + ((in[2] - in[1]) << 40) | + ((in[3] - in[2]) << 60) + out[1] = + (in[3] - in[2]) >> 4 | + ((in[4] - in[3]) << 16) | + ((in[5] - in[4]) << 36) | + ((in[6] - in[5]) << 56) + out[2] = + (in[6] - in[5]) >> 8 | + ((in[7] - in[6]) << 12) | + ((in[8] - in[7]) << 32) | + ((in[9] - in[8]) << 52) + out[3] = + (in[9] - in[8]) >> 12 | + ((in[10] - in[9]) << 8) | + ((in[11] - in[10]) << 28) | + ((in[12] - in[11]) << 48) + out[4] = + (in[12] - in[11]) >> 16 | + ((in[13] - in[12]) << 4) | + ((in[14] - in[13]) << 24) | + ((in[15] - in[14]) << 44) + out[5] = + in[16] - in[15] | + ((in[17] - in[16]) << 20) | + ((in[18] - in[17]) << 40) | + ((in[19] - in[18]) << 60) + out[6] = + (in[19] - in[18]) >> 4 | + ((in[20] - in[19]) << 16) | + ((in[21] - in[20]) << 36) | + ((in[22] - in[21]) << 56) + out[7] = + (in[22] - in[21]) >> 8 | + ((in[23] - in[22]) << 12) | + ((in[24] - in[23]) << 32) | + ((in[25] - in[24]) << 52) + out[8] = + (in[25] - in[24]) >> 12 | + ((in[26] - in[25]) << 8) | + ((in[27] - in[26]) << 28) | + ((in[28] - in[27]) << 48) + out[9] = + (in[28] - in[27]) >> 16 | + ((in[29] - in[28]) << 4) | + ((in[30] - in[29]) << 24) | + ((in[31] - in[30]) << 44) + out[10] = + in[32] - in[31] | + ((in[33] - in[32]) << 20) | + ((in[34] - in[33]) << 40) | + ((in[35] - in[34]) << 60) + out[11] = + (in[35] - in[34]) >> 4 | + ((in[36] - in[35]) << 16) | + ((in[37] - in[36]) << 36) | + ((in[38] - in[37]) << 56) + out[12] = + (in[38] - in[37]) >> 8 | + ((in[39] - in[38]) << 12) | + ((in[40] - in[39]) << 32) | + ((in[41] - in[40]) << 52) + out[13] = + (in[41] - in[40]) >> 12 | + ((in[42] - in[41]) << 8) | + ((in[43] - in[42]) << 28) | + ((in[44] - in[43]) << 48) + out[14] = + (in[44] - in[43]) >> 16 | + ((in[45] - in[44]) << 4) | + ((in[46] - in[45]) << 24) | + ((in[47] - in[46]) << 44) + out[15] = + in[48] - in[47] | + ((in[49] - in[48]) << 20) | + ((in[50] - in[49]) << 40) | + ((in[51] - in[50]) << 60) + out[16] = + (in[51] - in[50]) >> 4 | + ((in[52] - in[51]) << 16) | + ((in[53] - in[52]) << 36) | + ((in[54] - in[53]) << 56) + out[17] = + (in[54] - in[53]) >> 8 | + ((in[55] - in[54]) << 12) | + ((in[56] - in[55]) << 32) | + ((in[57] - in[56]) << 52) + out[18] = + (in[57] - in[56]) >> 12 | + ((in[58] - in[57]) << 8) | + ((in[59] - in[58]) << 28) | + ((in[60] - in[59]) << 48) + out[19] = + (in[60] - in[59]) >> 16 | + ((in[61] - in[60]) << 4) | + ((in[62] - in[61]) << 24) | + ((in[63] - in[62]) << 44) +} + +func deltapack_uint64_21(initoffset uint64, in *[64]uint64, out *[21]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 21) | + ((in[2] - in[1]) << 42) | + ((in[3] - in[2]) << 63) + out[1] = + (in[3] - in[2]) >> 1 | + ((in[4] - in[3]) << 20) | + ((in[5] - in[4]) << 41) | + ((in[6] - in[5]) << 62) + out[2] = + (in[6] - in[5]) >> 2 | + ((in[7] - in[6]) << 19) | + ((in[8] - in[7]) << 40) | + ((in[9] - in[8]) << 61) + out[3] = + (in[9] - in[8]) >> 3 | + ((in[10] - in[9]) << 18) | + ((in[11] - in[10]) << 39) | + ((in[12] - in[11]) << 60) + out[4] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 17) | + ((in[14] - in[13]) << 38) | + ((in[15] - in[14]) << 59) + out[5] = + (in[15] - in[14]) >> 5 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 37) | + ((in[18] - in[17]) << 58) + out[6] = + (in[18] - in[17]) >> 6 | + ((in[19] - in[18]) << 15) | + ((in[20] - in[19]) << 36) | + ((in[21] - in[20]) << 57) + out[7] = + (in[21] - in[20]) >> 7 | + ((in[22] - in[21]) << 14) | + ((in[23] - in[22]) << 35) | + ((in[24] - in[23]) << 56) + out[8] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 13) | + ((in[26] - in[25]) << 34) | + ((in[27] - in[26]) << 55) + out[9] = + (in[27] - in[26]) >> 9 | + ((in[28] - in[27]) << 12) | + ((in[29] - in[28]) << 33) | + ((in[30] - in[29]) << 54) + out[10] = + (in[30] - in[29]) >> 10 | + ((in[31] - in[30]) << 11) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 53) + out[11] = + (in[33] - in[32]) >> 11 | + ((in[34] - in[33]) << 10) | + ((in[35] - in[34]) << 31) | + ((in[36] - in[35]) << 52) + out[12] = + (in[36] - in[35]) >> 12 | + ((in[37] - in[36]) << 9) | + ((in[38] - in[37]) << 30) | + ((in[39] - in[38]) << 51) + out[13] = + (in[39] - in[38]) >> 13 | + ((in[40] - in[39]) << 8) | + ((in[41] - in[40]) << 29) | + ((in[42] - in[41]) << 50) + out[14] = + (in[42] - in[41]) >> 14 | + ((in[43] - in[42]) << 7) | + ((in[44] - in[43]) << 28) | + ((in[45] - in[44]) << 49) + out[15] = + (in[45] - in[44]) >> 15 | + ((in[46] - in[45]) << 6) | + ((in[47] - in[46]) << 27) | + ((in[48] - in[47]) << 48) + out[16] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 5) | + ((in[50] - in[49]) << 26) | + ((in[51] - in[50]) << 47) + out[17] = + (in[51] - in[50]) >> 17 | + ((in[52] - in[51]) << 4) | + ((in[53] - in[52]) << 25) | + ((in[54] - in[53]) << 46) + out[18] = + (in[54] - in[53]) >> 18 | + ((in[55] - in[54]) << 3) | + ((in[56] - in[55]) << 24) | + ((in[57] - in[56]) << 45) + out[19] = + (in[57] - in[56]) >> 19 | + ((in[58] - in[57]) << 2) | + ((in[59] - in[58]) << 23) | + ((in[60] - in[59]) << 44) + out[20] = + (in[60] - in[59]) >> 20 | + ((in[61] - in[60]) << 1) | + ((in[62] - in[61]) << 22) | + ((in[63] - in[62]) << 43) +} + +func deltapack_uint64_22(initoffset uint64, in *[64]uint64, out *[22]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 22) | + ((in[2] - in[1]) << 44) + out[1] = + (in[2] - in[1]) >> 20 | + ((in[3] - in[2]) << 2) | + ((in[4] - in[3]) << 24) | + ((in[5] - in[4]) << 46) + out[2] = + (in[5] - in[4]) >> 18 | + ((in[6] - in[5]) << 4) | + ((in[7] - in[6]) << 26) | + ((in[8] - in[7]) << 48) + out[3] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 6) | + ((in[10] - in[9]) << 28) | + ((in[11] - in[10]) << 50) + out[4] = + (in[11] - in[10]) >> 14 | + ((in[12] - in[11]) << 8) | + ((in[13] - in[12]) << 30) | + ((in[14] - in[13]) << 52) + out[5] = + (in[14] - in[13]) >> 12 | + ((in[15] - in[14]) << 10) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 54) + out[6] = + (in[17] - in[16]) >> 10 | + ((in[18] - in[17]) << 12) | + ((in[19] - in[18]) << 34) | + ((in[20] - in[19]) << 56) + out[7] = + (in[20] - in[19]) >> 8 | + ((in[21] - in[20]) << 14) | + ((in[22] - in[21]) << 36) | + ((in[23] - in[22]) << 58) + out[8] = + (in[23] - in[22]) >> 6 | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 38) | + ((in[26] - in[25]) << 60) + out[9] = + (in[26] - in[25]) >> 4 | + ((in[27] - in[26]) << 18) | + ((in[28] - in[27]) << 40) | + ((in[29] - in[28]) << 62) + out[10] = + (in[29] - in[28]) >> 2 | + ((in[30] - in[29]) << 20) | + ((in[31] - in[30]) << 42) + out[11] = + in[32] - in[31] | + ((in[33] - in[32]) << 22) | + ((in[34] - in[33]) << 44) + out[12] = + (in[34] - in[33]) >> 20 | + ((in[35] - in[34]) << 2) | + ((in[36] - in[35]) << 24) | + ((in[37] - in[36]) << 46) + out[13] = + (in[37] - in[36]) >> 18 | + ((in[38] - in[37]) << 4) | + ((in[39] - in[38]) << 26) | + ((in[40] - in[39]) << 48) + out[14] = + (in[40] - in[39]) >> 16 | + ((in[41] - in[40]) << 6) | + ((in[42] - in[41]) << 28) | + ((in[43] - in[42]) << 50) + out[15] = + (in[43] - in[42]) >> 14 | + ((in[44] - in[43]) << 8) | + ((in[45] - in[44]) << 30) | + ((in[46] - in[45]) << 52) + out[16] = + (in[46] - in[45]) >> 12 | + ((in[47] - in[46]) << 10) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 54) + out[17] = + (in[49] - in[48]) >> 10 | + ((in[50] - in[49]) << 12) | + ((in[51] - in[50]) << 34) | + ((in[52] - in[51]) << 56) + out[18] = + (in[52] - in[51]) >> 8 | + ((in[53] - in[52]) << 14) | + ((in[54] - in[53]) << 36) | + ((in[55] - in[54]) << 58) + out[19] = + (in[55] - in[54]) >> 6 | + ((in[56] - in[55]) << 16) | + ((in[57] - in[56]) << 38) | + ((in[58] - in[57]) << 60) + out[20] = + (in[58] - in[57]) >> 4 | + ((in[59] - in[58]) << 18) | + ((in[60] - in[59]) << 40) | + ((in[61] - in[60]) << 62) + out[21] = + (in[61] - in[60]) >> 2 | + ((in[62] - in[61]) << 20) | + ((in[63] - in[62]) << 42) +} + +func deltapack_uint64_23(initoffset uint64, in *[64]uint64, out *[23]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 23) | + ((in[2] - in[1]) << 46) + out[1] = + (in[2] - in[1]) >> 18 | + ((in[3] - in[2]) << 5) | + ((in[4] - in[3]) << 28) | + ((in[5] - in[4]) << 51) + out[2] = + (in[5] - in[4]) >> 13 | + ((in[6] - in[5]) << 10) | + ((in[7] - in[6]) << 33) | + ((in[8] - in[7]) << 56) + out[3] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 15) | + ((in[10] - in[9]) << 38) | + ((in[11] - in[10]) << 61) + out[4] = + (in[11] - in[10]) >> 3 | + ((in[12] - in[11]) << 20) | + ((in[13] - in[12]) << 43) + out[5] = + (in[13] - in[12]) >> 21 | + ((in[14] - in[13]) << 2) | + ((in[15] - in[14]) << 25) | + ((in[16] - in[15]) << 48) + out[6] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 7) | + ((in[18] - in[17]) << 30) | + ((in[19] - in[18]) << 53) + out[7] = + (in[19] - in[18]) >> 11 | + ((in[20] - in[19]) << 12) | + ((in[21] - in[20]) << 35) | + ((in[22] - in[21]) << 58) + out[8] = + (in[22] - in[21]) >> 6 | + ((in[23] - in[22]) << 17) | + ((in[24] - in[23]) << 40) | + ((in[25] - in[24]) << 63) + out[9] = + (in[25] - in[24]) >> 1 | + ((in[26] - in[25]) << 22) | + ((in[27] - in[26]) << 45) + out[10] = + (in[27] - in[26]) >> 19 | + ((in[28] - in[27]) << 4) | + ((in[29] - in[28]) << 27) | + ((in[30] - in[29]) << 50) + out[11] = + (in[30] - in[29]) >> 14 | + ((in[31] - in[30]) << 9) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 55) + out[12] = + (in[33] - in[32]) >> 9 | + ((in[34] - in[33]) << 14) | + ((in[35] - in[34]) << 37) | + ((in[36] - in[35]) << 60) + out[13] = + (in[36] - in[35]) >> 4 | + ((in[37] - in[36]) << 19) | + ((in[38] - in[37]) << 42) + out[14] = + (in[38] - in[37]) >> 22 | + ((in[39] - in[38]) << 1) | + ((in[40] - in[39]) << 24) | + ((in[41] - in[40]) << 47) + out[15] = + (in[41] - in[40]) >> 17 | + ((in[42] - in[41]) << 6) | + ((in[43] - in[42]) << 29) | + ((in[44] - in[43]) << 52) + out[16] = + (in[44] - in[43]) >> 12 | + ((in[45] - in[44]) << 11) | + ((in[46] - in[45]) << 34) | + ((in[47] - in[46]) << 57) + out[17] = + (in[47] - in[46]) >> 7 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 39) | + ((in[50] - in[49]) << 62) + out[18] = + (in[50] - in[49]) >> 2 | + ((in[51] - in[50]) << 21) | + ((in[52] - in[51]) << 44) + out[19] = + (in[52] - in[51]) >> 20 | + ((in[53] - in[52]) << 3) | + ((in[54] - in[53]) << 26) | + ((in[55] - in[54]) << 49) + out[20] = + (in[55] - in[54]) >> 15 | + ((in[56] - in[55]) << 8) | + ((in[57] - in[56]) << 31) | + ((in[58] - in[57]) << 54) + out[21] = + (in[58] - in[57]) >> 10 | + ((in[59] - in[58]) << 13) | + ((in[60] - in[59]) << 36) | + ((in[61] - in[60]) << 59) + out[22] = + (in[61] - in[60]) >> 5 | + ((in[62] - in[61]) << 18) | + ((in[63] - in[62]) << 41) +} + +func deltapack_uint64_24(initoffset uint64, in *[64]uint64, out *[24]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 24) | + ((in[2] - in[1]) << 48) + out[1] = + (in[2] - in[1]) >> 16 | + ((in[3] - in[2]) << 8) | + ((in[4] - in[3]) << 32) | + ((in[5] - in[4]) << 56) + out[2] = + (in[5] - in[4]) >> 8 | + ((in[6] - in[5]) << 16) | + ((in[7] - in[6]) << 40) + out[3] = + in[8] - in[7] | + ((in[9] - in[8]) << 24) | + ((in[10] - in[9]) << 48) + out[4] = + (in[10] - in[9]) >> 16 | + ((in[11] - in[10]) << 8) | + ((in[12] - in[11]) << 32) | + ((in[13] - in[12]) << 56) + out[5] = + (in[13] - in[12]) >> 8 | + ((in[14] - in[13]) << 16) | + ((in[15] - in[14]) << 40) + out[6] = + in[16] - in[15] | + ((in[17] - in[16]) << 24) | + ((in[18] - in[17]) << 48) + out[7] = + (in[18] - in[17]) >> 16 | + ((in[19] - in[18]) << 8) | + ((in[20] - in[19]) << 32) | + ((in[21] - in[20]) << 56) + out[8] = + (in[21] - in[20]) >> 8 | + ((in[22] - in[21]) << 16) | + ((in[23] - in[22]) << 40) + out[9] = + in[24] - in[23] | + ((in[25] - in[24]) << 24) | + ((in[26] - in[25]) << 48) + out[10] = + (in[26] - in[25]) >> 16 | + ((in[27] - in[26]) << 8) | + ((in[28] - in[27]) << 32) | + ((in[29] - in[28]) << 56) + out[11] = + (in[29] - in[28]) >> 8 | + ((in[30] - in[29]) << 16) | + ((in[31] - in[30]) << 40) + out[12] = + in[32] - in[31] | + ((in[33] - in[32]) << 24) | + ((in[34] - in[33]) << 48) + out[13] = + (in[34] - in[33]) >> 16 | + ((in[35] - in[34]) << 8) | + ((in[36] - in[35]) << 32) | + ((in[37] - in[36]) << 56) + out[14] = + (in[37] - in[36]) >> 8 | + ((in[38] - in[37]) << 16) | + ((in[39] - in[38]) << 40) + out[15] = + in[40] - in[39] | + ((in[41] - in[40]) << 24) | + ((in[42] - in[41]) << 48) + out[16] = + (in[42] - in[41]) >> 16 | + ((in[43] - in[42]) << 8) | + ((in[44] - in[43]) << 32) | + ((in[45] - in[44]) << 56) + out[17] = + (in[45] - in[44]) >> 8 | + ((in[46] - in[45]) << 16) | + ((in[47] - in[46]) << 40) + out[18] = + in[48] - in[47] | + ((in[49] - in[48]) << 24) | + ((in[50] - in[49]) << 48) + out[19] = + (in[50] - in[49]) >> 16 | + ((in[51] - in[50]) << 8) | + ((in[52] - in[51]) << 32) | + ((in[53] - in[52]) << 56) + out[20] = + (in[53] - in[52]) >> 8 | + ((in[54] - in[53]) << 16) | + ((in[55] - in[54]) << 40) + out[21] = + in[56] - in[55] | + ((in[57] - in[56]) << 24) | + ((in[58] - in[57]) << 48) + out[22] = + (in[58] - in[57]) >> 16 | + ((in[59] - in[58]) << 8) | + ((in[60] - in[59]) << 32) | + ((in[61] - in[60]) << 56) + out[23] = + (in[61] - in[60]) >> 8 | + ((in[62] - in[61]) << 16) | + ((in[63] - in[62]) << 40) +} + +func deltapack_uint64_25(initoffset uint64, in *[64]uint64, out *[25]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 25) | + ((in[2] - in[1]) << 50) + out[1] = + (in[2] - in[1]) >> 14 | + ((in[3] - in[2]) << 11) | + ((in[4] - in[3]) << 36) | + ((in[5] - in[4]) << 61) + out[2] = + (in[5] - in[4]) >> 3 | + ((in[6] - in[5]) << 22) | + ((in[7] - in[6]) << 47) + out[3] = + (in[7] - in[6]) >> 17 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 33) | + ((in[10] - in[9]) << 58) + out[4] = + (in[10] - in[9]) >> 6 | + ((in[11] - in[10]) << 19) | + ((in[12] - in[11]) << 44) + out[5] = + (in[12] - in[11]) >> 20 | + ((in[13] - in[12]) << 5) | + ((in[14] - in[13]) << 30) | + ((in[15] - in[14]) << 55) + out[6] = + (in[15] - in[14]) >> 9 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 41) + out[7] = + (in[17] - in[16]) >> 23 | + ((in[18] - in[17]) << 2) | + ((in[19] - in[18]) << 27) | + ((in[20] - in[19]) << 52) + out[8] = + (in[20] - in[19]) >> 12 | + ((in[21] - in[20]) << 13) | + ((in[22] - in[21]) << 38) | + ((in[23] - in[22]) << 63) + out[9] = + (in[23] - in[22]) >> 1 | + ((in[24] - in[23]) << 24) | + ((in[25] - in[24]) << 49) + out[10] = + (in[25] - in[24]) >> 15 | + ((in[26] - in[25]) << 10) | + ((in[27] - in[26]) << 35) | + ((in[28] - in[27]) << 60) + out[11] = + (in[28] - in[27]) >> 4 | + ((in[29] - in[28]) << 21) | + ((in[30] - in[29]) << 46) + out[12] = + (in[30] - in[29]) >> 18 | + ((in[31] - in[30]) << 7) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 57) + out[13] = + (in[33] - in[32]) >> 7 | + ((in[34] - in[33]) << 18) | + ((in[35] - in[34]) << 43) + out[14] = + (in[35] - in[34]) >> 21 | + ((in[36] - in[35]) << 4) | + ((in[37] - in[36]) << 29) | + ((in[38] - in[37]) << 54) + out[15] = + (in[38] - in[37]) >> 10 | + ((in[39] - in[38]) << 15) | + ((in[40] - in[39]) << 40) + out[16] = + (in[40] - in[39]) >> 24 | + ((in[41] - in[40]) << 1) | + ((in[42] - in[41]) << 26) | + ((in[43] - in[42]) << 51) + out[17] = + (in[43] - in[42]) >> 13 | + ((in[44] - in[43]) << 12) | + ((in[45] - in[44]) << 37) | + ((in[46] - in[45]) << 62) + out[18] = + (in[46] - in[45]) >> 2 | + ((in[47] - in[46]) << 23) | + ((in[48] - in[47]) << 48) + out[19] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 9) | + ((in[50] - in[49]) << 34) | + ((in[51] - in[50]) << 59) + out[20] = + (in[51] - in[50]) >> 5 | + ((in[52] - in[51]) << 20) | + ((in[53] - in[52]) << 45) + out[21] = + (in[53] - in[52]) >> 19 | + ((in[54] - in[53]) << 6) | + ((in[55] - in[54]) << 31) | + ((in[56] - in[55]) << 56) + out[22] = + (in[56] - in[55]) >> 8 | + ((in[57] - in[56]) << 17) | + ((in[58] - in[57]) << 42) + out[23] = + (in[58] - in[57]) >> 22 | + ((in[59] - in[58]) << 3) | + ((in[60] - in[59]) << 28) | + ((in[61] - in[60]) << 53) + out[24] = + (in[61] - in[60]) >> 11 | + ((in[62] - in[61]) << 14) | + ((in[63] - in[62]) << 39) +} + +func deltapack_uint64_26(initoffset uint64, in *[64]uint64, out *[26]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 26) | + ((in[2] - in[1]) << 52) + out[1] = + (in[2] - in[1]) >> 12 | + ((in[3] - in[2]) << 14) | + ((in[4] - in[3]) << 40) + out[2] = + (in[4] - in[3]) >> 24 | + ((in[5] - in[4]) << 2) | + ((in[6] - in[5]) << 28) | + ((in[7] - in[6]) << 54) + out[3] = + (in[7] - in[6]) >> 10 | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 42) + out[4] = + (in[9] - in[8]) >> 22 | + ((in[10] - in[9]) << 4) | + ((in[11] - in[10]) << 30) | + ((in[12] - in[11]) << 56) + out[5] = + (in[12] - in[11]) >> 8 | + ((in[13] - in[12]) << 18) | + ((in[14] - in[13]) << 44) + out[6] = + (in[14] - in[13]) >> 20 | + ((in[15] - in[14]) << 6) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 58) + out[7] = + (in[17] - in[16]) >> 6 | + ((in[18] - in[17]) << 20) | + ((in[19] - in[18]) << 46) + out[8] = + (in[19] - in[18]) >> 18 | + ((in[20] - in[19]) << 8) | + ((in[21] - in[20]) << 34) | + ((in[22] - in[21]) << 60) + out[9] = + (in[22] - in[21]) >> 4 | + ((in[23] - in[22]) << 22) | + ((in[24] - in[23]) << 48) + out[10] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 10) | + ((in[26] - in[25]) << 36) | + ((in[27] - in[26]) << 62) + out[11] = + (in[27] - in[26]) >> 2 | + ((in[28] - in[27]) << 24) | + ((in[29] - in[28]) << 50) + out[12] = + (in[29] - in[28]) >> 14 | + ((in[30] - in[29]) << 12) | + ((in[31] - in[30]) << 38) + out[13] = + in[32] - in[31] | + ((in[33] - in[32]) << 26) | + ((in[34] - in[33]) << 52) + out[14] = + (in[34] - in[33]) >> 12 | + ((in[35] - in[34]) << 14) | + ((in[36] - in[35]) << 40) + out[15] = + (in[36] - in[35]) >> 24 | + ((in[37] - in[36]) << 2) | + ((in[38] - in[37]) << 28) | + ((in[39] - in[38]) << 54) + out[16] = + (in[39] - in[38]) >> 10 | + ((in[40] - in[39]) << 16) | + ((in[41] - in[40]) << 42) + out[17] = + (in[41] - in[40]) >> 22 | + ((in[42] - in[41]) << 4) | + ((in[43] - in[42]) << 30) | + ((in[44] - in[43]) << 56) + out[18] = + (in[44] - in[43]) >> 8 | + ((in[45] - in[44]) << 18) | + ((in[46] - in[45]) << 44) + out[19] = + (in[46] - in[45]) >> 20 | + ((in[47] - in[46]) << 6) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 58) + out[20] = + (in[49] - in[48]) >> 6 | + ((in[50] - in[49]) << 20) | + ((in[51] - in[50]) << 46) + out[21] = + (in[51] - in[50]) >> 18 | + ((in[52] - in[51]) << 8) | + ((in[53] - in[52]) << 34) | + ((in[54] - in[53]) << 60) + out[22] = + (in[54] - in[53]) >> 4 | + ((in[55] - in[54]) << 22) | + ((in[56] - in[55]) << 48) + out[23] = + (in[56] - in[55]) >> 16 | + ((in[57] - in[56]) << 10) | + ((in[58] - in[57]) << 36) | + ((in[59] - in[58]) << 62) + out[24] = + (in[59] - in[58]) >> 2 | + ((in[60] - in[59]) << 24) | + ((in[61] - in[60]) << 50) + out[25] = + (in[61] - in[60]) >> 14 | + ((in[62] - in[61]) << 12) | + ((in[63] - in[62]) << 38) +} + +func deltapack_uint64_27(initoffset uint64, in *[64]uint64, out *[27]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 27) | + ((in[2] - in[1]) << 54) + out[1] = + (in[2] - in[1]) >> 10 | + ((in[3] - in[2]) << 17) | + ((in[4] - in[3]) << 44) + out[2] = + (in[4] - in[3]) >> 20 | + ((in[5] - in[4]) << 7) | + ((in[6] - in[5]) << 34) | + ((in[7] - in[6]) << 61) + out[3] = + (in[7] - in[6]) >> 3 | + ((in[8] - in[7]) << 24) | + ((in[9] - in[8]) << 51) + out[4] = + (in[9] - in[8]) >> 13 | + ((in[10] - in[9]) << 14) | + ((in[11] - in[10]) << 41) + out[5] = + (in[11] - in[10]) >> 23 | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 31) | + ((in[14] - in[13]) << 58) + out[6] = + (in[14] - in[13]) >> 6 | + ((in[15] - in[14]) << 21) | + ((in[16] - in[15]) << 48) + out[7] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 11) | + ((in[18] - in[17]) << 38) + out[8] = + (in[18] - in[17]) >> 26 | + ((in[19] - in[18]) << 1) | + ((in[20] - in[19]) << 28) | + ((in[21] - in[20]) << 55) + out[9] = + (in[21] - in[20]) >> 9 | + ((in[22] - in[21]) << 18) | + ((in[23] - in[22]) << 45) + out[10] = + (in[23] - in[22]) >> 19 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 35) | + ((in[26] - in[25]) << 62) + out[11] = + (in[26] - in[25]) >> 2 | + ((in[27] - in[26]) << 25) | + ((in[28] - in[27]) << 52) + out[12] = + (in[28] - in[27]) >> 12 | + ((in[29] - in[28]) << 15) | + ((in[30] - in[29]) << 42) + out[13] = + (in[30] - in[29]) >> 22 | + ((in[31] - in[30]) << 5) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 59) + out[14] = + (in[33] - in[32]) >> 5 | + ((in[34] - in[33]) << 22) | + ((in[35] - in[34]) << 49) + out[15] = + (in[35] - in[34]) >> 15 | + ((in[36] - in[35]) << 12) | + ((in[37] - in[36]) << 39) + out[16] = + (in[37] - in[36]) >> 25 | + ((in[38] - in[37]) << 2) | + ((in[39] - in[38]) << 29) | + ((in[40] - in[39]) << 56) + out[17] = + (in[40] - in[39]) >> 8 | + ((in[41] - in[40]) << 19) | + ((in[42] - in[41]) << 46) + out[18] = + (in[42] - in[41]) >> 18 | + ((in[43] - in[42]) << 9) | + ((in[44] - in[43]) << 36) | + ((in[45] - in[44]) << 63) + out[19] = + (in[45] - in[44]) >> 1 | + ((in[46] - in[45]) << 26) | + ((in[47] - in[46]) << 53) + out[20] = + (in[47] - in[46]) >> 11 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 43) + out[21] = + (in[49] - in[48]) >> 21 | + ((in[50] - in[49]) << 6) | + ((in[51] - in[50]) << 33) | + ((in[52] - in[51]) << 60) + out[22] = + (in[52] - in[51]) >> 4 | + ((in[53] - in[52]) << 23) | + ((in[54] - in[53]) << 50) + out[23] = + (in[54] - in[53]) >> 14 | + ((in[55] - in[54]) << 13) | + ((in[56] - in[55]) << 40) + out[24] = + (in[56] - in[55]) >> 24 | + ((in[57] - in[56]) << 3) | + ((in[58] - in[57]) << 30) | + ((in[59] - in[58]) << 57) + out[25] = + (in[59] - in[58]) >> 7 | + ((in[60] - in[59]) << 20) | + ((in[61] - in[60]) << 47) + out[26] = + (in[61] - in[60]) >> 17 | + ((in[62] - in[61]) << 10) | + ((in[63] - in[62]) << 37) +} + +func deltapack_uint64_28(initoffset uint64, in *[64]uint64, out *[28]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 28) | + ((in[2] - in[1]) << 56) + out[1] = + (in[2] - in[1]) >> 8 | + ((in[3] - in[2]) << 20) | + ((in[4] - in[3]) << 48) + out[2] = + (in[4] - in[3]) >> 16 | + ((in[5] - in[4]) << 12) | + ((in[6] - in[5]) << 40) + out[3] = + (in[6] - in[5]) >> 24 | + ((in[7] - in[6]) << 4) | + ((in[8] - in[7]) << 32) | + ((in[9] - in[8]) << 60) + out[4] = + (in[9] - in[8]) >> 4 | + ((in[10] - in[9]) << 24) | + ((in[11] - in[10]) << 52) + out[5] = + (in[11] - in[10]) >> 12 | + ((in[12] - in[11]) << 16) | + ((in[13] - in[12]) << 44) + out[6] = + (in[13] - in[12]) >> 20 | + ((in[14] - in[13]) << 8) | + ((in[15] - in[14]) << 36) + out[7] = + in[16] - in[15] | + ((in[17] - in[16]) << 28) | + ((in[18] - in[17]) << 56) + out[8] = + (in[18] - in[17]) >> 8 | + ((in[19] - in[18]) << 20) | + ((in[20] - in[19]) << 48) + out[9] = + (in[20] - in[19]) >> 16 | + ((in[21] - in[20]) << 12) | + ((in[22] - in[21]) << 40) + out[10] = + (in[22] - in[21]) >> 24 | + ((in[23] - in[22]) << 4) | + ((in[24] - in[23]) << 32) | + ((in[25] - in[24]) << 60) + out[11] = + (in[25] - in[24]) >> 4 | + ((in[26] - in[25]) << 24) | + ((in[27] - in[26]) << 52) + out[12] = + (in[27] - in[26]) >> 12 | + ((in[28] - in[27]) << 16) | + ((in[29] - in[28]) << 44) + out[13] = + (in[29] - in[28]) >> 20 | + ((in[30] - in[29]) << 8) | + ((in[31] - in[30]) << 36) + out[14] = + in[32] - in[31] | + ((in[33] - in[32]) << 28) | + ((in[34] - in[33]) << 56) + out[15] = + (in[34] - in[33]) >> 8 | + ((in[35] - in[34]) << 20) | + ((in[36] - in[35]) << 48) + out[16] = + (in[36] - in[35]) >> 16 | + ((in[37] - in[36]) << 12) | + ((in[38] - in[37]) << 40) + out[17] = + (in[38] - in[37]) >> 24 | + ((in[39] - in[38]) << 4) | + ((in[40] - in[39]) << 32) | + ((in[41] - in[40]) << 60) + out[18] = + (in[41] - in[40]) >> 4 | + ((in[42] - in[41]) << 24) | + ((in[43] - in[42]) << 52) + out[19] = + (in[43] - in[42]) >> 12 | + ((in[44] - in[43]) << 16) | + ((in[45] - in[44]) << 44) + out[20] = + (in[45] - in[44]) >> 20 | + ((in[46] - in[45]) << 8) | + ((in[47] - in[46]) << 36) + out[21] = + in[48] - in[47] | + ((in[49] - in[48]) << 28) | + ((in[50] - in[49]) << 56) + out[22] = + (in[50] - in[49]) >> 8 | + ((in[51] - in[50]) << 20) | + ((in[52] - in[51]) << 48) + out[23] = + (in[52] - in[51]) >> 16 | + ((in[53] - in[52]) << 12) | + ((in[54] - in[53]) << 40) + out[24] = + (in[54] - in[53]) >> 24 | + ((in[55] - in[54]) << 4) | + ((in[56] - in[55]) << 32) | + ((in[57] - in[56]) << 60) + out[25] = + (in[57] - in[56]) >> 4 | + ((in[58] - in[57]) << 24) | + ((in[59] - in[58]) << 52) + out[26] = + (in[59] - in[58]) >> 12 | + ((in[60] - in[59]) << 16) | + ((in[61] - in[60]) << 44) + out[27] = + (in[61] - in[60]) >> 20 | + ((in[62] - in[61]) << 8) | + ((in[63] - in[62]) << 36) +} + +func deltapack_uint64_29(initoffset uint64, in *[64]uint64, out *[29]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 29) | + ((in[2] - in[1]) << 58) + out[1] = + (in[2] - in[1]) >> 6 | + ((in[3] - in[2]) << 23) | + ((in[4] - in[3]) << 52) + out[2] = + (in[4] - in[3]) >> 12 | + ((in[5] - in[4]) << 17) | + ((in[6] - in[5]) << 46) + out[3] = + (in[6] - in[5]) >> 18 | + ((in[7] - in[6]) << 11) | + ((in[8] - in[7]) << 40) + out[4] = + (in[8] - in[7]) >> 24 | + ((in[9] - in[8]) << 5) | + ((in[10] - in[9]) << 34) | + ((in[11] - in[10]) << 63) + out[5] = + (in[11] - in[10]) >> 1 | + ((in[12] - in[11]) << 28) | + ((in[13] - in[12]) << 57) + out[6] = + (in[13] - in[12]) >> 7 | + ((in[14] - in[13]) << 22) | + ((in[15] - in[14]) << 51) + out[7] = + (in[15] - in[14]) >> 13 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 45) + out[8] = + (in[17] - in[16]) >> 19 | + ((in[18] - in[17]) << 10) | + ((in[19] - in[18]) << 39) + out[9] = + (in[19] - in[18]) >> 25 | + ((in[20] - in[19]) << 4) | + ((in[21] - in[20]) << 33) | + ((in[22] - in[21]) << 62) + out[10] = + (in[22] - in[21]) >> 2 | + ((in[23] - in[22]) << 27) | + ((in[24] - in[23]) << 56) + out[11] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 21) | + ((in[26] - in[25]) << 50) + out[12] = + (in[26] - in[25]) >> 14 | + ((in[27] - in[26]) << 15) | + ((in[28] - in[27]) << 44) + out[13] = + (in[28] - in[27]) >> 20 | + ((in[29] - in[28]) << 9) | + ((in[30] - in[29]) << 38) + out[14] = + (in[30] - in[29]) >> 26 | + ((in[31] - in[30]) << 3) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 61) + out[15] = + (in[33] - in[32]) >> 3 | + ((in[34] - in[33]) << 26) | + ((in[35] - in[34]) << 55) + out[16] = + (in[35] - in[34]) >> 9 | + ((in[36] - in[35]) << 20) | + ((in[37] - in[36]) << 49) + out[17] = + (in[37] - in[36]) >> 15 | + ((in[38] - in[37]) << 14) | + ((in[39] - in[38]) << 43) + out[18] = + (in[39] - in[38]) >> 21 | + ((in[40] - in[39]) << 8) | + ((in[41] - in[40]) << 37) + out[19] = + (in[41] - in[40]) >> 27 | + ((in[42] - in[41]) << 2) | + ((in[43] - in[42]) << 31) | + ((in[44] - in[43]) << 60) + out[20] = + (in[44] - in[43]) >> 4 | + ((in[45] - in[44]) << 25) | + ((in[46] - in[45]) << 54) + out[21] = + (in[46] - in[45]) >> 10 | + ((in[47] - in[46]) << 19) | + ((in[48] - in[47]) << 48) + out[22] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 13) | + ((in[50] - in[49]) << 42) + out[23] = + (in[50] - in[49]) >> 22 | + ((in[51] - in[50]) << 7) | + ((in[52] - in[51]) << 36) + out[24] = + (in[52] - in[51]) >> 28 | + ((in[53] - in[52]) << 1) | + ((in[54] - in[53]) << 30) | + ((in[55] - in[54]) << 59) + out[25] = + (in[55] - in[54]) >> 5 | + ((in[56] - in[55]) << 24) | + ((in[57] - in[56]) << 53) + out[26] = + (in[57] - in[56]) >> 11 | + ((in[58] - in[57]) << 18) | + ((in[59] - in[58]) << 47) + out[27] = + (in[59] - in[58]) >> 17 | + ((in[60] - in[59]) << 12) | + ((in[61] - in[60]) << 41) + out[28] = + (in[61] - in[60]) >> 23 | + ((in[62] - in[61]) << 6) | + ((in[63] - in[62]) << 35) +} + +func deltapack_uint64_30(initoffset uint64, in *[64]uint64, out *[30]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 30) | + ((in[2] - in[1]) << 60) + out[1] = + (in[2] - in[1]) >> 4 | + ((in[3] - in[2]) << 26) | + ((in[4] - in[3]) << 56) + out[2] = + (in[4] - in[3]) >> 8 | + ((in[5] - in[4]) << 22) | + ((in[6] - in[5]) << 52) + out[3] = + (in[6] - in[5]) >> 12 | + ((in[7] - in[6]) << 18) | + ((in[8] - in[7]) << 48) + out[4] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 14) | + ((in[10] - in[9]) << 44) + out[5] = + (in[10] - in[9]) >> 20 | + ((in[11] - in[10]) << 10) | + ((in[12] - in[11]) << 40) + out[6] = + (in[12] - in[11]) >> 24 | + ((in[13] - in[12]) << 6) | + ((in[14] - in[13]) << 36) + out[7] = + (in[14] - in[13]) >> 28 | + ((in[15] - in[14]) << 2) | + ((in[16] - in[15]) << 32) | + ((in[17] - in[16]) << 62) + out[8] = + (in[17] - in[16]) >> 2 | + ((in[18] - in[17]) << 28) | + ((in[19] - in[18]) << 58) + out[9] = + (in[19] - in[18]) >> 6 | + ((in[20] - in[19]) << 24) | + ((in[21] - in[20]) << 54) + out[10] = + (in[21] - in[20]) >> 10 | + ((in[22] - in[21]) << 20) | + ((in[23] - in[22]) << 50) + out[11] = + (in[23] - in[22]) >> 14 | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 46) + out[12] = + (in[25] - in[24]) >> 18 | + ((in[26] - in[25]) << 12) | + ((in[27] - in[26]) << 42) + out[13] = + (in[27] - in[26]) >> 22 | + ((in[28] - in[27]) << 8) | + ((in[29] - in[28]) << 38) + out[14] = + (in[29] - in[28]) >> 26 | + ((in[30] - in[29]) << 4) | + ((in[31] - in[30]) << 34) + out[15] = + in[32] - in[31] | + ((in[33] - in[32]) << 30) | + ((in[34] - in[33]) << 60) + out[16] = + (in[34] - in[33]) >> 4 | + ((in[35] - in[34]) << 26) | + ((in[36] - in[35]) << 56) + out[17] = + (in[36] - in[35]) >> 8 | + ((in[37] - in[36]) << 22) | + ((in[38] - in[37]) << 52) + out[18] = + (in[38] - in[37]) >> 12 | + ((in[39] - in[38]) << 18) | + ((in[40] - in[39]) << 48) + out[19] = + (in[40] - in[39]) >> 16 | + ((in[41] - in[40]) << 14) | + ((in[42] - in[41]) << 44) + out[20] = + (in[42] - in[41]) >> 20 | + ((in[43] - in[42]) << 10) | + ((in[44] - in[43]) << 40) + out[21] = + (in[44] - in[43]) >> 24 | + ((in[45] - in[44]) << 6) | + ((in[46] - in[45]) << 36) + out[22] = + (in[46] - in[45]) >> 28 | + ((in[47] - in[46]) << 2) | + ((in[48] - in[47]) << 32) | + ((in[49] - in[48]) << 62) + out[23] = + (in[49] - in[48]) >> 2 | + ((in[50] - in[49]) << 28) | + ((in[51] - in[50]) << 58) + out[24] = + (in[51] - in[50]) >> 6 | + ((in[52] - in[51]) << 24) | + ((in[53] - in[52]) << 54) + out[25] = + (in[53] - in[52]) >> 10 | + ((in[54] - in[53]) << 20) | + ((in[55] - in[54]) << 50) + out[26] = + (in[55] - in[54]) >> 14 | + ((in[56] - in[55]) << 16) | + ((in[57] - in[56]) << 46) + out[27] = + (in[57] - in[56]) >> 18 | + ((in[58] - in[57]) << 12) | + ((in[59] - in[58]) << 42) + out[28] = + (in[59] - in[58]) >> 22 | + ((in[60] - in[59]) << 8) | + ((in[61] - in[60]) << 38) + out[29] = + (in[61] - in[60]) >> 26 | + ((in[62] - in[61]) << 4) | + ((in[63] - in[62]) << 34) +} + +func deltapack_uint64_31(initoffset uint64, in *[64]uint64, out *[31]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 31) | + ((in[2] - in[1]) << 62) + out[1] = + (in[2] - in[1]) >> 2 | + ((in[3] - in[2]) << 29) | + ((in[4] - in[3]) << 60) + out[2] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 27) | + ((in[6] - in[5]) << 58) + out[3] = + (in[6] - in[5]) >> 6 | + ((in[7] - in[6]) << 25) | + ((in[8] - in[7]) << 56) + out[4] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 23) | + ((in[10] - in[9]) << 54) + out[5] = + (in[10] - in[9]) >> 10 | + ((in[11] - in[10]) << 21) | + ((in[12] - in[11]) << 52) + out[6] = + (in[12] - in[11]) >> 12 | + ((in[13] - in[12]) << 19) | + ((in[14] - in[13]) << 50) + out[7] = + (in[14] - in[13]) >> 14 | + ((in[15] - in[14]) << 17) | + ((in[16] - in[15]) << 48) + out[8] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 15) | + ((in[18] - in[17]) << 46) + out[9] = + (in[18] - in[17]) >> 18 | + ((in[19] - in[18]) << 13) | + ((in[20] - in[19]) << 44) + out[10] = + (in[20] - in[19]) >> 20 | + ((in[21] - in[20]) << 11) | + ((in[22] - in[21]) << 42) + out[11] = + (in[22] - in[21]) >> 22 | + ((in[23] - in[22]) << 9) | + ((in[24] - in[23]) << 40) + out[12] = + (in[24] - in[23]) >> 24 | + ((in[25] - in[24]) << 7) | + ((in[26] - in[25]) << 38) + out[13] = + (in[26] - in[25]) >> 26 | + ((in[27] - in[26]) << 5) | + ((in[28] - in[27]) << 36) + out[14] = + (in[28] - in[27]) >> 28 | + ((in[29] - in[28]) << 3) | + ((in[30] - in[29]) << 34) + out[15] = + (in[30] - in[29]) >> 30 | + ((in[31] - in[30]) << 1) | + ((in[32] - in[31]) << 32) | + ((in[33] - in[32]) << 63) + out[16] = + (in[33] - in[32]) >> 1 | + ((in[34] - in[33]) << 30) | + ((in[35] - in[34]) << 61) + out[17] = + (in[35] - in[34]) >> 3 | + ((in[36] - in[35]) << 28) | + ((in[37] - in[36]) << 59) + out[18] = + (in[37] - in[36]) >> 5 | + ((in[38] - in[37]) << 26) | + ((in[39] - in[38]) << 57) + out[19] = + (in[39] - in[38]) >> 7 | + ((in[40] - in[39]) << 24) | + ((in[41] - in[40]) << 55) + out[20] = + (in[41] - in[40]) >> 9 | + ((in[42] - in[41]) << 22) | + ((in[43] - in[42]) << 53) + out[21] = + (in[43] - in[42]) >> 11 | + ((in[44] - in[43]) << 20) | + ((in[45] - in[44]) << 51) + out[22] = + (in[45] - in[44]) >> 13 | + ((in[46] - in[45]) << 18) | + ((in[47] - in[46]) << 49) + out[23] = + (in[47] - in[46]) >> 15 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 47) + out[24] = + (in[49] - in[48]) >> 17 | + ((in[50] - in[49]) << 14) | + ((in[51] - in[50]) << 45) + out[25] = + (in[51] - in[50]) >> 19 | + ((in[52] - in[51]) << 12) | + ((in[53] - in[52]) << 43) + out[26] = + (in[53] - in[52]) >> 21 | + ((in[54] - in[53]) << 10) | + ((in[55] - in[54]) << 41) + out[27] = + (in[55] - in[54]) >> 23 | + ((in[56] - in[55]) << 8) | + ((in[57] - in[56]) << 39) + out[28] = + (in[57] - in[56]) >> 25 | + ((in[58] - in[57]) << 6) | + ((in[59] - in[58]) << 37) + out[29] = + (in[59] - in[58]) >> 27 | + ((in[60] - in[59]) << 4) | + ((in[61] - in[60]) << 35) + out[30] = + (in[61] - in[60]) >> 29 | + ((in[62] - in[61]) << 2) | + ((in[63] - in[62]) << 33) +} + +func deltapack_uint64_32(initoffset uint64, in *[64]uint64, out *[32]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 32) + out[1] = + in[2] - in[1] | + ((in[3] - in[2]) << 32) + out[2] = + in[4] - in[3] | + ((in[5] - in[4]) << 32) + out[3] = + in[6] - in[5] | + ((in[7] - in[6]) << 32) + out[4] = + in[8] - in[7] | + ((in[9] - in[8]) << 32) + out[5] = + in[10] - in[9] | + ((in[11] - in[10]) << 32) + out[6] = + in[12] - in[11] | + ((in[13] - in[12]) << 32) + out[7] = + in[14] - in[13] | + ((in[15] - in[14]) << 32) + out[8] = + in[16] - in[15] | + ((in[17] - in[16]) << 32) + out[9] = + in[18] - in[17] | + ((in[19] - in[18]) << 32) + out[10] = + in[20] - in[19] | + ((in[21] - in[20]) << 32) + out[11] = + in[22] - in[21] | + ((in[23] - in[22]) << 32) + out[12] = + in[24] - in[23] | + ((in[25] - in[24]) << 32) + out[13] = + in[26] - in[25] | + ((in[27] - in[26]) << 32) + out[14] = + in[28] - in[27] | + ((in[29] - in[28]) << 32) + out[15] = + in[30] - in[29] | + ((in[31] - in[30]) << 32) + out[16] = + in[32] - in[31] | + ((in[33] - in[32]) << 32) + out[17] = + in[34] - in[33] | + ((in[35] - in[34]) << 32) + out[18] = + in[36] - in[35] | + ((in[37] - in[36]) << 32) + out[19] = + in[38] - in[37] | + ((in[39] - in[38]) << 32) + out[20] = + in[40] - in[39] | + ((in[41] - in[40]) << 32) + out[21] = + in[42] - in[41] | + ((in[43] - in[42]) << 32) + out[22] = + in[44] - in[43] | + ((in[45] - in[44]) << 32) + out[23] = + in[46] - in[45] | + ((in[47] - in[46]) << 32) + out[24] = + in[48] - in[47] | + ((in[49] - in[48]) << 32) + out[25] = + in[50] - in[49] | + ((in[51] - in[50]) << 32) + out[26] = + in[52] - in[51] | + ((in[53] - in[52]) << 32) + out[27] = + in[54] - in[53] | + ((in[55] - in[54]) << 32) + out[28] = + in[56] - in[55] | + ((in[57] - in[56]) << 32) + out[29] = + in[58] - in[57] | + ((in[59] - in[58]) << 32) + out[30] = + in[60] - in[59] | + ((in[61] - in[60]) << 32) + out[31] = + in[62] - in[61] | + ((in[63] - in[62]) << 32) +} + +func deltapack_uint64_33(initoffset uint64, in *[64]uint64, out *[33]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 33) + out[1] = + (in[1] - in[0]) >> 31 | + ((in[2] - in[1]) << 2) | + ((in[3] - in[2]) << 35) + out[2] = + (in[3] - in[2]) >> 29 | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 37) + out[3] = + (in[5] - in[4]) >> 27 | + ((in[6] - in[5]) << 6) | + ((in[7] - in[6]) << 39) + out[4] = + (in[7] - in[6]) >> 25 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 41) + out[5] = + (in[9] - in[8]) >> 23 | + ((in[10] - in[9]) << 10) | + ((in[11] - in[10]) << 43) + out[6] = + (in[11] - in[10]) >> 21 | + ((in[12] - in[11]) << 12) | + ((in[13] - in[12]) << 45) + out[7] = + (in[13] - in[12]) >> 19 | + ((in[14] - in[13]) << 14) | + ((in[15] - in[14]) << 47) + out[8] = + (in[15] - in[14]) >> 17 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 49) + out[9] = + (in[17] - in[16]) >> 15 | + ((in[18] - in[17]) << 18) | + ((in[19] - in[18]) << 51) + out[10] = + (in[19] - in[18]) >> 13 | + ((in[20] - in[19]) << 20) | + ((in[21] - in[20]) << 53) + out[11] = + (in[21] - in[20]) >> 11 | + ((in[22] - in[21]) << 22) | + ((in[23] - in[22]) << 55) + out[12] = + (in[23] - in[22]) >> 9 | + ((in[24] - in[23]) << 24) | + ((in[25] - in[24]) << 57) + out[13] = + (in[25] - in[24]) >> 7 | + ((in[26] - in[25]) << 26) | + ((in[27] - in[26]) << 59) + out[14] = + (in[27] - in[26]) >> 5 | + ((in[28] - in[27]) << 28) | + ((in[29] - in[28]) << 61) + out[15] = + (in[29] - in[28]) >> 3 | + ((in[30] - in[29]) << 30) | + ((in[31] - in[30]) << 63) + out[16] = + (in[31] - in[30]) >> 1 | + ((in[32] - in[31]) << 32) + out[17] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 1) | + ((in[34] - in[33]) << 34) + out[18] = + (in[34] - in[33]) >> 30 | + ((in[35] - in[34]) << 3) | + ((in[36] - in[35]) << 36) + out[19] = + (in[36] - in[35]) >> 28 | + ((in[37] - in[36]) << 5) | + ((in[38] - in[37]) << 38) + out[20] = + (in[38] - in[37]) >> 26 | + ((in[39] - in[38]) << 7) | + ((in[40] - in[39]) << 40) + out[21] = + (in[40] - in[39]) >> 24 | + ((in[41] - in[40]) << 9) | + ((in[42] - in[41]) << 42) + out[22] = + (in[42] - in[41]) >> 22 | + ((in[43] - in[42]) << 11) | + ((in[44] - in[43]) << 44) + out[23] = + (in[44] - in[43]) >> 20 | + ((in[45] - in[44]) << 13) | + ((in[46] - in[45]) << 46) + out[24] = + (in[46] - in[45]) >> 18 | + ((in[47] - in[46]) << 15) | + ((in[48] - in[47]) << 48) + out[25] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 17) | + ((in[50] - in[49]) << 50) + out[26] = + (in[50] - in[49]) >> 14 | + ((in[51] - in[50]) << 19) | + ((in[52] - in[51]) << 52) + out[27] = + (in[52] - in[51]) >> 12 | + ((in[53] - in[52]) << 21) | + ((in[54] - in[53]) << 54) + out[28] = + (in[54] - in[53]) >> 10 | + ((in[55] - in[54]) << 23) | + ((in[56] - in[55]) << 56) + out[29] = + (in[56] - in[55]) >> 8 | + ((in[57] - in[56]) << 25) | + ((in[58] - in[57]) << 58) + out[30] = + (in[58] - in[57]) >> 6 | + ((in[59] - in[58]) << 27) | + ((in[60] - in[59]) << 60) + out[31] = + (in[60] - in[59]) >> 4 | + ((in[61] - in[60]) << 29) | + ((in[62] - in[61]) << 62) + out[32] = + (in[62] - in[61]) >> 2 | + ((in[63] - in[62]) << 31) +} + +func deltapack_uint64_34(initoffset uint64, in *[64]uint64, out *[34]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 34) + out[1] = + (in[1] - in[0]) >> 30 | + ((in[2] - in[1]) << 4) | + ((in[3] - in[2]) << 38) + out[2] = + (in[3] - in[2]) >> 26 | + ((in[4] - in[3]) << 8) | + ((in[5] - in[4]) << 42) + out[3] = + (in[5] - in[4]) >> 22 | + ((in[6] - in[5]) << 12) | + ((in[7] - in[6]) << 46) + out[4] = + (in[7] - in[6]) >> 18 | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 50) + out[5] = + (in[9] - in[8]) >> 14 | + ((in[10] - in[9]) << 20) | + ((in[11] - in[10]) << 54) + out[6] = + (in[11] - in[10]) >> 10 | + ((in[12] - in[11]) << 24) | + ((in[13] - in[12]) << 58) + out[7] = + (in[13] - in[12]) >> 6 | + ((in[14] - in[13]) << 28) | + ((in[15] - in[14]) << 62) + out[8] = + (in[15] - in[14]) >> 2 | + ((in[16] - in[15]) << 32) + out[9] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 2) | + ((in[18] - in[17]) << 36) + out[10] = + (in[18] - in[17]) >> 28 | + ((in[19] - in[18]) << 6) | + ((in[20] - in[19]) << 40) + out[11] = + (in[20] - in[19]) >> 24 | + ((in[21] - in[20]) << 10) | + ((in[22] - in[21]) << 44) + out[12] = + (in[22] - in[21]) >> 20 | + ((in[23] - in[22]) << 14) | + ((in[24] - in[23]) << 48) + out[13] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 18) | + ((in[26] - in[25]) << 52) + out[14] = + (in[26] - in[25]) >> 12 | + ((in[27] - in[26]) << 22) | + ((in[28] - in[27]) << 56) + out[15] = + (in[28] - in[27]) >> 8 | + ((in[29] - in[28]) << 26) | + ((in[30] - in[29]) << 60) + out[16] = + (in[30] - in[29]) >> 4 | + ((in[31] - in[30]) << 30) + out[17] = + in[32] - in[31] | + ((in[33] - in[32]) << 34) + out[18] = + (in[33] - in[32]) >> 30 | + ((in[34] - in[33]) << 4) | + ((in[35] - in[34]) << 38) + out[19] = + (in[35] - in[34]) >> 26 | + ((in[36] - in[35]) << 8) | + ((in[37] - in[36]) << 42) + out[20] = + (in[37] - in[36]) >> 22 | + ((in[38] - in[37]) << 12) | + ((in[39] - in[38]) << 46) + out[21] = + (in[39] - in[38]) >> 18 | + ((in[40] - in[39]) << 16) | + ((in[41] - in[40]) << 50) + out[22] = + (in[41] - in[40]) >> 14 | + ((in[42] - in[41]) << 20) | + ((in[43] - in[42]) << 54) + out[23] = + (in[43] - in[42]) >> 10 | + ((in[44] - in[43]) << 24) | + ((in[45] - in[44]) << 58) + out[24] = + (in[45] - in[44]) >> 6 | + ((in[46] - in[45]) << 28) | + ((in[47] - in[46]) << 62) + out[25] = + (in[47] - in[46]) >> 2 | + ((in[48] - in[47]) << 32) + out[26] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 2) | + ((in[50] - in[49]) << 36) + out[27] = + (in[50] - in[49]) >> 28 | + ((in[51] - in[50]) << 6) | + ((in[52] - in[51]) << 40) + out[28] = + (in[52] - in[51]) >> 24 | + ((in[53] - in[52]) << 10) | + ((in[54] - in[53]) << 44) + out[29] = + (in[54] - in[53]) >> 20 | + ((in[55] - in[54]) << 14) | + ((in[56] - in[55]) << 48) + out[30] = + (in[56] - in[55]) >> 16 | + ((in[57] - in[56]) << 18) | + ((in[58] - in[57]) << 52) + out[31] = + (in[58] - in[57]) >> 12 | + ((in[59] - in[58]) << 22) | + ((in[60] - in[59]) << 56) + out[32] = + (in[60] - in[59]) >> 8 | + ((in[61] - in[60]) << 26) | + ((in[62] - in[61]) << 60) + out[33] = + (in[62] - in[61]) >> 4 | + ((in[63] - in[62]) << 30) +} + +func deltapack_uint64_35(initoffset uint64, in *[64]uint64, out *[35]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 35) + out[1] = + (in[1] - in[0]) >> 29 | + ((in[2] - in[1]) << 6) | + ((in[3] - in[2]) << 41) + out[2] = + (in[3] - in[2]) >> 23 | + ((in[4] - in[3]) << 12) | + ((in[5] - in[4]) << 47) + out[3] = + (in[5] - in[4]) >> 17 | + ((in[6] - in[5]) << 18) | + ((in[7] - in[6]) << 53) + out[4] = + (in[7] - in[6]) >> 11 | + ((in[8] - in[7]) << 24) | + ((in[9] - in[8]) << 59) + out[5] = + (in[9] - in[8]) >> 5 | + ((in[10] - in[9]) << 30) + out[6] = + (in[10] - in[9]) >> 34 | + ((in[11] - in[10]) << 1) | + ((in[12] - in[11]) << 36) + out[7] = + (in[12] - in[11]) >> 28 | + ((in[13] - in[12]) << 7) | + ((in[14] - in[13]) << 42) + out[8] = + (in[14] - in[13]) >> 22 | + ((in[15] - in[14]) << 13) | + ((in[16] - in[15]) << 48) + out[9] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 19) | + ((in[18] - in[17]) << 54) + out[10] = + (in[18] - in[17]) >> 10 | + ((in[19] - in[18]) << 25) | + ((in[20] - in[19]) << 60) + out[11] = + (in[20] - in[19]) >> 4 | + ((in[21] - in[20]) << 31) + out[12] = + (in[21] - in[20]) >> 33 | + ((in[22] - in[21]) << 2) | + ((in[23] - in[22]) << 37) + out[13] = + (in[23] - in[22]) >> 27 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 43) + out[14] = + (in[25] - in[24]) >> 21 | + ((in[26] - in[25]) << 14) | + ((in[27] - in[26]) << 49) + out[15] = + (in[27] - in[26]) >> 15 | + ((in[28] - in[27]) << 20) | + ((in[29] - in[28]) << 55) + out[16] = + (in[29] - in[28]) >> 9 | + ((in[30] - in[29]) << 26) | + ((in[31] - in[30]) << 61) + out[17] = + (in[31] - in[30]) >> 3 | + ((in[32] - in[31]) << 32) + out[18] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 3) | + ((in[34] - in[33]) << 38) + out[19] = + (in[34] - in[33]) >> 26 | + ((in[35] - in[34]) << 9) | + ((in[36] - in[35]) << 44) + out[20] = + (in[36] - in[35]) >> 20 | + ((in[37] - in[36]) << 15) | + ((in[38] - in[37]) << 50) + out[21] = + (in[38] - in[37]) >> 14 | + ((in[39] - in[38]) << 21) | + ((in[40] - in[39]) << 56) + out[22] = + (in[40] - in[39]) >> 8 | + ((in[41] - in[40]) << 27) | + ((in[42] - in[41]) << 62) + out[23] = + (in[42] - in[41]) >> 2 | + ((in[43] - in[42]) << 33) + out[24] = + (in[43] - in[42]) >> 31 | + ((in[44] - in[43]) << 4) | + ((in[45] - in[44]) << 39) + out[25] = + (in[45] - in[44]) >> 25 | + ((in[46] - in[45]) << 10) | + ((in[47] - in[46]) << 45) + out[26] = + (in[47] - in[46]) >> 19 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 51) + out[27] = + (in[49] - in[48]) >> 13 | + ((in[50] - in[49]) << 22) | + ((in[51] - in[50]) << 57) + out[28] = + (in[51] - in[50]) >> 7 | + ((in[52] - in[51]) << 28) | + ((in[53] - in[52]) << 63) + out[29] = + (in[53] - in[52]) >> 1 | + ((in[54] - in[53]) << 34) + out[30] = + (in[54] - in[53]) >> 30 | + ((in[55] - in[54]) << 5) | + ((in[56] - in[55]) << 40) + out[31] = + (in[56] - in[55]) >> 24 | + ((in[57] - in[56]) << 11) | + ((in[58] - in[57]) << 46) + out[32] = + (in[58] - in[57]) >> 18 | + ((in[59] - in[58]) << 17) | + ((in[60] - in[59]) << 52) + out[33] = + (in[60] - in[59]) >> 12 | + ((in[61] - in[60]) << 23) | + ((in[62] - in[61]) << 58) + out[34] = + (in[62] - in[61]) >> 6 | + ((in[63] - in[62]) << 29) +} + +func deltapack_uint64_36(initoffset uint64, in *[64]uint64, out *[36]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 36) + out[1] = + (in[1] - in[0]) >> 28 | + ((in[2] - in[1]) << 8) | + ((in[3] - in[2]) << 44) + out[2] = + (in[3] - in[2]) >> 20 | + ((in[4] - in[3]) << 16) | + ((in[5] - in[4]) << 52) + out[3] = + (in[5] - in[4]) >> 12 | + ((in[6] - in[5]) << 24) | + ((in[7] - in[6]) << 60) + out[4] = + (in[7] - in[6]) >> 4 | + ((in[8] - in[7]) << 32) + out[5] = + (in[8] - in[7]) >> 32 | + ((in[9] - in[8]) << 4) | + ((in[10] - in[9]) << 40) + out[6] = + (in[10] - in[9]) >> 24 | + ((in[11] - in[10]) << 12) | + ((in[12] - in[11]) << 48) + out[7] = + (in[12] - in[11]) >> 16 | + ((in[13] - in[12]) << 20) | + ((in[14] - in[13]) << 56) + out[8] = + (in[14] - in[13]) >> 8 | + ((in[15] - in[14]) << 28) + out[9] = + in[16] - in[15] | + ((in[17] - in[16]) << 36) + out[10] = + (in[17] - in[16]) >> 28 | + ((in[18] - in[17]) << 8) | + ((in[19] - in[18]) << 44) + out[11] = + (in[19] - in[18]) >> 20 | + ((in[20] - in[19]) << 16) | + ((in[21] - in[20]) << 52) + out[12] = + (in[21] - in[20]) >> 12 | + ((in[22] - in[21]) << 24) | + ((in[23] - in[22]) << 60) + out[13] = + (in[23] - in[22]) >> 4 | + ((in[24] - in[23]) << 32) + out[14] = + (in[24] - in[23]) >> 32 | + ((in[25] - in[24]) << 4) | + ((in[26] - in[25]) << 40) + out[15] = + (in[26] - in[25]) >> 24 | + ((in[27] - in[26]) << 12) | + ((in[28] - in[27]) << 48) + out[16] = + (in[28] - in[27]) >> 16 | + ((in[29] - in[28]) << 20) | + ((in[30] - in[29]) << 56) + out[17] = + (in[30] - in[29]) >> 8 | + ((in[31] - in[30]) << 28) + out[18] = + in[32] - in[31] | + ((in[33] - in[32]) << 36) + out[19] = + (in[33] - in[32]) >> 28 | + ((in[34] - in[33]) << 8) | + ((in[35] - in[34]) << 44) + out[20] = + (in[35] - in[34]) >> 20 | + ((in[36] - in[35]) << 16) | + ((in[37] - in[36]) << 52) + out[21] = + (in[37] - in[36]) >> 12 | + ((in[38] - in[37]) << 24) | + ((in[39] - in[38]) << 60) + out[22] = + (in[39] - in[38]) >> 4 | + ((in[40] - in[39]) << 32) + out[23] = + (in[40] - in[39]) >> 32 | + ((in[41] - in[40]) << 4) | + ((in[42] - in[41]) << 40) + out[24] = + (in[42] - in[41]) >> 24 | + ((in[43] - in[42]) << 12) | + ((in[44] - in[43]) << 48) + out[25] = + (in[44] - in[43]) >> 16 | + ((in[45] - in[44]) << 20) | + ((in[46] - in[45]) << 56) + out[26] = + (in[46] - in[45]) >> 8 | + ((in[47] - in[46]) << 28) + out[27] = + in[48] - in[47] | + ((in[49] - in[48]) << 36) + out[28] = + (in[49] - in[48]) >> 28 | + ((in[50] - in[49]) << 8) | + ((in[51] - in[50]) << 44) + out[29] = + (in[51] - in[50]) >> 20 | + ((in[52] - in[51]) << 16) | + ((in[53] - in[52]) << 52) + out[30] = + (in[53] - in[52]) >> 12 | + ((in[54] - in[53]) << 24) | + ((in[55] - in[54]) << 60) + out[31] = + (in[55] - in[54]) >> 4 | + ((in[56] - in[55]) << 32) + out[32] = + (in[56] - in[55]) >> 32 | + ((in[57] - in[56]) << 4) | + ((in[58] - in[57]) << 40) + out[33] = + (in[58] - in[57]) >> 24 | + ((in[59] - in[58]) << 12) | + ((in[60] - in[59]) << 48) + out[34] = + (in[60] - in[59]) >> 16 | + ((in[61] - in[60]) << 20) | + ((in[62] - in[61]) << 56) + out[35] = + (in[62] - in[61]) >> 8 | + ((in[63] - in[62]) << 28) +} + +func deltapack_uint64_37(initoffset uint64, in *[64]uint64, out *[37]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 37) + out[1] = + (in[1] - in[0]) >> 27 | + ((in[2] - in[1]) << 10) | + ((in[3] - in[2]) << 47) + out[2] = + (in[3] - in[2]) >> 17 | + ((in[4] - in[3]) << 20) | + ((in[5] - in[4]) << 57) + out[3] = + (in[5] - in[4]) >> 7 | + ((in[6] - in[5]) << 30) + out[4] = + (in[6] - in[5]) >> 34 | + ((in[7] - in[6]) << 3) | + ((in[8] - in[7]) << 40) + out[5] = + (in[8] - in[7]) >> 24 | + ((in[9] - in[8]) << 13) | + ((in[10] - in[9]) << 50) + out[6] = + (in[10] - in[9]) >> 14 | + ((in[11] - in[10]) << 23) | + ((in[12] - in[11]) << 60) + out[7] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 33) + out[8] = + (in[13] - in[12]) >> 31 | + ((in[14] - in[13]) << 6) | + ((in[15] - in[14]) << 43) + out[9] = + (in[15] - in[14]) >> 21 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 53) + out[10] = + (in[17] - in[16]) >> 11 | + ((in[18] - in[17]) << 26) | + ((in[19] - in[18]) << 63) + out[11] = + (in[19] - in[18]) >> 1 | + ((in[20] - in[19]) << 36) + out[12] = + (in[20] - in[19]) >> 28 | + ((in[21] - in[20]) << 9) | + ((in[22] - in[21]) << 46) + out[13] = + (in[22] - in[21]) >> 18 | + ((in[23] - in[22]) << 19) | + ((in[24] - in[23]) << 56) + out[14] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 29) + out[15] = + (in[25] - in[24]) >> 35 | + ((in[26] - in[25]) << 2) | + ((in[27] - in[26]) << 39) + out[16] = + (in[27] - in[26]) >> 25 | + ((in[28] - in[27]) << 12) | + ((in[29] - in[28]) << 49) + out[17] = + (in[29] - in[28]) >> 15 | + ((in[30] - in[29]) << 22) | + ((in[31] - in[30]) << 59) + out[18] = + (in[31] - in[30]) >> 5 | + ((in[32] - in[31]) << 32) + out[19] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 5) | + ((in[34] - in[33]) << 42) + out[20] = + (in[34] - in[33]) >> 22 | + ((in[35] - in[34]) << 15) | + ((in[36] - in[35]) << 52) + out[21] = + (in[36] - in[35]) >> 12 | + ((in[37] - in[36]) << 25) | + ((in[38] - in[37]) << 62) + out[22] = + (in[38] - in[37]) >> 2 | + ((in[39] - in[38]) << 35) + out[23] = + (in[39] - in[38]) >> 29 | + ((in[40] - in[39]) << 8) | + ((in[41] - in[40]) << 45) + out[24] = + (in[41] - in[40]) >> 19 | + ((in[42] - in[41]) << 18) | + ((in[43] - in[42]) << 55) + out[25] = + (in[43] - in[42]) >> 9 | + ((in[44] - in[43]) << 28) + out[26] = + (in[44] - in[43]) >> 36 | + ((in[45] - in[44]) << 1) | + ((in[46] - in[45]) << 38) + out[27] = + (in[46] - in[45]) >> 26 | + ((in[47] - in[46]) << 11) | + ((in[48] - in[47]) << 48) + out[28] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 21) | + ((in[50] - in[49]) << 58) + out[29] = + (in[50] - in[49]) >> 6 | + ((in[51] - in[50]) << 31) + out[30] = + (in[51] - in[50]) >> 33 | + ((in[52] - in[51]) << 4) | + ((in[53] - in[52]) << 41) + out[31] = + (in[53] - in[52]) >> 23 | + ((in[54] - in[53]) << 14) | + ((in[55] - in[54]) << 51) + out[32] = + (in[55] - in[54]) >> 13 | + ((in[56] - in[55]) << 24) | + ((in[57] - in[56]) << 61) + out[33] = + (in[57] - in[56]) >> 3 | + ((in[58] - in[57]) << 34) + out[34] = + (in[58] - in[57]) >> 30 | + ((in[59] - in[58]) << 7) | + ((in[60] - in[59]) << 44) + out[35] = + (in[60] - in[59]) >> 20 | + ((in[61] - in[60]) << 17) | + ((in[62] - in[61]) << 54) + out[36] = + (in[62] - in[61]) >> 10 | + ((in[63] - in[62]) << 27) +} + +func deltapack_uint64_38(initoffset uint64, in *[64]uint64, out *[38]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 38) + out[1] = + (in[1] - in[0]) >> 26 | + ((in[2] - in[1]) << 12) | + ((in[3] - in[2]) << 50) + out[2] = + (in[3] - in[2]) >> 14 | + ((in[4] - in[3]) << 24) | + ((in[5] - in[4]) << 62) + out[3] = + (in[5] - in[4]) >> 2 | + ((in[6] - in[5]) << 36) + out[4] = + (in[6] - in[5]) >> 28 | + ((in[7] - in[6]) << 10) | + ((in[8] - in[7]) << 48) + out[5] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 22) | + ((in[10] - in[9]) << 60) + out[6] = + (in[10] - in[9]) >> 4 | + ((in[11] - in[10]) << 34) + out[7] = + (in[11] - in[10]) >> 30 | + ((in[12] - in[11]) << 8) | + ((in[13] - in[12]) << 46) + out[8] = + (in[13] - in[12]) >> 18 | + ((in[14] - in[13]) << 20) | + ((in[15] - in[14]) << 58) + out[9] = + (in[15] - in[14]) >> 6 | + ((in[16] - in[15]) << 32) + out[10] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 6) | + ((in[18] - in[17]) << 44) + out[11] = + (in[18] - in[17]) >> 20 | + ((in[19] - in[18]) << 18) | + ((in[20] - in[19]) << 56) + out[12] = + (in[20] - in[19]) >> 8 | + ((in[21] - in[20]) << 30) + out[13] = + (in[21] - in[20]) >> 34 | + ((in[22] - in[21]) << 4) | + ((in[23] - in[22]) << 42) + out[14] = + (in[23] - in[22]) >> 22 | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 54) + out[15] = + (in[25] - in[24]) >> 10 | + ((in[26] - in[25]) << 28) + out[16] = + (in[26] - in[25]) >> 36 | + ((in[27] - in[26]) << 2) | + ((in[28] - in[27]) << 40) + out[17] = + (in[28] - in[27]) >> 24 | + ((in[29] - in[28]) << 14) | + ((in[30] - in[29]) << 52) + out[18] = + (in[30] - in[29]) >> 12 | + ((in[31] - in[30]) << 26) + out[19] = + in[32] - in[31] | + ((in[33] - in[32]) << 38) + out[20] = + (in[33] - in[32]) >> 26 | + ((in[34] - in[33]) << 12) | + ((in[35] - in[34]) << 50) + out[21] = + (in[35] - in[34]) >> 14 | + ((in[36] - in[35]) << 24) | + ((in[37] - in[36]) << 62) + out[22] = + (in[37] - in[36]) >> 2 | + ((in[38] - in[37]) << 36) + out[23] = + (in[38] - in[37]) >> 28 | + ((in[39] - in[38]) << 10) | + ((in[40] - in[39]) << 48) + out[24] = + (in[40] - in[39]) >> 16 | + ((in[41] - in[40]) << 22) | + ((in[42] - in[41]) << 60) + out[25] = + (in[42] - in[41]) >> 4 | + ((in[43] - in[42]) << 34) + out[26] = + (in[43] - in[42]) >> 30 | + ((in[44] - in[43]) << 8) | + ((in[45] - in[44]) << 46) + out[27] = + (in[45] - in[44]) >> 18 | + ((in[46] - in[45]) << 20) | + ((in[47] - in[46]) << 58) + out[28] = + (in[47] - in[46]) >> 6 | + ((in[48] - in[47]) << 32) + out[29] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 6) | + ((in[50] - in[49]) << 44) + out[30] = + (in[50] - in[49]) >> 20 | + ((in[51] - in[50]) << 18) | + ((in[52] - in[51]) << 56) + out[31] = + (in[52] - in[51]) >> 8 | + ((in[53] - in[52]) << 30) + out[32] = + (in[53] - in[52]) >> 34 | + ((in[54] - in[53]) << 4) | + ((in[55] - in[54]) << 42) + out[33] = + (in[55] - in[54]) >> 22 | + ((in[56] - in[55]) << 16) | + ((in[57] - in[56]) << 54) + out[34] = + (in[57] - in[56]) >> 10 | + ((in[58] - in[57]) << 28) + out[35] = + (in[58] - in[57]) >> 36 | + ((in[59] - in[58]) << 2) | + ((in[60] - in[59]) << 40) + out[36] = + (in[60] - in[59]) >> 24 | + ((in[61] - in[60]) << 14) | + ((in[62] - in[61]) << 52) + out[37] = + (in[62] - in[61]) >> 12 | + ((in[63] - in[62]) << 26) +} + +func deltapack_uint64_39(initoffset uint64, in *[64]uint64, out *[39]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 39) + out[1] = + (in[1] - in[0]) >> 25 | + ((in[2] - in[1]) << 14) | + ((in[3] - in[2]) << 53) + out[2] = + (in[3] - in[2]) >> 11 | + ((in[4] - in[3]) << 28) + out[3] = + (in[4] - in[3]) >> 36 | + ((in[5] - in[4]) << 3) | + ((in[6] - in[5]) << 42) + out[4] = + (in[6] - in[5]) >> 22 | + ((in[7] - in[6]) << 17) | + ((in[8] - in[7]) << 56) + out[5] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 31) + out[6] = + (in[9] - in[8]) >> 33 | + ((in[10] - in[9]) << 6) | + ((in[11] - in[10]) << 45) + out[7] = + (in[11] - in[10]) >> 19 | + ((in[12] - in[11]) << 20) | + ((in[13] - in[12]) << 59) + out[8] = + (in[13] - in[12]) >> 5 | + ((in[14] - in[13]) << 34) + out[9] = + (in[14] - in[13]) >> 30 | + ((in[15] - in[14]) << 9) | + ((in[16] - in[15]) << 48) + out[10] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 23) | + ((in[18] - in[17]) << 62) + out[11] = + (in[18] - in[17]) >> 2 | + ((in[19] - in[18]) << 37) + out[12] = + (in[19] - in[18]) >> 27 | + ((in[20] - in[19]) << 12) | + ((in[21] - in[20]) << 51) + out[13] = + (in[21] - in[20]) >> 13 | + ((in[22] - in[21]) << 26) + out[14] = + (in[22] - in[21]) >> 38 | + ((in[23] - in[22]) << 1) | + ((in[24] - in[23]) << 40) + out[15] = + (in[24] - in[23]) >> 24 | + ((in[25] - in[24]) << 15) | + ((in[26] - in[25]) << 54) + out[16] = + (in[26] - in[25]) >> 10 | + ((in[27] - in[26]) << 29) + out[17] = + (in[27] - in[26]) >> 35 | + ((in[28] - in[27]) << 4) | + ((in[29] - in[28]) << 43) + out[18] = + (in[29] - in[28]) >> 21 | + ((in[30] - in[29]) << 18) | + ((in[31] - in[30]) << 57) + out[19] = + (in[31] - in[30]) >> 7 | + ((in[32] - in[31]) << 32) + out[20] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 7) | + ((in[34] - in[33]) << 46) + out[21] = + (in[34] - in[33]) >> 18 | + ((in[35] - in[34]) << 21) | + ((in[36] - in[35]) << 60) + out[22] = + (in[36] - in[35]) >> 4 | + ((in[37] - in[36]) << 35) + out[23] = + (in[37] - in[36]) >> 29 | + ((in[38] - in[37]) << 10) | + ((in[39] - in[38]) << 49) + out[24] = + (in[39] - in[38]) >> 15 | + ((in[40] - in[39]) << 24) | + ((in[41] - in[40]) << 63) + out[25] = + (in[41] - in[40]) >> 1 | + ((in[42] - in[41]) << 38) + out[26] = + (in[42] - in[41]) >> 26 | + ((in[43] - in[42]) << 13) | + ((in[44] - in[43]) << 52) + out[27] = + (in[44] - in[43]) >> 12 | + ((in[45] - in[44]) << 27) + out[28] = + (in[45] - in[44]) >> 37 | + ((in[46] - in[45]) << 2) | + ((in[47] - in[46]) << 41) + out[29] = + (in[47] - in[46]) >> 23 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 55) + out[30] = + (in[49] - in[48]) >> 9 | + ((in[50] - in[49]) << 30) + out[31] = + (in[50] - in[49]) >> 34 | + ((in[51] - in[50]) << 5) | + ((in[52] - in[51]) << 44) + out[32] = + (in[52] - in[51]) >> 20 | + ((in[53] - in[52]) << 19) | + ((in[54] - in[53]) << 58) + out[33] = + (in[54] - in[53]) >> 6 | + ((in[55] - in[54]) << 33) + out[34] = + (in[55] - in[54]) >> 31 | + ((in[56] - in[55]) << 8) | + ((in[57] - in[56]) << 47) + out[35] = + (in[57] - in[56]) >> 17 | + ((in[58] - in[57]) << 22) | + ((in[59] - in[58]) << 61) + out[36] = + (in[59] - in[58]) >> 3 | + ((in[60] - in[59]) << 36) + out[37] = + (in[60] - in[59]) >> 28 | + ((in[61] - in[60]) << 11) | + ((in[62] - in[61]) << 50) + out[38] = + (in[62] - in[61]) >> 14 | + ((in[63] - in[62]) << 25) +} + +func deltapack_uint64_40(initoffset uint64, in *[64]uint64, out *[40]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 40) + out[1] = + (in[1] - in[0]) >> 24 | + ((in[2] - in[1]) << 16) | + ((in[3] - in[2]) << 56) + out[2] = + (in[3] - in[2]) >> 8 | + ((in[4] - in[3]) << 32) + out[3] = + (in[4] - in[3]) >> 32 | + ((in[5] - in[4]) << 8) | + ((in[6] - in[5]) << 48) + out[4] = + (in[6] - in[5]) >> 16 | + ((in[7] - in[6]) << 24) + out[5] = + in[8] - in[7] | + ((in[9] - in[8]) << 40) + out[6] = + (in[9] - in[8]) >> 24 | + ((in[10] - in[9]) << 16) | + ((in[11] - in[10]) << 56) + out[7] = + (in[11] - in[10]) >> 8 | + ((in[12] - in[11]) << 32) + out[8] = + (in[12] - in[11]) >> 32 | + ((in[13] - in[12]) << 8) | + ((in[14] - in[13]) << 48) + out[9] = + (in[14] - in[13]) >> 16 | + ((in[15] - in[14]) << 24) + out[10] = + in[16] - in[15] | + ((in[17] - in[16]) << 40) + out[11] = + (in[17] - in[16]) >> 24 | + ((in[18] - in[17]) << 16) | + ((in[19] - in[18]) << 56) + out[12] = + (in[19] - in[18]) >> 8 | + ((in[20] - in[19]) << 32) + out[13] = + (in[20] - in[19]) >> 32 | + ((in[21] - in[20]) << 8) | + ((in[22] - in[21]) << 48) + out[14] = + (in[22] - in[21]) >> 16 | + ((in[23] - in[22]) << 24) + out[15] = + in[24] - in[23] | + ((in[25] - in[24]) << 40) + out[16] = + (in[25] - in[24]) >> 24 | + ((in[26] - in[25]) << 16) | + ((in[27] - in[26]) << 56) + out[17] = + (in[27] - in[26]) >> 8 | + ((in[28] - in[27]) << 32) + out[18] = + (in[28] - in[27]) >> 32 | + ((in[29] - in[28]) << 8) | + ((in[30] - in[29]) << 48) + out[19] = + (in[30] - in[29]) >> 16 | + ((in[31] - in[30]) << 24) + out[20] = + in[32] - in[31] | + ((in[33] - in[32]) << 40) + out[21] = + (in[33] - in[32]) >> 24 | + ((in[34] - in[33]) << 16) | + ((in[35] - in[34]) << 56) + out[22] = + (in[35] - in[34]) >> 8 | + ((in[36] - in[35]) << 32) + out[23] = + (in[36] - in[35]) >> 32 | + ((in[37] - in[36]) << 8) | + ((in[38] - in[37]) << 48) + out[24] = + (in[38] - in[37]) >> 16 | + ((in[39] - in[38]) << 24) + out[25] = + in[40] - in[39] | + ((in[41] - in[40]) << 40) + out[26] = + (in[41] - in[40]) >> 24 | + ((in[42] - in[41]) << 16) | + ((in[43] - in[42]) << 56) + out[27] = + (in[43] - in[42]) >> 8 | + ((in[44] - in[43]) << 32) + out[28] = + (in[44] - in[43]) >> 32 | + ((in[45] - in[44]) << 8) | + ((in[46] - in[45]) << 48) + out[29] = + (in[46] - in[45]) >> 16 | + ((in[47] - in[46]) << 24) + out[30] = + in[48] - in[47] | + ((in[49] - in[48]) << 40) + out[31] = + (in[49] - in[48]) >> 24 | + ((in[50] - in[49]) << 16) | + ((in[51] - in[50]) << 56) + out[32] = + (in[51] - in[50]) >> 8 | + ((in[52] - in[51]) << 32) + out[33] = + (in[52] - in[51]) >> 32 | + ((in[53] - in[52]) << 8) | + ((in[54] - in[53]) << 48) + out[34] = + (in[54] - in[53]) >> 16 | + ((in[55] - in[54]) << 24) + out[35] = + in[56] - in[55] | + ((in[57] - in[56]) << 40) + out[36] = + (in[57] - in[56]) >> 24 | + ((in[58] - in[57]) << 16) | + ((in[59] - in[58]) << 56) + out[37] = + (in[59] - in[58]) >> 8 | + ((in[60] - in[59]) << 32) + out[38] = + (in[60] - in[59]) >> 32 | + ((in[61] - in[60]) << 8) | + ((in[62] - in[61]) << 48) + out[39] = + (in[62] - in[61]) >> 16 | + ((in[63] - in[62]) << 24) +} + +func deltapack_uint64_41(initoffset uint64, in *[64]uint64, out *[41]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 41) + out[1] = + (in[1] - in[0]) >> 23 | + ((in[2] - in[1]) << 18) | + ((in[3] - in[2]) << 59) + out[2] = + (in[3] - in[2]) >> 5 | + ((in[4] - in[3]) << 36) + out[3] = + (in[4] - in[3]) >> 28 | + ((in[5] - in[4]) << 13) | + ((in[6] - in[5]) << 54) + out[4] = + (in[6] - in[5]) >> 10 | + ((in[7] - in[6]) << 31) + out[5] = + (in[7] - in[6]) >> 33 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 49) + out[6] = + (in[9] - in[8]) >> 15 | + ((in[10] - in[9]) << 26) + out[7] = + (in[10] - in[9]) >> 38 | + ((in[11] - in[10]) << 3) | + ((in[12] - in[11]) << 44) + out[8] = + (in[12] - in[11]) >> 20 | + ((in[13] - in[12]) << 21) | + ((in[14] - in[13]) << 62) + out[9] = + (in[14] - in[13]) >> 2 | + ((in[15] - in[14]) << 39) + out[10] = + (in[15] - in[14]) >> 25 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 57) + out[11] = + (in[17] - in[16]) >> 7 | + ((in[18] - in[17]) << 34) + out[12] = + (in[18] - in[17]) >> 30 | + ((in[19] - in[18]) << 11) | + ((in[20] - in[19]) << 52) + out[13] = + (in[20] - in[19]) >> 12 | + ((in[21] - in[20]) << 29) + out[14] = + (in[21] - in[20]) >> 35 | + ((in[22] - in[21]) << 6) | + ((in[23] - in[22]) << 47) + out[15] = + (in[23] - in[22]) >> 17 | + ((in[24] - in[23]) << 24) + out[16] = + (in[24] - in[23]) >> 40 | + ((in[25] - in[24]) << 1) | + ((in[26] - in[25]) << 42) + out[17] = + (in[26] - in[25]) >> 22 | + ((in[27] - in[26]) << 19) | + ((in[28] - in[27]) << 60) + out[18] = + (in[28] - in[27]) >> 4 | + ((in[29] - in[28]) << 37) + out[19] = + (in[29] - in[28]) >> 27 | + ((in[30] - in[29]) << 14) | + ((in[31] - in[30]) << 55) + out[20] = + (in[31] - in[30]) >> 9 | + ((in[32] - in[31]) << 32) + out[21] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 9) | + ((in[34] - in[33]) << 50) + out[22] = + (in[34] - in[33]) >> 14 | + ((in[35] - in[34]) << 27) + out[23] = + (in[35] - in[34]) >> 37 | + ((in[36] - in[35]) << 4) | + ((in[37] - in[36]) << 45) + out[24] = + (in[37] - in[36]) >> 19 | + ((in[38] - in[37]) << 22) | + ((in[39] - in[38]) << 63) + out[25] = + (in[39] - in[38]) >> 1 | + ((in[40] - in[39]) << 40) + out[26] = + (in[40] - in[39]) >> 24 | + ((in[41] - in[40]) << 17) | + ((in[42] - in[41]) << 58) + out[27] = + (in[42] - in[41]) >> 6 | + ((in[43] - in[42]) << 35) + out[28] = + (in[43] - in[42]) >> 29 | + ((in[44] - in[43]) << 12) | + ((in[45] - in[44]) << 53) + out[29] = + (in[45] - in[44]) >> 11 | + ((in[46] - in[45]) << 30) + out[30] = + (in[46] - in[45]) >> 34 | + ((in[47] - in[46]) << 7) | + ((in[48] - in[47]) << 48) + out[31] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 25) + out[32] = + (in[49] - in[48]) >> 39 | + ((in[50] - in[49]) << 2) | + ((in[51] - in[50]) << 43) + out[33] = + (in[51] - in[50]) >> 21 | + ((in[52] - in[51]) << 20) | + ((in[53] - in[52]) << 61) + out[34] = + (in[53] - in[52]) >> 3 | + ((in[54] - in[53]) << 38) + out[35] = + (in[54] - in[53]) >> 26 | + ((in[55] - in[54]) << 15) | + ((in[56] - in[55]) << 56) + out[36] = + (in[56] - in[55]) >> 8 | + ((in[57] - in[56]) << 33) + out[37] = + (in[57] - in[56]) >> 31 | + ((in[58] - in[57]) << 10) | + ((in[59] - in[58]) << 51) + out[38] = + (in[59] - in[58]) >> 13 | + ((in[60] - in[59]) << 28) + out[39] = + (in[60] - in[59]) >> 36 | + ((in[61] - in[60]) << 5) | + ((in[62] - in[61]) << 46) + out[40] = + (in[62] - in[61]) >> 18 | + ((in[63] - in[62]) << 23) +} + +func deltapack_uint64_42(initoffset uint64, in *[64]uint64, out *[42]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 42) + out[1] = + (in[1] - in[0]) >> 22 | + ((in[2] - in[1]) << 20) | + ((in[3] - in[2]) << 62) + out[2] = + (in[3] - in[2]) >> 2 | + ((in[4] - in[3]) << 40) + out[3] = + (in[4] - in[3]) >> 24 | + ((in[5] - in[4]) << 18) | + ((in[6] - in[5]) << 60) + out[4] = + (in[6] - in[5]) >> 4 | + ((in[7] - in[6]) << 38) + out[5] = + (in[7] - in[6]) >> 26 | + ((in[8] - in[7]) << 16) | + ((in[9] - in[8]) << 58) + out[6] = + (in[9] - in[8]) >> 6 | + ((in[10] - in[9]) << 36) + out[7] = + (in[10] - in[9]) >> 28 | + ((in[11] - in[10]) << 14) | + ((in[12] - in[11]) << 56) + out[8] = + (in[12] - in[11]) >> 8 | + ((in[13] - in[12]) << 34) + out[9] = + (in[13] - in[12]) >> 30 | + ((in[14] - in[13]) << 12) | + ((in[15] - in[14]) << 54) + out[10] = + (in[15] - in[14]) >> 10 | + ((in[16] - in[15]) << 32) + out[11] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 10) | + ((in[18] - in[17]) << 52) + out[12] = + (in[18] - in[17]) >> 12 | + ((in[19] - in[18]) << 30) + out[13] = + (in[19] - in[18]) >> 34 | + ((in[20] - in[19]) << 8) | + ((in[21] - in[20]) << 50) + out[14] = + (in[21] - in[20]) >> 14 | + ((in[22] - in[21]) << 28) + out[15] = + (in[22] - in[21]) >> 36 | + ((in[23] - in[22]) << 6) | + ((in[24] - in[23]) << 48) + out[16] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 26) + out[17] = + (in[25] - in[24]) >> 38 | + ((in[26] - in[25]) << 4) | + ((in[27] - in[26]) << 46) + out[18] = + (in[27] - in[26]) >> 18 | + ((in[28] - in[27]) << 24) + out[19] = + (in[28] - in[27]) >> 40 | + ((in[29] - in[28]) << 2) | + ((in[30] - in[29]) << 44) + out[20] = + (in[30] - in[29]) >> 20 | + ((in[31] - in[30]) << 22) + out[21] = + in[32] - in[31] | + ((in[33] - in[32]) << 42) + out[22] = + (in[33] - in[32]) >> 22 | + ((in[34] - in[33]) << 20) | + ((in[35] - in[34]) << 62) + out[23] = + (in[35] - in[34]) >> 2 | + ((in[36] - in[35]) << 40) + out[24] = + (in[36] - in[35]) >> 24 | + ((in[37] - in[36]) << 18) | + ((in[38] - in[37]) << 60) + out[25] = + (in[38] - in[37]) >> 4 | + ((in[39] - in[38]) << 38) + out[26] = + (in[39] - in[38]) >> 26 | + ((in[40] - in[39]) << 16) | + ((in[41] - in[40]) << 58) + out[27] = + (in[41] - in[40]) >> 6 | + ((in[42] - in[41]) << 36) + out[28] = + (in[42] - in[41]) >> 28 | + ((in[43] - in[42]) << 14) | + ((in[44] - in[43]) << 56) + out[29] = + (in[44] - in[43]) >> 8 | + ((in[45] - in[44]) << 34) + out[30] = + (in[45] - in[44]) >> 30 | + ((in[46] - in[45]) << 12) | + ((in[47] - in[46]) << 54) + out[31] = + (in[47] - in[46]) >> 10 | + ((in[48] - in[47]) << 32) + out[32] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 10) | + ((in[50] - in[49]) << 52) + out[33] = + (in[50] - in[49]) >> 12 | + ((in[51] - in[50]) << 30) + out[34] = + (in[51] - in[50]) >> 34 | + ((in[52] - in[51]) << 8) | + ((in[53] - in[52]) << 50) + out[35] = + (in[53] - in[52]) >> 14 | + ((in[54] - in[53]) << 28) + out[36] = + (in[54] - in[53]) >> 36 | + ((in[55] - in[54]) << 6) | + ((in[56] - in[55]) << 48) + out[37] = + (in[56] - in[55]) >> 16 | + ((in[57] - in[56]) << 26) + out[38] = + (in[57] - in[56]) >> 38 | + ((in[58] - in[57]) << 4) | + ((in[59] - in[58]) << 46) + out[39] = + (in[59] - in[58]) >> 18 | + ((in[60] - in[59]) << 24) + out[40] = + (in[60] - in[59]) >> 40 | + ((in[61] - in[60]) << 2) | + ((in[62] - in[61]) << 44) + out[41] = + (in[62] - in[61]) >> 20 | + ((in[63] - in[62]) << 22) +} + +func deltapack_uint64_43(initoffset uint64, in *[64]uint64, out *[43]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 43) + out[1] = + (in[1] - in[0]) >> 21 | + ((in[2] - in[1]) << 22) + out[2] = + (in[2] - in[1]) >> 42 | + ((in[3] - in[2]) << 1) | + ((in[4] - in[3]) << 44) + out[3] = + (in[4] - in[3]) >> 20 | + ((in[5] - in[4]) << 23) + out[4] = + (in[5] - in[4]) >> 41 | + ((in[6] - in[5]) << 2) | + ((in[7] - in[6]) << 45) + out[5] = + (in[7] - in[6]) >> 19 | + ((in[8] - in[7]) << 24) + out[6] = + (in[8] - in[7]) >> 40 | + ((in[9] - in[8]) << 3) | + ((in[10] - in[9]) << 46) + out[7] = + (in[10] - in[9]) >> 18 | + ((in[11] - in[10]) << 25) + out[8] = + (in[11] - in[10]) >> 39 | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 47) + out[9] = + (in[13] - in[12]) >> 17 | + ((in[14] - in[13]) << 26) + out[10] = + (in[14] - in[13]) >> 38 | + ((in[15] - in[14]) << 5) | + ((in[16] - in[15]) << 48) + out[11] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 27) + out[12] = + (in[17] - in[16]) >> 37 | + ((in[18] - in[17]) << 6) | + ((in[19] - in[18]) << 49) + out[13] = + (in[19] - in[18]) >> 15 | + ((in[20] - in[19]) << 28) + out[14] = + (in[20] - in[19]) >> 36 | + ((in[21] - in[20]) << 7) | + ((in[22] - in[21]) << 50) + out[15] = + (in[22] - in[21]) >> 14 | + ((in[23] - in[22]) << 29) + out[16] = + (in[23] - in[22]) >> 35 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 51) + out[17] = + (in[25] - in[24]) >> 13 | + ((in[26] - in[25]) << 30) + out[18] = + (in[26] - in[25]) >> 34 | + ((in[27] - in[26]) << 9) | + ((in[28] - in[27]) << 52) + out[19] = + (in[28] - in[27]) >> 12 | + ((in[29] - in[28]) << 31) + out[20] = + (in[29] - in[28]) >> 33 | + ((in[30] - in[29]) << 10) | + ((in[31] - in[30]) << 53) + out[21] = + (in[31] - in[30]) >> 11 | + ((in[32] - in[31]) << 32) + out[22] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 11) | + ((in[34] - in[33]) << 54) + out[23] = + (in[34] - in[33]) >> 10 | + ((in[35] - in[34]) << 33) + out[24] = + (in[35] - in[34]) >> 31 | + ((in[36] - in[35]) << 12) | + ((in[37] - in[36]) << 55) + out[25] = + (in[37] - in[36]) >> 9 | + ((in[38] - in[37]) << 34) + out[26] = + (in[38] - in[37]) >> 30 | + ((in[39] - in[38]) << 13) | + ((in[40] - in[39]) << 56) + out[27] = + (in[40] - in[39]) >> 8 | + ((in[41] - in[40]) << 35) + out[28] = + (in[41] - in[40]) >> 29 | + ((in[42] - in[41]) << 14) | + ((in[43] - in[42]) << 57) + out[29] = + (in[43] - in[42]) >> 7 | + ((in[44] - in[43]) << 36) + out[30] = + (in[44] - in[43]) >> 28 | + ((in[45] - in[44]) << 15) | + ((in[46] - in[45]) << 58) + out[31] = + (in[46] - in[45]) >> 6 | + ((in[47] - in[46]) << 37) + out[32] = + (in[47] - in[46]) >> 27 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 59) + out[33] = + (in[49] - in[48]) >> 5 | + ((in[50] - in[49]) << 38) + out[34] = + (in[50] - in[49]) >> 26 | + ((in[51] - in[50]) << 17) | + ((in[52] - in[51]) << 60) + out[35] = + (in[52] - in[51]) >> 4 | + ((in[53] - in[52]) << 39) + out[36] = + (in[53] - in[52]) >> 25 | + ((in[54] - in[53]) << 18) | + ((in[55] - in[54]) << 61) + out[37] = + (in[55] - in[54]) >> 3 | + ((in[56] - in[55]) << 40) + out[38] = + (in[56] - in[55]) >> 24 | + ((in[57] - in[56]) << 19) | + ((in[58] - in[57]) << 62) + out[39] = + (in[58] - in[57]) >> 2 | + ((in[59] - in[58]) << 41) + out[40] = + (in[59] - in[58]) >> 23 | + ((in[60] - in[59]) << 20) | + ((in[61] - in[60]) << 63) + out[41] = + (in[61] - in[60]) >> 1 | + ((in[62] - in[61]) << 42) + out[42] = + (in[62] - in[61]) >> 22 | + ((in[63] - in[62]) << 21) +} + +func deltapack_uint64_44(initoffset uint64, in *[64]uint64, out *[44]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 44) + out[1] = + (in[1] - in[0]) >> 20 | + ((in[2] - in[1]) << 24) + out[2] = + (in[2] - in[1]) >> 40 | + ((in[3] - in[2]) << 4) | + ((in[4] - in[3]) << 48) + out[3] = + (in[4] - in[3]) >> 16 | + ((in[5] - in[4]) << 28) + out[4] = + (in[5] - in[4]) >> 36 | + ((in[6] - in[5]) << 8) | + ((in[7] - in[6]) << 52) + out[5] = + (in[7] - in[6]) >> 12 | + ((in[8] - in[7]) << 32) + out[6] = + (in[8] - in[7]) >> 32 | + ((in[9] - in[8]) << 12) | + ((in[10] - in[9]) << 56) + out[7] = + (in[10] - in[9]) >> 8 | + ((in[11] - in[10]) << 36) + out[8] = + (in[11] - in[10]) >> 28 | + ((in[12] - in[11]) << 16) | + ((in[13] - in[12]) << 60) + out[9] = + (in[13] - in[12]) >> 4 | + ((in[14] - in[13]) << 40) + out[10] = + (in[14] - in[13]) >> 24 | + ((in[15] - in[14]) << 20) + out[11] = + in[16] - in[15] | + ((in[17] - in[16]) << 44) + out[12] = + (in[17] - in[16]) >> 20 | + ((in[18] - in[17]) << 24) + out[13] = + (in[18] - in[17]) >> 40 | + ((in[19] - in[18]) << 4) | + ((in[20] - in[19]) << 48) + out[14] = + (in[20] - in[19]) >> 16 | + ((in[21] - in[20]) << 28) + out[15] = + (in[21] - in[20]) >> 36 | + ((in[22] - in[21]) << 8) | + ((in[23] - in[22]) << 52) + out[16] = + (in[23] - in[22]) >> 12 | + ((in[24] - in[23]) << 32) + out[17] = + (in[24] - in[23]) >> 32 | + ((in[25] - in[24]) << 12) | + ((in[26] - in[25]) << 56) + out[18] = + (in[26] - in[25]) >> 8 | + ((in[27] - in[26]) << 36) + out[19] = + (in[27] - in[26]) >> 28 | + ((in[28] - in[27]) << 16) | + ((in[29] - in[28]) << 60) + out[20] = + (in[29] - in[28]) >> 4 | + ((in[30] - in[29]) << 40) + out[21] = + (in[30] - in[29]) >> 24 | + ((in[31] - in[30]) << 20) + out[22] = + in[32] - in[31] | + ((in[33] - in[32]) << 44) + out[23] = + (in[33] - in[32]) >> 20 | + ((in[34] - in[33]) << 24) + out[24] = + (in[34] - in[33]) >> 40 | + ((in[35] - in[34]) << 4) | + ((in[36] - in[35]) << 48) + out[25] = + (in[36] - in[35]) >> 16 | + ((in[37] - in[36]) << 28) + out[26] = + (in[37] - in[36]) >> 36 | + ((in[38] - in[37]) << 8) | + ((in[39] - in[38]) << 52) + out[27] = + (in[39] - in[38]) >> 12 | + ((in[40] - in[39]) << 32) + out[28] = + (in[40] - in[39]) >> 32 | + ((in[41] - in[40]) << 12) | + ((in[42] - in[41]) << 56) + out[29] = + (in[42] - in[41]) >> 8 | + ((in[43] - in[42]) << 36) + out[30] = + (in[43] - in[42]) >> 28 | + ((in[44] - in[43]) << 16) | + ((in[45] - in[44]) << 60) + out[31] = + (in[45] - in[44]) >> 4 | + ((in[46] - in[45]) << 40) + out[32] = + (in[46] - in[45]) >> 24 | + ((in[47] - in[46]) << 20) + out[33] = + in[48] - in[47] | + ((in[49] - in[48]) << 44) + out[34] = + (in[49] - in[48]) >> 20 | + ((in[50] - in[49]) << 24) + out[35] = + (in[50] - in[49]) >> 40 | + ((in[51] - in[50]) << 4) | + ((in[52] - in[51]) << 48) + out[36] = + (in[52] - in[51]) >> 16 | + ((in[53] - in[52]) << 28) + out[37] = + (in[53] - in[52]) >> 36 | + ((in[54] - in[53]) << 8) | + ((in[55] - in[54]) << 52) + out[38] = + (in[55] - in[54]) >> 12 | + ((in[56] - in[55]) << 32) + out[39] = + (in[56] - in[55]) >> 32 | + ((in[57] - in[56]) << 12) | + ((in[58] - in[57]) << 56) + out[40] = + (in[58] - in[57]) >> 8 | + ((in[59] - in[58]) << 36) + out[41] = + (in[59] - in[58]) >> 28 | + ((in[60] - in[59]) << 16) | + ((in[61] - in[60]) << 60) + out[42] = + (in[61] - in[60]) >> 4 | + ((in[62] - in[61]) << 40) + out[43] = + (in[62] - in[61]) >> 24 | + ((in[63] - in[62]) << 20) +} + +func deltapack_uint64_45(initoffset uint64, in *[64]uint64, out *[45]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 45) + out[1] = + (in[1] - in[0]) >> 19 | + ((in[2] - in[1]) << 26) + out[2] = + (in[2] - in[1]) >> 38 | + ((in[3] - in[2]) << 7) | + ((in[4] - in[3]) << 52) + out[3] = + (in[4] - in[3]) >> 12 | + ((in[5] - in[4]) << 33) + out[4] = + (in[5] - in[4]) >> 31 | + ((in[6] - in[5]) << 14) | + ((in[7] - in[6]) << 59) + out[5] = + (in[7] - in[6]) >> 5 | + ((in[8] - in[7]) << 40) + out[6] = + (in[8] - in[7]) >> 24 | + ((in[9] - in[8]) << 21) + out[7] = + (in[9] - in[8]) >> 43 | + ((in[10] - in[9]) << 2) | + ((in[11] - in[10]) << 47) + out[8] = + (in[11] - in[10]) >> 17 | + ((in[12] - in[11]) << 28) + out[9] = + (in[12] - in[11]) >> 36 | + ((in[13] - in[12]) << 9) | + ((in[14] - in[13]) << 54) + out[10] = + (in[14] - in[13]) >> 10 | + ((in[15] - in[14]) << 35) + out[11] = + (in[15] - in[14]) >> 29 | + ((in[16] - in[15]) << 16) | + ((in[17] - in[16]) << 61) + out[12] = + (in[17] - in[16]) >> 3 | + ((in[18] - in[17]) << 42) + out[13] = + (in[18] - in[17]) >> 22 | + ((in[19] - in[18]) << 23) + out[14] = + (in[19] - in[18]) >> 41 | + ((in[20] - in[19]) << 4) | + ((in[21] - in[20]) << 49) + out[15] = + (in[21] - in[20]) >> 15 | + ((in[22] - in[21]) << 30) + out[16] = + (in[22] - in[21]) >> 34 | + ((in[23] - in[22]) << 11) | + ((in[24] - in[23]) << 56) + out[17] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 37) + out[18] = + (in[25] - in[24]) >> 27 | + ((in[26] - in[25]) << 18) | + ((in[27] - in[26]) << 63) + out[19] = + (in[27] - in[26]) >> 1 | + ((in[28] - in[27]) << 44) + out[20] = + (in[28] - in[27]) >> 20 | + ((in[29] - in[28]) << 25) + out[21] = + (in[29] - in[28]) >> 39 | + ((in[30] - in[29]) << 6) | + ((in[31] - in[30]) << 51) + out[22] = + (in[31] - in[30]) >> 13 | + ((in[32] - in[31]) << 32) + out[23] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 13) | + ((in[34] - in[33]) << 58) + out[24] = + (in[34] - in[33]) >> 6 | + ((in[35] - in[34]) << 39) + out[25] = + (in[35] - in[34]) >> 25 | + ((in[36] - in[35]) << 20) + out[26] = + (in[36] - in[35]) >> 44 | + ((in[37] - in[36]) << 1) | + ((in[38] - in[37]) << 46) + out[27] = + (in[38] - in[37]) >> 18 | + ((in[39] - in[38]) << 27) + out[28] = + (in[39] - in[38]) >> 37 | + ((in[40] - in[39]) << 8) | + ((in[41] - in[40]) << 53) + out[29] = + (in[41] - in[40]) >> 11 | + ((in[42] - in[41]) << 34) + out[30] = + (in[42] - in[41]) >> 30 | + ((in[43] - in[42]) << 15) | + ((in[44] - in[43]) << 60) + out[31] = + (in[44] - in[43]) >> 4 | + ((in[45] - in[44]) << 41) + out[32] = + (in[45] - in[44]) >> 23 | + ((in[46] - in[45]) << 22) + out[33] = + (in[46] - in[45]) >> 42 | + ((in[47] - in[46]) << 3) | + ((in[48] - in[47]) << 48) + out[34] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 29) + out[35] = + (in[49] - in[48]) >> 35 | + ((in[50] - in[49]) << 10) | + ((in[51] - in[50]) << 55) + out[36] = + (in[51] - in[50]) >> 9 | + ((in[52] - in[51]) << 36) + out[37] = + (in[52] - in[51]) >> 28 | + ((in[53] - in[52]) << 17) | + ((in[54] - in[53]) << 62) + out[38] = + (in[54] - in[53]) >> 2 | + ((in[55] - in[54]) << 43) + out[39] = + (in[55] - in[54]) >> 21 | + ((in[56] - in[55]) << 24) + out[40] = + (in[56] - in[55]) >> 40 | + ((in[57] - in[56]) << 5) | + ((in[58] - in[57]) << 50) + out[41] = + (in[58] - in[57]) >> 14 | + ((in[59] - in[58]) << 31) + out[42] = + (in[59] - in[58]) >> 33 | + ((in[60] - in[59]) << 12) | + ((in[61] - in[60]) << 57) + out[43] = + (in[61] - in[60]) >> 7 | + ((in[62] - in[61]) << 38) + out[44] = + (in[62] - in[61]) >> 26 | + ((in[63] - in[62]) << 19) +} + +func deltapack_uint64_46(initoffset uint64, in *[64]uint64, out *[46]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 46) + out[1] = + (in[1] - in[0]) >> 18 | + ((in[2] - in[1]) << 28) + out[2] = + (in[2] - in[1]) >> 36 | + ((in[3] - in[2]) << 10) | + ((in[4] - in[3]) << 56) + out[3] = + (in[4] - in[3]) >> 8 | + ((in[5] - in[4]) << 38) + out[4] = + (in[5] - in[4]) >> 26 | + ((in[6] - in[5]) << 20) + out[5] = + (in[6] - in[5]) >> 44 | + ((in[7] - in[6]) << 2) | + ((in[8] - in[7]) << 48) + out[6] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 30) + out[7] = + (in[9] - in[8]) >> 34 | + ((in[10] - in[9]) << 12) | + ((in[11] - in[10]) << 58) + out[8] = + (in[11] - in[10]) >> 6 | + ((in[12] - in[11]) << 40) + out[9] = + (in[12] - in[11]) >> 24 | + ((in[13] - in[12]) << 22) + out[10] = + (in[13] - in[12]) >> 42 | + ((in[14] - in[13]) << 4) | + ((in[15] - in[14]) << 50) + out[11] = + (in[15] - in[14]) >> 14 | + ((in[16] - in[15]) << 32) + out[12] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 14) | + ((in[18] - in[17]) << 60) + out[13] = + (in[18] - in[17]) >> 4 | + ((in[19] - in[18]) << 42) + out[14] = + (in[19] - in[18]) >> 22 | + ((in[20] - in[19]) << 24) + out[15] = + (in[20] - in[19]) >> 40 | + ((in[21] - in[20]) << 6) | + ((in[22] - in[21]) << 52) + out[16] = + (in[22] - in[21]) >> 12 | + ((in[23] - in[22]) << 34) + out[17] = + (in[23] - in[22]) >> 30 | + ((in[24] - in[23]) << 16) | + ((in[25] - in[24]) << 62) + out[18] = + (in[25] - in[24]) >> 2 | + ((in[26] - in[25]) << 44) + out[19] = + (in[26] - in[25]) >> 20 | + ((in[27] - in[26]) << 26) + out[20] = + (in[27] - in[26]) >> 38 | + ((in[28] - in[27]) << 8) | + ((in[29] - in[28]) << 54) + out[21] = + (in[29] - in[28]) >> 10 | + ((in[30] - in[29]) << 36) + out[22] = + (in[30] - in[29]) >> 28 | + ((in[31] - in[30]) << 18) + out[23] = + in[32] - in[31] | + ((in[33] - in[32]) << 46) + out[24] = + (in[33] - in[32]) >> 18 | + ((in[34] - in[33]) << 28) + out[25] = + (in[34] - in[33]) >> 36 | + ((in[35] - in[34]) << 10) | + ((in[36] - in[35]) << 56) + out[26] = + (in[36] - in[35]) >> 8 | + ((in[37] - in[36]) << 38) + out[27] = + (in[37] - in[36]) >> 26 | + ((in[38] - in[37]) << 20) + out[28] = + (in[38] - in[37]) >> 44 | + ((in[39] - in[38]) << 2) | + ((in[40] - in[39]) << 48) + out[29] = + (in[40] - in[39]) >> 16 | + ((in[41] - in[40]) << 30) + out[30] = + (in[41] - in[40]) >> 34 | + ((in[42] - in[41]) << 12) | + ((in[43] - in[42]) << 58) + out[31] = + (in[43] - in[42]) >> 6 | + ((in[44] - in[43]) << 40) + out[32] = + (in[44] - in[43]) >> 24 | + ((in[45] - in[44]) << 22) + out[33] = + (in[45] - in[44]) >> 42 | + ((in[46] - in[45]) << 4) | + ((in[47] - in[46]) << 50) + out[34] = + (in[47] - in[46]) >> 14 | + ((in[48] - in[47]) << 32) + out[35] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 14) | + ((in[50] - in[49]) << 60) + out[36] = + (in[50] - in[49]) >> 4 | + ((in[51] - in[50]) << 42) + out[37] = + (in[51] - in[50]) >> 22 | + ((in[52] - in[51]) << 24) + out[38] = + (in[52] - in[51]) >> 40 | + ((in[53] - in[52]) << 6) | + ((in[54] - in[53]) << 52) + out[39] = + (in[54] - in[53]) >> 12 | + ((in[55] - in[54]) << 34) + out[40] = + (in[55] - in[54]) >> 30 | + ((in[56] - in[55]) << 16) | + ((in[57] - in[56]) << 62) + out[41] = + (in[57] - in[56]) >> 2 | + ((in[58] - in[57]) << 44) + out[42] = + (in[58] - in[57]) >> 20 | + ((in[59] - in[58]) << 26) + out[43] = + (in[59] - in[58]) >> 38 | + ((in[60] - in[59]) << 8) | + ((in[61] - in[60]) << 54) + out[44] = + (in[61] - in[60]) >> 10 | + ((in[62] - in[61]) << 36) + out[45] = + (in[62] - in[61]) >> 28 | + ((in[63] - in[62]) << 18) +} + +func deltapack_uint64_47(initoffset uint64, in *[64]uint64, out *[47]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 47) + out[1] = + (in[1] - in[0]) >> 17 | + ((in[2] - in[1]) << 30) + out[2] = + (in[2] - in[1]) >> 34 | + ((in[3] - in[2]) << 13) | + ((in[4] - in[3]) << 60) + out[3] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 43) + out[4] = + (in[5] - in[4]) >> 21 | + ((in[6] - in[5]) << 26) + out[5] = + (in[6] - in[5]) >> 38 | + ((in[7] - in[6]) << 9) | + ((in[8] - in[7]) << 56) + out[6] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 39) + out[7] = + (in[9] - in[8]) >> 25 | + ((in[10] - in[9]) << 22) + out[8] = + (in[10] - in[9]) >> 42 | + ((in[11] - in[10]) << 5) | + ((in[12] - in[11]) << 52) + out[9] = + (in[12] - in[11]) >> 12 | + ((in[13] - in[12]) << 35) + out[10] = + (in[13] - in[12]) >> 29 | + ((in[14] - in[13]) << 18) + out[11] = + (in[14] - in[13]) >> 46 | + ((in[15] - in[14]) << 1) | + ((in[16] - in[15]) << 48) + out[12] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 31) + out[13] = + (in[17] - in[16]) >> 33 | + ((in[18] - in[17]) << 14) | + ((in[19] - in[18]) << 61) + out[14] = + (in[19] - in[18]) >> 3 | + ((in[20] - in[19]) << 44) + out[15] = + (in[20] - in[19]) >> 20 | + ((in[21] - in[20]) << 27) + out[16] = + (in[21] - in[20]) >> 37 | + ((in[22] - in[21]) << 10) | + ((in[23] - in[22]) << 57) + out[17] = + (in[23] - in[22]) >> 7 | + ((in[24] - in[23]) << 40) + out[18] = + (in[24] - in[23]) >> 24 | + ((in[25] - in[24]) << 23) + out[19] = + (in[25] - in[24]) >> 41 | + ((in[26] - in[25]) << 6) | + ((in[27] - in[26]) << 53) + out[20] = + (in[27] - in[26]) >> 11 | + ((in[28] - in[27]) << 36) + out[21] = + (in[28] - in[27]) >> 28 | + ((in[29] - in[28]) << 19) + out[22] = + (in[29] - in[28]) >> 45 | + ((in[30] - in[29]) << 2) | + ((in[31] - in[30]) << 49) + out[23] = + (in[31] - in[30]) >> 15 | + ((in[32] - in[31]) << 32) + out[24] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 15) | + ((in[34] - in[33]) << 62) + out[25] = + (in[34] - in[33]) >> 2 | + ((in[35] - in[34]) << 45) + out[26] = + (in[35] - in[34]) >> 19 | + ((in[36] - in[35]) << 28) + out[27] = + (in[36] - in[35]) >> 36 | + ((in[37] - in[36]) << 11) | + ((in[38] - in[37]) << 58) + out[28] = + (in[38] - in[37]) >> 6 | + ((in[39] - in[38]) << 41) + out[29] = + (in[39] - in[38]) >> 23 | + ((in[40] - in[39]) << 24) + out[30] = + (in[40] - in[39]) >> 40 | + ((in[41] - in[40]) << 7) | + ((in[42] - in[41]) << 54) + out[31] = + (in[42] - in[41]) >> 10 | + ((in[43] - in[42]) << 37) + out[32] = + (in[43] - in[42]) >> 27 | + ((in[44] - in[43]) << 20) + out[33] = + (in[44] - in[43]) >> 44 | + ((in[45] - in[44]) << 3) | + ((in[46] - in[45]) << 50) + out[34] = + (in[46] - in[45]) >> 14 | + ((in[47] - in[46]) << 33) + out[35] = + (in[47] - in[46]) >> 31 | + ((in[48] - in[47]) << 16) | + ((in[49] - in[48]) << 63) + out[36] = + (in[49] - in[48]) >> 1 | + ((in[50] - in[49]) << 46) + out[37] = + (in[50] - in[49]) >> 18 | + ((in[51] - in[50]) << 29) + out[38] = + (in[51] - in[50]) >> 35 | + ((in[52] - in[51]) << 12) | + ((in[53] - in[52]) << 59) + out[39] = + (in[53] - in[52]) >> 5 | + ((in[54] - in[53]) << 42) + out[40] = + (in[54] - in[53]) >> 22 | + ((in[55] - in[54]) << 25) + out[41] = + (in[55] - in[54]) >> 39 | + ((in[56] - in[55]) << 8) | + ((in[57] - in[56]) << 55) + out[42] = + (in[57] - in[56]) >> 9 | + ((in[58] - in[57]) << 38) + out[43] = + (in[58] - in[57]) >> 26 | + ((in[59] - in[58]) << 21) + out[44] = + (in[59] - in[58]) >> 43 | + ((in[60] - in[59]) << 4) | + ((in[61] - in[60]) << 51) + out[45] = + (in[61] - in[60]) >> 13 | + ((in[62] - in[61]) << 34) + out[46] = + (in[62] - in[61]) >> 30 | + ((in[63] - in[62]) << 17) +} + +func deltapack_uint64_48(initoffset uint64, in *[64]uint64, out *[48]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 48) + out[1] = + (in[1] - in[0]) >> 16 | + ((in[2] - in[1]) << 32) + out[2] = + (in[2] - in[1]) >> 32 | + ((in[3] - in[2]) << 16) + out[3] = + in[4] - in[3] | + ((in[5] - in[4]) << 48) + out[4] = + (in[5] - in[4]) >> 16 | + ((in[6] - in[5]) << 32) + out[5] = + (in[6] - in[5]) >> 32 | + ((in[7] - in[6]) << 16) + out[6] = + in[8] - in[7] | + ((in[9] - in[8]) << 48) + out[7] = + (in[9] - in[8]) >> 16 | + ((in[10] - in[9]) << 32) + out[8] = + (in[10] - in[9]) >> 32 | + ((in[11] - in[10]) << 16) + out[9] = + in[12] - in[11] | + ((in[13] - in[12]) << 48) + out[10] = + (in[13] - in[12]) >> 16 | + ((in[14] - in[13]) << 32) + out[11] = + (in[14] - in[13]) >> 32 | + ((in[15] - in[14]) << 16) + out[12] = + in[16] - in[15] | + ((in[17] - in[16]) << 48) + out[13] = + (in[17] - in[16]) >> 16 | + ((in[18] - in[17]) << 32) + out[14] = + (in[18] - in[17]) >> 32 | + ((in[19] - in[18]) << 16) + out[15] = + in[20] - in[19] | + ((in[21] - in[20]) << 48) + out[16] = + (in[21] - in[20]) >> 16 | + ((in[22] - in[21]) << 32) + out[17] = + (in[22] - in[21]) >> 32 | + ((in[23] - in[22]) << 16) + out[18] = + in[24] - in[23] | + ((in[25] - in[24]) << 48) + out[19] = + (in[25] - in[24]) >> 16 | + ((in[26] - in[25]) << 32) + out[20] = + (in[26] - in[25]) >> 32 | + ((in[27] - in[26]) << 16) + out[21] = + in[28] - in[27] | + ((in[29] - in[28]) << 48) + out[22] = + (in[29] - in[28]) >> 16 | + ((in[30] - in[29]) << 32) + out[23] = + (in[30] - in[29]) >> 32 | + ((in[31] - in[30]) << 16) + out[24] = + in[32] - in[31] | + ((in[33] - in[32]) << 48) + out[25] = + (in[33] - in[32]) >> 16 | + ((in[34] - in[33]) << 32) + out[26] = + (in[34] - in[33]) >> 32 | + ((in[35] - in[34]) << 16) + out[27] = + in[36] - in[35] | + ((in[37] - in[36]) << 48) + out[28] = + (in[37] - in[36]) >> 16 | + ((in[38] - in[37]) << 32) + out[29] = + (in[38] - in[37]) >> 32 | + ((in[39] - in[38]) << 16) + out[30] = + in[40] - in[39] | + ((in[41] - in[40]) << 48) + out[31] = + (in[41] - in[40]) >> 16 | + ((in[42] - in[41]) << 32) + out[32] = + (in[42] - in[41]) >> 32 | + ((in[43] - in[42]) << 16) + out[33] = + in[44] - in[43] | + ((in[45] - in[44]) << 48) + out[34] = + (in[45] - in[44]) >> 16 | + ((in[46] - in[45]) << 32) + out[35] = + (in[46] - in[45]) >> 32 | + ((in[47] - in[46]) << 16) + out[36] = + in[48] - in[47] | + ((in[49] - in[48]) << 48) + out[37] = + (in[49] - in[48]) >> 16 | + ((in[50] - in[49]) << 32) + out[38] = + (in[50] - in[49]) >> 32 | + ((in[51] - in[50]) << 16) + out[39] = + in[52] - in[51] | + ((in[53] - in[52]) << 48) + out[40] = + (in[53] - in[52]) >> 16 | + ((in[54] - in[53]) << 32) + out[41] = + (in[54] - in[53]) >> 32 | + ((in[55] - in[54]) << 16) + out[42] = + in[56] - in[55] | + ((in[57] - in[56]) << 48) + out[43] = + (in[57] - in[56]) >> 16 | + ((in[58] - in[57]) << 32) + out[44] = + (in[58] - in[57]) >> 32 | + ((in[59] - in[58]) << 16) + out[45] = + in[60] - in[59] | + ((in[61] - in[60]) << 48) + out[46] = + (in[61] - in[60]) >> 16 | + ((in[62] - in[61]) << 32) + out[47] = + (in[62] - in[61]) >> 32 | + ((in[63] - in[62]) << 16) +} + +func deltapack_uint64_49(initoffset uint64, in *[64]uint64, out *[49]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 49) + out[1] = + (in[1] - in[0]) >> 15 | + ((in[2] - in[1]) << 34) + out[2] = + (in[2] - in[1]) >> 30 | + ((in[3] - in[2]) << 19) + out[3] = + (in[3] - in[2]) >> 45 | + ((in[4] - in[3]) << 4) | + ((in[5] - in[4]) << 53) + out[4] = + (in[5] - in[4]) >> 11 | + ((in[6] - in[5]) << 38) + out[5] = + (in[6] - in[5]) >> 26 | + ((in[7] - in[6]) << 23) + out[6] = + (in[7] - in[6]) >> 41 | + ((in[8] - in[7]) << 8) | + ((in[9] - in[8]) << 57) + out[7] = + (in[9] - in[8]) >> 7 | + ((in[10] - in[9]) << 42) + out[8] = + (in[10] - in[9]) >> 22 | + ((in[11] - in[10]) << 27) + out[9] = + (in[11] - in[10]) >> 37 | + ((in[12] - in[11]) << 12) | + ((in[13] - in[12]) << 61) + out[10] = + (in[13] - in[12]) >> 3 | + ((in[14] - in[13]) << 46) + out[11] = + (in[14] - in[13]) >> 18 | + ((in[15] - in[14]) << 31) + out[12] = + (in[15] - in[14]) >> 33 | + ((in[16] - in[15]) << 16) + out[13] = + (in[16] - in[15]) >> 48 | + ((in[17] - in[16]) << 1) | + ((in[18] - in[17]) << 50) + out[14] = + (in[18] - in[17]) >> 14 | + ((in[19] - in[18]) << 35) + out[15] = + (in[19] - in[18]) >> 29 | + ((in[20] - in[19]) << 20) + out[16] = + (in[20] - in[19]) >> 44 | + ((in[21] - in[20]) << 5) | + ((in[22] - in[21]) << 54) + out[17] = + (in[22] - in[21]) >> 10 | + ((in[23] - in[22]) << 39) + out[18] = + (in[23] - in[22]) >> 25 | + ((in[24] - in[23]) << 24) + out[19] = + (in[24] - in[23]) >> 40 | + ((in[25] - in[24]) << 9) | + ((in[26] - in[25]) << 58) + out[20] = + (in[26] - in[25]) >> 6 | + ((in[27] - in[26]) << 43) + out[21] = + (in[27] - in[26]) >> 21 | + ((in[28] - in[27]) << 28) + out[22] = + (in[28] - in[27]) >> 36 | + ((in[29] - in[28]) << 13) | + ((in[30] - in[29]) << 62) + out[23] = + (in[30] - in[29]) >> 2 | + ((in[31] - in[30]) << 47) + out[24] = + (in[31] - in[30]) >> 17 | + ((in[32] - in[31]) << 32) + out[25] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 17) + out[26] = + (in[33] - in[32]) >> 47 | + ((in[34] - in[33]) << 2) | + ((in[35] - in[34]) << 51) + out[27] = + (in[35] - in[34]) >> 13 | + ((in[36] - in[35]) << 36) + out[28] = + (in[36] - in[35]) >> 28 | + ((in[37] - in[36]) << 21) + out[29] = + (in[37] - in[36]) >> 43 | + ((in[38] - in[37]) << 6) | + ((in[39] - in[38]) << 55) + out[30] = + (in[39] - in[38]) >> 9 | + ((in[40] - in[39]) << 40) + out[31] = + (in[40] - in[39]) >> 24 | + ((in[41] - in[40]) << 25) + out[32] = + (in[41] - in[40]) >> 39 | + ((in[42] - in[41]) << 10) | + ((in[43] - in[42]) << 59) + out[33] = + (in[43] - in[42]) >> 5 | + ((in[44] - in[43]) << 44) + out[34] = + (in[44] - in[43]) >> 20 | + ((in[45] - in[44]) << 29) + out[35] = + (in[45] - in[44]) >> 35 | + ((in[46] - in[45]) << 14) | + ((in[47] - in[46]) << 63) + out[36] = + (in[47] - in[46]) >> 1 | + ((in[48] - in[47]) << 48) + out[37] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 33) + out[38] = + (in[49] - in[48]) >> 31 | + ((in[50] - in[49]) << 18) + out[39] = + (in[50] - in[49]) >> 46 | + ((in[51] - in[50]) << 3) | + ((in[52] - in[51]) << 52) + out[40] = + (in[52] - in[51]) >> 12 | + ((in[53] - in[52]) << 37) + out[41] = + (in[53] - in[52]) >> 27 | + ((in[54] - in[53]) << 22) + out[42] = + (in[54] - in[53]) >> 42 | + ((in[55] - in[54]) << 7) | + ((in[56] - in[55]) << 56) + out[43] = + (in[56] - in[55]) >> 8 | + ((in[57] - in[56]) << 41) + out[44] = + (in[57] - in[56]) >> 23 | + ((in[58] - in[57]) << 26) + out[45] = + (in[58] - in[57]) >> 38 | + ((in[59] - in[58]) << 11) | + ((in[60] - in[59]) << 60) + out[46] = + (in[60] - in[59]) >> 4 | + ((in[61] - in[60]) << 45) + out[47] = + (in[61] - in[60]) >> 19 | + ((in[62] - in[61]) << 30) + out[48] = + (in[62] - in[61]) >> 34 | + ((in[63] - in[62]) << 15) +} + +func deltapack_uint64_50(initoffset uint64, in *[64]uint64, out *[50]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 50) + out[1] = + (in[1] - in[0]) >> 14 | + ((in[2] - in[1]) << 36) + out[2] = + (in[2] - in[1]) >> 28 | + ((in[3] - in[2]) << 22) + out[3] = + (in[3] - in[2]) >> 42 | + ((in[4] - in[3]) << 8) | + ((in[5] - in[4]) << 58) + out[4] = + (in[5] - in[4]) >> 6 | + ((in[6] - in[5]) << 44) + out[5] = + (in[6] - in[5]) >> 20 | + ((in[7] - in[6]) << 30) + out[6] = + (in[7] - in[6]) >> 34 | + ((in[8] - in[7]) << 16) + out[7] = + (in[8] - in[7]) >> 48 | + ((in[9] - in[8]) << 2) | + ((in[10] - in[9]) << 52) + out[8] = + (in[10] - in[9]) >> 12 | + ((in[11] - in[10]) << 38) + out[9] = + (in[11] - in[10]) >> 26 | + ((in[12] - in[11]) << 24) + out[10] = + (in[12] - in[11]) >> 40 | + ((in[13] - in[12]) << 10) | + ((in[14] - in[13]) << 60) + out[11] = + (in[14] - in[13]) >> 4 | + ((in[15] - in[14]) << 46) + out[12] = + (in[15] - in[14]) >> 18 | + ((in[16] - in[15]) << 32) + out[13] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 18) + out[14] = + (in[17] - in[16]) >> 46 | + ((in[18] - in[17]) << 4) | + ((in[19] - in[18]) << 54) + out[15] = + (in[19] - in[18]) >> 10 | + ((in[20] - in[19]) << 40) + out[16] = + (in[20] - in[19]) >> 24 | + ((in[21] - in[20]) << 26) + out[17] = + (in[21] - in[20]) >> 38 | + ((in[22] - in[21]) << 12) | + ((in[23] - in[22]) << 62) + out[18] = + (in[23] - in[22]) >> 2 | + ((in[24] - in[23]) << 48) + out[19] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 34) + out[20] = + (in[25] - in[24]) >> 30 | + ((in[26] - in[25]) << 20) + out[21] = + (in[26] - in[25]) >> 44 | + ((in[27] - in[26]) << 6) | + ((in[28] - in[27]) << 56) + out[22] = + (in[28] - in[27]) >> 8 | + ((in[29] - in[28]) << 42) + out[23] = + (in[29] - in[28]) >> 22 | + ((in[30] - in[29]) << 28) + out[24] = + (in[30] - in[29]) >> 36 | + ((in[31] - in[30]) << 14) + out[25] = + in[32] - in[31] | + ((in[33] - in[32]) << 50) + out[26] = + (in[33] - in[32]) >> 14 | + ((in[34] - in[33]) << 36) + out[27] = + (in[34] - in[33]) >> 28 | + ((in[35] - in[34]) << 22) + out[28] = + (in[35] - in[34]) >> 42 | + ((in[36] - in[35]) << 8) | + ((in[37] - in[36]) << 58) + out[29] = + (in[37] - in[36]) >> 6 | + ((in[38] - in[37]) << 44) + out[30] = + (in[38] - in[37]) >> 20 | + ((in[39] - in[38]) << 30) + out[31] = + (in[39] - in[38]) >> 34 | + ((in[40] - in[39]) << 16) + out[32] = + (in[40] - in[39]) >> 48 | + ((in[41] - in[40]) << 2) | + ((in[42] - in[41]) << 52) + out[33] = + (in[42] - in[41]) >> 12 | + ((in[43] - in[42]) << 38) + out[34] = + (in[43] - in[42]) >> 26 | + ((in[44] - in[43]) << 24) + out[35] = + (in[44] - in[43]) >> 40 | + ((in[45] - in[44]) << 10) | + ((in[46] - in[45]) << 60) + out[36] = + (in[46] - in[45]) >> 4 | + ((in[47] - in[46]) << 46) + out[37] = + (in[47] - in[46]) >> 18 | + ((in[48] - in[47]) << 32) + out[38] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 18) + out[39] = + (in[49] - in[48]) >> 46 | + ((in[50] - in[49]) << 4) | + ((in[51] - in[50]) << 54) + out[40] = + (in[51] - in[50]) >> 10 | + ((in[52] - in[51]) << 40) + out[41] = + (in[52] - in[51]) >> 24 | + ((in[53] - in[52]) << 26) + out[42] = + (in[53] - in[52]) >> 38 | + ((in[54] - in[53]) << 12) | + ((in[55] - in[54]) << 62) + out[43] = + (in[55] - in[54]) >> 2 | + ((in[56] - in[55]) << 48) + out[44] = + (in[56] - in[55]) >> 16 | + ((in[57] - in[56]) << 34) + out[45] = + (in[57] - in[56]) >> 30 | + ((in[58] - in[57]) << 20) + out[46] = + (in[58] - in[57]) >> 44 | + ((in[59] - in[58]) << 6) | + ((in[60] - in[59]) << 56) + out[47] = + (in[60] - in[59]) >> 8 | + ((in[61] - in[60]) << 42) + out[48] = + (in[61] - in[60]) >> 22 | + ((in[62] - in[61]) << 28) + out[49] = + (in[62] - in[61]) >> 36 | + ((in[63] - in[62]) << 14) +} + +func deltapack_uint64_51(initoffset uint64, in *[64]uint64, out *[51]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 51) + out[1] = + (in[1] - in[0]) >> 13 | + ((in[2] - in[1]) << 38) + out[2] = + (in[2] - in[1]) >> 26 | + ((in[3] - in[2]) << 25) + out[3] = + (in[3] - in[2]) >> 39 | + ((in[4] - in[3]) << 12) | + ((in[5] - in[4]) << 63) + out[4] = + (in[5] - in[4]) >> 1 | + ((in[6] - in[5]) << 50) + out[5] = + (in[6] - in[5]) >> 14 | + ((in[7] - in[6]) << 37) + out[6] = + (in[7] - in[6]) >> 27 | + ((in[8] - in[7]) << 24) + out[7] = + (in[8] - in[7]) >> 40 | + ((in[9] - in[8]) << 11) | + ((in[10] - in[9]) << 62) + out[8] = + (in[10] - in[9]) >> 2 | + ((in[11] - in[10]) << 49) + out[9] = + (in[11] - in[10]) >> 15 | + ((in[12] - in[11]) << 36) + out[10] = + (in[12] - in[11]) >> 28 | + ((in[13] - in[12]) << 23) + out[11] = + (in[13] - in[12]) >> 41 | + ((in[14] - in[13]) << 10) | + ((in[15] - in[14]) << 61) + out[12] = + (in[15] - in[14]) >> 3 | + ((in[16] - in[15]) << 48) + out[13] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 35) + out[14] = + (in[17] - in[16]) >> 29 | + ((in[18] - in[17]) << 22) + out[15] = + (in[18] - in[17]) >> 42 | + ((in[19] - in[18]) << 9) | + ((in[20] - in[19]) << 60) + out[16] = + (in[20] - in[19]) >> 4 | + ((in[21] - in[20]) << 47) + out[17] = + (in[21] - in[20]) >> 17 | + ((in[22] - in[21]) << 34) + out[18] = + (in[22] - in[21]) >> 30 | + ((in[23] - in[22]) << 21) + out[19] = + (in[23] - in[22]) >> 43 | + ((in[24] - in[23]) << 8) | + ((in[25] - in[24]) << 59) + out[20] = + (in[25] - in[24]) >> 5 | + ((in[26] - in[25]) << 46) + out[21] = + (in[26] - in[25]) >> 18 | + ((in[27] - in[26]) << 33) + out[22] = + (in[27] - in[26]) >> 31 | + ((in[28] - in[27]) << 20) + out[23] = + (in[28] - in[27]) >> 44 | + ((in[29] - in[28]) << 7) | + ((in[30] - in[29]) << 58) + out[24] = + (in[30] - in[29]) >> 6 | + ((in[31] - in[30]) << 45) + out[25] = + (in[31] - in[30]) >> 19 | + ((in[32] - in[31]) << 32) + out[26] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 19) + out[27] = + (in[33] - in[32]) >> 45 | + ((in[34] - in[33]) << 6) | + ((in[35] - in[34]) << 57) + out[28] = + (in[35] - in[34]) >> 7 | + ((in[36] - in[35]) << 44) + out[29] = + (in[36] - in[35]) >> 20 | + ((in[37] - in[36]) << 31) + out[30] = + (in[37] - in[36]) >> 33 | + ((in[38] - in[37]) << 18) + out[31] = + (in[38] - in[37]) >> 46 | + ((in[39] - in[38]) << 5) | + ((in[40] - in[39]) << 56) + out[32] = + (in[40] - in[39]) >> 8 | + ((in[41] - in[40]) << 43) + out[33] = + (in[41] - in[40]) >> 21 | + ((in[42] - in[41]) << 30) + out[34] = + (in[42] - in[41]) >> 34 | + ((in[43] - in[42]) << 17) + out[35] = + (in[43] - in[42]) >> 47 | + ((in[44] - in[43]) << 4) | + ((in[45] - in[44]) << 55) + out[36] = + (in[45] - in[44]) >> 9 | + ((in[46] - in[45]) << 42) + out[37] = + (in[46] - in[45]) >> 22 | + ((in[47] - in[46]) << 29) + out[38] = + (in[47] - in[46]) >> 35 | + ((in[48] - in[47]) << 16) + out[39] = + (in[48] - in[47]) >> 48 | + ((in[49] - in[48]) << 3) | + ((in[50] - in[49]) << 54) + out[40] = + (in[50] - in[49]) >> 10 | + ((in[51] - in[50]) << 41) + out[41] = + (in[51] - in[50]) >> 23 | + ((in[52] - in[51]) << 28) + out[42] = + (in[52] - in[51]) >> 36 | + ((in[53] - in[52]) << 15) + out[43] = + (in[53] - in[52]) >> 49 | + ((in[54] - in[53]) << 2) | + ((in[55] - in[54]) << 53) + out[44] = + (in[55] - in[54]) >> 11 | + ((in[56] - in[55]) << 40) + out[45] = + (in[56] - in[55]) >> 24 | + ((in[57] - in[56]) << 27) + out[46] = + (in[57] - in[56]) >> 37 | + ((in[58] - in[57]) << 14) + out[47] = + (in[58] - in[57]) >> 50 | + ((in[59] - in[58]) << 1) | + ((in[60] - in[59]) << 52) + out[48] = + (in[60] - in[59]) >> 12 | + ((in[61] - in[60]) << 39) + out[49] = + (in[61] - in[60]) >> 25 | + ((in[62] - in[61]) << 26) + out[50] = + (in[62] - in[61]) >> 38 | + ((in[63] - in[62]) << 13) +} + +func deltapack_uint64_52(initoffset uint64, in *[64]uint64, out *[52]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 52) + out[1] = + (in[1] - in[0]) >> 12 | + ((in[2] - in[1]) << 40) + out[2] = + (in[2] - in[1]) >> 24 | + ((in[3] - in[2]) << 28) + out[3] = + (in[3] - in[2]) >> 36 | + ((in[4] - in[3]) << 16) + out[4] = + (in[4] - in[3]) >> 48 | + ((in[5] - in[4]) << 4) | + ((in[6] - in[5]) << 56) + out[5] = + (in[6] - in[5]) >> 8 | + ((in[7] - in[6]) << 44) + out[6] = + (in[7] - in[6]) >> 20 | + ((in[8] - in[7]) << 32) + out[7] = + (in[8] - in[7]) >> 32 | + ((in[9] - in[8]) << 20) + out[8] = + (in[9] - in[8]) >> 44 | + ((in[10] - in[9]) << 8) | + ((in[11] - in[10]) << 60) + out[9] = + (in[11] - in[10]) >> 4 | + ((in[12] - in[11]) << 48) + out[10] = + (in[12] - in[11]) >> 16 | + ((in[13] - in[12]) << 36) + out[11] = + (in[13] - in[12]) >> 28 | + ((in[14] - in[13]) << 24) + out[12] = + (in[14] - in[13]) >> 40 | + ((in[15] - in[14]) << 12) + out[13] = + in[16] - in[15] | + ((in[17] - in[16]) << 52) + out[14] = + (in[17] - in[16]) >> 12 | + ((in[18] - in[17]) << 40) + out[15] = + (in[18] - in[17]) >> 24 | + ((in[19] - in[18]) << 28) + out[16] = + (in[19] - in[18]) >> 36 | + ((in[20] - in[19]) << 16) + out[17] = + (in[20] - in[19]) >> 48 | + ((in[21] - in[20]) << 4) | + ((in[22] - in[21]) << 56) + out[18] = + (in[22] - in[21]) >> 8 | + ((in[23] - in[22]) << 44) + out[19] = + (in[23] - in[22]) >> 20 | + ((in[24] - in[23]) << 32) + out[20] = + (in[24] - in[23]) >> 32 | + ((in[25] - in[24]) << 20) + out[21] = + (in[25] - in[24]) >> 44 | + ((in[26] - in[25]) << 8) | + ((in[27] - in[26]) << 60) + out[22] = + (in[27] - in[26]) >> 4 | + ((in[28] - in[27]) << 48) + out[23] = + (in[28] - in[27]) >> 16 | + ((in[29] - in[28]) << 36) + out[24] = + (in[29] - in[28]) >> 28 | + ((in[30] - in[29]) << 24) + out[25] = + (in[30] - in[29]) >> 40 | + ((in[31] - in[30]) << 12) + out[26] = + in[32] - in[31] | + ((in[33] - in[32]) << 52) + out[27] = + (in[33] - in[32]) >> 12 | + ((in[34] - in[33]) << 40) + out[28] = + (in[34] - in[33]) >> 24 | + ((in[35] - in[34]) << 28) + out[29] = + (in[35] - in[34]) >> 36 | + ((in[36] - in[35]) << 16) + out[30] = + (in[36] - in[35]) >> 48 | + ((in[37] - in[36]) << 4) | + ((in[38] - in[37]) << 56) + out[31] = + (in[38] - in[37]) >> 8 | + ((in[39] - in[38]) << 44) + out[32] = + (in[39] - in[38]) >> 20 | + ((in[40] - in[39]) << 32) + out[33] = + (in[40] - in[39]) >> 32 | + ((in[41] - in[40]) << 20) + out[34] = + (in[41] - in[40]) >> 44 | + ((in[42] - in[41]) << 8) | + ((in[43] - in[42]) << 60) + out[35] = + (in[43] - in[42]) >> 4 | + ((in[44] - in[43]) << 48) + out[36] = + (in[44] - in[43]) >> 16 | + ((in[45] - in[44]) << 36) + out[37] = + (in[45] - in[44]) >> 28 | + ((in[46] - in[45]) << 24) + out[38] = + (in[46] - in[45]) >> 40 | + ((in[47] - in[46]) << 12) + out[39] = + in[48] - in[47] | + ((in[49] - in[48]) << 52) + out[40] = + (in[49] - in[48]) >> 12 | + ((in[50] - in[49]) << 40) + out[41] = + (in[50] - in[49]) >> 24 | + ((in[51] - in[50]) << 28) + out[42] = + (in[51] - in[50]) >> 36 | + ((in[52] - in[51]) << 16) + out[43] = + (in[52] - in[51]) >> 48 | + ((in[53] - in[52]) << 4) | + ((in[54] - in[53]) << 56) + out[44] = + (in[54] - in[53]) >> 8 | + ((in[55] - in[54]) << 44) + out[45] = + (in[55] - in[54]) >> 20 | + ((in[56] - in[55]) << 32) + out[46] = + (in[56] - in[55]) >> 32 | + ((in[57] - in[56]) << 20) + out[47] = + (in[57] - in[56]) >> 44 | + ((in[58] - in[57]) << 8) | + ((in[59] - in[58]) << 60) + out[48] = + (in[59] - in[58]) >> 4 | + ((in[60] - in[59]) << 48) + out[49] = + (in[60] - in[59]) >> 16 | + ((in[61] - in[60]) << 36) + out[50] = + (in[61] - in[60]) >> 28 | + ((in[62] - in[61]) << 24) + out[51] = + (in[62] - in[61]) >> 40 | + ((in[63] - in[62]) << 12) +} + +func deltapack_uint64_53(initoffset uint64, in *[64]uint64, out *[53]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 53) + out[1] = + (in[1] - in[0]) >> 11 | + ((in[2] - in[1]) << 42) + out[2] = + (in[2] - in[1]) >> 22 | + ((in[3] - in[2]) << 31) + out[3] = + (in[3] - in[2]) >> 33 | + ((in[4] - in[3]) << 20) + out[4] = + (in[4] - in[3]) >> 44 | + ((in[5] - in[4]) << 9) | + ((in[6] - in[5]) << 62) + out[5] = + (in[6] - in[5]) >> 2 | + ((in[7] - in[6]) << 51) + out[6] = + (in[7] - in[6]) >> 13 | + ((in[8] - in[7]) << 40) + out[7] = + (in[8] - in[7]) >> 24 | + ((in[9] - in[8]) << 29) + out[8] = + (in[9] - in[8]) >> 35 | + ((in[10] - in[9]) << 18) + out[9] = + (in[10] - in[9]) >> 46 | + ((in[11] - in[10]) << 7) | + ((in[12] - in[11]) << 60) + out[10] = + (in[12] - in[11]) >> 4 | + ((in[13] - in[12]) << 49) + out[11] = + (in[13] - in[12]) >> 15 | + ((in[14] - in[13]) << 38) + out[12] = + (in[14] - in[13]) >> 26 | + ((in[15] - in[14]) << 27) + out[13] = + (in[15] - in[14]) >> 37 | + ((in[16] - in[15]) << 16) + out[14] = + (in[16] - in[15]) >> 48 | + ((in[17] - in[16]) << 5) | + ((in[18] - in[17]) << 58) + out[15] = + (in[18] - in[17]) >> 6 | + ((in[19] - in[18]) << 47) + out[16] = + (in[19] - in[18]) >> 17 | + ((in[20] - in[19]) << 36) + out[17] = + (in[20] - in[19]) >> 28 | + ((in[21] - in[20]) << 25) + out[18] = + (in[21] - in[20]) >> 39 | + ((in[22] - in[21]) << 14) + out[19] = + (in[22] - in[21]) >> 50 | + ((in[23] - in[22]) << 3) | + ((in[24] - in[23]) << 56) + out[20] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 45) + out[21] = + (in[25] - in[24]) >> 19 | + ((in[26] - in[25]) << 34) + out[22] = + (in[26] - in[25]) >> 30 | + ((in[27] - in[26]) << 23) + out[23] = + (in[27] - in[26]) >> 41 | + ((in[28] - in[27]) << 12) + out[24] = + (in[28] - in[27]) >> 52 | + ((in[29] - in[28]) << 1) | + ((in[30] - in[29]) << 54) + out[25] = + (in[30] - in[29]) >> 10 | + ((in[31] - in[30]) << 43) + out[26] = + (in[31] - in[30]) >> 21 | + ((in[32] - in[31]) << 32) + out[27] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 21) + out[28] = + (in[33] - in[32]) >> 43 | + ((in[34] - in[33]) << 10) | + ((in[35] - in[34]) << 63) + out[29] = + (in[35] - in[34]) >> 1 | + ((in[36] - in[35]) << 52) + out[30] = + (in[36] - in[35]) >> 12 | + ((in[37] - in[36]) << 41) + out[31] = + (in[37] - in[36]) >> 23 | + ((in[38] - in[37]) << 30) + out[32] = + (in[38] - in[37]) >> 34 | + ((in[39] - in[38]) << 19) + out[33] = + (in[39] - in[38]) >> 45 | + ((in[40] - in[39]) << 8) | + ((in[41] - in[40]) << 61) + out[34] = + (in[41] - in[40]) >> 3 | + ((in[42] - in[41]) << 50) + out[35] = + (in[42] - in[41]) >> 14 | + ((in[43] - in[42]) << 39) + out[36] = + (in[43] - in[42]) >> 25 | + ((in[44] - in[43]) << 28) + out[37] = + (in[44] - in[43]) >> 36 | + ((in[45] - in[44]) << 17) + out[38] = + (in[45] - in[44]) >> 47 | + ((in[46] - in[45]) << 6) | + ((in[47] - in[46]) << 59) + out[39] = + (in[47] - in[46]) >> 5 | + ((in[48] - in[47]) << 48) + out[40] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 37) + out[41] = + (in[49] - in[48]) >> 27 | + ((in[50] - in[49]) << 26) + out[42] = + (in[50] - in[49]) >> 38 | + ((in[51] - in[50]) << 15) + out[43] = + (in[51] - in[50]) >> 49 | + ((in[52] - in[51]) << 4) | + ((in[53] - in[52]) << 57) + out[44] = + (in[53] - in[52]) >> 7 | + ((in[54] - in[53]) << 46) + out[45] = + (in[54] - in[53]) >> 18 | + ((in[55] - in[54]) << 35) + out[46] = + (in[55] - in[54]) >> 29 | + ((in[56] - in[55]) << 24) + out[47] = + (in[56] - in[55]) >> 40 | + ((in[57] - in[56]) << 13) + out[48] = + (in[57] - in[56]) >> 51 | + ((in[58] - in[57]) << 2) | + ((in[59] - in[58]) << 55) + out[49] = + (in[59] - in[58]) >> 9 | + ((in[60] - in[59]) << 44) + out[50] = + (in[60] - in[59]) >> 20 | + ((in[61] - in[60]) << 33) + out[51] = + (in[61] - in[60]) >> 31 | + ((in[62] - in[61]) << 22) + out[52] = + (in[62] - in[61]) >> 42 | + ((in[63] - in[62]) << 11) +} + +func deltapack_uint64_54(initoffset uint64, in *[64]uint64, out *[54]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 54) + out[1] = + (in[1] - in[0]) >> 10 | + ((in[2] - in[1]) << 44) + out[2] = + (in[2] - in[1]) >> 20 | + ((in[3] - in[2]) << 34) + out[3] = + (in[3] - in[2]) >> 30 | + ((in[4] - in[3]) << 24) + out[4] = + (in[4] - in[3]) >> 40 | + ((in[5] - in[4]) << 14) + out[5] = + (in[5] - in[4]) >> 50 | + ((in[6] - in[5]) << 4) | + ((in[7] - in[6]) << 58) + out[6] = + (in[7] - in[6]) >> 6 | + ((in[8] - in[7]) << 48) + out[7] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 38) + out[8] = + (in[9] - in[8]) >> 26 | + ((in[10] - in[9]) << 28) + out[9] = + (in[10] - in[9]) >> 36 | + ((in[11] - in[10]) << 18) + out[10] = + (in[11] - in[10]) >> 46 | + ((in[12] - in[11]) << 8) | + ((in[13] - in[12]) << 62) + out[11] = + (in[13] - in[12]) >> 2 | + ((in[14] - in[13]) << 52) + out[12] = + (in[14] - in[13]) >> 12 | + ((in[15] - in[14]) << 42) + out[13] = + (in[15] - in[14]) >> 22 | + ((in[16] - in[15]) << 32) + out[14] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 22) + out[15] = + (in[17] - in[16]) >> 42 | + ((in[18] - in[17]) << 12) + out[16] = + (in[18] - in[17]) >> 52 | + ((in[19] - in[18]) << 2) | + ((in[20] - in[19]) << 56) + out[17] = + (in[20] - in[19]) >> 8 | + ((in[21] - in[20]) << 46) + out[18] = + (in[21] - in[20]) >> 18 | + ((in[22] - in[21]) << 36) + out[19] = + (in[22] - in[21]) >> 28 | + ((in[23] - in[22]) << 26) + out[20] = + (in[23] - in[22]) >> 38 | + ((in[24] - in[23]) << 16) + out[21] = + (in[24] - in[23]) >> 48 | + ((in[25] - in[24]) << 6) | + ((in[26] - in[25]) << 60) + out[22] = + (in[26] - in[25]) >> 4 | + ((in[27] - in[26]) << 50) + out[23] = + (in[27] - in[26]) >> 14 | + ((in[28] - in[27]) << 40) + out[24] = + (in[28] - in[27]) >> 24 | + ((in[29] - in[28]) << 30) + out[25] = + (in[29] - in[28]) >> 34 | + ((in[30] - in[29]) << 20) + out[26] = + (in[30] - in[29]) >> 44 | + ((in[31] - in[30]) << 10) + out[27] = + in[32] - in[31] | + ((in[33] - in[32]) << 54) + out[28] = + (in[33] - in[32]) >> 10 | + ((in[34] - in[33]) << 44) + out[29] = + (in[34] - in[33]) >> 20 | + ((in[35] - in[34]) << 34) + out[30] = + (in[35] - in[34]) >> 30 | + ((in[36] - in[35]) << 24) + out[31] = + (in[36] - in[35]) >> 40 | + ((in[37] - in[36]) << 14) + out[32] = + (in[37] - in[36]) >> 50 | + ((in[38] - in[37]) << 4) | + ((in[39] - in[38]) << 58) + out[33] = + (in[39] - in[38]) >> 6 | + ((in[40] - in[39]) << 48) + out[34] = + (in[40] - in[39]) >> 16 | + ((in[41] - in[40]) << 38) + out[35] = + (in[41] - in[40]) >> 26 | + ((in[42] - in[41]) << 28) + out[36] = + (in[42] - in[41]) >> 36 | + ((in[43] - in[42]) << 18) + out[37] = + (in[43] - in[42]) >> 46 | + ((in[44] - in[43]) << 8) | + ((in[45] - in[44]) << 62) + out[38] = + (in[45] - in[44]) >> 2 | + ((in[46] - in[45]) << 52) + out[39] = + (in[46] - in[45]) >> 12 | + ((in[47] - in[46]) << 42) + out[40] = + (in[47] - in[46]) >> 22 | + ((in[48] - in[47]) << 32) + out[41] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 22) + out[42] = + (in[49] - in[48]) >> 42 | + ((in[50] - in[49]) << 12) + out[43] = + (in[50] - in[49]) >> 52 | + ((in[51] - in[50]) << 2) | + ((in[52] - in[51]) << 56) + out[44] = + (in[52] - in[51]) >> 8 | + ((in[53] - in[52]) << 46) + out[45] = + (in[53] - in[52]) >> 18 | + ((in[54] - in[53]) << 36) + out[46] = + (in[54] - in[53]) >> 28 | + ((in[55] - in[54]) << 26) + out[47] = + (in[55] - in[54]) >> 38 | + ((in[56] - in[55]) << 16) + out[48] = + (in[56] - in[55]) >> 48 | + ((in[57] - in[56]) << 6) | + ((in[58] - in[57]) << 60) + out[49] = + (in[58] - in[57]) >> 4 | + ((in[59] - in[58]) << 50) + out[50] = + (in[59] - in[58]) >> 14 | + ((in[60] - in[59]) << 40) + out[51] = + (in[60] - in[59]) >> 24 | + ((in[61] - in[60]) << 30) + out[52] = + (in[61] - in[60]) >> 34 | + ((in[62] - in[61]) << 20) + out[53] = + (in[62] - in[61]) >> 44 | + ((in[63] - in[62]) << 10) +} + +func deltapack_uint64_55(initoffset uint64, in *[64]uint64, out *[55]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 55) + out[1] = + (in[1] - in[0]) >> 9 | + ((in[2] - in[1]) << 46) + out[2] = + (in[2] - in[1]) >> 18 | + ((in[3] - in[2]) << 37) + out[3] = + (in[3] - in[2]) >> 27 | + ((in[4] - in[3]) << 28) + out[4] = + (in[4] - in[3]) >> 36 | + ((in[5] - in[4]) << 19) + out[5] = + (in[5] - in[4]) >> 45 | + ((in[6] - in[5]) << 10) + out[6] = + (in[6] - in[5]) >> 54 | + ((in[7] - in[6]) << 1) | + ((in[8] - in[7]) << 56) + out[7] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 47) + out[8] = + (in[9] - in[8]) >> 17 | + ((in[10] - in[9]) << 38) + out[9] = + (in[10] - in[9]) >> 26 | + ((in[11] - in[10]) << 29) + out[10] = + (in[11] - in[10]) >> 35 | + ((in[12] - in[11]) << 20) + out[11] = + (in[12] - in[11]) >> 44 | + ((in[13] - in[12]) << 11) + out[12] = + (in[13] - in[12]) >> 53 | + ((in[14] - in[13]) << 2) | + ((in[15] - in[14]) << 57) + out[13] = + (in[15] - in[14]) >> 7 | + ((in[16] - in[15]) << 48) + out[14] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 39) + out[15] = + (in[17] - in[16]) >> 25 | + ((in[18] - in[17]) << 30) + out[16] = + (in[18] - in[17]) >> 34 | + ((in[19] - in[18]) << 21) + out[17] = + (in[19] - in[18]) >> 43 | + ((in[20] - in[19]) << 12) + out[18] = + (in[20] - in[19]) >> 52 | + ((in[21] - in[20]) << 3) | + ((in[22] - in[21]) << 58) + out[19] = + (in[22] - in[21]) >> 6 | + ((in[23] - in[22]) << 49) + out[20] = + (in[23] - in[22]) >> 15 | + ((in[24] - in[23]) << 40) + out[21] = + (in[24] - in[23]) >> 24 | + ((in[25] - in[24]) << 31) + out[22] = + (in[25] - in[24]) >> 33 | + ((in[26] - in[25]) << 22) + out[23] = + (in[26] - in[25]) >> 42 | + ((in[27] - in[26]) << 13) + out[24] = + (in[27] - in[26]) >> 51 | + ((in[28] - in[27]) << 4) | + ((in[29] - in[28]) << 59) + out[25] = + (in[29] - in[28]) >> 5 | + ((in[30] - in[29]) << 50) + out[26] = + (in[30] - in[29]) >> 14 | + ((in[31] - in[30]) << 41) + out[27] = + (in[31] - in[30]) >> 23 | + ((in[32] - in[31]) << 32) + out[28] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 23) + out[29] = + (in[33] - in[32]) >> 41 | + ((in[34] - in[33]) << 14) + out[30] = + (in[34] - in[33]) >> 50 | + ((in[35] - in[34]) << 5) | + ((in[36] - in[35]) << 60) + out[31] = + (in[36] - in[35]) >> 4 | + ((in[37] - in[36]) << 51) + out[32] = + (in[37] - in[36]) >> 13 | + ((in[38] - in[37]) << 42) + out[33] = + (in[38] - in[37]) >> 22 | + ((in[39] - in[38]) << 33) + out[34] = + (in[39] - in[38]) >> 31 | + ((in[40] - in[39]) << 24) + out[35] = + (in[40] - in[39]) >> 40 | + ((in[41] - in[40]) << 15) + out[36] = + (in[41] - in[40]) >> 49 | + ((in[42] - in[41]) << 6) | + ((in[43] - in[42]) << 61) + out[37] = + (in[43] - in[42]) >> 3 | + ((in[44] - in[43]) << 52) + out[38] = + (in[44] - in[43]) >> 12 | + ((in[45] - in[44]) << 43) + out[39] = + (in[45] - in[44]) >> 21 | + ((in[46] - in[45]) << 34) + out[40] = + (in[46] - in[45]) >> 30 | + ((in[47] - in[46]) << 25) + out[41] = + (in[47] - in[46]) >> 39 | + ((in[48] - in[47]) << 16) + out[42] = + (in[48] - in[47]) >> 48 | + ((in[49] - in[48]) << 7) | + ((in[50] - in[49]) << 62) + out[43] = + (in[50] - in[49]) >> 2 | + ((in[51] - in[50]) << 53) + out[44] = + (in[51] - in[50]) >> 11 | + ((in[52] - in[51]) << 44) + out[45] = + (in[52] - in[51]) >> 20 | + ((in[53] - in[52]) << 35) + out[46] = + (in[53] - in[52]) >> 29 | + ((in[54] - in[53]) << 26) + out[47] = + (in[54] - in[53]) >> 38 | + ((in[55] - in[54]) << 17) + out[48] = + (in[55] - in[54]) >> 47 | + ((in[56] - in[55]) << 8) | + ((in[57] - in[56]) << 63) + out[49] = + (in[57] - in[56]) >> 1 | + ((in[58] - in[57]) << 54) + out[50] = + (in[58] - in[57]) >> 10 | + ((in[59] - in[58]) << 45) + out[51] = + (in[59] - in[58]) >> 19 | + ((in[60] - in[59]) << 36) + out[52] = + (in[60] - in[59]) >> 28 | + ((in[61] - in[60]) << 27) + out[53] = + (in[61] - in[60]) >> 37 | + ((in[62] - in[61]) << 18) + out[54] = + (in[62] - in[61]) >> 46 | + ((in[63] - in[62]) << 9) +} + +func deltapack_uint64_56(initoffset uint64, in *[64]uint64, out *[56]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 56) + out[1] = + (in[1] - in[0]) >> 8 | + ((in[2] - in[1]) << 48) + out[2] = + (in[2] - in[1]) >> 16 | + ((in[3] - in[2]) << 40) + out[3] = + (in[3] - in[2]) >> 24 | + ((in[4] - in[3]) << 32) + out[4] = + (in[4] - in[3]) >> 32 | + ((in[5] - in[4]) << 24) + out[5] = + (in[5] - in[4]) >> 40 | + ((in[6] - in[5]) << 16) + out[6] = + (in[6] - in[5]) >> 48 | + ((in[7] - in[6]) << 8) + out[7] = + in[8] - in[7] | + ((in[9] - in[8]) << 56) + out[8] = + (in[9] - in[8]) >> 8 | + ((in[10] - in[9]) << 48) + out[9] = + (in[10] - in[9]) >> 16 | + ((in[11] - in[10]) << 40) + out[10] = + (in[11] - in[10]) >> 24 | + ((in[12] - in[11]) << 32) + out[11] = + (in[12] - in[11]) >> 32 | + ((in[13] - in[12]) << 24) + out[12] = + (in[13] - in[12]) >> 40 | + ((in[14] - in[13]) << 16) + out[13] = + (in[14] - in[13]) >> 48 | + ((in[15] - in[14]) << 8) + out[14] = + in[16] - in[15] | + ((in[17] - in[16]) << 56) + out[15] = + (in[17] - in[16]) >> 8 | + ((in[18] - in[17]) << 48) + out[16] = + (in[18] - in[17]) >> 16 | + ((in[19] - in[18]) << 40) + out[17] = + (in[19] - in[18]) >> 24 | + ((in[20] - in[19]) << 32) + out[18] = + (in[20] - in[19]) >> 32 | + ((in[21] - in[20]) << 24) + out[19] = + (in[21] - in[20]) >> 40 | + ((in[22] - in[21]) << 16) + out[20] = + (in[22] - in[21]) >> 48 | + ((in[23] - in[22]) << 8) + out[21] = + in[24] - in[23] | + ((in[25] - in[24]) << 56) + out[22] = + (in[25] - in[24]) >> 8 | + ((in[26] - in[25]) << 48) + out[23] = + (in[26] - in[25]) >> 16 | + ((in[27] - in[26]) << 40) + out[24] = + (in[27] - in[26]) >> 24 | + ((in[28] - in[27]) << 32) + out[25] = + (in[28] - in[27]) >> 32 | + ((in[29] - in[28]) << 24) + out[26] = + (in[29] - in[28]) >> 40 | + ((in[30] - in[29]) << 16) + out[27] = + (in[30] - in[29]) >> 48 | + ((in[31] - in[30]) << 8) + out[28] = + in[32] - in[31] | + ((in[33] - in[32]) << 56) + out[29] = + (in[33] - in[32]) >> 8 | + ((in[34] - in[33]) << 48) + out[30] = + (in[34] - in[33]) >> 16 | + ((in[35] - in[34]) << 40) + out[31] = + (in[35] - in[34]) >> 24 | + ((in[36] - in[35]) << 32) + out[32] = + (in[36] - in[35]) >> 32 | + ((in[37] - in[36]) << 24) + out[33] = + (in[37] - in[36]) >> 40 | + ((in[38] - in[37]) << 16) + out[34] = + (in[38] - in[37]) >> 48 | + ((in[39] - in[38]) << 8) + out[35] = + in[40] - in[39] | + ((in[41] - in[40]) << 56) + out[36] = + (in[41] - in[40]) >> 8 | + ((in[42] - in[41]) << 48) + out[37] = + (in[42] - in[41]) >> 16 | + ((in[43] - in[42]) << 40) + out[38] = + (in[43] - in[42]) >> 24 | + ((in[44] - in[43]) << 32) + out[39] = + (in[44] - in[43]) >> 32 | + ((in[45] - in[44]) << 24) + out[40] = + (in[45] - in[44]) >> 40 | + ((in[46] - in[45]) << 16) + out[41] = + (in[46] - in[45]) >> 48 | + ((in[47] - in[46]) << 8) + out[42] = + in[48] - in[47] | + ((in[49] - in[48]) << 56) + out[43] = + (in[49] - in[48]) >> 8 | + ((in[50] - in[49]) << 48) + out[44] = + (in[50] - in[49]) >> 16 | + ((in[51] - in[50]) << 40) + out[45] = + (in[51] - in[50]) >> 24 | + ((in[52] - in[51]) << 32) + out[46] = + (in[52] - in[51]) >> 32 | + ((in[53] - in[52]) << 24) + out[47] = + (in[53] - in[52]) >> 40 | + ((in[54] - in[53]) << 16) + out[48] = + (in[54] - in[53]) >> 48 | + ((in[55] - in[54]) << 8) + out[49] = + in[56] - in[55] | + ((in[57] - in[56]) << 56) + out[50] = + (in[57] - in[56]) >> 8 | + ((in[58] - in[57]) << 48) + out[51] = + (in[58] - in[57]) >> 16 | + ((in[59] - in[58]) << 40) + out[52] = + (in[59] - in[58]) >> 24 | + ((in[60] - in[59]) << 32) + out[53] = + (in[60] - in[59]) >> 32 | + ((in[61] - in[60]) << 24) + out[54] = + (in[61] - in[60]) >> 40 | + ((in[62] - in[61]) << 16) + out[55] = + (in[62] - in[61]) >> 48 | + ((in[63] - in[62]) << 8) +} + +func deltapack_uint64_57(initoffset uint64, in *[64]uint64, out *[57]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 57) + out[1] = + (in[1] - in[0]) >> 7 | + ((in[2] - in[1]) << 50) + out[2] = + (in[2] - in[1]) >> 14 | + ((in[3] - in[2]) << 43) + out[3] = + (in[3] - in[2]) >> 21 | + ((in[4] - in[3]) << 36) + out[4] = + (in[4] - in[3]) >> 28 | + ((in[5] - in[4]) << 29) + out[5] = + (in[5] - in[4]) >> 35 | + ((in[6] - in[5]) << 22) + out[6] = + (in[6] - in[5]) >> 42 | + ((in[7] - in[6]) << 15) + out[7] = + (in[7] - in[6]) >> 49 | + ((in[8] - in[7]) << 8) + out[8] = + (in[8] - in[7]) >> 56 | + ((in[9] - in[8]) << 1) | + ((in[10] - in[9]) << 58) + out[9] = + (in[10] - in[9]) >> 6 | + ((in[11] - in[10]) << 51) + out[10] = + (in[11] - in[10]) >> 13 | + ((in[12] - in[11]) << 44) + out[11] = + (in[12] - in[11]) >> 20 | + ((in[13] - in[12]) << 37) + out[12] = + (in[13] - in[12]) >> 27 | + ((in[14] - in[13]) << 30) + out[13] = + (in[14] - in[13]) >> 34 | + ((in[15] - in[14]) << 23) + out[14] = + (in[15] - in[14]) >> 41 | + ((in[16] - in[15]) << 16) + out[15] = + (in[16] - in[15]) >> 48 | + ((in[17] - in[16]) << 9) + out[16] = + (in[17] - in[16]) >> 55 | + ((in[18] - in[17]) << 2) | + ((in[19] - in[18]) << 59) + out[17] = + (in[19] - in[18]) >> 5 | + ((in[20] - in[19]) << 52) + out[18] = + (in[20] - in[19]) >> 12 | + ((in[21] - in[20]) << 45) + out[19] = + (in[21] - in[20]) >> 19 | + ((in[22] - in[21]) << 38) + out[20] = + (in[22] - in[21]) >> 26 | + ((in[23] - in[22]) << 31) + out[21] = + (in[23] - in[22]) >> 33 | + ((in[24] - in[23]) << 24) + out[22] = + (in[24] - in[23]) >> 40 | + ((in[25] - in[24]) << 17) + out[23] = + (in[25] - in[24]) >> 47 | + ((in[26] - in[25]) << 10) + out[24] = + (in[26] - in[25]) >> 54 | + ((in[27] - in[26]) << 3) | + ((in[28] - in[27]) << 60) + out[25] = + (in[28] - in[27]) >> 4 | + ((in[29] - in[28]) << 53) + out[26] = + (in[29] - in[28]) >> 11 | + ((in[30] - in[29]) << 46) + out[27] = + (in[30] - in[29]) >> 18 | + ((in[31] - in[30]) << 39) + out[28] = + (in[31] - in[30]) >> 25 | + ((in[32] - in[31]) << 32) + out[29] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 25) + out[30] = + (in[33] - in[32]) >> 39 | + ((in[34] - in[33]) << 18) + out[31] = + (in[34] - in[33]) >> 46 | + ((in[35] - in[34]) << 11) + out[32] = + (in[35] - in[34]) >> 53 | + ((in[36] - in[35]) << 4) | + ((in[37] - in[36]) << 61) + out[33] = + (in[37] - in[36]) >> 3 | + ((in[38] - in[37]) << 54) + out[34] = + (in[38] - in[37]) >> 10 | + ((in[39] - in[38]) << 47) + out[35] = + (in[39] - in[38]) >> 17 | + ((in[40] - in[39]) << 40) + out[36] = + (in[40] - in[39]) >> 24 | + ((in[41] - in[40]) << 33) + out[37] = + (in[41] - in[40]) >> 31 | + ((in[42] - in[41]) << 26) + out[38] = + (in[42] - in[41]) >> 38 | + ((in[43] - in[42]) << 19) + out[39] = + (in[43] - in[42]) >> 45 | + ((in[44] - in[43]) << 12) + out[40] = + (in[44] - in[43]) >> 52 | + ((in[45] - in[44]) << 5) | + ((in[46] - in[45]) << 62) + out[41] = + (in[46] - in[45]) >> 2 | + ((in[47] - in[46]) << 55) + out[42] = + (in[47] - in[46]) >> 9 | + ((in[48] - in[47]) << 48) + out[43] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 41) + out[44] = + (in[49] - in[48]) >> 23 | + ((in[50] - in[49]) << 34) + out[45] = + (in[50] - in[49]) >> 30 | + ((in[51] - in[50]) << 27) + out[46] = + (in[51] - in[50]) >> 37 | + ((in[52] - in[51]) << 20) + out[47] = + (in[52] - in[51]) >> 44 | + ((in[53] - in[52]) << 13) + out[48] = + (in[53] - in[52]) >> 51 | + ((in[54] - in[53]) << 6) | + ((in[55] - in[54]) << 63) + out[49] = + (in[55] - in[54]) >> 1 | + ((in[56] - in[55]) << 56) + out[50] = + (in[56] - in[55]) >> 8 | + ((in[57] - in[56]) << 49) + out[51] = + (in[57] - in[56]) >> 15 | + ((in[58] - in[57]) << 42) + out[52] = + (in[58] - in[57]) >> 22 | + ((in[59] - in[58]) << 35) + out[53] = + (in[59] - in[58]) >> 29 | + ((in[60] - in[59]) << 28) + out[54] = + (in[60] - in[59]) >> 36 | + ((in[61] - in[60]) << 21) + out[55] = + (in[61] - in[60]) >> 43 | + ((in[62] - in[61]) << 14) + out[56] = + (in[62] - in[61]) >> 50 | + ((in[63] - in[62]) << 7) +} + +func deltapack_uint64_58(initoffset uint64, in *[64]uint64, out *[58]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 58) + out[1] = + (in[1] - in[0]) >> 6 | + ((in[2] - in[1]) << 52) + out[2] = + (in[2] - in[1]) >> 12 | + ((in[3] - in[2]) << 46) + out[3] = + (in[3] - in[2]) >> 18 | + ((in[4] - in[3]) << 40) + out[4] = + (in[4] - in[3]) >> 24 | + ((in[5] - in[4]) << 34) + out[5] = + (in[5] - in[4]) >> 30 | + ((in[6] - in[5]) << 28) + out[6] = + (in[6] - in[5]) >> 36 | + ((in[7] - in[6]) << 22) + out[7] = + (in[7] - in[6]) >> 42 | + ((in[8] - in[7]) << 16) + out[8] = + (in[8] - in[7]) >> 48 | + ((in[9] - in[8]) << 10) + out[9] = + (in[9] - in[8]) >> 54 | + ((in[10] - in[9]) << 4) | + ((in[11] - in[10]) << 62) + out[10] = + (in[11] - in[10]) >> 2 | + ((in[12] - in[11]) << 56) + out[11] = + (in[12] - in[11]) >> 8 | + ((in[13] - in[12]) << 50) + out[12] = + (in[13] - in[12]) >> 14 | + ((in[14] - in[13]) << 44) + out[13] = + (in[14] - in[13]) >> 20 | + ((in[15] - in[14]) << 38) + out[14] = + (in[15] - in[14]) >> 26 | + ((in[16] - in[15]) << 32) + out[15] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 26) + out[16] = + (in[17] - in[16]) >> 38 | + ((in[18] - in[17]) << 20) + out[17] = + (in[18] - in[17]) >> 44 | + ((in[19] - in[18]) << 14) + out[18] = + (in[19] - in[18]) >> 50 | + ((in[20] - in[19]) << 8) + out[19] = + (in[20] - in[19]) >> 56 | + ((in[21] - in[20]) << 2) | + ((in[22] - in[21]) << 60) + out[20] = + (in[22] - in[21]) >> 4 | + ((in[23] - in[22]) << 54) + out[21] = + (in[23] - in[22]) >> 10 | + ((in[24] - in[23]) << 48) + out[22] = + (in[24] - in[23]) >> 16 | + ((in[25] - in[24]) << 42) + out[23] = + (in[25] - in[24]) >> 22 | + ((in[26] - in[25]) << 36) + out[24] = + (in[26] - in[25]) >> 28 | + ((in[27] - in[26]) << 30) + out[25] = + (in[27] - in[26]) >> 34 | + ((in[28] - in[27]) << 24) + out[26] = + (in[28] - in[27]) >> 40 | + ((in[29] - in[28]) << 18) + out[27] = + (in[29] - in[28]) >> 46 | + ((in[30] - in[29]) << 12) + out[28] = + (in[30] - in[29]) >> 52 | + ((in[31] - in[30]) << 6) + out[29] = + in[32] - in[31] | + ((in[33] - in[32]) << 58) + out[30] = + (in[33] - in[32]) >> 6 | + ((in[34] - in[33]) << 52) + out[31] = + (in[34] - in[33]) >> 12 | + ((in[35] - in[34]) << 46) + out[32] = + (in[35] - in[34]) >> 18 | + ((in[36] - in[35]) << 40) + out[33] = + (in[36] - in[35]) >> 24 | + ((in[37] - in[36]) << 34) + out[34] = + (in[37] - in[36]) >> 30 | + ((in[38] - in[37]) << 28) + out[35] = + (in[38] - in[37]) >> 36 | + ((in[39] - in[38]) << 22) + out[36] = + (in[39] - in[38]) >> 42 | + ((in[40] - in[39]) << 16) + out[37] = + (in[40] - in[39]) >> 48 | + ((in[41] - in[40]) << 10) + out[38] = + (in[41] - in[40]) >> 54 | + ((in[42] - in[41]) << 4) | + ((in[43] - in[42]) << 62) + out[39] = + (in[43] - in[42]) >> 2 | + ((in[44] - in[43]) << 56) + out[40] = + (in[44] - in[43]) >> 8 | + ((in[45] - in[44]) << 50) + out[41] = + (in[45] - in[44]) >> 14 | + ((in[46] - in[45]) << 44) + out[42] = + (in[46] - in[45]) >> 20 | + ((in[47] - in[46]) << 38) + out[43] = + (in[47] - in[46]) >> 26 | + ((in[48] - in[47]) << 32) + out[44] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 26) + out[45] = + (in[49] - in[48]) >> 38 | + ((in[50] - in[49]) << 20) + out[46] = + (in[50] - in[49]) >> 44 | + ((in[51] - in[50]) << 14) + out[47] = + (in[51] - in[50]) >> 50 | + ((in[52] - in[51]) << 8) + out[48] = + (in[52] - in[51]) >> 56 | + ((in[53] - in[52]) << 2) | + ((in[54] - in[53]) << 60) + out[49] = + (in[54] - in[53]) >> 4 | + ((in[55] - in[54]) << 54) + out[50] = + (in[55] - in[54]) >> 10 | + ((in[56] - in[55]) << 48) + out[51] = + (in[56] - in[55]) >> 16 | + ((in[57] - in[56]) << 42) + out[52] = + (in[57] - in[56]) >> 22 | + ((in[58] - in[57]) << 36) + out[53] = + (in[58] - in[57]) >> 28 | + ((in[59] - in[58]) << 30) + out[54] = + (in[59] - in[58]) >> 34 | + ((in[60] - in[59]) << 24) + out[55] = + (in[60] - in[59]) >> 40 | + ((in[61] - in[60]) << 18) + out[56] = + (in[61] - in[60]) >> 46 | + ((in[62] - in[61]) << 12) + out[57] = + (in[62] - in[61]) >> 52 | + ((in[63] - in[62]) << 6) +} + +func deltapack_uint64_59(initoffset uint64, in *[64]uint64, out *[59]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 59) + out[1] = + (in[1] - in[0]) >> 5 | + ((in[2] - in[1]) << 54) + out[2] = + (in[2] - in[1]) >> 10 | + ((in[3] - in[2]) << 49) + out[3] = + (in[3] - in[2]) >> 15 | + ((in[4] - in[3]) << 44) + out[4] = + (in[4] - in[3]) >> 20 | + ((in[5] - in[4]) << 39) + out[5] = + (in[5] - in[4]) >> 25 | + ((in[6] - in[5]) << 34) + out[6] = + (in[6] - in[5]) >> 30 | + ((in[7] - in[6]) << 29) + out[7] = + (in[7] - in[6]) >> 35 | + ((in[8] - in[7]) << 24) + out[8] = + (in[8] - in[7]) >> 40 | + ((in[9] - in[8]) << 19) + out[9] = + (in[9] - in[8]) >> 45 | + ((in[10] - in[9]) << 14) + out[10] = + (in[10] - in[9]) >> 50 | + ((in[11] - in[10]) << 9) + out[11] = + (in[11] - in[10]) >> 55 | + ((in[12] - in[11]) << 4) | + ((in[13] - in[12]) << 63) + out[12] = + (in[13] - in[12]) >> 1 | + ((in[14] - in[13]) << 58) + out[13] = + (in[14] - in[13]) >> 6 | + ((in[15] - in[14]) << 53) + out[14] = + (in[15] - in[14]) >> 11 | + ((in[16] - in[15]) << 48) + out[15] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 43) + out[16] = + (in[17] - in[16]) >> 21 | + ((in[18] - in[17]) << 38) + out[17] = + (in[18] - in[17]) >> 26 | + ((in[19] - in[18]) << 33) + out[18] = + (in[19] - in[18]) >> 31 | + ((in[20] - in[19]) << 28) + out[19] = + (in[20] - in[19]) >> 36 | + ((in[21] - in[20]) << 23) + out[20] = + (in[21] - in[20]) >> 41 | + ((in[22] - in[21]) << 18) + out[21] = + (in[22] - in[21]) >> 46 | + ((in[23] - in[22]) << 13) + out[22] = + (in[23] - in[22]) >> 51 | + ((in[24] - in[23]) << 8) + out[23] = + (in[24] - in[23]) >> 56 | + ((in[25] - in[24]) << 3) | + ((in[26] - in[25]) << 62) + out[24] = + (in[26] - in[25]) >> 2 | + ((in[27] - in[26]) << 57) + out[25] = + (in[27] - in[26]) >> 7 | + ((in[28] - in[27]) << 52) + out[26] = + (in[28] - in[27]) >> 12 | + ((in[29] - in[28]) << 47) + out[27] = + (in[29] - in[28]) >> 17 | + ((in[30] - in[29]) << 42) + out[28] = + (in[30] - in[29]) >> 22 | + ((in[31] - in[30]) << 37) + out[29] = + (in[31] - in[30]) >> 27 | + ((in[32] - in[31]) << 32) + out[30] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 27) + out[31] = + (in[33] - in[32]) >> 37 | + ((in[34] - in[33]) << 22) + out[32] = + (in[34] - in[33]) >> 42 | + ((in[35] - in[34]) << 17) + out[33] = + (in[35] - in[34]) >> 47 | + ((in[36] - in[35]) << 12) + out[34] = + (in[36] - in[35]) >> 52 | + ((in[37] - in[36]) << 7) + out[35] = + (in[37] - in[36]) >> 57 | + ((in[38] - in[37]) << 2) | + ((in[39] - in[38]) << 61) + out[36] = + (in[39] - in[38]) >> 3 | + ((in[40] - in[39]) << 56) + out[37] = + (in[40] - in[39]) >> 8 | + ((in[41] - in[40]) << 51) + out[38] = + (in[41] - in[40]) >> 13 | + ((in[42] - in[41]) << 46) + out[39] = + (in[42] - in[41]) >> 18 | + ((in[43] - in[42]) << 41) + out[40] = + (in[43] - in[42]) >> 23 | + ((in[44] - in[43]) << 36) + out[41] = + (in[44] - in[43]) >> 28 | + ((in[45] - in[44]) << 31) + out[42] = + (in[45] - in[44]) >> 33 | + ((in[46] - in[45]) << 26) + out[43] = + (in[46] - in[45]) >> 38 | + ((in[47] - in[46]) << 21) + out[44] = + (in[47] - in[46]) >> 43 | + ((in[48] - in[47]) << 16) + out[45] = + (in[48] - in[47]) >> 48 | + ((in[49] - in[48]) << 11) + out[46] = + (in[49] - in[48]) >> 53 | + ((in[50] - in[49]) << 6) + out[47] = + (in[50] - in[49]) >> 58 | + ((in[51] - in[50]) << 1) | + ((in[52] - in[51]) << 60) + out[48] = + (in[52] - in[51]) >> 4 | + ((in[53] - in[52]) << 55) + out[49] = + (in[53] - in[52]) >> 9 | + ((in[54] - in[53]) << 50) + out[50] = + (in[54] - in[53]) >> 14 | + ((in[55] - in[54]) << 45) + out[51] = + (in[55] - in[54]) >> 19 | + ((in[56] - in[55]) << 40) + out[52] = + (in[56] - in[55]) >> 24 | + ((in[57] - in[56]) << 35) + out[53] = + (in[57] - in[56]) >> 29 | + ((in[58] - in[57]) << 30) + out[54] = + (in[58] - in[57]) >> 34 | + ((in[59] - in[58]) << 25) + out[55] = + (in[59] - in[58]) >> 39 | + ((in[60] - in[59]) << 20) + out[56] = + (in[60] - in[59]) >> 44 | + ((in[61] - in[60]) << 15) + out[57] = + (in[61] - in[60]) >> 49 | + ((in[62] - in[61]) << 10) + out[58] = + (in[62] - in[61]) >> 54 | + ((in[63] - in[62]) << 5) +} + +func deltapack_uint64_60(initoffset uint64, in *[64]uint64, out *[60]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 60) + out[1] = + (in[1] - in[0]) >> 4 | + ((in[2] - in[1]) << 56) + out[2] = + (in[2] - in[1]) >> 8 | + ((in[3] - in[2]) << 52) + out[3] = + (in[3] - in[2]) >> 12 | + ((in[4] - in[3]) << 48) + out[4] = + (in[4] - in[3]) >> 16 | + ((in[5] - in[4]) << 44) + out[5] = + (in[5] - in[4]) >> 20 | + ((in[6] - in[5]) << 40) + out[6] = + (in[6] - in[5]) >> 24 | + ((in[7] - in[6]) << 36) + out[7] = + (in[7] - in[6]) >> 28 | + ((in[8] - in[7]) << 32) + out[8] = + (in[8] - in[7]) >> 32 | + ((in[9] - in[8]) << 28) + out[9] = + (in[9] - in[8]) >> 36 | + ((in[10] - in[9]) << 24) + out[10] = + (in[10] - in[9]) >> 40 | + ((in[11] - in[10]) << 20) + out[11] = + (in[11] - in[10]) >> 44 | + ((in[12] - in[11]) << 16) + out[12] = + (in[12] - in[11]) >> 48 | + ((in[13] - in[12]) << 12) + out[13] = + (in[13] - in[12]) >> 52 | + ((in[14] - in[13]) << 8) + out[14] = + (in[14] - in[13]) >> 56 | + ((in[15] - in[14]) << 4) + out[15] = + in[16] - in[15] | + ((in[17] - in[16]) << 60) + out[16] = + (in[17] - in[16]) >> 4 | + ((in[18] - in[17]) << 56) + out[17] = + (in[18] - in[17]) >> 8 | + ((in[19] - in[18]) << 52) + out[18] = + (in[19] - in[18]) >> 12 | + ((in[20] - in[19]) << 48) + out[19] = + (in[20] - in[19]) >> 16 | + ((in[21] - in[20]) << 44) + out[20] = + (in[21] - in[20]) >> 20 | + ((in[22] - in[21]) << 40) + out[21] = + (in[22] - in[21]) >> 24 | + ((in[23] - in[22]) << 36) + out[22] = + (in[23] - in[22]) >> 28 | + ((in[24] - in[23]) << 32) + out[23] = + (in[24] - in[23]) >> 32 | + ((in[25] - in[24]) << 28) + out[24] = + (in[25] - in[24]) >> 36 | + ((in[26] - in[25]) << 24) + out[25] = + (in[26] - in[25]) >> 40 | + ((in[27] - in[26]) << 20) + out[26] = + (in[27] - in[26]) >> 44 | + ((in[28] - in[27]) << 16) + out[27] = + (in[28] - in[27]) >> 48 | + ((in[29] - in[28]) << 12) + out[28] = + (in[29] - in[28]) >> 52 | + ((in[30] - in[29]) << 8) + out[29] = + (in[30] - in[29]) >> 56 | + ((in[31] - in[30]) << 4) + out[30] = + in[32] - in[31] | + ((in[33] - in[32]) << 60) + out[31] = + (in[33] - in[32]) >> 4 | + ((in[34] - in[33]) << 56) + out[32] = + (in[34] - in[33]) >> 8 | + ((in[35] - in[34]) << 52) + out[33] = + (in[35] - in[34]) >> 12 | + ((in[36] - in[35]) << 48) + out[34] = + (in[36] - in[35]) >> 16 | + ((in[37] - in[36]) << 44) + out[35] = + (in[37] - in[36]) >> 20 | + ((in[38] - in[37]) << 40) + out[36] = + (in[38] - in[37]) >> 24 | + ((in[39] - in[38]) << 36) + out[37] = + (in[39] - in[38]) >> 28 | + ((in[40] - in[39]) << 32) + out[38] = + (in[40] - in[39]) >> 32 | + ((in[41] - in[40]) << 28) + out[39] = + (in[41] - in[40]) >> 36 | + ((in[42] - in[41]) << 24) + out[40] = + (in[42] - in[41]) >> 40 | + ((in[43] - in[42]) << 20) + out[41] = + (in[43] - in[42]) >> 44 | + ((in[44] - in[43]) << 16) + out[42] = + (in[44] - in[43]) >> 48 | + ((in[45] - in[44]) << 12) + out[43] = + (in[45] - in[44]) >> 52 | + ((in[46] - in[45]) << 8) + out[44] = + (in[46] - in[45]) >> 56 | + ((in[47] - in[46]) << 4) + out[45] = + in[48] - in[47] | + ((in[49] - in[48]) << 60) + out[46] = + (in[49] - in[48]) >> 4 | + ((in[50] - in[49]) << 56) + out[47] = + (in[50] - in[49]) >> 8 | + ((in[51] - in[50]) << 52) + out[48] = + (in[51] - in[50]) >> 12 | + ((in[52] - in[51]) << 48) + out[49] = + (in[52] - in[51]) >> 16 | + ((in[53] - in[52]) << 44) + out[50] = + (in[53] - in[52]) >> 20 | + ((in[54] - in[53]) << 40) + out[51] = + (in[54] - in[53]) >> 24 | + ((in[55] - in[54]) << 36) + out[52] = + (in[55] - in[54]) >> 28 | + ((in[56] - in[55]) << 32) + out[53] = + (in[56] - in[55]) >> 32 | + ((in[57] - in[56]) << 28) + out[54] = + (in[57] - in[56]) >> 36 | + ((in[58] - in[57]) << 24) + out[55] = + (in[58] - in[57]) >> 40 | + ((in[59] - in[58]) << 20) + out[56] = + (in[59] - in[58]) >> 44 | + ((in[60] - in[59]) << 16) + out[57] = + (in[60] - in[59]) >> 48 | + ((in[61] - in[60]) << 12) + out[58] = + (in[61] - in[60]) >> 52 | + ((in[62] - in[61]) << 8) + out[59] = + (in[62] - in[61]) >> 56 | + ((in[63] - in[62]) << 4) +} + +func deltapack_uint64_61(initoffset uint64, in *[64]uint64, out *[61]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 61) + out[1] = + (in[1] - in[0]) >> 3 | + ((in[2] - in[1]) << 58) + out[2] = + (in[2] - in[1]) >> 6 | + ((in[3] - in[2]) << 55) + out[3] = + (in[3] - in[2]) >> 9 | + ((in[4] - in[3]) << 52) + out[4] = + (in[4] - in[3]) >> 12 | + ((in[5] - in[4]) << 49) + out[5] = + (in[5] - in[4]) >> 15 | + ((in[6] - in[5]) << 46) + out[6] = + (in[6] - in[5]) >> 18 | + ((in[7] - in[6]) << 43) + out[7] = + (in[7] - in[6]) >> 21 | + ((in[8] - in[7]) << 40) + out[8] = + (in[8] - in[7]) >> 24 | + ((in[9] - in[8]) << 37) + out[9] = + (in[9] - in[8]) >> 27 | + ((in[10] - in[9]) << 34) + out[10] = + (in[10] - in[9]) >> 30 | + ((in[11] - in[10]) << 31) + out[11] = + (in[11] - in[10]) >> 33 | + ((in[12] - in[11]) << 28) + out[12] = + (in[12] - in[11]) >> 36 | + ((in[13] - in[12]) << 25) + out[13] = + (in[13] - in[12]) >> 39 | + ((in[14] - in[13]) << 22) + out[14] = + (in[14] - in[13]) >> 42 | + ((in[15] - in[14]) << 19) + out[15] = + (in[15] - in[14]) >> 45 | + ((in[16] - in[15]) << 16) + out[16] = + (in[16] - in[15]) >> 48 | + ((in[17] - in[16]) << 13) + out[17] = + (in[17] - in[16]) >> 51 | + ((in[18] - in[17]) << 10) + out[18] = + (in[18] - in[17]) >> 54 | + ((in[19] - in[18]) << 7) + out[19] = + (in[19] - in[18]) >> 57 | + ((in[20] - in[19]) << 4) + out[20] = + (in[20] - in[19]) >> 60 | + ((in[21] - in[20]) << 1) | + ((in[22] - in[21]) << 62) + out[21] = + (in[22] - in[21]) >> 2 | + ((in[23] - in[22]) << 59) + out[22] = + (in[23] - in[22]) >> 5 | + ((in[24] - in[23]) << 56) + out[23] = + (in[24] - in[23]) >> 8 | + ((in[25] - in[24]) << 53) + out[24] = + (in[25] - in[24]) >> 11 | + ((in[26] - in[25]) << 50) + out[25] = + (in[26] - in[25]) >> 14 | + ((in[27] - in[26]) << 47) + out[26] = + (in[27] - in[26]) >> 17 | + ((in[28] - in[27]) << 44) + out[27] = + (in[28] - in[27]) >> 20 | + ((in[29] - in[28]) << 41) + out[28] = + (in[29] - in[28]) >> 23 | + ((in[30] - in[29]) << 38) + out[29] = + (in[30] - in[29]) >> 26 | + ((in[31] - in[30]) << 35) + out[30] = + (in[31] - in[30]) >> 29 | + ((in[32] - in[31]) << 32) + out[31] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 29) + out[32] = + (in[33] - in[32]) >> 35 | + ((in[34] - in[33]) << 26) + out[33] = + (in[34] - in[33]) >> 38 | + ((in[35] - in[34]) << 23) + out[34] = + (in[35] - in[34]) >> 41 | + ((in[36] - in[35]) << 20) + out[35] = + (in[36] - in[35]) >> 44 | + ((in[37] - in[36]) << 17) + out[36] = + (in[37] - in[36]) >> 47 | + ((in[38] - in[37]) << 14) + out[37] = + (in[38] - in[37]) >> 50 | + ((in[39] - in[38]) << 11) + out[38] = + (in[39] - in[38]) >> 53 | + ((in[40] - in[39]) << 8) + out[39] = + (in[40] - in[39]) >> 56 | + ((in[41] - in[40]) << 5) + out[40] = + (in[41] - in[40]) >> 59 | + ((in[42] - in[41]) << 2) | + ((in[43] - in[42]) << 63) + out[41] = + (in[43] - in[42]) >> 1 | + ((in[44] - in[43]) << 60) + out[42] = + (in[44] - in[43]) >> 4 | + ((in[45] - in[44]) << 57) + out[43] = + (in[45] - in[44]) >> 7 | + ((in[46] - in[45]) << 54) + out[44] = + (in[46] - in[45]) >> 10 | + ((in[47] - in[46]) << 51) + out[45] = + (in[47] - in[46]) >> 13 | + ((in[48] - in[47]) << 48) + out[46] = + (in[48] - in[47]) >> 16 | + ((in[49] - in[48]) << 45) + out[47] = + (in[49] - in[48]) >> 19 | + ((in[50] - in[49]) << 42) + out[48] = + (in[50] - in[49]) >> 22 | + ((in[51] - in[50]) << 39) + out[49] = + (in[51] - in[50]) >> 25 | + ((in[52] - in[51]) << 36) + out[50] = + (in[52] - in[51]) >> 28 | + ((in[53] - in[52]) << 33) + out[51] = + (in[53] - in[52]) >> 31 | + ((in[54] - in[53]) << 30) + out[52] = + (in[54] - in[53]) >> 34 | + ((in[55] - in[54]) << 27) + out[53] = + (in[55] - in[54]) >> 37 | + ((in[56] - in[55]) << 24) + out[54] = + (in[56] - in[55]) >> 40 | + ((in[57] - in[56]) << 21) + out[55] = + (in[57] - in[56]) >> 43 | + ((in[58] - in[57]) << 18) + out[56] = + (in[58] - in[57]) >> 46 | + ((in[59] - in[58]) << 15) + out[57] = + (in[59] - in[58]) >> 49 | + ((in[60] - in[59]) << 12) + out[58] = + (in[60] - in[59]) >> 52 | + ((in[61] - in[60]) << 9) + out[59] = + (in[61] - in[60]) >> 55 | + ((in[62] - in[61]) << 6) + out[60] = + (in[62] - in[61]) >> 58 | + ((in[63] - in[62]) << 3) +} + +func deltapack_uint64_62(initoffset uint64, in *[64]uint64, out *[62]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 62) + out[1] = + (in[1] - in[0]) >> 2 | + ((in[2] - in[1]) << 60) + out[2] = + (in[2] - in[1]) >> 4 | + ((in[3] - in[2]) << 58) + out[3] = + (in[3] - in[2]) >> 6 | + ((in[4] - in[3]) << 56) + out[4] = + (in[4] - in[3]) >> 8 | + ((in[5] - in[4]) << 54) + out[5] = + (in[5] - in[4]) >> 10 | + ((in[6] - in[5]) << 52) + out[6] = + (in[6] - in[5]) >> 12 | + ((in[7] - in[6]) << 50) + out[7] = + (in[7] - in[6]) >> 14 | + ((in[8] - in[7]) << 48) + out[8] = + (in[8] - in[7]) >> 16 | + ((in[9] - in[8]) << 46) + out[9] = + (in[9] - in[8]) >> 18 | + ((in[10] - in[9]) << 44) + out[10] = + (in[10] - in[9]) >> 20 | + ((in[11] - in[10]) << 42) + out[11] = + (in[11] - in[10]) >> 22 | + ((in[12] - in[11]) << 40) + out[12] = + (in[12] - in[11]) >> 24 | + ((in[13] - in[12]) << 38) + out[13] = + (in[13] - in[12]) >> 26 | + ((in[14] - in[13]) << 36) + out[14] = + (in[14] - in[13]) >> 28 | + ((in[15] - in[14]) << 34) + out[15] = + (in[15] - in[14]) >> 30 | + ((in[16] - in[15]) << 32) + out[16] = + (in[16] - in[15]) >> 32 | + ((in[17] - in[16]) << 30) + out[17] = + (in[17] - in[16]) >> 34 | + ((in[18] - in[17]) << 28) + out[18] = + (in[18] - in[17]) >> 36 | + ((in[19] - in[18]) << 26) + out[19] = + (in[19] - in[18]) >> 38 | + ((in[20] - in[19]) << 24) + out[20] = + (in[20] - in[19]) >> 40 | + ((in[21] - in[20]) << 22) + out[21] = + (in[21] - in[20]) >> 42 | + ((in[22] - in[21]) << 20) + out[22] = + (in[22] - in[21]) >> 44 | + ((in[23] - in[22]) << 18) + out[23] = + (in[23] - in[22]) >> 46 | + ((in[24] - in[23]) << 16) + out[24] = + (in[24] - in[23]) >> 48 | + ((in[25] - in[24]) << 14) + out[25] = + (in[25] - in[24]) >> 50 | + ((in[26] - in[25]) << 12) + out[26] = + (in[26] - in[25]) >> 52 | + ((in[27] - in[26]) << 10) + out[27] = + (in[27] - in[26]) >> 54 | + ((in[28] - in[27]) << 8) + out[28] = + (in[28] - in[27]) >> 56 | + ((in[29] - in[28]) << 6) + out[29] = + (in[29] - in[28]) >> 58 | + ((in[30] - in[29]) << 4) + out[30] = + (in[30] - in[29]) >> 60 | + ((in[31] - in[30]) << 2) + out[31] = + in[32] - in[31] | + ((in[33] - in[32]) << 62) + out[32] = + (in[33] - in[32]) >> 2 | + ((in[34] - in[33]) << 60) + out[33] = + (in[34] - in[33]) >> 4 | + ((in[35] - in[34]) << 58) + out[34] = + (in[35] - in[34]) >> 6 | + ((in[36] - in[35]) << 56) + out[35] = + (in[36] - in[35]) >> 8 | + ((in[37] - in[36]) << 54) + out[36] = + (in[37] - in[36]) >> 10 | + ((in[38] - in[37]) << 52) + out[37] = + (in[38] - in[37]) >> 12 | + ((in[39] - in[38]) << 50) + out[38] = + (in[39] - in[38]) >> 14 | + ((in[40] - in[39]) << 48) + out[39] = + (in[40] - in[39]) >> 16 | + ((in[41] - in[40]) << 46) + out[40] = + (in[41] - in[40]) >> 18 | + ((in[42] - in[41]) << 44) + out[41] = + (in[42] - in[41]) >> 20 | + ((in[43] - in[42]) << 42) + out[42] = + (in[43] - in[42]) >> 22 | + ((in[44] - in[43]) << 40) + out[43] = + (in[44] - in[43]) >> 24 | + ((in[45] - in[44]) << 38) + out[44] = + (in[45] - in[44]) >> 26 | + ((in[46] - in[45]) << 36) + out[45] = + (in[46] - in[45]) >> 28 | + ((in[47] - in[46]) << 34) + out[46] = + (in[47] - in[46]) >> 30 | + ((in[48] - in[47]) << 32) + out[47] = + (in[48] - in[47]) >> 32 | + ((in[49] - in[48]) << 30) + out[48] = + (in[49] - in[48]) >> 34 | + ((in[50] - in[49]) << 28) + out[49] = + (in[50] - in[49]) >> 36 | + ((in[51] - in[50]) << 26) + out[50] = + (in[51] - in[50]) >> 38 | + ((in[52] - in[51]) << 24) + out[51] = + (in[52] - in[51]) >> 40 | + ((in[53] - in[52]) << 22) + out[52] = + (in[53] - in[52]) >> 42 | + ((in[54] - in[53]) << 20) + out[53] = + (in[54] - in[53]) >> 44 | + ((in[55] - in[54]) << 18) + out[54] = + (in[55] - in[54]) >> 46 | + ((in[56] - in[55]) << 16) + out[55] = + (in[56] - in[55]) >> 48 | + ((in[57] - in[56]) << 14) + out[56] = + (in[57] - in[56]) >> 50 | + ((in[58] - in[57]) << 12) + out[57] = + (in[58] - in[57]) >> 52 | + ((in[59] - in[58]) << 10) + out[58] = + (in[59] - in[58]) >> 54 | + ((in[60] - in[59]) << 8) + out[59] = + (in[60] - in[59]) >> 56 | + ((in[61] - in[60]) << 6) + out[60] = + (in[61] - in[60]) >> 58 | + ((in[62] - in[61]) << 4) + out[61] = + (in[62] - in[61]) >> 60 | + ((in[63] - in[62]) << 2) +} + +func deltapack_uint64_63(initoffset uint64, in *[64]uint64, out *[63]uint64) { + out[0] = + in[0] - initoffset | + ((in[1] - in[0]) << 63) + out[1] = + (in[1] - in[0]) >> 1 | + ((in[2] - in[1]) << 62) + out[2] = + (in[2] - in[1]) >> 2 | + ((in[3] - in[2]) << 61) + out[3] = + (in[3] - in[2]) >> 3 | + ((in[4] - in[3]) << 60) + out[4] = + (in[4] - in[3]) >> 4 | + ((in[5] - in[4]) << 59) + out[5] = + (in[5] - in[4]) >> 5 | + ((in[6] - in[5]) << 58) + out[6] = + (in[6] - in[5]) >> 6 | + ((in[7] - in[6]) << 57) + out[7] = + (in[7] - in[6]) >> 7 | + ((in[8] - in[7]) << 56) + out[8] = + (in[8] - in[7]) >> 8 | + ((in[9] - in[8]) << 55) + out[9] = + (in[9] - in[8]) >> 9 | + ((in[10] - in[9]) << 54) + out[10] = + (in[10] - in[9]) >> 10 | + ((in[11] - in[10]) << 53) + out[11] = + (in[11] - in[10]) >> 11 | + ((in[12] - in[11]) << 52) + out[12] = + (in[12] - in[11]) >> 12 | + ((in[13] - in[12]) << 51) + out[13] = + (in[13] - in[12]) >> 13 | + ((in[14] - in[13]) << 50) + out[14] = + (in[14] - in[13]) >> 14 | + ((in[15] - in[14]) << 49) + out[15] = + (in[15] - in[14]) >> 15 | + ((in[16] - in[15]) << 48) + out[16] = + (in[16] - in[15]) >> 16 | + ((in[17] - in[16]) << 47) + out[17] = + (in[17] - in[16]) >> 17 | + ((in[18] - in[17]) << 46) + out[18] = + (in[18] - in[17]) >> 18 | + ((in[19] - in[18]) << 45) + out[19] = + (in[19] - in[18]) >> 19 | + ((in[20] - in[19]) << 44) + out[20] = + (in[20] - in[19]) >> 20 | + ((in[21] - in[20]) << 43) + out[21] = + (in[21] - in[20]) >> 21 | + ((in[22] - in[21]) << 42) + out[22] = + (in[22] - in[21]) >> 22 | + ((in[23] - in[22]) << 41) + out[23] = + (in[23] - in[22]) >> 23 | + ((in[24] - in[23]) << 40) + out[24] = + (in[24] - in[23]) >> 24 | + ((in[25] - in[24]) << 39) + out[25] = + (in[25] - in[24]) >> 25 | + ((in[26] - in[25]) << 38) + out[26] = + (in[26] - in[25]) >> 26 | + ((in[27] - in[26]) << 37) + out[27] = + (in[27] - in[26]) >> 27 | + ((in[28] - in[27]) << 36) + out[28] = + (in[28] - in[27]) >> 28 | + ((in[29] - in[28]) << 35) + out[29] = + (in[29] - in[28]) >> 29 | + ((in[30] - in[29]) << 34) + out[30] = + (in[30] - in[29]) >> 30 | + ((in[31] - in[30]) << 33) + out[31] = + (in[31] - in[30]) >> 31 | + ((in[32] - in[31]) << 32) + out[32] = + (in[32] - in[31]) >> 32 | + ((in[33] - in[32]) << 31) + out[33] = + (in[33] - in[32]) >> 33 | + ((in[34] - in[33]) << 30) + out[34] = + (in[34] - in[33]) >> 34 | + ((in[35] - in[34]) << 29) + out[35] = + (in[35] - in[34]) >> 35 | + ((in[36] - in[35]) << 28) + out[36] = + (in[36] - in[35]) >> 36 | + ((in[37] - in[36]) << 27) + out[37] = + (in[37] - in[36]) >> 37 | + ((in[38] - in[37]) << 26) + out[38] = + (in[38] - in[37]) >> 38 | + ((in[39] - in[38]) << 25) + out[39] = + (in[39] - in[38]) >> 39 | + ((in[40] - in[39]) << 24) + out[40] = + (in[40] - in[39]) >> 40 | + ((in[41] - in[40]) << 23) + out[41] = + (in[41] - in[40]) >> 41 | + ((in[42] - in[41]) << 22) + out[42] = + (in[42] - in[41]) >> 42 | + ((in[43] - in[42]) << 21) + out[43] = + (in[43] - in[42]) >> 43 | + ((in[44] - in[43]) << 20) + out[44] = + (in[44] - in[43]) >> 44 | + ((in[45] - in[44]) << 19) + out[45] = + (in[45] - in[44]) >> 45 | + ((in[46] - in[45]) << 18) + out[46] = + (in[46] - in[45]) >> 46 | + ((in[47] - in[46]) << 17) + out[47] = + (in[47] - in[46]) >> 47 | + ((in[48] - in[47]) << 16) + out[48] = + (in[48] - in[47]) >> 48 | + ((in[49] - in[48]) << 15) + out[49] = + (in[49] - in[48]) >> 49 | + ((in[50] - in[49]) << 14) + out[50] = + (in[50] - in[49]) >> 50 | + ((in[51] - in[50]) << 13) + out[51] = + (in[51] - in[50]) >> 51 | + ((in[52] - in[51]) << 12) + out[52] = + (in[52] - in[51]) >> 52 | + ((in[53] - in[52]) << 11) + out[53] = + (in[53] - in[52]) >> 53 | + ((in[54] - in[53]) << 10) + out[54] = + (in[54] - in[53]) >> 54 | + ((in[55] - in[54]) << 9) + out[55] = + (in[55] - in[54]) >> 55 | + ((in[56] - in[55]) << 8) + out[56] = + (in[56] - in[55]) >> 56 | + ((in[57] - in[56]) << 7) + out[57] = + (in[57] - in[56]) >> 57 | + ((in[58] - in[57]) << 6) + out[58] = + (in[58] - in[57]) >> 58 | + ((in[59] - in[58]) << 5) + out[59] = + (in[59] - in[58]) >> 59 | + ((in[60] - in[59]) << 4) + out[60] = + (in[60] - in[59]) >> 60 | + ((in[61] - in[60]) << 3) + out[61] = + (in[61] - in[60]) >> 61 | + ((in[62] - in[61]) << 2) + out[62] = + (in[62] - in[61]) >> 62 | + ((in[63] - in[62]) << 1) +} + +func deltaunpack_uint64_0(initoffset uint64, in *[0]uint64, out *[64]uint64) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset + out[32] = initoffset + out[33] = initoffset + out[34] = initoffset + out[35] = initoffset + out[36] = initoffset + out[37] = initoffset + out[38] = initoffset + out[39] = initoffset + out[40] = initoffset + out[41] = initoffset + out[42] = initoffset + out[43] = initoffset + out[44] = initoffset + out[45] = initoffset + out[46] = initoffset + out[47] = initoffset + out[48] = initoffset + out[49] = initoffset + out[50] = initoffset + out[51] = initoffset + out[52] = initoffset + out[53] = initoffset + out[54] = initoffset + out[55] = initoffset + out[56] = initoffset + out[57] = initoffset + out[58] = initoffset + out[59] = initoffset + out[60] = initoffset + out[61] = initoffset + out[62] = initoffset + out[63] = initoffset +} + +func deltaunpack_uint64_1(initoffset uint64, in *[1]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1 + initoffset + out[1] = (in[0] >> 1) & 0x1 + out[0] + out[2] = (in[0] >> 2) & 0x1 + out[1] + out[3] = (in[0] >> 3) & 0x1 + out[2] + out[4] = (in[0] >> 4) & 0x1 + out[3] + out[5] = (in[0] >> 5) & 0x1 + out[4] + out[6] = (in[0] >> 6) & 0x1 + out[5] + out[7] = (in[0] >> 7) & 0x1 + out[6] + out[8] = (in[0] >> 8) & 0x1 + out[7] + out[9] = (in[0] >> 9) & 0x1 + out[8] + out[10] = (in[0] >> 10) & 0x1 + out[9] + out[11] = (in[0] >> 11) & 0x1 + out[10] + out[12] = (in[0] >> 12) & 0x1 + out[11] + out[13] = (in[0] >> 13) & 0x1 + out[12] + out[14] = (in[0] >> 14) & 0x1 + out[13] + out[15] = (in[0] >> 15) & 0x1 + out[14] + out[16] = (in[0] >> 16) & 0x1 + out[15] + out[17] = (in[0] >> 17) & 0x1 + out[16] + out[18] = (in[0] >> 18) & 0x1 + out[17] + out[19] = (in[0] >> 19) & 0x1 + out[18] + out[20] = (in[0] >> 20) & 0x1 + out[19] + out[21] = (in[0] >> 21) & 0x1 + out[20] + out[22] = (in[0] >> 22) & 0x1 + out[21] + out[23] = (in[0] >> 23) & 0x1 + out[22] + out[24] = (in[0] >> 24) & 0x1 + out[23] + out[25] = (in[0] >> 25) & 0x1 + out[24] + out[26] = (in[0] >> 26) & 0x1 + out[25] + out[27] = (in[0] >> 27) & 0x1 + out[26] + out[28] = (in[0] >> 28) & 0x1 + out[27] + out[29] = (in[0] >> 29) & 0x1 + out[28] + out[30] = (in[0] >> 30) & 0x1 + out[29] + out[31] = (in[0] >> 31) & 0x1 + out[30] + out[32] = (in[0] >> 32) & 0x1 + out[31] + out[33] = (in[0] >> 33) & 0x1 + out[32] + out[34] = (in[0] >> 34) & 0x1 + out[33] + out[35] = (in[0] >> 35) & 0x1 + out[34] + out[36] = (in[0] >> 36) & 0x1 + out[35] + out[37] = (in[0] >> 37) & 0x1 + out[36] + out[38] = (in[0] >> 38) & 0x1 + out[37] + out[39] = (in[0] >> 39) & 0x1 + out[38] + out[40] = (in[0] >> 40) & 0x1 + out[39] + out[41] = (in[0] >> 41) & 0x1 + out[40] + out[42] = (in[0] >> 42) & 0x1 + out[41] + out[43] = (in[0] >> 43) & 0x1 + out[42] + out[44] = (in[0] >> 44) & 0x1 + out[43] + out[45] = (in[0] >> 45) & 0x1 + out[44] + out[46] = (in[0] >> 46) & 0x1 + out[45] + out[47] = (in[0] >> 47) & 0x1 + out[46] + out[48] = (in[0] >> 48) & 0x1 + out[47] + out[49] = (in[0] >> 49) & 0x1 + out[48] + out[50] = (in[0] >> 50) & 0x1 + out[49] + out[51] = (in[0] >> 51) & 0x1 + out[50] + out[52] = (in[0] >> 52) & 0x1 + out[51] + out[53] = (in[0] >> 53) & 0x1 + out[52] + out[54] = (in[0] >> 54) & 0x1 + out[53] + out[55] = (in[0] >> 55) & 0x1 + out[54] + out[56] = (in[0] >> 56) & 0x1 + out[55] + out[57] = (in[0] >> 57) & 0x1 + out[56] + out[58] = (in[0] >> 58) & 0x1 + out[57] + out[59] = (in[0] >> 59) & 0x1 + out[58] + out[60] = (in[0] >> 60) & 0x1 + out[59] + out[61] = (in[0] >> 61) & 0x1 + out[60] + out[62] = (in[0] >> 62) & 0x1 + out[61] + out[63] = (in[0] >> 63) + out[62] +} + +func deltaunpack_uint64_2(initoffset uint64, in *[2]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3 + initoffset + out[1] = (in[0] >> 2) & 0x3 + out[0] + out[2] = (in[0] >> 4) & 0x3 + out[1] + out[3] = (in[0] >> 6) & 0x3 + out[2] + out[4] = (in[0] >> 8) & 0x3 + out[3] + out[5] = (in[0] >> 10) & 0x3 + out[4] + out[6] = (in[0] >> 12) & 0x3 + out[5] + out[7] = (in[0] >> 14) & 0x3 + out[6] + out[8] = (in[0] >> 16) & 0x3 + out[7] + out[9] = (in[0] >> 18) & 0x3 + out[8] + out[10] = (in[0] >> 20) & 0x3 + out[9] + out[11] = (in[0] >> 22) & 0x3 + out[10] + out[12] = (in[0] >> 24) & 0x3 + out[11] + out[13] = (in[0] >> 26) & 0x3 + out[12] + out[14] = (in[0] >> 28) & 0x3 + out[13] + out[15] = (in[0] >> 30) & 0x3 + out[14] + out[16] = (in[0] >> 32) & 0x3 + out[15] + out[17] = (in[0] >> 34) & 0x3 + out[16] + out[18] = (in[0] >> 36) & 0x3 + out[17] + out[19] = (in[0] >> 38) & 0x3 + out[18] + out[20] = (in[0] >> 40) & 0x3 + out[19] + out[21] = (in[0] >> 42) & 0x3 + out[20] + out[22] = (in[0] >> 44) & 0x3 + out[21] + out[23] = (in[0] >> 46) & 0x3 + out[22] + out[24] = (in[0] >> 48) & 0x3 + out[23] + out[25] = (in[0] >> 50) & 0x3 + out[24] + out[26] = (in[0] >> 52) & 0x3 + out[25] + out[27] = (in[0] >> 54) & 0x3 + out[26] + out[28] = (in[0] >> 56) & 0x3 + out[27] + out[29] = (in[0] >> 58) & 0x3 + out[28] + out[30] = (in[0] >> 60) & 0x3 + out[29] + out[31] = (in[0] >> 62) + out[30] + out[32] = (in[1] >> 0) & 0x3 + out[31] + out[33] = (in[1] >> 2) & 0x3 + out[32] + out[34] = (in[1] >> 4) & 0x3 + out[33] + out[35] = (in[1] >> 6) & 0x3 + out[34] + out[36] = (in[1] >> 8) & 0x3 + out[35] + out[37] = (in[1] >> 10) & 0x3 + out[36] + out[38] = (in[1] >> 12) & 0x3 + out[37] + out[39] = (in[1] >> 14) & 0x3 + out[38] + out[40] = (in[1] >> 16) & 0x3 + out[39] + out[41] = (in[1] >> 18) & 0x3 + out[40] + out[42] = (in[1] >> 20) & 0x3 + out[41] + out[43] = (in[1] >> 22) & 0x3 + out[42] + out[44] = (in[1] >> 24) & 0x3 + out[43] + out[45] = (in[1] >> 26) & 0x3 + out[44] + out[46] = (in[1] >> 28) & 0x3 + out[45] + out[47] = (in[1] >> 30) & 0x3 + out[46] + out[48] = (in[1] >> 32) & 0x3 + out[47] + out[49] = (in[1] >> 34) & 0x3 + out[48] + out[50] = (in[1] >> 36) & 0x3 + out[49] + out[51] = (in[1] >> 38) & 0x3 + out[50] + out[52] = (in[1] >> 40) & 0x3 + out[51] + out[53] = (in[1] >> 42) & 0x3 + out[52] + out[54] = (in[1] >> 44) & 0x3 + out[53] + out[55] = (in[1] >> 46) & 0x3 + out[54] + out[56] = (in[1] >> 48) & 0x3 + out[55] + out[57] = (in[1] >> 50) & 0x3 + out[56] + out[58] = (in[1] >> 52) & 0x3 + out[57] + out[59] = (in[1] >> 54) & 0x3 + out[58] + out[60] = (in[1] >> 56) & 0x3 + out[59] + out[61] = (in[1] >> 58) & 0x3 + out[60] + out[62] = (in[1] >> 60) & 0x3 + out[61] + out[63] = (in[1] >> 62) + out[62] +} + +func deltaunpack_uint64_3(initoffset uint64, in *[3]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7 + initoffset + out[1] = (in[0] >> 3) & 0x7 + out[0] + out[2] = (in[0] >> 6) & 0x7 + out[1] + out[3] = (in[0] >> 9) & 0x7 + out[2] + out[4] = (in[0] >> 12) & 0x7 + out[3] + out[5] = (in[0] >> 15) & 0x7 + out[4] + out[6] = (in[0] >> 18) & 0x7 + out[5] + out[7] = (in[0] >> 21) & 0x7 + out[6] + out[8] = (in[0] >> 24) & 0x7 + out[7] + out[9] = (in[0] >> 27) & 0x7 + out[8] + out[10] = (in[0] >> 30) & 0x7 + out[9] + out[11] = (in[0] >> 33) & 0x7 + out[10] + out[12] = (in[0] >> 36) & 0x7 + out[11] + out[13] = (in[0] >> 39) & 0x7 + out[12] + out[14] = (in[0] >> 42) & 0x7 + out[13] + out[15] = (in[0] >> 45) & 0x7 + out[14] + out[16] = (in[0] >> 48) & 0x7 + out[15] + out[17] = (in[0] >> 51) & 0x7 + out[16] + out[18] = (in[0] >> 54) & 0x7 + out[17] + out[19] = (in[0] >> 57) & 0x7 + out[18] + out[20] = (in[0] >> 60) & 0x7 + out[19] + out[21] = ((in[0] >> 63) | ((in[1] & 0x3) << 1)) + out[20] + out[22] = (in[1] >> 2) & 0x7 + out[21] + out[23] = (in[1] >> 5) & 0x7 + out[22] + out[24] = (in[1] >> 8) & 0x7 + out[23] + out[25] = (in[1] >> 11) & 0x7 + out[24] + out[26] = (in[1] >> 14) & 0x7 + out[25] + out[27] = (in[1] >> 17) & 0x7 + out[26] + out[28] = (in[1] >> 20) & 0x7 + out[27] + out[29] = (in[1] >> 23) & 0x7 + out[28] + out[30] = (in[1] >> 26) & 0x7 + out[29] + out[31] = (in[1] >> 29) & 0x7 + out[30] + out[32] = (in[1] >> 32) & 0x7 + out[31] + out[33] = (in[1] >> 35) & 0x7 + out[32] + out[34] = (in[1] >> 38) & 0x7 + out[33] + out[35] = (in[1] >> 41) & 0x7 + out[34] + out[36] = (in[1] >> 44) & 0x7 + out[35] + out[37] = (in[1] >> 47) & 0x7 + out[36] + out[38] = (in[1] >> 50) & 0x7 + out[37] + out[39] = (in[1] >> 53) & 0x7 + out[38] + out[40] = (in[1] >> 56) & 0x7 + out[39] + out[41] = (in[1] >> 59) & 0x7 + out[40] + out[42] = ((in[1] >> 62) | ((in[2] & 0x1) << 2)) + out[41] + out[43] = (in[2] >> 1) & 0x7 + out[42] + out[44] = (in[2] >> 4) & 0x7 + out[43] + out[45] = (in[2] >> 7) & 0x7 + out[44] + out[46] = (in[2] >> 10) & 0x7 + out[45] + out[47] = (in[2] >> 13) & 0x7 + out[46] + out[48] = (in[2] >> 16) & 0x7 + out[47] + out[49] = (in[2] >> 19) & 0x7 + out[48] + out[50] = (in[2] >> 22) & 0x7 + out[49] + out[51] = (in[2] >> 25) & 0x7 + out[50] + out[52] = (in[2] >> 28) & 0x7 + out[51] + out[53] = (in[2] >> 31) & 0x7 + out[52] + out[54] = (in[2] >> 34) & 0x7 + out[53] + out[55] = (in[2] >> 37) & 0x7 + out[54] + out[56] = (in[2] >> 40) & 0x7 + out[55] + out[57] = (in[2] >> 43) & 0x7 + out[56] + out[58] = (in[2] >> 46) & 0x7 + out[57] + out[59] = (in[2] >> 49) & 0x7 + out[58] + out[60] = (in[2] >> 52) & 0x7 + out[59] + out[61] = (in[2] >> 55) & 0x7 + out[60] + out[62] = (in[2] >> 58) & 0x7 + out[61] + out[63] = (in[2] >> 61) + out[62] +} + +func deltaunpack_uint64_4(initoffset uint64, in *[4]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xF + initoffset + out[1] = (in[0] >> 4) & 0xF + out[0] + out[2] = (in[0] >> 8) & 0xF + out[1] + out[3] = (in[0] >> 12) & 0xF + out[2] + out[4] = (in[0] >> 16) & 0xF + out[3] + out[5] = (in[0] >> 20) & 0xF + out[4] + out[6] = (in[0] >> 24) & 0xF + out[5] + out[7] = (in[0] >> 28) & 0xF + out[6] + out[8] = (in[0] >> 32) & 0xF + out[7] + out[9] = (in[0] >> 36) & 0xF + out[8] + out[10] = (in[0] >> 40) & 0xF + out[9] + out[11] = (in[0] >> 44) & 0xF + out[10] + out[12] = (in[0] >> 48) & 0xF + out[11] + out[13] = (in[0] >> 52) & 0xF + out[12] + out[14] = (in[0] >> 56) & 0xF + out[13] + out[15] = (in[0] >> 60) + out[14] + out[16] = (in[1] >> 0) & 0xF + out[15] + out[17] = (in[1] >> 4) & 0xF + out[16] + out[18] = (in[1] >> 8) & 0xF + out[17] + out[19] = (in[1] >> 12) & 0xF + out[18] + out[20] = (in[1] >> 16) & 0xF + out[19] + out[21] = (in[1] >> 20) & 0xF + out[20] + out[22] = (in[1] >> 24) & 0xF + out[21] + out[23] = (in[1] >> 28) & 0xF + out[22] + out[24] = (in[1] >> 32) & 0xF + out[23] + out[25] = (in[1] >> 36) & 0xF + out[24] + out[26] = (in[1] >> 40) & 0xF + out[25] + out[27] = (in[1] >> 44) & 0xF + out[26] + out[28] = (in[1] >> 48) & 0xF + out[27] + out[29] = (in[1] >> 52) & 0xF + out[28] + out[30] = (in[1] >> 56) & 0xF + out[29] + out[31] = (in[1] >> 60) + out[30] + out[32] = (in[2] >> 0) & 0xF + out[31] + out[33] = (in[2] >> 4) & 0xF + out[32] + out[34] = (in[2] >> 8) & 0xF + out[33] + out[35] = (in[2] >> 12) & 0xF + out[34] + out[36] = (in[2] >> 16) & 0xF + out[35] + out[37] = (in[2] >> 20) & 0xF + out[36] + out[38] = (in[2] >> 24) & 0xF + out[37] + out[39] = (in[2] >> 28) & 0xF + out[38] + out[40] = (in[2] >> 32) & 0xF + out[39] + out[41] = (in[2] >> 36) & 0xF + out[40] + out[42] = (in[2] >> 40) & 0xF + out[41] + out[43] = (in[2] >> 44) & 0xF + out[42] + out[44] = (in[2] >> 48) & 0xF + out[43] + out[45] = (in[2] >> 52) & 0xF + out[44] + out[46] = (in[2] >> 56) & 0xF + out[45] + out[47] = (in[2] >> 60) + out[46] + out[48] = (in[3] >> 0) & 0xF + out[47] + out[49] = (in[3] >> 4) & 0xF + out[48] + out[50] = (in[3] >> 8) & 0xF + out[49] + out[51] = (in[3] >> 12) & 0xF + out[50] + out[52] = (in[3] >> 16) & 0xF + out[51] + out[53] = (in[3] >> 20) & 0xF + out[52] + out[54] = (in[3] >> 24) & 0xF + out[53] + out[55] = (in[3] >> 28) & 0xF + out[54] + out[56] = (in[3] >> 32) & 0xF + out[55] + out[57] = (in[3] >> 36) & 0xF + out[56] + out[58] = (in[3] >> 40) & 0xF + out[57] + out[59] = (in[3] >> 44) & 0xF + out[58] + out[60] = (in[3] >> 48) & 0xF + out[59] + out[61] = (in[3] >> 52) & 0xF + out[60] + out[62] = (in[3] >> 56) & 0xF + out[61] + out[63] = (in[3] >> 60) + out[62] +} + +func deltaunpack_uint64_5(initoffset uint64, in *[5]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1F + initoffset + out[1] = (in[0] >> 5) & 0x1F + out[0] + out[2] = (in[0] >> 10) & 0x1F + out[1] + out[3] = (in[0] >> 15) & 0x1F + out[2] + out[4] = (in[0] >> 20) & 0x1F + out[3] + out[5] = (in[0] >> 25) & 0x1F + out[4] + out[6] = (in[0] >> 30) & 0x1F + out[5] + out[7] = (in[0] >> 35) & 0x1F + out[6] + out[8] = (in[0] >> 40) & 0x1F + out[7] + out[9] = (in[0] >> 45) & 0x1F + out[8] + out[10] = (in[0] >> 50) & 0x1F + out[9] + out[11] = (in[0] >> 55) & 0x1F + out[10] + out[12] = ((in[0] >> 60) | ((in[1] & 0x1) << 4)) + out[11] + out[13] = (in[1] >> 1) & 0x1F + out[12] + out[14] = (in[1] >> 6) & 0x1F + out[13] + out[15] = (in[1] >> 11) & 0x1F + out[14] + out[16] = (in[1] >> 16) & 0x1F + out[15] + out[17] = (in[1] >> 21) & 0x1F + out[16] + out[18] = (in[1] >> 26) & 0x1F + out[17] + out[19] = (in[1] >> 31) & 0x1F + out[18] + out[20] = (in[1] >> 36) & 0x1F + out[19] + out[21] = (in[1] >> 41) & 0x1F + out[20] + out[22] = (in[1] >> 46) & 0x1F + out[21] + out[23] = (in[1] >> 51) & 0x1F + out[22] + out[24] = (in[1] >> 56) & 0x1F + out[23] + out[25] = ((in[1] >> 61) | ((in[2] & 0x3) << 3)) + out[24] + out[26] = (in[2] >> 2) & 0x1F + out[25] + out[27] = (in[2] >> 7) & 0x1F + out[26] + out[28] = (in[2] >> 12) & 0x1F + out[27] + out[29] = (in[2] >> 17) & 0x1F + out[28] + out[30] = (in[2] >> 22) & 0x1F + out[29] + out[31] = (in[2] >> 27) & 0x1F + out[30] + out[32] = (in[2] >> 32) & 0x1F + out[31] + out[33] = (in[2] >> 37) & 0x1F + out[32] + out[34] = (in[2] >> 42) & 0x1F + out[33] + out[35] = (in[2] >> 47) & 0x1F + out[34] + out[36] = (in[2] >> 52) & 0x1F + out[35] + out[37] = (in[2] >> 57) & 0x1F + out[36] + out[38] = ((in[2] >> 62) | ((in[3] & 0x7) << 2)) + out[37] + out[39] = (in[3] >> 3) & 0x1F + out[38] + out[40] = (in[3] >> 8) & 0x1F + out[39] + out[41] = (in[3] >> 13) & 0x1F + out[40] + out[42] = (in[3] >> 18) & 0x1F + out[41] + out[43] = (in[3] >> 23) & 0x1F + out[42] + out[44] = (in[3] >> 28) & 0x1F + out[43] + out[45] = (in[3] >> 33) & 0x1F + out[44] + out[46] = (in[3] >> 38) & 0x1F + out[45] + out[47] = (in[3] >> 43) & 0x1F + out[46] + out[48] = (in[3] >> 48) & 0x1F + out[47] + out[49] = (in[3] >> 53) & 0x1F + out[48] + out[50] = (in[3] >> 58) & 0x1F + out[49] + out[51] = ((in[3] >> 63) | ((in[4] & 0xF) << 1)) + out[50] + out[52] = (in[4] >> 4) & 0x1F + out[51] + out[53] = (in[4] >> 9) & 0x1F + out[52] + out[54] = (in[4] >> 14) & 0x1F + out[53] + out[55] = (in[4] >> 19) & 0x1F + out[54] + out[56] = (in[4] >> 24) & 0x1F + out[55] + out[57] = (in[4] >> 29) & 0x1F + out[56] + out[58] = (in[4] >> 34) & 0x1F + out[57] + out[59] = (in[4] >> 39) & 0x1F + out[58] + out[60] = (in[4] >> 44) & 0x1F + out[59] + out[61] = (in[4] >> 49) & 0x1F + out[60] + out[62] = (in[4] >> 54) & 0x1F + out[61] + out[63] = (in[4] >> 59) + out[62] +} + +func deltaunpack_uint64_6(initoffset uint64, in *[6]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3F + initoffset + out[1] = (in[0] >> 6) & 0x3F + out[0] + out[2] = (in[0] >> 12) & 0x3F + out[1] + out[3] = (in[0] >> 18) & 0x3F + out[2] + out[4] = (in[0] >> 24) & 0x3F + out[3] + out[5] = (in[0] >> 30) & 0x3F + out[4] + out[6] = (in[0] >> 36) & 0x3F + out[5] + out[7] = (in[0] >> 42) & 0x3F + out[6] + out[8] = (in[0] >> 48) & 0x3F + out[7] + out[9] = (in[0] >> 54) & 0x3F + out[8] + out[10] = ((in[0] >> 60) | ((in[1] & 0x3) << 4)) + out[9] + out[11] = (in[1] >> 2) & 0x3F + out[10] + out[12] = (in[1] >> 8) & 0x3F + out[11] + out[13] = (in[1] >> 14) & 0x3F + out[12] + out[14] = (in[1] >> 20) & 0x3F + out[13] + out[15] = (in[1] >> 26) & 0x3F + out[14] + out[16] = (in[1] >> 32) & 0x3F + out[15] + out[17] = (in[1] >> 38) & 0x3F + out[16] + out[18] = (in[1] >> 44) & 0x3F + out[17] + out[19] = (in[1] >> 50) & 0x3F + out[18] + out[20] = (in[1] >> 56) & 0x3F + out[19] + out[21] = ((in[1] >> 62) | ((in[2] & 0xF) << 2)) + out[20] + out[22] = (in[2] >> 4) & 0x3F + out[21] + out[23] = (in[2] >> 10) & 0x3F + out[22] + out[24] = (in[2] >> 16) & 0x3F + out[23] + out[25] = (in[2] >> 22) & 0x3F + out[24] + out[26] = (in[2] >> 28) & 0x3F + out[25] + out[27] = (in[2] >> 34) & 0x3F + out[26] + out[28] = (in[2] >> 40) & 0x3F + out[27] + out[29] = (in[2] >> 46) & 0x3F + out[28] + out[30] = (in[2] >> 52) & 0x3F + out[29] + out[31] = (in[2] >> 58) + out[30] + out[32] = (in[3] >> 0) & 0x3F + out[31] + out[33] = (in[3] >> 6) & 0x3F + out[32] + out[34] = (in[3] >> 12) & 0x3F + out[33] + out[35] = (in[3] >> 18) & 0x3F + out[34] + out[36] = (in[3] >> 24) & 0x3F + out[35] + out[37] = (in[3] >> 30) & 0x3F + out[36] + out[38] = (in[3] >> 36) & 0x3F + out[37] + out[39] = (in[3] >> 42) & 0x3F + out[38] + out[40] = (in[3] >> 48) & 0x3F + out[39] + out[41] = (in[3] >> 54) & 0x3F + out[40] + out[42] = ((in[3] >> 60) | ((in[4] & 0x3) << 4)) + out[41] + out[43] = (in[4] >> 2) & 0x3F + out[42] + out[44] = (in[4] >> 8) & 0x3F + out[43] + out[45] = (in[4] >> 14) & 0x3F + out[44] + out[46] = (in[4] >> 20) & 0x3F + out[45] + out[47] = (in[4] >> 26) & 0x3F + out[46] + out[48] = (in[4] >> 32) & 0x3F + out[47] + out[49] = (in[4] >> 38) & 0x3F + out[48] + out[50] = (in[4] >> 44) & 0x3F + out[49] + out[51] = (in[4] >> 50) & 0x3F + out[50] + out[52] = (in[4] >> 56) & 0x3F + out[51] + out[53] = ((in[4] >> 62) | ((in[5] & 0xF) << 2)) + out[52] + out[54] = (in[5] >> 4) & 0x3F + out[53] + out[55] = (in[5] >> 10) & 0x3F + out[54] + out[56] = (in[5] >> 16) & 0x3F + out[55] + out[57] = (in[5] >> 22) & 0x3F + out[56] + out[58] = (in[5] >> 28) & 0x3F + out[57] + out[59] = (in[5] >> 34) & 0x3F + out[58] + out[60] = (in[5] >> 40) & 0x3F + out[59] + out[61] = (in[5] >> 46) & 0x3F + out[60] + out[62] = (in[5] >> 52) & 0x3F + out[61] + out[63] = (in[5] >> 58) + out[62] +} + +func deltaunpack_uint64_7(initoffset uint64, in *[7]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7F + initoffset + out[1] = (in[0] >> 7) & 0x7F + out[0] + out[2] = (in[0] >> 14) & 0x7F + out[1] + out[3] = (in[0] >> 21) & 0x7F + out[2] + out[4] = (in[0] >> 28) & 0x7F + out[3] + out[5] = (in[0] >> 35) & 0x7F + out[4] + out[6] = (in[0] >> 42) & 0x7F + out[5] + out[7] = (in[0] >> 49) & 0x7F + out[6] + out[8] = (in[0] >> 56) & 0x7F + out[7] + out[9] = ((in[0] >> 63) | ((in[1] & 0x3F) << 1)) + out[8] + out[10] = (in[1] >> 6) & 0x7F + out[9] + out[11] = (in[1] >> 13) & 0x7F + out[10] + out[12] = (in[1] >> 20) & 0x7F + out[11] + out[13] = (in[1] >> 27) & 0x7F + out[12] + out[14] = (in[1] >> 34) & 0x7F + out[13] + out[15] = (in[1] >> 41) & 0x7F + out[14] + out[16] = (in[1] >> 48) & 0x7F + out[15] + out[17] = (in[1] >> 55) & 0x7F + out[16] + out[18] = ((in[1] >> 62) | ((in[2] & 0x1F) << 2)) + out[17] + out[19] = (in[2] >> 5) & 0x7F + out[18] + out[20] = (in[2] >> 12) & 0x7F + out[19] + out[21] = (in[2] >> 19) & 0x7F + out[20] + out[22] = (in[2] >> 26) & 0x7F + out[21] + out[23] = (in[2] >> 33) & 0x7F + out[22] + out[24] = (in[2] >> 40) & 0x7F + out[23] + out[25] = (in[2] >> 47) & 0x7F + out[24] + out[26] = (in[2] >> 54) & 0x7F + out[25] + out[27] = ((in[2] >> 61) | ((in[3] & 0xF) << 3)) + out[26] + out[28] = (in[3] >> 4) & 0x7F + out[27] + out[29] = (in[3] >> 11) & 0x7F + out[28] + out[30] = (in[3] >> 18) & 0x7F + out[29] + out[31] = (in[3] >> 25) & 0x7F + out[30] + out[32] = (in[3] >> 32) & 0x7F + out[31] + out[33] = (in[3] >> 39) & 0x7F + out[32] + out[34] = (in[3] >> 46) & 0x7F + out[33] + out[35] = (in[3] >> 53) & 0x7F + out[34] + out[36] = ((in[3] >> 60) | ((in[4] & 0x7) << 4)) + out[35] + out[37] = (in[4] >> 3) & 0x7F + out[36] + out[38] = (in[4] >> 10) & 0x7F + out[37] + out[39] = (in[4] >> 17) & 0x7F + out[38] + out[40] = (in[4] >> 24) & 0x7F + out[39] + out[41] = (in[4] >> 31) & 0x7F + out[40] + out[42] = (in[4] >> 38) & 0x7F + out[41] + out[43] = (in[4] >> 45) & 0x7F + out[42] + out[44] = (in[4] >> 52) & 0x7F + out[43] + out[45] = ((in[4] >> 59) | ((in[5] & 0x3) << 5)) + out[44] + out[46] = (in[5] >> 2) & 0x7F + out[45] + out[47] = (in[5] >> 9) & 0x7F + out[46] + out[48] = (in[5] >> 16) & 0x7F + out[47] + out[49] = (in[5] >> 23) & 0x7F + out[48] + out[50] = (in[5] >> 30) & 0x7F + out[49] + out[51] = (in[5] >> 37) & 0x7F + out[50] + out[52] = (in[5] >> 44) & 0x7F + out[51] + out[53] = (in[5] >> 51) & 0x7F + out[52] + out[54] = ((in[5] >> 58) | ((in[6] & 0x1) << 6)) + out[53] + out[55] = (in[6] >> 1) & 0x7F + out[54] + out[56] = (in[6] >> 8) & 0x7F + out[55] + out[57] = (in[6] >> 15) & 0x7F + out[56] + out[58] = (in[6] >> 22) & 0x7F + out[57] + out[59] = (in[6] >> 29) & 0x7F + out[58] + out[60] = (in[6] >> 36) & 0x7F + out[59] + out[61] = (in[6] >> 43) & 0x7F + out[60] + out[62] = (in[6] >> 50) & 0x7F + out[61] + out[63] = (in[6] >> 57) + out[62] +} + +func deltaunpack_uint64_8(initoffset uint64, in *[8]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFF + initoffset + out[1] = (in[0] >> 8) & 0xFF + out[0] + out[2] = (in[0] >> 16) & 0xFF + out[1] + out[3] = (in[0] >> 24) & 0xFF + out[2] + out[4] = (in[0] >> 32) & 0xFF + out[3] + out[5] = (in[0] >> 40) & 0xFF + out[4] + out[6] = (in[0] >> 48) & 0xFF + out[5] + out[7] = (in[0] >> 56) + out[6] + out[8] = (in[1] >> 0) & 0xFF + out[7] + out[9] = (in[1] >> 8) & 0xFF + out[8] + out[10] = (in[1] >> 16) & 0xFF + out[9] + out[11] = (in[1] >> 24) & 0xFF + out[10] + out[12] = (in[1] >> 32) & 0xFF + out[11] + out[13] = (in[1] >> 40) & 0xFF + out[12] + out[14] = (in[1] >> 48) & 0xFF + out[13] + out[15] = (in[1] >> 56) + out[14] + out[16] = (in[2] >> 0) & 0xFF + out[15] + out[17] = (in[2] >> 8) & 0xFF + out[16] + out[18] = (in[2] >> 16) & 0xFF + out[17] + out[19] = (in[2] >> 24) & 0xFF + out[18] + out[20] = (in[2] >> 32) & 0xFF + out[19] + out[21] = (in[2] >> 40) & 0xFF + out[20] + out[22] = (in[2] >> 48) & 0xFF + out[21] + out[23] = (in[2] >> 56) + out[22] + out[24] = (in[3] >> 0) & 0xFF + out[23] + out[25] = (in[3] >> 8) & 0xFF + out[24] + out[26] = (in[3] >> 16) & 0xFF + out[25] + out[27] = (in[3] >> 24) & 0xFF + out[26] + out[28] = (in[3] >> 32) & 0xFF + out[27] + out[29] = (in[3] >> 40) & 0xFF + out[28] + out[30] = (in[3] >> 48) & 0xFF + out[29] + out[31] = (in[3] >> 56) + out[30] + out[32] = (in[4] >> 0) & 0xFF + out[31] + out[33] = (in[4] >> 8) & 0xFF + out[32] + out[34] = (in[4] >> 16) & 0xFF + out[33] + out[35] = (in[4] >> 24) & 0xFF + out[34] + out[36] = (in[4] >> 32) & 0xFF + out[35] + out[37] = (in[4] >> 40) & 0xFF + out[36] + out[38] = (in[4] >> 48) & 0xFF + out[37] + out[39] = (in[4] >> 56) + out[38] + out[40] = (in[5] >> 0) & 0xFF + out[39] + out[41] = (in[5] >> 8) & 0xFF + out[40] + out[42] = (in[5] >> 16) & 0xFF + out[41] + out[43] = (in[5] >> 24) & 0xFF + out[42] + out[44] = (in[5] >> 32) & 0xFF + out[43] + out[45] = (in[5] >> 40) & 0xFF + out[44] + out[46] = (in[5] >> 48) & 0xFF + out[45] + out[47] = (in[5] >> 56) + out[46] + out[48] = (in[6] >> 0) & 0xFF + out[47] + out[49] = (in[6] >> 8) & 0xFF + out[48] + out[50] = (in[6] >> 16) & 0xFF + out[49] + out[51] = (in[6] >> 24) & 0xFF + out[50] + out[52] = (in[6] >> 32) & 0xFF + out[51] + out[53] = (in[6] >> 40) & 0xFF + out[52] + out[54] = (in[6] >> 48) & 0xFF + out[53] + out[55] = (in[6] >> 56) + out[54] + out[56] = (in[7] >> 0) & 0xFF + out[55] + out[57] = (in[7] >> 8) & 0xFF + out[56] + out[58] = (in[7] >> 16) & 0xFF + out[57] + out[59] = (in[7] >> 24) & 0xFF + out[58] + out[60] = (in[7] >> 32) & 0xFF + out[59] + out[61] = (in[7] >> 40) & 0xFF + out[60] + out[62] = (in[7] >> 48) & 0xFF + out[61] + out[63] = (in[7] >> 56) + out[62] +} + +func deltaunpack_uint64_9(initoffset uint64, in *[9]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FF + initoffset + out[1] = (in[0] >> 9) & 0x1FF + out[0] + out[2] = (in[0] >> 18) & 0x1FF + out[1] + out[3] = (in[0] >> 27) & 0x1FF + out[2] + out[4] = (in[0] >> 36) & 0x1FF + out[3] + out[5] = (in[0] >> 45) & 0x1FF + out[4] + out[6] = (in[0] >> 54) & 0x1FF + out[5] + out[7] = ((in[0] >> 63) | ((in[1] & 0xFF) << 1)) + out[6] + out[8] = (in[1] >> 8) & 0x1FF + out[7] + out[9] = (in[1] >> 17) & 0x1FF + out[8] + out[10] = (in[1] >> 26) & 0x1FF + out[9] + out[11] = (in[1] >> 35) & 0x1FF + out[10] + out[12] = (in[1] >> 44) & 0x1FF + out[11] + out[13] = (in[1] >> 53) & 0x1FF + out[12] + out[14] = ((in[1] >> 62) | ((in[2] & 0x7F) << 2)) + out[13] + out[15] = (in[2] >> 7) & 0x1FF + out[14] + out[16] = (in[2] >> 16) & 0x1FF + out[15] + out[17] = (in[2] >> 25) & 0x1FF + out[16] + out[18] = (in[2] >> 34) & 0x1FF + out[17] + out[19] = (in[2] >> 43) & 0x1FF + out[18] + out[20] = (in[2] >> 52) & 0x1FF + out[19] + out[21] = ((in[2] >> 61) | ((in[3] & 0x3F) << 3)) + out[20] + out[22] = (in[3] >> 6) & 0x1FF + out[21] + out[23] = (in[3] >> 15) & 0x1FF + out[22] + out[24] = (in[3] >> 24) & 0x1FF + out[23] + out[25] = (in[3] >> 33) & 0x1FF + out[24] + out[26] = (in[3] >> 42) & 0x1FF + out[25] + out[27] = (in[3] >> 51) & 0x1FF + out[26] + out[28] = ((in[3] >> 60) | ((in[4] & 0x1F) << 4)) + out[27] + out[29] = (in[4] >> 5) & 0x1FF + out[28] + out[30] = (in[4] >> 14) & 0x1FF + out[29] + out[31] = (in[4] >> 23) & 0x1FF + out[30] + out[32] = (in[4] >> 32) & 0x1FF + out[31] + out[33] = (in[4] >> 41) & 0x1FF + out[32] + out[34] = (in[4] >> 50) & 0x1FF + out[33] + out[35] = ((in[4] >> 59) | ((in[5] & 0xF) << 5)) + out[34] + out[36] = (in[5] >> 4) & 0x1FF + out[35] + out[37] = (in[5] >> 13) & 0x1FF + out[36] + out[38] = (in[5] >> 22) & 0x1FF + out[37] + out[39] = (in[5] >> 31) & 0x1FF + out[38] + out[40] = (in[5] >> 40) & 0x1FF + out[39] + out[41] = (in[5] >> 49) & 0x1FF + out[40] + out[42] = ((in[5] >> 58) | ((in[6] & 0x7) << 6)) + out[41] + out[43] = (in[6] >> 3) & 0x1FF + out[42] + out[44] = (in[6] >> 12) & 0x1FF + out[43] + out[45] = (in[6] >> 21) & 0x1FF + out[44] + out[46] = (in[6] >> 30) & 0x1FF + out[45] + out[47] = (in[6] >> 39) & 0x1FF + out[46] + out[48] = (in[6] >> 48) & 0x1FF + out[47] + out[49] = ((in[6] >> 57) | ((in[7] & 0x3) << 7)) + out[48] + out[50] = (in[7] >> 2) & 0x1FF + out[49] + out[51] = (in[7] >> 11) & 0x1FF + out[50] + out[52] = (in[7] >> 20) & 0x1FF + out[51] + out[53] = (in[7] >> 29) & 0x1FF + out[52] + out[54] = (in[7] >> 38) & 0x1FF + out[53] + out[55] = (in[7] >> 47) & 0x1FF + out[54] + out[56] = ((in[7] >> 56) | ((in[8] & 0x1) << 8)) + out[55] + out[57] = (in[8] >> 1) & 0x1FF + out[56] + out[58] = (in[8] >> 10) & 0x1FF + out[57] + out[59] = (in[8] >> 19) & 0x1FF + out[58] + out[60] = (in[8] >> 28) & 0x1FF + out[59] + out[61] = (in[8] >> 37) & 0x1FF + out[60] + out[62] = (in[8] >> 46) & 0x1FF + out[61] + out[63] = (in[8] >> 55) + out[62] +} + +func deltaunpack_uint64_10(initoffset uint64, in *[10]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FF + initoffset + out[1] = (in[0] >> 10) & 0x3FF + out[0] + out[2] = (in[0] >> 20) & 0x3FF + out[1] + out[3] = (in[0] >> 30) & 0x3FF + out[2] + out[4] = (in[0] >> 40) & 0x3FF + out[3] + out[5] = (in[0] >> 50) & 0x3FF + out[4] + out[6] = ((in[0] >> 60) | ((in[1] & 0x3F) << 4)) + out[5] + out[7] = (in[1] >> 6) & 0x3FF + out[6] + out[8] = (in[1] >> 16) & 0x3FF + out[7] + out[9] = (in[1] >> 26) & 0x3FF + out[8] + out[10] = (in[1] >> 36) & 0x3FF + out[9] + out[11] = (in[1] >> 46) & 0x3FF + out[10] + out[12] = ((in[1] >> 56) | ((in[2] & 0x3) << 8)) + out[11] + out[13] = (in[2] >> 2) & 0x3FF + out[12] + out[14] = (in[2] >> 12) & 0x3FF + out[13] + out[15] = (in[2] >> 22) & 0x3FF + out[14] + out[16] = (in[2] >> 32) & 0x3FF + out[15] + out[17] = (in[2] >> 42) & 0x3FF + out[16] + out[18] = (in[2] >> 52) & 0x3FF + out[17] + out[19] = ((in[2] >> 62) | ((in[3] & 0xFF) << 2)) + out[18] + out[20] = (in[3] >> 8) & 0x3FF + out[19] + out[21] = (in[3] >> 18) & 0x3FF + out[20] + out[22] = (in[3] >> 28) & 0x3FF + out[21] + out[23] = (in[3] >> 38) & 0x3FF + out[22] + out[24] = (in[3] >> 48) & 0x3FF + out[23] + out[25] = ((in[3] >> 58) | ((in[4] & 0xF) << 6)) + out[24] + out[26] = (in[4] >> 4) & 0x3FF + out[25] + out[27] = (in[4] >> 14) & 0x3FF + out[26] + out[28] = (in[4] >> 24) & 0x3FF + out[27] + out[29] = (in[4] >> 34) & 0x3FF + out[28] + out[30] = (in[4] >> 44) & 0x3FF + out[29] + out[31] = (in[4] >> 54) + out[30] + out[32] = (in[5] >> 0) & 0x3FF + out[31] + out[33] = (in[5] >> 10) & 0x3FF + out[32] + out[34] = (in[5] >> 20) & 0x3FF + out[33] + out[35] = (in[5] >> 30) & 0x3FF + out[34] + out[36] = (in[5] >> 40) & 0x3FF + out[35] + out[37] = (in[5] >> 50) & 0x3FF + out[36] + out[38] = ((in[5] >> 60) | ((in[6] & 0x3F) << 4)) + out[37] + out[39] = (in[6] >> 6) & 0x3FF + out[38] + out[40] = (in[6] >> 16) & 0x3FF + out[39] + out[41] = (in[6] >> 26) & 0x3FF + out[40] + out[42] = (in[6] >> 36) & 0x3FF + out[41] + out[43] = (in[6] >> 46) & 0x3FF + out[42] + out[44] = ((in[6] >> 56) | ((in[7] & 0x3) << 8)) + out[43] + out[45] = (in[7] >> 2) & 0x3FF + out[44] + out[46] = (in[7] >> 12) & 0x3FF + out[45] + out[47] = (in[7] >> 22) & 0x3FF + out[46] + out[48] = (in[7] >> 32) & 0x3FF + out[47] + out[49] = (in[7] >> 42) & 0x3FF + out[48] + out[50] = (in[7] >> 52) & 0x3FF + out[49] + out[51] = ((in[7] >> 62) | ((in[8] & 0xFF) << 2)) + out[50] + out[52] = (in[8] >> 8) & 0x3FF + out[51] + out[53] = (in[8] >> 18) & 0x3FF + out[52] + out[54] = (in[8] >> 28) & 0x3FF + out[53] + out[55] = (in[8] >> 38) & 0x3FF + out[54] + out[56] = (in[8] >> 48) & 0x3FF + out[55] + out[57] = ((in[8] >> 58) | ((in[9] & 0xF) << 6)) + out[56] + out[58] = (in[9] >> 4) & 0x3FF + out[57] + out[59] = (in[9] >> 14) & 0x3FF + out[58] + out[60] = (in[9] >> 24) & 0x3FF + out[59] + out[61] = (in[9] >> 34) & 0x3FF + out[60] + out[62] = (in[9] >> 44) & 0x3FF + out[61] + out[63] = (in[9] >> 54) + out[62] +} + +func deltaunpack_uint64_11(initoffset uint64, in *[11]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FF + initoffset + out[1] = (in[0] >> 11) & 0x7FF + out[0] + out[2] = (in[0] >> 22) & 0x7FF + out[1] + out[3] = (in[0] >> 33) & 0x7FF + out[2] + out[4] = (in[0] >> 44) & 0x7FF + out[3] + out[5] = ((in[0] >> 55) | ((in[1] & 0x3) << 9)) + out[4] + out[6] = (in[1] >> 2) & 0x7FF + out[5] + out[7] = (in[1] >> 13) & 0x7FF + out[6] + out[8] = (in[1] >> 24) & 0x7FF + out[7] + out[9] = (in[1] >> 35) & 0x7FF + out[8] + out[10] = (in[1] >> 46) & 0x7FF + out[9] + out[11] = ((in[1] >> 57) | ((in[2] & 0xF) << 7)) + out[10] + out[12] = (in[2] >> 4) & 0x7FF + out[11] + out[13] = (in[2] >> 15) & 0x7FF + out[12] + out[14] = (in[2] >> 26) & 0x7FF + out[13] + out[15] = (in[2] >> 37) & 0x7FF + out[14] + out[16] = (in[2] >> 48) & 0x7FF + out[15] + out[17] = ((in[2] >> 59) | ((in[3] & 0x3F) << 5)) + out[16] + out[18] = (in[3] >> 6) & 0x7FF + out[17] + out[19] = (in[3] >> 17) & 0x7FF + out[18] + out[20] = (in[3] >> 28) & 0x7FF + out[19] + out[21] = (in[3] >> 39) & 0x7FF + out[20] + out[22] = (in[3] >> 50) & 0x7FF + out[21] + out[23] = ((in[3] >> 61) | ((in[4] & 0xFF) << 3)) + out[22] + out[24] = (in[4] >> 8) & 0x7FF + out[23] + out[25] = (in[4] >> 19) & 0x7FF + out[24] + out[26] = (in[4] >> 30) & 0x7FF + out[25] + out[27] = (in[4] >> 41) & 0x7FF + out[26] + out[28] = (in[4] >> 52) & 0x7FF + out[27] + out[29] = ((in[4] >> 63) | ((in[5] & 0x3FF) << 1)) + out[28] + out[30] = (in[5] >> 10) & 0x7FF + out[29] + out[31] = (in[5] >> 21) & 0x7FF + out[30] + out[32] = (in[5] >> 32) & 0x7FF + out[31] + out[33] = (in[5] >> 43) & 0x7FF + out[32] + out[34] = ((in[5] >> 54) | ((in[6] & 0x1) << 10)) + out[33] + out[35] = (in[6] >> 1) & 0x7FF + out[34] + out[36] = (in[6] >> 12) & 0x7FF + out[35] + out[37] = (in[6] >> 23) & 0x7FF + out[36] + out[38] = (in[6] >> 34) & 0x7FF + out[37] + out[39] = (in[6] >> 45) & 0x7FF + out[38] + out[40] = ((in[6] >> 56) | ((in[7] & 0x7) << 8)) + out[39] + out[41] = (in[7] >> 3) & 0x7FF + out[40] + out[42] = (in[7] >> 14) & 0x7FF + out[41] + out[43] = (in[7] >> 25) & 0x7FF + out[42] + out[44] = (in[7] >> 36) & 0x7FF + out[43] + out[45] = (in[7] >> 47) & 0x7FF + out[44] + out[46] = ((in[7] >> 58) | ((in[8] & 0x1F) << 6)) + out[45] + out[47] = (in[8] >> 5) & 0x7FF + out[46] + out[48] = (in[8] >> 16) & 0x7FF + out[47] + out[49] = (in[8] >> 27) & 0x7FF + out[48] + out[50] = (in[8] >> 38) & 0x7FF + out[49] + out[51] = (in[8] >> 49) & 0x7FF + out[50] + out[52] = ((in[8] >> 60) | ((in[9] & 0x7F) << 4)) + out[51] + out[53] = (in[9] >> 7) & 0x7FF + out[52] + out[54] = (in[9] >> 18) & 0x7FF + out[53] + out[55] = (in[9] >> 29) & 0x7FF + out[54] + out[56] = (in[9] >> 40) & 0x7FF + out[55] + out[57] = (in[9] >> 51) & 0x7FF + out[56] + out[58] = ((in[9] >> 62) | ((in[10] & 0x1FF) << 2)) + out[57] + out[59] = (in[10] >> 9) & 0x7FF + out[58] + out[60] = (in[10] >> 20) & 0x7FF + out[59] + out[61] = (in[10] >> 31) & 0x7FF + out[60] + out[62] = (in[10] >> 42) & 0x7FF + out[61] + out[63] = (in[10] >> 53) + out[62] +} + +func deltaunpack_uint64_12(initoffset uint64, in *[12]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFF + initoffset + out[1] = (in[0] >> 12) & 0xFFF + out[0] + out[2] = (in[0] >> 24) & 0xFFF + out[1] + out[3] = (in[0] >> 36) & 0xFFF + out[2] + out[4] = (in[0] >> 48) & 0xFFF + out[3] + out[5] = ((in[0] >> 60) | ((in[1] & 0xFF) << 4)) + out[4] + out[6] = (in[1] >> 8) & 0xFFF + out[5] + out[7] = (in[1] >> 20) & 0xFFF + out[6] + out[8] = (in[1] >> 32) & 0xFFF + out[7] + out[9] = (in[1] >> 44) & 0xFFF + out[8] + out[10] = ((in[1] >> 56) | ((in[2] & 0xF) << 8)) + out[9] + out[11] = (in[2] >> 4) & 0xFFF + out[10] + out[12] = (in[2] >> 16) & 0xFFF + out[11] + out[13] = (in[2] >> 28) & 0xFFF + out[12] + out[14] = (in[2] >> 40) & 0xFFF + out[13] + out[15] = (in[2] >> 52) + out[14] + out[16] = (in[3] >> 0) & 0xFFF + out[15] + out[17] = (in[3] >> 12) & 0xFFF + out[16] + out[18] = (in[3] >> 24) & 0xFFF + out[17] + out[19] = (in[3] >> 36) & 0xFFF + out[18] + out[20] = (in[3] >> 48) & 0xFFF + out[19] + out[21] = ((in[3] >> 60) | ((in[4] & 0xFF) << 4)) + out[20] + out[22] = (in[4] >> 8) & 0xFFF + out[21] + out[23] = (in[4] >> 20) & 0xFFF + out[22] + out[24] = (in[4] >> 32) & 0xFFF + out[23] + out[25] = (in[4] >> 44) & 0xFFF + out[24] + out[26] = ((in[4] >> 56) | ((in[5] & 0xF) << 8)) + out[25] + out[27] = (in[5] >> 4) & 0xFFF + out[26] + out[28] = (in[5] >> 16) & 0xFFF + out[27] + out[29] = (in[5] >> 28) & 0xFFF + out[28] + out[30] = (in[5] >> 40) & 0xFFF + out[29] + out[31] = (in[5] >> 52) + out[30] + out[32] = (in[6] >> 0) & 0xFFF + out[31] + out[33] = (in[6] >> 12) & 0xFFF + out[32] + out[34] = (in[6] >> 24) & 0xFFF + out[33] + out[35] = (in[6] >> 36) & 0xFFF + out[34] + out[36] = (in[6] >> 48) & 0xFFF + out[35] + out[37] = ((in[6] >> 60) | ((in[7] & 0xFF) << 4)) + out[36] + out[38] = (in[7] >> 8) & 0xFFF + out[37] + out[39] = (in[7] >> 20) & 0xFFF + out[38] + out[40] = (in[7] >> 32) & 0xFFF + out[39] + out[41] = (in[7] >> 44) & 0xFFF + out[40] + out[42] = ((in[7] >> 56) | ((in[8] & 0xF) << 8)) + out[41] + out[43] = (in[8] >> 4) & 0xFFF + out[42] + out[44] = (in[8] >> 16) & 0xFFF + out[43] + out[45] = (in[8] >> 28) & 0xFFF + out[44] + out[46] = (in[8] >> 40) & 0xFFF + out[45] + out[47] = (in[8] >> 52) + out[46] + out[48] = (in[9] >> 0) & 0xFFF + out[47] + out[49] = (in[9] >> 12) & 0xFFF + out[48] + out[50] = (in[9] >> 24) & 0xFFF + out[49] + out[51] = (in[9] >> 36) & 0xFFF + out[50] + out[52] = (in[9] >> 48) & 0xFFF + out[51] + out[53] = ((in[9] >> 60) | ((in[10] & 0xFF) << 4)) + out[52] + out[54] = (in[10] >> 8) & 0xFFF + out[53] + out[55] = (in[10] >> 20) & 0xFFF + out[54] + out[56] = (in[10] >> 32) & 0xFFF + out[55] + out[57] = (in[10] >> 44) & 0xFFF + out[56] + out[58] = ((in[10] >> 56) | ((in[11] & 0xF) << 8)) + out[57] + out[59] = (in[11] >> 4) & 0xFFF + out[58] + out[60] = (in[11] >> 16) & 0xFFF + out[59] + out[61] = (in[11] >> 28) & 0xFFF + out[60] + out[62] = (in[11] >> 40) & 0xFFF + out[61] + out[63] = (in[11] >> 52) + out[62] +} + +func deltaunpack_uint64_13(initoffset uint64, in *[13]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFF + initoffset + out[1] = (in[0] >> 13) & 0x1FFF + out[0] + out[2] = (in[0] >> 26) & 0x1FFF + out[1] + out[3] = (in[0] >> 39) & 0x1FFF + out[2] + out[4] = ((in[0] >> 52) | ((in[1] & 0x1) << 12)) + out[3] + out[5] = (in[1] >> 1) & 0x1FFF + out[4] + out[6] = (in[1] >> 14) & 0x1FFF + out[5] + out[7] = (in[1] >> 27) & 0x1FFF + out[6] + out[8] = (in[1] >> 40) & 0x1FFF + out[7] + out[9] = ((in[1] >> 53) | ((in[2] & 0x3) << 11)) + out[8] + out[10] = (in[2] >> 2) & 0x1FFF + out[9] + out[11] = (in[2] >> 15) & 0x1FFF + out[10] + out[12] = (in[2] >> 28) & 0x1FFF + out[11] + out[13] = (in[2] >> 41) & 0x1FFF + out[12] + out[14] = ((in[2] >> 54) | ((in[3] & 0x7) << 10)) + out[13] + out[15] = (in[3] >> 3) & 0x1FFF + out[14] + out[16] = (in[3] >> 16) & 0x1FFF + out[15] + out[17] = (in[3] >> 29) & 0x1FFF + out[16] + out[18] = (in[3] >> 42) & 0x1FFF + out[17] + out[19] = ((in[3] >> 55) | ((in[4] & 0xF) << 9)) + out[18] + out[20] = (in[4] >> 4) & 0x1FFF + out[19] + out[21] = (in[4] >> 17) & 0x1FFF + out[20] + out[22] = (in[4] >> 30) & 0x1FFF + out[21] + out[23] = (in[4] >> 43) & 0x1FFF + out[22] + out[24] = ((in[4] >> 56) | ((in[5] & 0x1F) << 8)) + out[23] + out[25] = (in[5] >> 5) & 0x1FFF + out[24] + out[26] = (in[5] >> 18) & 0x1FFF + out[25] + out[27] = (in[5] >> 31) & 0x1FFF + out[26] + out[28] = (in[5] >> 44) & 0x1FFF + out[27] + out[29] = ((in[5] >> 57) | ((in[6] & 0x3F) << 7)) + out[28] + out[30] = (in[6] >> 6) & 0x1FFF + out[29] + out[31] = (in[6] >> 19) & 0x1FFF + out[30] + out[32] = (in[6] >> 32) & 0x1FFF + out[31] + out[33] = (in[6] >> 45) & 0x1FFF + out[32] + out[34] = ((in[6] >> 58) | ((in[7] & 0x7F) << 6)) + out[33] + out[35] = (in[7] >> 7) & 0x1FFF + out[34] + out[36] = (in[7] >> 20) & 0x1FFF + out[35] + out[37] = (in[7] >> 33) & 0x1FFF + out[36] + out[38] = (in[7] >> 46) & 0x1FFF + out[37] + out[39] = ((in[7] >> 59) | ((in[8] & 0xFF) << 5)) + out[38] + out[40] = (in[8] >> 8) & 0x1FFF + out[39] + out[41] = (in[8] >> 21) & 0x1FFF + out[40] + out[42] = (in[8] >> 34) & 0x1FFF + out[41] + out[43] = (in[8] >> 47) & 0x1FFF + out[42] + out[44] = ((in[8] >> 60) | ((in[9] & 0x1FF) << 4)) + out[43] + out[45] = (in[9] >> 9) & 0x1FFF + out[44] + out[46] = (in[9] >> 22) & 0x1FFF + out[45] + out[47] = (in[9] >> 35) & 0x1FFF + out[46] + out[48] = (in[9] >> 48) & 0x1FFF + out[47] + out[49] = ((in[9] >> 61) | ((in[10] & 0x3FF) << 3)) + out[48] + out[50] = (in[10] >> 10) & 0x1FFF + out[49] + out[51] = (in[10] >> 23) & 0x1FFF + out[50] + out[52] = (in[10] >> 36) & 0x1FFF + out[51] + out[53] = (in[10] >> 49) & 0x1FFF + out[52] + out[54] = ((in[10] >> 62) | ((in[11] & 0x7FF) << 2)) + out[53] + out[55] = (in[11] >> 11) & 0x1FFF + out[54] + out[56] = (in[11] >> 24) & 0x1FFF + out[55] + out[57] = (in[11] >> 37) & 0x1FFF + out[56] + out[58] = (in[11] >> 50) & 0x1FFF + out[57] + out[59] = ((in[11] >> 63) | ((in[12] & 0xFFF) << 1)) + out[58] + out[60] = (in[12] >> 12) & 0x1FFF + out[59] + out[61] = (in[12] >> 25) & 0x1FFF + out[60] + out[62] = (in[12] >> 38) & 0x1FFF + out[61] + out[63] = (in[12] >> 51) + out[62] +} + +func deltaunpack_uint64_14(initoffset uint64, in *[14]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFF + initoffset + out[1] = (in[0] >> 14) & 0x3FFF + out[0] + out[2] = (in[0] >> 28) & 0x3FFF + out[1] + out[3] = (in[0] >> 42) & 0x3FFF + out[2] + out[4] = ((in[0] >> 56) | ((in[1] & 0x3F) << 8)) + out[3] + out[5] = (in[1] >> 6) & 0x3FFF + out[4] + out[6] = (in[1] >> 20) & 0x3FFF + out[5] + out[7] = (in[1] >> 34) & 0x3FFF + out[6] + out[8] = (in[1] >> 48) & 0x3FFF + out[7] + out[9] = ((in[1] >> 62) | ((in[2] & 0xFFF) << 2)) + out[8] + out[10] = (in[2] >> 12) & 0x3FFF + out[9] + out[11] = (in[2] >> 26) & 0x3FFF + out[10] + out[12] = (in[2] >> 40) & 0x3FFF + out[11] + out[13] = ((in[2] >> 54) | ((in[3] & 0xF) << 10)) + out[12] + out[14] = (in[3] >> 4) & 0x3FFF + out[13] + out[15] = (in[3] >> 18) & 0x3FFF + out[14] + out[16] = (in[3] >> 32) & 0x3FFF + out[15] + out[17] = (in[3] >> 46) & 0x3FFF + out[16] + out[18] = ((in[3] >> 60) | ((in[4] & 0x3FF) << 4)) + out[17] + out[19] = (in[4] >> 10) & 0x3FFF + out[18] + out[20] = (in[4] >> 24) & 0x3FFF + out[19] + out[21] = (in[4] >> 38) & 0x3FFF + out[20] + out[22] = ((in[4] >> 52) | ((in[5] & 0x3) << 12)) + out[21] + out[23] = (in[5] >> 2) & 0x3FFF + out[22] + out[24] = (in[5] >> 16) & 0x3FFF + out[23] + out[25] = (in[5] >> 30) & 0x3FFF + out[24] + out[26] = (in[5] >> 44) & 0x3FFF + out[25] + out[27] = ((in[5] >> 58) | ((in[6] & 0xFF) << 6)) + out[26] + out[28] = (in[6] >> 8) & 0x3FFF + out[27] + out[29] = (in[6] >> 22) & 0x3FFF + out[28] + out[30] = (in[6] >> 36) & 0x3FFF + out[29] + out[31] = (in[6] >> 50) + out[30] + out[32] = (in[7] >> 0) & 0x3FFF + out[31] + out[33] = (in[7] >> 14) & 0x3FFF + out[32] + out[34] = (in[7] >> 28) & 0x3FFF + out[33] + out[35] = (in[7] >> 42) & 0x3FFF + out[34] + out[36] = ((in[7] >> 56) | ((in[8] & 0x3F) << 8)) + out[35] + out[37] = (in[8] >> 6) & 0x3FFF + out[36] + out[38] = (in[8] >> 20) & 0x3FFF + out[37] + out[39] = (in[8] >> 34) & 0x3FFF + out[38] + out[40] = (in[8] >> 48) & 0x3FFF + out[39] + out[41] = ((in[8] >> 62) | ((in[9] & 0xFFF) << 2)) + out[40] + out[42] = (in[9] >> 12) & 0x3FFF + out[41] + out[43] = (in[9] >> 26) & 0x3FFF + out[42] + out[44] = (in[9] >> 40) & 0x3FFF + out[43] + out[45] = ((in[9] >> 54) | ((in[10] & 0xF) << 10)) + out[44] + out[46] = (in[10] >> 4) & 0x3FFF + out[45] + out[47] = (in[10] >> 18) & 0x3FFF + out[46] + out[48] = (in[10] >> 32) & 0x3FFF + out[47] + out[49] = (in[10] >> 46) & 0x3FFF + out[48] + out[50] = ((in[10] >> 60) | ((in[11] & 0x3FF) << 4)) + out[49] + out[51] = (in[11] >> 10) & 0x3FFF + out[50] + out[52] = (in[11] >> 24) & 0x3FFF + out[51] + out[53] = (in[11] >> 38) & 0x3FFF + out[52] + out[54] = ((in[11] >> 52) | ((in[12] & 0x3) << 12)) + out[53] + out[55] = (in[12] >> 2) & 0x3FFF + out[54] + out[56] = (in[12] >> 16) & 0x3FFF + out[55] + out[57] = (in[12] >> 30) & 0x3FFF + out[56] + out[58] = (in[12] >> 44) & 0x3FFF + out[57] + out[59] = ((in[12] >> 58) | ((in[13] & 0xFF) << 6)) + out[58] + out[60] = (in[13] >> 8) & 0x3FFF + out[59] + out[61] = (in[13] >> 22) & 0x3FFF + out[60] + out[62] = (in[13] >> 36) & 0x3FFF + out[61] + out[63] = (in[13] >> 50) + out[62] +} + +func deltaunpack_uint64_15(initoffset uint64, in *[15]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFF + initoffset + out[1] = (in[0] >> 15) & 0x7FFF + out[0] + out[2] = (in[0] >> 30) & 0x7FFF + out[1] + out[3] = (in[0] >> 45) & 0x7FFF + out[2] + out[4] = ((in[0] >> 60) | ((in[1] & 0x7FF) << 4)) + out[3] + out[5] = (in[1] >> 11) & 0x7FFF + out[4] + out[6] = (in[1] >> 26) & 0x7FFF + out[5] + out[7] = (in[1] >> 41) & 0x7FFF + out[6] + out[8] = ((in[1] >> 56) | ((in[2] & 0x7F) << 8)) + out[7] + out[9] = (in[2] >> 7) & 0x7FFF + out[8] + out[10] = (in[2] >> 22) & 0x7FFF + out[9] + out[11] = (in[2] >> 37) & 0x7FFF + out[10] + out[12] = ((in[2] >> 52) | ((in[3] & 0x7) << 12)) + out[11] + out[13] = (in[3] >> 3) & 0x7FFF + out[12] + out[14] = (in[3] >> 18) & 0x7FFF + out[13] + out[15] = (in[3] >> 33) & 0x7FFF + out[14] + out[16] = (in[3] >> 48) & 0x7FFF + out[15] + out[17] = ((in[3] >> 63) | ((in[4] & 0x3FFF) << 1)) + out[16] + out[18] = (in[4] >> 14) & 0x7FFF + out[17] + out[19] = (in[4] >> 29) & 0x7FFF + out[18] + out[20] = (in[4] >> 44) & 0x7FFF + out[19] + out[21] = ((in[4] >> 59) | ((in[5] & 0x3FF) << 5)) + out[20] + out[22] = (in[5] >> 10) & 0x7FFF + out[21] + out[23] = (in[5] >> 25) & 0x7FFF + out[22] + out[24] = (in[5] >> 40) & 0x7FFF + out[23] + out[25] = ((in[5] >> 55) | ((in[6] & 0x3F) << 9)) + out[24] + out[26] = (in[6] >> 6) & 0x7FFF + out[25] + out[27] = (in[6] >> 21) & 0x7FFF + out[26] + out[28] = (in[6] >> 36) & 0x7FFF + out[27] + out[29] = ((in[6] >> 51) | ((in[7] & 0x3) << 13)) + out[28] + out[30] = (in[7] >> 2) & 0x7FFF + out[29] + out[31] = (in[7] >> 17) & 0x7FFF + out[30] + out[32] = (in[7] >> 32) & 0x7FFF + out[31] + out[33] = (in[7] >> 47) & 0x7FFF + out[32] + out[34] = ((in[7] >> 62) | ((in[8] & 0x1FFF) << 2)) + out[33] + out[35] = (in[8] >> 13) & 0x7FFF + out[34] + out[36] = (in[8] >> 28) & 0x7FFF + out[35] + out[37] = (in[8] >> 43) & 0x7FFF + out[36] + out[38] = ((in[8] >> 58) | ((in[9] & 0x1FF) << 6)) + out[37] + out[39] = (in[9] >> 9) & 0x7FFF + out[38] + out[40] = (in[9] >> 24) & 0x7FFF + out[39] + out[41] = (in[9] >> 39) & 0x7FFF + out[40] + out[42] = ((in[9] >> 54) | ((in[10] & 0x1F) << 10)) + out[41] + out[43] = (in[10] >> 5) & 0x7FFF + out[42] + out[44] = (in[10] >> 20) & 0x7FFF + out[43] + out[45] = (in[10] >> 35) & 0x7FFF + out[44] + out[46] = ((in[10] >> 50) | ((in[11] & 0x1) << 14)) + out[45] + out[47] = (in[11] >> 1) & 0x7FFF + out[46] + out[48] = (in[11] >> 16) & 0x7FFF + out[47] + out[49] = (in[11] >> 31) & 0x7FFF + out[48] + out[50] = (in[11] >> 46) & 0x7FFF + out[49] + out[51] = ((in[11] >> 61) | ((in[12] & 0xFFF) << 3)) + out[50] + out[52] = (in[12] >> 12) & 0x7FFF + out[51] + out[53] = (in[12] >> 27) & 0x7FFF + out[52] + out[54] = (in[12] >> 42) & 0x7FFF + out[53] + out[55] = ((in[12] >> 57) | ((in[13] & 0xFF) << 7)) + out[54] + out[56] = (in[13] >> 8) & 0x7FFF + out[55] + out[57] = (in[13] >> 23) & 0x7FFF + out[56] + out[58] = (in[13] >> 38) & 0x7FFF + out[57] + out[59] = ((in[13] >> 53) | ((in[14] & 0xF) << 11)) + out[58] + out[60] = (in[14] >> 4) & 0x7FFF + out[59] + out[61] = (in[14] >> 19) & 0x7FFF + out[60] + out[62] = (in[14] >> 34) & 0x7FFF + out[61] + out[63] = (in[14] >> 49) + out[62] +} + +func deltaunpack_uint64_16(initoffset uint64, in *[16]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFF + initoffset + out[1] = (in[0] >> 16) & 0xFFFF + out[0] + out[2] = (in[0] >> 32) & 0xFFFF + out[1] + out[3] = (in[0] >> 48) + out[2] + out[4] = (in[1] >> 0) & 0xFFFF + out[3] + out[5] = (in[1] >> 16) & 0xFFFF + out[4] + out[6] = (in[1] >> 32) & 0xFFFF + out[5] + out[7] = (in[1] >> 48) + out[6] + out[8] = (in[2] >> 0) & 0xFFFF + out[7] + out[9] = (in[2] >> 16) & 0xFFFF + out[8] + out[10] = (in[2] >> 32) & 0xFFFF + out[9] + out[11] = (in[2] >> 48) + out[10] + out[12] = (in[3] >> 0) & 0xFFFF + out[11] + out[13] = (in[3] >> 16) & 0xFFFF + out[12] + out[14] = (in[3] >> 32) & 0xFFFF + out[13] + out[15] = (in[3] >> 48) + out[14] + out[16] = (in[4] >> 0) & 0xFFFF + out[15] + out[17] = (in[4] >> 16) & 0xFFFF + out[16] + out[18] = (in[4] >> 32) & 0xFFFF + out[17] + out[19] = (in[4] >> 48) + out[18] + out[20] = (in[5] >> 0) & 0xFFFF + out[19] + out[21] = (in[5] >> 16) & 0xFFFF + out[20] + out[22] = (in[5] >> 32) & 0xFFFF + out[21] + out[23] = (in[5] >> 48) + out[22] + out[24] = (in[6] >> 0) & 0xFFFF + out[23] + out[25] = (in[6] >> 16) & 0xFFFF + out[24] + out[26] = (in[6] >> 32) & 0xFFFF + out[25] + out[27] = (in[6] >> 48) + out[26] + out[28] = (in[7] >> 0) & 0xFFFF + out[27] + out[29] = (in[7] >> 16) & 0xFFFF + out[28] + out[30] = (in[7] >> 32) & 0xFFFF + out[29] + out[31] = (in[7] >> 48) + out[30] + out[32] = (in[8] >> 0) & 0xFFFF + out[31] + out[33] = (in[8] >> 16) & 0xFFFF + out[32] + out[34] = (in[8] >> 32) & 0xFFFF + out[33] + out[35] = (in[8] >> 48) + out[34] + out[36] = (in[9] >> 0) & 0xFFFF + out[35] + out[37] = (in[9] >> 16) & 0xFFFF + out[36] + out[38] = (in[9] >> 32) & 0xFFFF + out[37] + out[39] = (in[9] >> 48) + out[38] + out[40] = (in[10] >> 0) & 0xFFFF + out[39] + out[41] = (in[10] >> 16) & 0xFFFF + out[40] + out[42] = (in[10] >> 32) & 0xFFFF + out[41] + out[43] = (in[10] >> 48) + out[42] + out[44] = (in[11] >> 0) & 0xFFFF + out[43] + out[45] = (in[11] >> 16) & 0xFFFF + out[44] + out[46] = (in[11] >> 32) & 0xFFFF + out[45] + out[47] = (in[11] >> 48) + out[46] + out[48] = (in[12] >> 0) & 0xFFFF + out[47] + out[49] = (in[12] >> 16) & 0xFFFF + out[48] + out[50] = (in[12] >> 32) & 0xFFFF + out[49] + out[51] = (in[12] >> 48) + out[50] + out[52] = (in[13] >> 0) & 0xFFFF + out[51] + out[53] = (in[13] >> 16) & 0xFFFF + out[52] + out[54] = (in[13] >> 32) & 0xFFFF + out[53] + out[55] = (in[13] >> 48) + out[54] + out[56] = (in[14] >> 0) & 0xFFFF + out[55] + out[57] = (in[14] >> 16) & 0xFFFF + out[56] + out[58] = (in[14] >> 32) & 0xFFFF + out[57] + out[59] = (in[14] >> 48) + out[58] + out[60] = (in[15] >> 0) & 0xFFFF + out[59] + out[61] = (in[15] >> 16) & 0xFFFF + out[60] + out[62] = (in[15] >> 32) & 0xFFFF + out[61] + out[63] = (in[15] >> 48) + out[62] +} + +func deltaunpack_uint64_17(initoffset uint64, in *[17]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFF + initoffset + out[1] = (in[0] >> 17) & 0x1FFFF + out[0] + out[2] = (in[0] >> 34) & 0x1FFFF + out[1] + out[3] = ((in[0] >> 51) | ((in[1] & 0xF) << 13)) + out[2] + out[4] = (in[1] >> 4) & 0x1FFFF + out[3] + out[5] = (in[1] >> 21) & 0x1FFFF + out[4] + out[6] = (in[1] >> 38) & 0x1FFFF + out[5] + out[7] = ((in[1] >> 55) | ((in[2] & 0xFF) << 9)) + out[6] + out[8] = (in[2] >> 8) & 0x1FFFF + out[7] + out[9] = (in[2] >> 25) & 0x1FFFF + out[8] + out[10] = (in[2] >> 42) & 0x1FFFF + out[9] + out[11] = ((in[2] >> 59) | ((in[3] & 0xFFF) << 5)) + out[10] + out[12] = (in[3] >> 12) & 0x1FFFF + out[11] + out[13] = (in[3] >> 29) & 0x1FFFF + out[12] + out[14] = (in[3] >> 46) & 0x1FFFF + out[13] + out[15] = ((in[3] >> 63) | ((in[4] & 0xFFFF) << 1)) + out[14] + out[16] = (in[4] >> 16) & 0x1FFFF + out[15] + out[17] = (in[4] >> 33) & 0x1FFFF + out[16] + out[18] = ((in[4] >> 50) | ((in[5] & 0x7) << 14)) + out[17] + out[19] = (in[5] >> 3) & 0x1FFFF + out[18] + out[20] = (in[5] >> 20) & 0x1FFFF + out[19] + out[21] = (in[5] >> 37) & 0x1FFFF + out[20] + out[22] = ((in[5] >> 54) | ((in[6] & 0x7F) << 10)) + out[21] + out[23] = (in[6] >> 7) & 0x1FFFF + out[22] + out[24] = (in[6] >> 24) & 0x1FFFF + out[23] + out[25] = (in[6] >> 41) & 0x1FFFF + out[24] + out[26] = ((in[6] >> 58) | ((in[7] & 0x7FF) << 6)) + out[25] + out[27] = (in[7] >> 11) & 0x1FFFF + out[26] + out[28] = (in[7] >> 28) & 0x1FFFF + out[27] + out[29] = (in[7] >> 45) & 0x1FFFF + out[28] + out[30] = ((in[7] >> 62) | ((in[8] & 0x7FFF) << 2)) + out[29] + out[31] = (in[8] >> 15) & 0x1FFFF + out[30] + out[32] = (in[8] >> 32) & 0x1FFFF + out[31] + out[33] = ((in[8] >> 49) | ((in[9] & 0x3) << 15)) + out[32] + out[34] = (in[9] >> 2) & 0x1FFFF + out[33] + out[35] = (in[9] >> 19) & 0x1FFFF + out[34] + out[36] = (in[9] >> 36) & 0x1FFFF + out[35] + out[37] = ((in[9] >> 53) | ((in[10] & 0x3F) << 11)) + out[36] + out[38] = (in[10] >> 6) & 0x1FFFF + out[37] + out[39] = (in[10] >> 23) & 0x1FFFF + out[38] + out[40] = (in[10] >> 40) & 0x1FFFF + out[39] + out[41] = ((in[10] >> 57) | ((in[11] & 0x3FF) << 7)) + out[40] + out[42] = (in[11] >> 10) & 0x1FFFF + out[41] + out[43] = (in[11] >> 27) & 0x1FFFF + out[42] + out[44] = (in[11] >> 44) & 0x1FFFF + out[43] + out[45] = ((in[11] >> 61) | ((in[12] & 0x3FFF) << 3)) + out[44] + out[46] = (in[12] >> 14) & 0x1FFFF + out[45] + out[47] = (in[12] >> 31) & 0x1FFFF + out[46] + out[48] = ((in[12] >> 48) | ((in[13] & 0x1) << 16)) + out[47] + out[49] = (in[13] >> 1) & 0x1FFFF + out[48] + out[50] = (in[13] >> 18) & 0x1FFFF + out[49] + out[51] = (in[13] >> 35) & 0x1FFFF + out[50] + out[52] = ((in[13] >> 52) | ((in[14] & 0x1F) << 12)) + out[51] + out[53] = (in[14] >> 5) & 0x1FFFF + out[52] + out[54] = (in[14] >> 22) & 0x1FFFF + out[53] + out[55] = (in[14] >> 39) & 0x1FFFF + out[54] + out[56] = ((in[14] >> 56) | ((in[15] & 0x1FF) << 8)) + out[55] + out[57] = (in[15] >> 9) & 0x1FFFF + out[56] + out[58] = (in[15] >> 26) & 0x1FFFF + out[57] + out[59] = (in[15] >> 43) & 0x1FFFF + out[58] + out[60] = ((in[15] >> 60) | ((in[16] & 0x1FFF) << 4)) + out[59] + out[61] = (in[16] >> 13) & 0x1FFFF + out[60] + out[62] = (in[16] >> 30) & 0x1FFFF + out[61] + out[63] = (in[16] >> 47) + out[62] +} + +func deltaunpack_uint64_18(initoffset uint64, in *[18]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFF + initoffset + out[1] = (in[0] >> 18) & 0x3FFFF + out[0] + out[2] = (in[0] >> 36) & 0x3FFFF + out[1] + out[3] = ((in[0] >> 54) | ((in[1] & 0xFF) << 10)) + out[2] + out[4] = (in[1] >> 8) & 0x3FFFF + out[3] + out[5] = (in[1] >> 26) & 0x3FFFF + out[4] + out[6] = (in[1] >> 44) & 0x3FFFF + out[5] + out[7] = ((in[1] >> 62) | ((in[2] & 0xFFFF) << 2)) + out[6] + out[8] = (in[2] >> 16) & 0x3FFFF + out[7] + out[9] = (in[2] >> 34) & 0x3FFFF + out[8] + out[10] = ((in[2] >> 52) | ((in[3] & 0x3F) << 12)) + out[9] + out[11] = (in[3] >> 6) & 0x3FFFF + out[10] + out[12] = (in[3] >> 24) & 0x3FFFF + out[11] + out[13] = (in[3] >> 42) & 0x3FFFF + out[12] + out[14] = ((in[3] >> 60) | ((in[4] & 0x3FFF) << 4)) + out[13] + out[15] = (in[4] >> 14) & 0x3FFFF + out[14] + out[16] = (in[4] >> 32) & 0x3FFFF + out[15] + out[17] = ((in[4] >> 50) | ((in[5] & 0xF) << 14)) + out[16] + out[18] = (in[5] >> 4) & 0x3FFFF + out[17] + out[19] = (in[5] >> 22) & 0x3FFFF + out[18] + out[20] = (in[5] >> 40) & 0x3FFFF + out[19] + out[21] = ((in[5] >> 58) | ((in[6] & 0xFFF) << 6)) + out[20] + out[22] = (in[6] >> 12) & 0x3FFFF + out[21] + out[23] = (in[6] >> 30) & 0x3FFFF + out[22] + out[24] = ((in[6] >> 48) | ((in[7] & 0x3) << 16)) + out[23] + out[25] = (in[7] >> 2) & 0x3FFFF + out[24] + out[26] = (in[7] >> 20) & 0x3FFFF + out[25] + out[27] = (in[7] >> 38) & 0x3FFFF + out[26] + out[28] = ((in[7] >> 56) | ((in[8] & 0x3FF) << 8)) + out[27] + out[29] = (in[8] >> 10) & 0x3FFFF + out[28] + out[30] = (in[8] >> 28) & 0x3FFFF + out[29] + out[31] = (in[8] >> 46) + out[30] + out[32] = (in[9] >> 0) & 0x3FFFF + out[31] + out[33] = (in[9] >> 18) & 0x3FFFF + out[32] + out[34] = (in[9] >> 36) & 0x3FFFF + out[33] + out[35] = ((in[9] >> 54) | ((in[10] & 0xFF) << 10)) + out[34] + out[36] = (in[10] >> 8) & 0x3FFFF + out[35] + out[37] = (in[10] >> 26) & 0x3FFFF + out[36] + out[38] = (in[10] >> 44) & 0x3FFFF + out[37] + out[39] = ((in[10] >> 62) | ((in[11] & 0xFFFF) << 2)) + out[38] + out[40] = (in[11] >> 16) & 0x3FFFF + out[39] + out[41] = (in[11] >> 34) & 0x3FFFF + out[40] + out[42] = ((in[11] >> 52) | ((in[12] & 0x3F) << 12)) + out[41] + out[43] = (in[12] >> 6) & 0x3FFFF + out[42] + out[44] = (in[12] >> 24) & 0x3FFFF + out[43] + out[45] = (in[12] >> 42) & 0x3FFFF + out[44] + out[46] = ((in[12] >> 60) | ((in[13] & 0x3FFF) << 4)) + out[45] + out[47] = (in[13] >> 14) & 0x3FFFF + out[46] + out[48] = (in[13] >> 32) & 0x3FFFF + out[47] + out[49] = ((in[13] >> 50) | ((in[14] & 0xF) << 14)) + out[48] + out[50] = (in[14] >> 4) & 0x3FFFF + out[49] + out[51] = (in[14] >> 22) & 0x3FFFF + out[50] + out[52] = (in[14] >> 40) & 0x3FFFF + out[51] + out[53] = ((in[14] >> 58) | ((in[15] & 0xFFF) << 6)) + out[52] + out[54] = (in[15] >> 12) & 0x3FFFF + out[53] + out[55] = (in[15] >> 30) & 0x3FFFF + out[54] + out[56] = ((in[15] >> 48) | ((in[16] & 0x3) << 16)) + out[55] + out[57] = (in[16] >> 2) & 0x3FFFF + out[56] + out[58] = (in[16] >> 20) & 0x3FFFF + out[57] + out[59] = (in[16] >> 38) & 0x3FFFF + out[58] + out[60] = ((in[16] >> 56) | ((in[17] & 0x3FF) << 8)) + out[59] + out[61] = (in[17] >> 10) & 0x3FFFF + out[60] + out[62] = (in[17] >> 28) & 0x3FFFF + out[61] + out[63] = (in[17] >> 46) + out[62] +} + +func deltaunpack_uint64_19(initoffset uint64, in *[19]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFF + initoffset + out[1] = (in[0] >> 19) & 0x7FFFF + out[0] + out[2] = (in[0] >> 38) & 0x7FFFF + out[1] + out[3] = ((in[0] >> 57) | ((in[1] & 0xFFF) << 7)) + out[2] + out[4] = (in[1] >> 12) & 0x7FFFF + out[3] + out[5] = (in[1] >> 31) & 0x7FFFF + out[4] + out[6] = ((in[1] >> 50) | ((in[2] & 0x1F) << 14)) + out[5] + out[7] = (in[2] >> 5) & 0x7FFFF + out[6] + out[8] = (in[2] >> 24) & 0x7FFFF + out[7] + out[9] = (in[2] >> 43) & 0x7FFFF + out[8] + out[10] = ((in[2] >> 62) | ((in[3] & 0x1FFFF) << 2)) + out[9] + out[11] = (in[3] >> 17) & 0x7FFFF + out[10] + out[12] = (in[3] >> 36) & 0x7FFFF + out[11] + out[13] = ((in[3] >> 55) | ((in[4] & 0x3FF) << 9)) + out[12] + out[14] = (in[4] >> 10) & 0x7FFFF + out[13] + out[15] = (in[4] >> 29) & 0x7FFFF + out[14] + out[16] = ((in[4] >> 48) | ((in[5] & 0x7) << 16)) + out[15] + out[17] = (in[5] >> 3) & 0x7FFFF + out[16] + out[18] = (in[5] >> 22) & 0x7FFFF + out[17] + out[19] = (in[5] >> 41) & 0x7FFFF + out[18] + out[20] = ((in[5] >> 60) | ((in[6] & 0x7FFF) << 4)) + out[19] + out[21] = (in[6] >> 15) & 0x7FFFF + out[20] + out[22] = (in[6] >> 34) & 0x7FFFF + out[21] + out[23] = ((in[6] >> 53) | ((in[7] & 0xFF) << 11)) + out[22] + out[24] = (in[7] >> 8) & 0x7FFFF + out[23] + out[25] = (in[7] >> 27) & 0x7FFFF + out[24] + out[26] = ((in[7] >> 46) | ((in[8] & 0x1) << 18)) + out[25] + out[27] = (in[8] >> 1) & 0x7FFFF + out[26] + out[28] = (in[8] >> 20) & 0x7FFFF + out[27] + out[29] = (in[8] >> 39) & 0x7FFFF + out[28] + out[30] = ((in[8] >> 58) | ((in[9] & 0x1FFF) << 6)) + out[29] + out[31] = (in[9] >> 13) & 0x7FFFF + out[30] + out[32] = (in[9] >> 32) & 0x7FFFF + out[31] + out[33] = ((in[9] >> 51) | ((in[10] & 0x3F) << 13)) + out[32] + out[34] = (in[10] >> 6) & 0x7FFFF + out[33] + out[35] = (in[10] >> 25) & 0x7FFFF + out[34] + out[36] = (in[10] >> 44) & 0x7FFFF + out[35] + out[37] = ((in[10] >> 63) | ((in[11] & 0x3FFFF) << 1)) + out[36] + out[38] = (in[11] >> 18) & 0x7FFFF + out[37] + out[39] = (in[11] >> 37) & 0x7FFFF + out[38] + out[40] = ((in[11] >> 56) | ((in[12] & 0x7FF) << 8)) + out[39] + out[41] = (in[12] >> 11) & 0x7FFFF + out[40] + out[42] = (in[12] >> 30) & 0x7FFFF + out[41] + out[43] = ((in[12] >> 49) | ((in[13] & 0xF) << 15)) + out[42] + out[44] = (in[13] >> 4) & 0x7FFFF + out[43] + out[45] = (in[13] >> 23) & 0x7FFFF + out[44] + out[46] = (in[13] >> 42) & 0x7FFFF + out[45] + out[47] = ((in[13] >> 61) | ((in[14] & 0xFFFF) << 3)) + out[46] + out[48] = (in[14] >> 16) & 0x7FFFF + out[47] + out[49] = (in[14] >> 35) & 0x7FFFF + out[48] + out[50] = ((in[14] >> 54) | ((in[15] & 0x1FF) << 10)) + out[49] + out[51] = (in[15] >> 9) & 0x7FFFF + out[50] + out[52] = (in[15] >> 28) & 0x7FFFF + out[51] + out[53] = ((in[15] >> 47) | ((in[16] & 0x3) << 17)) + out[52] + out[54] = (in[16] >> 2) & 0x7FFFF + out[53] + out[55] = (in[16] >> 21) & 0x7FFFF + out[54] + out[56] = (in[16] >> 40) & 0x7FFFF + out[55] + out[57] = ((in[16] >> 59) | ((in[17] & 0x3FFF) << 5)) + out[56] + out[58] = (in[17] >> 14) & 0x7FFFF + out[57] + out[59] = (in[17] >> 33) & 0x7FFFF + out[58] + out[60] = ((in[17] >> 52) | ((in[18] & 0x7F) << 12)) + out[59] + out[61] = (in[18] >> 7) & 0x7FFFF + out[60] + out[62] = (in[18] >> 26) & 0x7FFFF + out[61] + out[63] = (in[18] >> 45) + out[62] +} + +func deltaunpack_uint64_20(initoffset uint64, in *[20]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFF + initoffset + out[1] = (in[0] >> 20) & 0xFFFFF + out[0] + out[2] = (in[0] >> 40) & 0xFFFFF + out[1] + out[3] = ((in[0] >> 60) | ((in[1] & 0xFFFF) << 4)) + out[2] + out[4] = (in[1] >> 16) & 0xFFFFF + out[3] + out[5] = (in[1] >> 36) & 0xFFFFF + out[4] + out[6] = ((in[1] >> 56) | ((in[2] & 0xFFF) << 8)) + out[5] + out[7] = (in[2] >> 12) & 0xFFFFF + out[6] + out[8] = (in[2] >> 32) & 0xFFFFF + out[7] + out[9] = ((in[2] >> 52) | ((in[3] & 0xFF) << 12)) + out[8] + out[10] = (in[3] >> 8) & 0xFFFFF + out[9] + out[11] = (in[3] >> 28) & 0xFFFFF + out[10] + out[12] = ((in[3] >> 48) | ((in[4] & 0xF) << 16)) + out[11] + out[13] = (in[4] >> 4) & 0xFFFFF + out[12] + out[14] = (in[4] >> 24) & 0xFFFFF + out[13] + out[15] = (in[4] >> 44) + out[14] + out[16] = (in[5] >> 0) & 0xFFFFF + out[15] + out[17] = (in[5] >> 20) & 0xFFFFF + out[16] + out[18] = (in[5] >> 40) & 0xFFFFF + out[17] + out[19] = ((in[5] >> 60) | ((in[6] & 0xFFFF) << 4)) + out[18] + out[20] = (in[6] >> 16) & 0xFFFFF + out[19] + out[21] = (in[6] >> 36) & 0xFFFFF + out[20] + out[22] = ((in[6] >> 56) | ((in[7] & 0xFFF) << 8)) + out[21] + out[23] = (in[7] >> 12) & 0xFFFFF + out[22] + out[24] = (in[7] >> 32) & 0xFFFFF + out[23] + out[25] = ((in[7] >> 52) | ((in[8] & 0xFF) << 12)) + out[24] + out[26] = (in[8] >> 8) & 0xFFFFF + out[25] + out[27] = (in[8] >> 28) & 0xFFFFF + out[26] + out[28] = ((in[8] >> 48) | ((in[9] & 0xF) << 16)) + out[27] + out[29] = (in[9] >> 4) & 0xFFFFF + out[28] + out[30] = (in[9] >> 24) & 0xFFFFF + out[29] + out[31] = (in[9] >> 44) + out[30] + out[32] = (in[10] >> 0) & 0xFFFFF + out[31] + out[33] = (in[10] >> 20) & 0xFFFFF + out[32] + out[34] = (in[10] >> 40) & 0xFFFFF + out[33] + out[35] = ((in[10] >> 60) | ((in[11] & 0xFFFF) << 4)) + out[34] + out[36] = (in[11] >> 16) & 0xFFFFF + out[35] + out[37] = (in[11] >> 36) & 0xFFFFF + out[36] + out[38] = ((in[11] >> 56) | ((in[12] & 0xFFF) << 8)) + out[37] + out[39] = (in[12] >> 12) & 0xFFFFF + out[38] + out[40] = (in[12] >> 32) & 0xFFFFF + out[39] + out[41] = ((in[12] >> 52) | ((in[13] & 0xFF) << 12)) + out[40] + out[42] = (in[13] >> 8) & 0xFFFFF + out[41] + out[43] = (in[13] >> 28) & 0xFFFFF + out[42] + out[44] = ((in[13] >> 48) | ((in[14] & 0xF) << 16)) + out[43] + out[45] = (in[14] >> 4) & 0xFFFFF + out[44] + out[46] = (in[14] >> 24) & 0xFFFFF + out[45] + out[47] = (in[14] >> 44) + out[46] + out[48] = (in[15] >> 0) & 0xFFFFF + out[47] + out[49] = (in[15] >> 20) & 0xFFFFF + out[48] + out[50] = (in[15] >> 40) & 0xFFFFF + out[49] + out[51] = ((in[15] >> 60) | ((in[16] & 0xFFFF) << 4)) + out[50] + out[52] = (in[16] >> 16) & 0xFFFFF + out[51] + out[53] = (in[16] >> 36) & 0xFFFFF + out[52] + out[54] = ((in[16] >> 56) | ((in[17] & 0xFFF) << 8)) + out[53] + out[55] = (in[17] >> 12) & 0xFFFFF + out[54] + out[56] = (in[17] >> 32) & 0xFFFFF + out[55] + out[57] = ((in[17] >> 52) | ((in[18] & 0xFF) << 12)) + out[56] + out[58] = (in[18] >> 8) & 0xFFFFF + out[57] + out[59] = (in[18] >> 28) & 0xFFFFF + out[58] + out[60] = ((in[18] >> 48) | ((in[19] & 0xF) << 16)) + out[59] + out[61] = (in[19] >> 4) & 0xFFFFF + out[60] + out[62] = (in[19] >> 24) & 0xFFFFF + out[61] + out[63] = (in[19] >> 44) + out[62] +} + +func deltaunpack_uint64_21(initoffset uint64, in *[21]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFF + initoffset + out[1] = (in[0] >> 21) & 0x1FFFFF + out[0] + out[2] = (in[0] >> 42) & 0x1FFFFF + out[1] + out[3] = ((in[0] >> 63) | ((in[1] & 0xFFFFF) << 1)) + out[2] + out[4] = (in[1] >> 20) & 0x1FFFFF + out[3] + out[5] = (in[1] >> 41) & 0x1FFFFF + out[4] + out[6] = ((in[1] >> 62) | ((in[2] & 0x7FFFF) << 2)) + out[5] + out[7] = (in[2] >> 19) & 0x1FFFFF + out[6] + out[8] = (in[2] >> 40) & 0x1FFFFF + out[7] + out[9] = ((in[2] >> 61) | ((in[3] & 0x3FFFF) << 3)) + out[8] + out[10] = (in[3] >> 18) & 0x1FFFFF + out[9] + out[11] = (in[3] >> 39) & 0x1FFFFF + out[10] + out[12] = ((in[3] >> 60) | ((in[4] & 0x1FFFF) << 4)) + out[11] + out[13] = (in[4] >> 17) & 0x1FFFFF + out[12] + out[14] = (in[4] >> 38) & 0x1FFFFF + out[13] + out[15] = ((in[4] >> 59) | ((in[5] & 0xFFFF) << 5)) + out[14] + out[16] = (in[5] >> 16) & 0x1FFFFF + out[15] + out[17] = (in[5] >> 37) & 0x1FFFFF + out[16] + out[18] = ((in[5] >> 58) | ((in[6] & 0x7FFF) << 6)) + out[17] + out[19] = (in[6] >> 15) & 0x1FFFFF + out[18] + out[20] = (in[6] >> 36) & 0x1FFFFF + out[19] + out[21] = ((in[6] >> 57) | ((in[7] & 0x3FFF) << 7)) + out[20] + out[22] = (in[7] >> 14) & 0x1FFFFF + out[21] + out[23] = (in[7] >> 35) & 0x1FFFFF + out[22] + out[24] = ((in[7] >> 56) | ((in[8] & 0x1FFF) << 8)) + out[23] + out[25] = (in[8] >> 13) & 0x1FFFFF + out[24] + out[26] = (in[8] >> 34) & 0x1FFFFF + out[25] + out[27] = ((in[8] >> 55) | ((in[9] & 0xFFF) << 9)) + out[26] + out[28] = (in[9] >> 12) & 0x1FFFFF + out[27] + out[29] = (in[9] >> 33) & 0x1FFFFF + out[28] + out[30] = ((in[9] >> 54) | ((in[10] & 0x7FF) << 10)) + out[29] + out[31] = (in[10] >> 11) & 0x1FFFFF + out[30] + out[32] = (in[10] >> 32) & 0x1FFFFF + out[31] + out[33] = ((in[10] >> 53) | ((in[11] & 0x3FF) << 11)) + out[32] + out[34] = (in[11] >> 10) & 0x1FFFFF + out[33] + out[35] = (in[11] >> 31) & 0x1FFFFF + out[34] + out[36] = ((in[11] >> 52) | ((in[12] & 0x1FF) << 12)) + out[35] + out[37] = (in[12] >> 9) & 0x1FFFFF + out[36] + out[38] = (in[12] >> 30) & 0x1FFFFF + out[37] + out[39] = ((in[12] >> 51) | ((in[13] & 0xFF) << 13)) + out[38] + out[40] = (in[13] >> 8) & 0x1FFFFF + out[39] + out[41] = (in[13] >> 29) & 0x1FFFFF + out[40] + out[42] = ((in[13] >> 50) | ((in[14] & 0x7F) << 14)) + out[41] + out[43] = (in[14] >> 7) & 0x1FFFFF + out[42] + out[44] = (in[14] >> 28) & 0x1FFFFF + out[43] + out[45] = ((in[14] >> 49) | ((in[15] & 0x3F) << 15)) + out[44] + out[46] = (in[15] >> 6) & 0x1FFFFF + out[45] + out[47] = (in[15] >> 27) & 0x1FFFFF + out[46] + out[48] = ((in[15] >> 48) | ((in[16] & 0x1F) << 16)) + out[47] + out[49] = (in[16] >> 5) & 0x1FFFFF + out[48] + out[50] = (in[16] >> 26) & 0x1FFFFF + out[49] + out[51] = ((in[16] >> 47) | ((in[17] & 0xF) << 17)) + out[50] + out[52] = (in[17] >> 4) & 0x1FFFFF + out[51] + out[53] = (in[17] >> 25) & 0x1FFFFF + out[52] + out[54] = ((in[17] >> 46) | ((in[18] & 0x7) << 18)) + out[53] + out[55] = (in[18] >> 3) & 0x1FFFFF + out[54] + out[56] = (in[18] >> 24) & 0x1FFFFF + out[55] + out[57] = ((in[18] >> 45) | ((in[19] & 0x3) << 19)) + out[56] + out[58] = (in[19] >> 2) & 0x1FFFFF + out[57] + out[59] = (in[19] >> 23) & 0x1FFFFF + out[58] + out[60] = ((in[19] >> 44) | ((in[20] & 0x1) << 20)) + out[59] + out[61] = (in[20] >> 1) & 0x1FFFFF + out[60] + out[62] = (in[20] >> 22) & 0x1FFFFF + out[61] + out[63] = (in[20] >> 43) + out[62] +} + +func deltaunpack_uint64_22(initoffset uint64, in *[22]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFF + initoffset + out[1] = (in[0] >> 22) & 0x3FFFFF + out[0] + out[2] = ((in[0] >> 44) | ((in[1] & 0x3) << 20)) + out[1] + out[3] = (in[1] >> 2) & 0x3FFFFF + out[2] + out[4] = (in[1] >> 24) & 0x3FFFFF + out[3] + out[5] = ((in[1] >> 46) | ((in[2] & 0xF) << 18)) + out[4] + out[6] = (in[2] >> 4) & 0x3FFFFF + out[5] + out[7] = (in[2] >> 26) & 0x3FFFFF + out[6] + out[8] = ((in[2] >> 48) | ((in[3] & 0x3F) << 16)) + out[7] + out[9] = (in[3] >> 6) & 0x3FFFFF + out[8] + out[10] = (in[3] >> 28) & 0x3FFFFF + out[9] + out[11] = ((in[3] >> 50) | ((in[4] & 0xFF) << 14)) + out[10] + out[12] = (in[4] >> 8) & 0x3FFFFF + out[11] + out[13] = (in[4] >> 30) & 0x3FFFFF + out[12] + out[14] = ((in[4] >> 52) | ((in[5] & 0x3FF) << 12)) + out[13] + out[15] = (in[5] >> 10) & 0x3FFFFF + out[14] + out[16] = (in[5] >> 32) & 0x3FFFFF + out[15] + out[17] = ((in[5] >> 54) | ((in[6] & 0xFFF) << 10)) + out[16] + out[18] = (in[6] >> 12) & 0x3FFFFF + out[17] + out[19] = (in[6] >> 34) & 0x3FFFFF + out[18] + out[20] = ((in[6] >> 56) | ((in[7] & 0x3FFF) << 8)) + out[19] + out[21] = (in[7] >> 14) & 0x3FFFFF + out[20] + out[22] = (in[7] >> 36) & 0x3FFFFF + out[21] + out[23] = ((in[7] >> 58) | ((in[8] & 0xFFFF) << 6)) + out[22] + out[24] = (in[8] >> 16) & 0x3FFFFF + out[23] + out[25] = (in[8] >> 38) & 0x3FFFFF + out[24] + out[26] = ((in[8] >> 60) | ((in[9] & 0x3FFFF) << 4)) + out[25] + out[27] = (in[9] >> 18) & 0x3FFFFF + out[26] + out[28] = (in[9] >> 40) & 0x3FFFFF + out[27] + out[29] = ((in[9] >> 62) | ((in[10] & 0xFFFFF) << 2)) + out[28] + out[30] = (in[10] >> 20) & 0x3FFFFF + out[29] + out[31] = (in[10] >> 42) + out[30] + out[32] = (in[11] >> 0) & 0x3FFFFF + out[31] + out[33] = (in[11] >> 22) & 0x3FFFFF + out[32] + out[34] = ((in[11] >> 44) | ((in[12] & 0x3) << 20)) + out[33] + out[35] = (in[12] >> 2) & 0x3FFFFF + out[34] + out[36] = (in[12] >> 24) & 0x3FFFFF + out[35] + out[37] = ((in[12] >> 46) | ((in[13] & 0xF) << 18)) + out[36] + out[38] = (in[13] >> 4) & 0x3FFFFF + out[37] + out[39] = (in[13] >> 26) & 0x3FFFFF + out[38] + out[40] = ((in[13] >> 48) | ((in[14] & 0x3F) << 16)) + out[39] + out[41] = (in[14] >> 6) & 0x3FFFFF + out[40] + out[42] = (in[14] >> 28) & 0x3FFFFF + out[41] + out[43] = ((in[14] >> 50) | ((in[15] & 0xFF) << 14)) + out[42] + out[44] = (in[15] >> 8) & 0x3FFFFF + out[43] + out[45] = (in[15] >> 30) & 0x3FFFFF + out[44] + out[46] = ((in[15] >> 52) | ((in[16] & 0x3FF) << 12)) + out[45] + out[47] = (in[16] >> 10) & 0x3FFFFF + out[46] + out[48] = (in[16] >> 32) & 0x3FFFFF + out[47] + out[49] = ((in[16] >> 54) | ((in[17] & 0xFFF) << 10)) + out[48] + out[50] = (in[17] >> 12) & 0x3FFFFF + out[49] + out[51] = (in[17] >> 34) & 0x3FFFFF + out[50] + out[52] = ((in[17] >> 56) | ((in[18] & 0x3FFF) << 8)) + out[51] + out[53] = (in[18] >> 14) & 0x3FFFFF + out[52] + out[54] = (in[18] >> 36) & 0x3FFFFF + out[53] + out[55] = ((in[18] >> 58) | ((in[19] & 0xFFFF) << 6)) + out[54] + out[56] = (in[19] >> 16) & 0x3FFFFF + out[55] + out[57] = (in[19] >> 38) & 0x3FFFFF + out[56] + out[58] = ((in[19] >> 60) | ((in[20] & 0x3FFFF) << 4)) + out[57] + out[59] = (in[20] >> 18) & 0x3FFFFF + out[58] + out[60] = (in[20] >> 40) & 0x3FFFFF + out[59] + out[61] = ((in[20] >> 62) | ((in[21] & 0xFFFFF) << 2)) + out[60] + out[62] = (in[21] >> 20) & 0x3FFFFF + out[61] + out[63] = (in[21] >> 42) + out[62] +} + +func deltaunpack_uint64_23(initoffset uint64, in *[23]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFF + initoffset + out[1] = (in[0] >> 23) & 0x7FFFFF + out[0] + out[2] = ((in[0] >> 46) | ((in[1] & 0x1F) << 18)) + out[1] + out[3] = (in[1] >> 5) & 0x7FFFFF + out[2] + out[4] = (in[1] >> 28) & 0x7FFFFF + out[3] + out[5] = ((in[1] >> 51) | ((in[2] & 0x3FF) << 13)) + out[4] + out[6] = (in[2] >> 10) & 0x7FFFFF + out[5] + out[7] = (in[2] >> 33) & 0x7FFFFF + out[6] + out[8] = ((in[2] >> 56) | ((in[3] & 0x7FFF) << 8)) + out[7] + out[9] = (in[3] >> 15) & 0x7FFFFF + out[8] + out[10] = (in[3] >> 38) & 0x7FFFFF + out[9] + out[11] = ((in[3] >> 61) | ((in[4] & 0xFFFFF) << 3)) + out[10] + out[12] = (in[4] >> 20) & 0x7FFFFF + out[11] + out[13] = ((in[4] >> 43) | ((in[5] & 0x3) << 21)) + out[12] + out[14] = (in[5] >> 2) & 0x7FFFFF + out[13] + out[15] = (in[5] >> 25) & 0x7FFFFF + out[14] + out[16] = ((in[5] >> 48) | ((in[6] & 0x7F) << 16)) + out[15] + out[17] = (in[6] >> 7) & 0x7FFFFF + out[16] + out[18] = (in[6] >> 30) & 0x7FFFFF + out[17] + out[19] = ((in[6] >> 53) | ((in[7] & 0xFFF) << 11)) + out[18] + out[20] = (in[7] >> 12) & 0x7FFFFF + out[19] + out[21] = (in[7] >> 35) & 0x7FFFFF + out[20] + out[22] = ((in[7] >> 58) | ((in[8] & 0x1FFFF) << 6)) + out[21] + out[23] = (in[8] >> 17) & 0x7FFFFF + out[22] + out[24] = (in[8] >> 40) & 0x7FFFFF + out[23] + out[25] = ((in[8] >> 63) | ((in[9] & 0x3FFFFF) << 1)) + out[24] + out[26] = (in[9] >> 22) & 0x7FFFFF + out[25] + out[27] = ((in[9] >> 45) | ((in[10] & 0xF) << 19)) + out[26] + out[28] = (in[10] >> 4) & 0x7FFFFF + out[27] + out[29] = (in[10] >> 27) & 0x7FFFFF + out[28] + out[30] = ((in[10] >> 50) | ((in[11] & 0x1FF) << 14)) + out[29] + out[31] = (in[11] >> 9) & 0x7FFFFF + out[30] + out[32] = (in[11] >> 32) & 0x7FFFFF + out[31] + out[33] = ((in[11] >> 55) | ((in[12] & 0x3FFF) << 9)) + out[32] + out[34] = (in[12] >> 14) & 0x7FFFFF + out[33] + out[35] = (in[12] >> 37) & 0x7FFFFF + out[34] + out[36] = ((in[12] >> 60) | ((in[13] & 0x7FFFF) << 4)) + out[35] + out[37] = (in[13] >> 19) & 0x7FFFFF + out[36] + out[38] = ((in[13] >> 42) | ((in[14] & 0x1) << 22)) + out[37] + out[39] = (in[14] >> 1) & 0x7FFFFF + out[38] + out[40] = (in[14] >> 24) & 0x7FFFFF + out[39] + out[41] = ((in[14] >> 47) | ((in[15] & 0x3F) << 17)) + out[40] + out[42] = (in[15] >> 6) & 0x7FFFFF + out[41] + out[43] = (in[15] >> 29) & 0x7FFFFF + out[42] + out[44] = ((in[15] >> 52) | ((in[16] & 0x7FF) << 12)) + out[43] + out[45] = (in[16] >> 11) & 0x7FFFFF + out[44] + out[46] = (in[16] >> 34) & 0x7FFFFF + out[45] + out[47] = ((in[16] >> 57) | ((in[17] & 0xFFFF) << 7)) + out[46] + out[48] = (in[17] >> 16) & 0x7FFFFF + out[47] + out[49] = (in[17] >> 39) & 0x7FFFFF + out[48] + out[50] = ((in[17] >> 62) | ((in[18] & 0x1FFFFF) << 2)) + out[49] + out[51] = (in[18] >> 21) & 0x7FFFFF + out[50] + out[52] = ((in[18] >> 44) | ((in[19] & 0x7) << 20)) + out[51] + out[53] = (in[19] >> 3) & 0x7FFFFF + out[52] + out[54] = (in[19] >> 26) & 0x7FFFFF + out[53] + out[55] = ((in[19] >> 49) | ((in[20] & 0xFF) << 15)) + out[54] + out[56] = (in[20] >> 8) & 0x7FFFFF + out[55] + out[57] = (in[20] >> 31) & 0x7FFFFF + out[56] + out[58] = ((in[20] >> 54) | ((in[21] & 0x1FFF) << 10)) + out[57] + out[59] = (in[21] >> 13) & 0x7FFFFF + out[58] + out[60] = (in[21] >> 36) & 0x7FFFFF + out[59] + out[61] = ((in[21] >> 59) | ((in[22] & 0x3FFFF) << 5)) + out[60] + out[62] = (in[22] >> 18) & 0x7FFFFF + out[61] + out[63] = (in[22] >> 41) + out[62] +} + +func deltaunpack_uint64_24(initoffset uint64, in *[24]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFF + initoffset + out[1] = (in[0] >> 24) & 0xFFFFFF + out[0] + out[2] = ((in[0] >> 48) | ((in[1] & 0xFF) << 16)) + out[1] + out[3] = (in[1] >> 8) & 0xFFFFFF + out[2] + out[4] = (in[1] >> 32) & 0xFFFFFF + out[3] + out[5] = ((in[1] >> 56) | ((in[2] & 0xFFFF) << 8)) + out[4] + out[6] = (in[2] >> 16) & 0xFFFFFF + out[5] + out[7] = (in[2] >> 40) + out[6] + out[8] = (in[3] >> 0) & 0xFFFFFF + out[7] + out[9] = (in[3] >> 24) & 0xFFFFFF + out[8] + out[10] = ((in[3] >> 48) | ((in[4] & 0xFF) << 16)) + out[9] + out[11] = (in[4] >> 8) & 0xFFFFFF + out[10] + out[12] = (in[4] >> 32) & 0xFFFFFF + out[11] + out[13] = ((in[4] >> 56) | ((in[5] & 0xFFFF) << 8)) + out[12] + out[14] = (in[5] >> 16) & 0xFFFFFF + out[13] + out[15] = (in[5] >> 40) + out[14] + out[16] = (in[6] >> 0) & 0xFFFFFF + out[15] + out[17] = (in[6] >> 24) & 0xFFFFFF + out[16] + out[18] = ((in[6] >> 48) | ((in[7] & 0xFF) << 16)) + out[17] + out[19] = (in[7] >> 8) & 0xFFFFFF + out[18] + out[20] = (in[7] >> 32) & 0xFFFFFF + out[19] + out[21] = ((in[7] >> 56) | ((in[8] & 0xFFFF) << 8)) + out[20] + out[22] = (in[8] >> 16) & 0xFFFFFF + out[21] + out[23] = (in[8] >> 40) + out[22] + out[24] = (in[9] >> 0) & 0xFFFFFF + out[23] + out[25] = (in[9] >> 24) & 0xFFFFFF + out[24] + out[26] = ((in[9] >> 48) | ((in[10] & 0xFF) << 16)) + out[25] + out[27] = (in[10] >> 8) & 0xFFFFFF + out[26] + out[28] = (in[10] >> 32) & 0xFFFFFF + out[27] + out[29] = ((in[10] >> 56) | ((in[11] & 0xFFFF) << 8)) + out[28] + out[30] = (in[11] >> 16) & 0xFFFFFF + out[29] + out[31] = (in[11] >> 40) + out[30] + out[32] = (in[12] >> 0) & 0xFFFFFF + out[31] + out[33] = (in[12] >> 24) & 0xFFFFFF + out[32] + out[34] = ((in[12] >> 48) | ((in[13] & 0xFF) << 16)) + out[33] + out[35] = (in[13] >> 8) & 0xFFFFFF + out[34] + out[36] = (in[13] >> 32) & 0xFFFFFF + out[35] + out[37] = ((in[13] >> 56) | ((in[14] & 0xFFFF) << 8)) + out[36] + out[38] = (in[14] >> 16) & 0xFFFFFF + out[37] + out[39] = (in[14] >> 40) + out[38] + out[40] = (in[15] >> 0) & 0xFFFFFF + out[39] + out[41] = (in[15] >> 24) & 0xFFFFFF + out[40] + out[42] = ((in[15] >> 48) | ((in[16] & 0xFF) << 16)) + out[41] + out[43] = (in[16] >> 8) & 0xFFFFFF + out[42] + out[44] = (in[16] >> 32) & 0xFFFFFF + out[43] + out[45] = ((in[16] >> 56) | ((in[17] & 0xFFFF) << 8)) + out[44] + out[46] = (in[17] >> 16) & 0xFFFFFF + out[45] + out[47] = (in[17] >> 40) + out[46] + out[48] = (in[18] >> 0) & 0xFFFFFF + out[47] + out[49] = (in[18] >> 24) & 0xFFFFFF + out[48] + out[50] = ((in[18] >> 48) | ((in[19] & 0xFF) << 16)) + out[49] + out[51] = (in[19] >> 8) & 0xFFFFFF + out[50] + out[52] = (in[19] >> 32) & 0xFFFFFF + out[51] + out[53] = ((in[19] >> 56) | ((in[20] & 0xFFFF) << 8)) + out[52] + out[54] = (in[20] >> 16) & 0xFFFFFF + out[53] + out[55] = (in[20] >> 40) + out[54] + out[56] = (in[21] >> 0) & 0xFFFFFF + out[55] + out[57] = (in[21] >> 24) & 0xFFFFFF + out[56] + out[58] = ((in[21] >> 48) | ((in[22] & 0xFF) << 16)) + out[57] + out[59] = (in[22] >> 8) & 0xFFFFFF + out[58] + out[60] = (in[22] >> 32) & 0xFFFFFF + out[59] + out[61] = ((in[22] >> 56) | ((in[23] & 0xFFFF) << 8)) + out[60] + out[62] = (in[23] >> 16) & 0xFFFFFF + out[61] + out[63] = (in[23] >> 40) + out[62] +} + +func deltaunpack_uint64_25(initoffset uint64, in *[25]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFF + initoffset + out[1] = (in[0] >> 25) & 0x1FFFFFF + out[0] + out[2] = ((in[0] >> 50) | ((in[1] & 0x7FF) << 14)) + out[1] + out[3] = (in[1] >> 11) & 0x1FFFFFF + out[2] + out[4] = (in[1] >> 36) & 0x1FFFFFF + out[3] + out[5] = ((in[1] >> 61) | ((in[2] & 0x3FFFFF) << 3)) + out[4] + out[6] = (in[2] >> 22) & 0x1FFFFFF + out[5] + out[7] = ((in[2] >> 47) | ((in[3] & 0xFF) << 17)) + out[6] + out[8] = (in[3] >> 8) & 0x1FFFFFF + out[7] + out[9] = (in[3] >> 33) & 0x1FFFFFF + out[8] + out[10] = ((in[3] >> 58) | ((in[4] & 0x7FFFF) << 6)) + out[9] + out[11] = (in[4] >> 19) & 0x1FFFFFF + out[10] + out[12] = ((in[4] >> 44) | ((in[5] & 0x1F) << 20)) + out[11] + out[13] = (in[5] >> 5) & 0x1FFFFFF + out[12] + out[14] = (in[5] >> 30) & 0x1FFFFFF + out[13] + out[15] = ((in[5] >> 55) | ((in[6] & 0xFFFF) << 9)) + out[14] + out[16] = (in[6] >> 16) & 0x1FFFFFF + out[15] + out[17] = ((in[6] >> 41) | ((in[7] & 0x3) << 23)) + out[16] + out[18] = (in[7] >> 2) & 0x1FFFFFF + out[17] + out[19] = (in[7] >> 27) & 0x1FFFFFF + out[18] + out[20] = ((in[7] >> 52) | ((in[8] & 0x1FFF) << 12)) + out[19] + out[21] = (in[8] >> 13) & 0x1FFFFFF + out[20] + out[22] = (in[8] >> 38) & 0x1FFFFFF + out[21] + out[23] = ((in[8] >> 63) | ((in[9] & 0xFFFFFF) << 1)) + out[22] + out[24] = (in[9] >> 24) & 0x1FFFFFF + out[23] + out[25] = ((in[9] >> 49) | ((in[10] & 0x3FF) << 15)) + out[24] + out[26] = (in[10] >> 10) & 0x1FFFFFF + out[25] + out[27] = (in[10] >> 35) & 0x1FFFFFF + out[26] + out[28] = ((in[10] >> 60) | ((in[11] & 0x1FFFFF) << 4)) + out[27] + out[29] = (in[11] >> 21) & 0x1FFFFFF + out[28] + out[30] = ((in[11] >> 46) | ((in[12] & 0x7F) << 18)) + out[29] + out[31] = (in[12] >> 7) & 0x1FFFFFF + out[30] + out[32] = (in[12] >> 32) & 0x1FFFFFF + out[31] + out[33] = ((in[12] >> 57) | ((in[13] & 0x3FFFF) << 7)) + out[32] + out[34] = (in[13] >> 18) & 0x1FFFFFF + out[33] + out[35] = ((in[13] >> 43) | ((in[14] & 0xF) << 21)) + out[34] + out[36] = (in[14] >> 4) & 0x1FFFFFF + out[35] + out[37] = (in[14] >> 29) & 0x1FFFFFF + out[36] + out[38] = ((in[14] >> 54) | ((in[15] & 0x7FFF) << 10)) + out[37] + out[39] = (in[15] >> 15) & 0x1FFFFFF + out[38] + out[40] = ((in[15] >> 40) | ((in[16] & 0x1) << 24)) + out[39] + out[41] = (in[16] >> 1) & 0x1FFFFFF + out[40] + out[42] = (in[16] >> 26) & 0x1FFFFFF + out[41] + out[43] = ((in[16] >> 51) | ((in[17] & 0xFFF) << 13)) + out[42] + out[44] = (in[17] >> 12) & 0x1FFFFFF + out[43] + out[45] = (in[17] >> 37) & 0x1FFFFFF + out[44] + out[46] = ((in[17] >> 62) | ((in[18] & 0x7FFFFF) << 2)) + out[45] + out[47] = (in[18] >> 23) & 0x1FFFFFF + out[46] + out[48] = ((in[18] >> 48) | ((in[19] & 0x1FF) << 16)) + out[47] + out[49] = (in[19] >> 9) & 0x1FFFFFF + out[48] + out[50] = (in[19] >> 34) & 0x1FFFFFF + out[49] + out[51] = ((in[19] >> 59) | ((in[20] & 0xFFFFF) << 5)) + out[50] + out[52] = (in[20] >> 20) & 0x1FFFFFF + out[51] + out[53] = ((in[20] >> 45) | ((in[21] & 0x3F) << 19)) + out[52] + out[54] = (in[21] >> 6) & 0x1FFFFFF + out[53] + out[55] = (in[21] >> 31) & 0x1FFFFFF + out[54] + out[56] = ((in[21] >> 56) | ((in[22] & 0x1FFFF) << 8)) + out[55] + out[57] = (in[22] >> 17) & 0x1FFFFFF + out[56] + out[58] = ((in[22] >> 42) | ((in[23] & 0x7) << 22)) + out[57] + out[59] = (in[23] >> 3) & 0x1FFFFFF + out[58] + out[60] = (in[23] >> 28) & 0x1FFFFFF + out[59] + out[61] = ((in[23] >> 53) | ((in[24] & 0x3FFF) << 11)) + out[60] + out[62] = (in[24] >> 14) & 0x1FFFFFF + out[61] + out[63] = (in[24] >> 39) + out[62] +} + +func deltaunpack_uint64_26(initoffset uint64, in *[26]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFF + initoffset + out[1] = (in[0] >> 26) & 0x3FFFFFF + out[0] + out[2] = ((in[0] >> 52) | ((in[1] & 0x3FFF) << 12)) + out[1] + out[3] = (in[1] >> 14) & 0x3FFFFFF + out[2] + out[4] = ((in[1] >> 40) | ((in[2] & 0x3) << 24)) + out[3] + out[5] = (in[2] >> 2) & 0x3FFFFFF + out[4] + out[6] = (in[2] >> 28) & 0x3FFFFFF + out[5] + out[7] = ((in[2] >> 54) | ((in[3] & 0xFFFF) << 10)) + out[6] + out[8] = (in[3] >> 16) & 0x3FFFFFF + out[7] + out[9] = ((in[3] >> 42) | ((in[4] & 0xF) << 22)) + out[8] + out[10] = (in[4] >> 4) & 0x3FFFFFF + out[9] + out[11] = (in[4] >> 30) & 0x3FFFFFF + out[10] + out[12] = ((in[4] >> 56) | ((in[5] & 0x3FFFF) << 8)) + out[11] + out[13] = (in[5] >> 18) & 0x3FFFFFF + out[12] + out[14] = ((in[5] >> 44) | ((in[6] & 0x3F) << 20)) + out[13] + out[15] = (in[6] >> 6) & 0x3FFFFFF + out[14] + out[16] = (in[6] >> 32) & 0x3FFFFFF + out[15] + out[17] = ((in[6] >> 58) | ((in[7] & 0xFFFFF) << 6)) + out[16] + out[18] = (in[7] >> 20) & 0x3FFFFFF + out[17] + out[19] = ((in[7] >> 46) | ((in[8] & 0xFF) << 18)) + out[18] + out[20] = (in[8] >> 8) & 0x3FFFFFF + out[19] + out[21] = (in[8] >> 34) & 0x3FFFFFF + out[20] + out[22] = ((in[8] >> 60) | ((in[9] & 0x3FFFFF) << 4)) + out[21] + out[23] = (in[9] >> 22) & 0x3FFFFFF + out[22] + out[24] = ((in[9] >> 48) | ((in[10] & 0x3FF) << 16)) + out[23] + out[25] = (in[10] >> 10) & 0x3FFFFFF + out[24] + out[26] = (in[10] >> 36) & 0x3FFFFFF + out[25] + out[27] = ((in[10] >> 62) | ((in[11] & 0xFFFFFF) << 2)) + out[26] + out[28] = (in[11] >> 24) & 0x3FFFFFF + out[27] + out[29] = ((in[11] >> 50) | ((in[12] & 0xFFF) << 14)) + out[28] + out[30] = (in[12] >> 12) & 0x3FFFFFF + out[29] + out[31] = (in[12] >> 38) + out[30] + out[32] = (in[13] >> 0) & 0x3FFFFFF + out[31] + out[33] = (in[13] >> 26) & 0x3FFFFFF + out[32] + out[34] = ((in[13] >> 52) | ((in[14] & 0x3FFF) << 12)) + out[33] + out[35] = (in[14] >> 14) & 0x3FFFFFF + out[34] + out[36] = ((in[14] >> 40) | ((in[15] & 0x3) << 24)) + out[35] + out[37] = (in[15] >> 2) & 0x3FFFFFF + out[36] + out[38] = (in[15] >> 28) & 0x3FFFFFF + out[37] + out[39] = ((in[15] >> 54) | ((in[16] & 0xFFFF) << 10)) + out[38] + out[40] = (in[16] >> 16) & 0x3FFFFFF + out[39] + out[41] = ((in[16] >> 42) | ((in[17] & 0xF) << 22)) + out[40] + out[42] = (in[17] >> 4) & 0x3FFFFFF + out[41] + out[43] = (in[17] >> 30) & 0x3FFFFFF + out[42] + out[44] = ((in[17] >> 56) | ((in[18] & 0x3FFFF) << 8)) + out[43] + out[45] = (in[18] >> 18) & 0x3FFFFFF + out[44] + out[46] = ((in[18] >> 44) | ((in[19] & 0x3F) << 20)) + out[45] + out[47] = (in[19] >> 6) & 0x3FFFFFF + out[46] + out[48] = (in[19] >> 32) & 0x3FFFFFF + out[47] + out[49] = ((in[19] >> 58) | ((in[20] & 0xFFFFF) << 6)) + out[48] + out[50] = (in[20] >> 20) & 0x3FFFFFF + out[49] + out[51] = ((in[20] >> 46) | ((in[21] & 0xFF) << 18)) + out[50] + out[52] = (in[21] >> 8) & 0x3FFFFFF + out[51] + out[53] = (in[21] >> 34) & 0x3FFFFFF + out[52] + out[54] = ((in[21] >> 60) | ((in[22] & 0x3FFFFF) << 4)) + out[53] + out[55] = (in[22] >> 22) & 0x3FFFFFF + out[54] + out[56] = ((in[22] >> 48) | ((in[23] & 0x3FF) << 16)) + out[55] + out[57] = (in[23] >> 10) & 0x3FFFFFF + out[56] + out[58] = (in[23] >> 36) & 0x3FFFFFF + out[57] + out[59] = ((in[23] >> 62) | ((in[24] & 0xFFFFFF) << 2)) + out[58] + out[60] = (in[24] >> 24) & 0x3FFFFFF + out[59] + out[61] = ((in[24] >> 50) | ((in[25] & 0xFFF) << 14)) + out[60] + out[62] = (in[25] >> 12) & 0x3FFFFFF + out[61] + out[63] = (in[25] >> 38) + out[62] +} + +func deltaunpack_uint64_27(initoffset uint64, in *[27]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFF + initoffset + out[1] = (in[0] >> 27) & 0x7FFFFFF + out[0] + out[2] = ((in[0] >> 54) | ((in[1] & 0x1FFFF) << 10)) + out[1] + out[3] = (in[1] >> 17) & 0x7FFFFFF + out[2] + out[4] = ((in[1] >> 44) | ((in[2] & 0x7F) << 20)) + out[3] + out[5] = (in[2] >> 7) & 0x7FFFFFF + out[4] + out[6] = (in[2] >> 34) & 0x7FFFFFF + out[5] + out[7] = ((in[2] >> 61) | ((in[3] & 0xFFFFFF) << 3)) + out[6] + out[8] = (in[3] >> 24) & 0x7FFFFFF + out[7] + out[9] = ((in[3] >> 51) | ((in[4] & 0x3FFF) << 13)) + out[8] + out[10] = (in[4] >> 14) & 0x7FFFFFF + out[9] + out[11] = ((in[4] >> 41) | ((in[5] & 0xF) << 23)) + out[10] + out[12] = (in[5] >> 4) & 0x7FFFFFF + out[11] + out[13] = (in[5] >> 31) & 0x7FFFFFF + out[12] + out[14] = ((in[5] >> 58) | ((in[6] & 0x1FFFFF) << 6)) + out[13] + out[15] = (in[6] >> 21) & 0x7FFFFFF + out[14] + out[16] = ((in[6] >> 48) | ((in[7] & 0x7FF) << 16)) + out[15] + out[17] = (in[7] >> 11) & 0x7FFFFFF + out[16] + out[18] = ((in[7] >> 38) | ((in[8] & 0x1) << 26)) + out[17] + out[19] = (in[8] >> 1) & 0x7FFFFFF + out[18] + out[20] = (in[8] >> 28) & 0x7FFFFFF + out[19] + out[21] = ((in[8] >> 55) | ((in[9] & 0x3FFFF) << 9)) + out[20] + out[22] = (in[9] >> 18) & 0x7FFFFFF + out[21] + out[23] = ((in[9] >> 45) | ((in[10] & 0xFF) << 19)) + out[22] + out[24] = (in[10] >> 8) & 0x7FFFFFF + out[23] + out[25] = (in[10] >> 35) & 0x7FFFFFF + out[24] + out[26] = ((in[10] >> 62) | ((in[11] & 0x1FFFFFF) << 2)) + out[25] + out[27] = (in[11] >> 25) & 0x7FFFFFF + out[26] + out[28] = ((in[11] >> 52) | ((in[12] & 0x7FFF) << 12)) + out[27] + out[29] = (in[12] >> 15) & 0x7FFFFFF + out[28] + out[30] = ((in[12] >> 42) | ((in[13] & 0x1F) << 22)) + out[29] + out[31] = (in[13] >> 5) & 0x7FFFFFF + out[30] + out[32] = (in[13] >> 32) & 0x7FFFFFF + out[31] + out[33] = ((in[13] >> 59) | ((in[14] & 0x3FFFFF) << 5)) + out[32] + out[34] = (in[14] >> 22) & 0x7FFFFFF + out[33] + out[35] = ((in[14] >> 49) | ((in[15] & 0xFFF) << 15)) + out[34] + out[36] = (in[15] >> 12) & 0x7FFFFFF + out[35] + out[37] = ((in[15] >> 39) | ((in[16] & 0x3) << 25)) + out[36] + out[38] = (in[16] >> 2) & 0x7FFFFFF + out[37] + out[39] = (in[16] >> 29) & 0x7FFFFFF + out[38] + out[40] = ((in[16] >> 56) | ((in[17] & 0x7FFFF) << 8)) + out[39] + out[41] = (in[17] >> 19) & 0x7FFFFFF + out[40] + out[42] = ((in[17] >> 46) | ((in[18] & 0x1FF) << 18)) + out[41] + out[43] = (in[18] >> 9) & 0x7FFFFFF + out[42] + out[44] = (in[18] >> 36) & 0x7FFFFFF + out[43] + out[45] = ((in[18] >> 63) | ((in[19] & 0x3FFFFFF) << 1)) + out[44] + out[46] = (in[19] >> 26) & 0x7FFFFFF + out[45] + out[47] = ((in[19] >> 53) | ((in[20] & 0xFFFF) << 11)) + out[46] + out[48] = (in[20] >> 16) & 0x7FFFFFF + out[47] + out[49] = ((in[20] >> 43) | ((in[21] & 0x3F) << 21)) + out[48] + out[50] = (in[21] >> 6) & 0x7FFFFFF + out[49] + out[51] = (in[21] >> 33) & 0x7FFFFFF + out[50] + out[52] = ((in[21] >> 60) | ((in[22] & 0x7FFFFF) << 4)) + out[51] + out[53] = (in[22] >> 23) & 0x7FFFFFF + out[52] + out[54] = ((in[22] >> 50) | ((in[23] & 0x1FFF) << 14)) + out[53] + out[55] = (in[23] >> 13) & 0x7FFFFFF + out[54] + out[56] = ((in[23] >> 40) | ((in[24] & 0x7) << 24)) + out[55] + out[57] = (in[24] >> 3) & 0x7FFFFFF + out[56] + out[58] = (in[24] >> 30) & 0x7FFFFFF + out[57] + out[59] = ((in[24] >> 57) | ((in[25] & 0xFFFFF) << 7)) + out[58] + out[60] = (in[25] >> 20) & 0x7FFFFFF + out[59] + out[61] = ((in[25] >> 47) | ((in[26] & 0x3FF) << 17)) + out[60] + out[62] = (in[26] >> 10) & 0x7FFFFFF + out[61] + out[63] = (in[26] >> 37) + out[62] +} + +func deltaunpack_uint64_28(initoffset uint64, in *[28]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFF + initoffset + out[1] = (in[0] >> 28) & 0xFFFFFFF + out[0] + out[2] = ((in[0] >> 56) | ((in[1] & 0xFFFFF) << 8)) + out[1] + out[3] = (in[1] >> 20) & 0xFFFFFFF + out[2] + out[4] = ((in[1] >> 48) | ((in[2] & 0xFFF) << 16)) + out[3] + out[5] = (in[2] >> 12) & 0xFFFFFFF + out[4] + out[6] = ((in[2] >> 40) | ((in[3] & 0xF) << 24)) + out[5] + out[7] = (in[3] >> 4) & 0xFFFFFFF + out[6] + out[8] = (in[3] >> 32) & 0xFFFFFFF + out[7] + out[9] = ((in[3] >> 60) | ((in[4] & 0xFFFFFF) << 4)) + out[8] + out[10] = (in[4] >> 24) & 0xFFFFFFF + out[9] + out[11] = ((in[4] >> 52) | ((in[5] & 0xFFFF) << 12)) + out[10] + out[12] = (in[5] >> 16) & 0xFFFFFFF + out[11] + out[13] = ((in[5] >> 44) | ((in[6] & 0xFF) << 20)) + out[12] + out[14] = (in[6] >> 8) & 0xFFFFFFF + out[13] + out[15] = (in[6] >> 36) + out[14] + out[16] = (in[7] >> 0) & 0xFFFFFFF + out[15] + out[17] = (in[7] >> 28) & 0xFFFFFFF + out[16] + out[18] = ((in[7] >> 56) | ((in[8] & 0xFFFFF) << 8)) + out[17] + out[19] = (in[8] >> 20) & 0xFFFFFFF + out[18] + out[20] = ((in[8] >> 48) | ((in[9] & 0xFFF) << 16)) + out[19] + out[21] = (in[9] >> 12) & 0xFFFFFFF + out[20] + out[22] = ((in[9] >> 40) | ((in[10] & 0xF) << 24)) + out[21] + out[23] = (in[10] >> 4) & 0xFFFFFFF + out[22] + out[24] = (in[10] >> 32) & 0xFFFFFFF + out[23] + out[25] = ((in[10] >> 60) | ((in[11] & 0xFFFFFF) << 4)) + out[24] + out[26] = (in[11] >> 24) & 0xFFFFFFF + out[25] + out[27] = ((in[11] >> 52) | ((in[12] & 0xFFFF) << 12)) + out[26] + out[28] = (in[12] >> 16) & 0xFFFFFFF + out[27] + out[29] = ((in[12] >> 44) | ((in[13] & 0xFF) << 20)) + out[28] + out[30] = (in[13] >> 8) & 0xFFFFFFF + out[29] + out[31] = (in[13] >> 36) + out[30] + out[32] = (in[14] >> 0) & 0xFFFFFFF + out[31] + out[33] = (in[14] >> 28) & 0xFFFFFFF + out[32] + out[34] = ((in[14] >> 56) | ((in[15] & 0xFFFFF) << 8)) + out[33] + out[35] = (in[15] >> 20) & 0xFFFFFFF + out[34] + out[36] = ((in[15] >> 48) | ((in[16] & 0xFFF) << 16)) + out[35] + out[37] = (in[16] >> 12) & 0xFFFFFFF + out[36] + out[38] = ((in[16] >> 40) | ((in[17] & 0xF) << 24)) + out[37] + out[39] = (in[17] >> 4) & 0xFFFFFFF + out[38] + out[40] = (in[17] >> 32) & 0xFFFFFFF + out[39] + out[41] = ((in[17] >> 60) | ((in[18] & 0xFFFFFF) << 4)) + out[40] + out[42] = (in[18] >> 24) & 0xFFFFFFF + out[41] + out[43] = ((in[18] >> 52) | ((in[19] & 0xFFFF) << 12)) + out[42] + out[44] = (in[19] >> 16) & 0xFFFFFFF + out[43] + out[45] = ((in[19] >> 44) | ((in[20] & 0xFF) << 20)) + out[44] + out[46] = (in[20] >> 8) & 0xFFFFFFF + out[45] + out[47] = (in[20] >> 36) + out[46] + out[48] = (in[21] >> 0) & 0xFFFFFFF + out[47] + out[49] = (in[21] >> 28) & 0xFFFFFFF + out[48] + out[50] = ((in[21] >> 56) | ((in[22] & 0xFFFFF) << 8)) + out[49] + out[51] = (in[22] >> 20) & 0xFFFFFFF + out[50] + out[52] = ((in[22] >> 48) | ((in[23] & 0xFFF) << 16)) + out[51] + out[53] = (in[23] >> 12) & 0xFFFFFFF + out[52] + out[54] = ((in[23] >> 40) | ((in[24] & 0xF) << 24)) + out[53] + out[55] = (in[24] >> 4) & 0xFFFFFFF + out[54] + out[56] = (in[24] >> 32) & 0xFFFFFFF + out[55] + out[57] = ((in[24] >> 60) | ((in[25] & 0xFFFFFF) << 4)) + out[56] + out[58] = (in[25] >> 24) & 0xFFFFFFF + out[57] + out[59] = ((in[25] >> 52) | ((in[26] & 0xFFFF) << 12)) + out[58] + out[60] = (in[26] >> 16) & 0xFFFFFFF + out[59] + out[61] = ((in[26] >> 44) | ((in[27] & 0xFF) << 20)) + out[60] + out[62] = (in[27] >> 8) & 0xFFFFFFF + out[61] + out[63] = (in[27] >> 36) + out[62] +} + +func deltaunpack_uint64_29(initoffset uint64, in *[29]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFF + initoffset + out[1] = (in[0] >> 29) & 0x1FFFFFFF + out[0] + out[2] = ((in[0] >> 58) | ((in[1] & 0x7FFFFF) << 6)) + out[1] + out[3] = (in[1] >> 23) & 0x1FFFFFFF + out[2] + out[4] = ((in[1] >> 52) | ((in[2] & 0x1FFFF) << 12)) + out[3] + out[5] = (in[2] >> 17) & 0x1FFFFFFF + out[4] + out[6] = ((in[2] >> 46) | ((in[3] & 0x7FF) << 18)) + out[5] + out[7] = (in[3] >> 11) & 0x1FFFFFFF + out[6] + out[8] = ((in[3] >> 40) | ((in[4] & 0x1F) << 24)) + out[7] + out[9] = (in[4] >> 5) & 0x1FFFFFFF + out[8] + out[10] = (in[4] >> 34) & 0x1FFFFFFF + out[9] + out[11] = ((in[4] >> 63) | ((in[5] & 0xFFFFFFF) << 1)) + out[10] + out[12] = (in[5] >> 28) & 0x1FFFFFFF + out[11] + out[13] = ((in[5] >> 57) | ((in[6] & 0x3FFFFF) << 7)) + out[12] + out[14] = (in[6] >> 22) & 0x1FFFFFFF + out[13] + out[15] = ((in[6] >> 51) | ((in[7] & 0xFFFF) << 13)) + out[14] + out[16] = (in[7] >> 16) & 0x1FFFFFFF + out[15] + out[17] = ((in[7] >> 45) | ((in[8] & 0x3FF) << 19)) + out[16] + out[18] = (in[8] >> 10) & 0x1FFFFFFF + out[17] + out[19] = ((in[8] >> 39) | ((in[9] & 0xF) << 25)) + out[18] + out[20] = (in[9] >> 4) & 0x1FFFFFFF + out[19] + out[21] = (in[9] >> 33) & 0x1FFFFFFF + out[20] + out[22] = ((in[9] >> 62) | ((in[10] & 0x7FFFFFF) << 2)) + out[21] + out[23] = (in[10] >> 27) & 0x1FFFFFFF + out[22] + out[24] = ((in[10] >> 56) | ((in[11] & 0x1FFFFF) << 8)) + out[23] + out[25] = (in[11] >> 21) & 0x1FFFFFFF + out[24] + out[26] = ((in[11] >> 50) | ((in[12] & 0x7FFF) << 14)) + out[25] + out[27] = (in[12] >> 15) & 0x1FFFFFFF + out[26] + out[28] = ((in[12] >> 44) | ((in[13] & 0x1FF) << 20)) + out[27] + out[29] = (in[13] >> 9) & 0x1FFFFFFF + out[28] + out[30] = ((in[13] >> 38) | ((in[14] & 0x7) << 26)) + out[29] + out[31] = (in[14] >> 3) & 0x1FFFFFFF + out[30] + out[32] = (in[14] >> 32) & 0x1FFFFFFF + out[31] + out[33] = ((in[14] >> 61) | ((in[15] & 0x3FFFFFF) << 3)) + out[32] + out[34] = (in[15] >> 26) & 0x1FFFFFFF + out[33] + out[35] = ((in[15] >> 55) | ((in[16] & 0xFFFFF) << 9)) + out[34] + out[36] = (in[16] >> 20) & 0x1FFFFFFF + out[35] + out[37] = ((in[16] >> 49) | ((in[17] & 0x3FFF) << 15)) + out[36] + out[38] = (in[17] >> 14) & 0x1FFFFFFF + out[37] + out[39] = ((in[17] >> 43) | ((in[18] & 0xFF) << 21)) + out[38] + out[40] = (in[18] >> 8) & 0x1FFFFFFF + out[39] + out[41] = ((in[18] >> 37) | ((in[19] & 0x3) << 27)) + out[40] + out[42] = (in[19] >> 2) & 0x1FFFFFFF + out[41] + out[43] = (in[19] >> 31) & 0x1FFFFFFF + out[42] + out[44] = ((in[19] >> 60) | ((in[20] & 0x1FFFFFF) << 4)) + out[43] + out[45] = (in[20] >> 25) & 0x1FFFFFFF + out[44] + out[46] = ((in[20] >> 54) | ((in[21] & 0x7FFFF) << 10)) + out[45] + out[47] = (in[21] >> 19) & 0x1FFFFFFF + out[46] + out[48] = ((in[21] >> 48) | ((in[22] & 0x1FFF) << 16)) + out[47] + out[49] = (in[22] >> 13) & 0x1FFFFFFF + out[48] + out[50] = ((in[22] >> 42) | ((in[23] & 0x7F) << 22)) + out[49] + out[51] = (in[23] >> 7) & 0x1FFFFFFF + out[50] + out[52] = ((in[23] >> 36) | ((in[24] & 0x1) << 28)) + out[51] + out[53] = (in[24] >> 1) & 0x1FFFFFFF + out[52] + out[54] = (in[24] >> 30) & 0x1FFFFFFF + out[53] + out[55] = ((in[24] >> 59) | ((in[25] & 0xFFFFFF) << 5)) + out[54] + out[56] = (in[25] >> 24) & 0x1FFFFFFF + out[55] + out[57] = ((in[25] >> 53) | ((in[26] & 0x3FFFF) << 11)) + out[56] + out[58] = (in[26] >> 18) & 0x1FFFFFFF + out[57] + out[59] = ((in[26] >> 47) | ((in[27] & 0xFFF) << 17)) + out[58] + out[60] = (in[27] >> 12) & 0x1FFFFFFF + out[59] + out[61] = ((in[27] >> 41) | ((in[28] & 0x3F) << 23)) + out[60] + out[62] = (in[28] >> 6) & 0x1FFFFFFF + out[61] + out[63] = (in[28] >> 35) + out[62] +} + +func deltaunpack_uint64_30(initoffset uint64, in *[30]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFF + initoffset + out[1] = (in[0] >> 30) & 0x3FFFFFFF + out[0] + out[2] = ((in[0] >> 60) | ((in[1] & 0x3FFFFFF) << 4)) + out[1] + out[3] = (in[1] >> 26) & 0x3FFFFFFF + out[2] + out[4] = ((in[1] >> 56) | ((in[2] & 0x3FFFFF) << 8)) + out[3] + out[5] = (in[2] >> 22) & 0x3FFFFFFF + out[4] + out[6] = ((in[2] >> 52) | ((in[3] & 0x3FFFF) << 12)) + out[5] + out[7] = (in[3] >> 18) & 0x3FFFFFFF + out[6] + out[8] = ((in[3] >> 48) | ((in[4] & 0x3FFF) << 16)) + out[7] + out[9] = (in[4] >> 14) & 0x3FFFFFFF + out[8] + out[10] = ((in[4] >> 44) | ((in[5] & 0x3FF) << 20)) + out[9] + out[11] = (in[5] >> 10) & 0x3FFFFFFF + out[10] + out[12] = ((in[5] >> 40) | ((in[6] & 0x3F) << 24)) + out[11] + out[13] = (in[6] >> 6) & 0x3FFFFFFF + out[12] + out[14] = ((in[6] >> 36) | ((in[7] & 0x3) << 28)) + out[13] + out[15] = (in[7] >> 2) & 0x3FFFFFFF + out[14] + out[16] = (in[7] >> 32) & 0x3FFFFFFF + out[15] + out[17] = ((in[7] >> 62) | ((in[8] & 0xFFFFFFF) << 2)) + out[16] + out[18] = (in[8] >> 28) & 0x3FFFFFFF + out[17] + out[19] = ((in[8] >> 58) | ((in[9] & 0xFFFFFF) << 6)) + out[18] + out[20] = (in[9] >> 24) & 0x3FFFFFFF + out[19] + out[21] = ((in[9] >> 54) | ((in[10] & 0xFFFFF) << 10)) + out[20] + out[22] = (in[10] >> 20) & 0x3FFFFFFF + out[21] + out[23] = ((in[10] >> 50) | ((in[11] & 0xFFFF) << 14)) + out[22] + out[24] = (in[11] >> 16) & 0x3FFFFFFF + out[23] + out[25] = ((in[11] >> 46) | ((in[12] & 0xFFF) << 18)) + out[24] + out[26] = (in[12] >> 12) & 0x3FFFFFFF + out[25] + out[27] = ((in[12] >> 42) | ((in[13] & 0xFF) << 22)) + out[26] + out[28] = (in[13] >> 8) & 0x3FFFFFFF + out[27] + out[29] = ((in[13] >> 38) | ((in[14] & 0xF) << 26)) + out[28] + out[30] = (in[14] >> 4) & 0x3FFFFFFF + out[29] + out[31] = (in[14] >> 34) + out[30] + out[32] = (in[15] >> 0) & 0x3FFFFFFF + out[31] + out[33] = (in[15] >> 30) & 0x3FFFFFFF + out[32] + out[34] = ((in[15] >> 60) | ((in[16] & 0x3FFFFFF) << 4)) + out[33] + out[35] = (in[16] >> 26) & 0x3FFFFFFF + out[34] + out[36] = ((in[16] >> 56) | ((in[17] & 0x3FFFFF) << 8)) + out[35] + out[37] = (in[17] >> 22) & 0x3FFFFFFF + out[36] + out[38] = ((in[17] >> 52) | ((in[18] & 0x3FFFF) << 12)) + out[37] + out[39] = (in[18] >> 18) & 0x3FFFFFFF + out[38] + out[40] = ((in[18] >> 48) | ((in[19] & 0x3FFF) << 16)) + out[39] + out[41] = (in[19] >> 14) & 0x3FFFFFFF + out[40] + out[42] = ((in[19] >> 44) | ((in[20] & 0x3FF) << 20)) + out[41] + out[43] = (in[20] >> 10) & 0x3FFFFFFF + out[42] + out[44] = ((in[20] >> 40) | ((in[21] & 0x3F) << 24)) + out[43] + out[45] = (in[21] >> 6) & 0x3FFFFFFF + out[44] + out[46] = ((in[21] >> 36) | ((in[22] & 0x3) << 28)) + out[45] + out[47] = (in[22] >> 2) & 0x3FFFFFFF + out[46] + out[48] = (in[22] >> 32) & 0x3FFFFFFF + out[47] + out[49] = ((in[22] >> 62) | ((in[23] & 0xFFFFFFF) << 2)) + out[48] + out[50] = (in[23] >> 28) & 0x3FFFFFFF + out[49] + out[51] = ((in[23] >> 58) | ((in[24] & 0xFFFFFF) << 6)) + out[50] + out[52] = (in[24] >> 24) & 0x3FFFFFFF + out[51] + out[53] = ((in[24] >> 54) | ((in[25] & 0xFFFFF) << 10)) + out[52] + out[54] = (in[25] >> 20) & 0x3FFFFFFF + out[53] + out[55] = ((in[25] >> 50) | ((in[26] & 0xFFFF) << 14)) + out[54] + out[56] = (in[26] >> 16) & 0x3FFFFFFF + out[55] + out[57] = ((in[26] >> 46) | ((in[27] & 0xFFF) << 18)) + out[56] + out[58] = (in[27] >> 12) & 0x3FFFFFFF + out[57] + out[59] = ((in[27] >> 42) | ((in[28] & 0xFF) << 22)) + out[58] + out[60] = (in[28] >> 8) & 0x3FFFFFFF + out[59] + out[61] = ((in[28] >> 38) | ((in[29] & 0xF) << 26)) + out[60] + out[62] = (in[29] >> 4) & 0x3FFFFFFF + out[61] + out[63] = (in[29] >> 34) + out[62] +} + +func deltaunpack_uint64_31(initoffset uint64, in *[31]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFF + initoffset + out[1] = (in[0] >> 31) & 0x7FFFFFFF + out[0] + out[2] = ((in[0] >> 62) | ((in[1] & 0x1FFFFFFF) << 2)) + out[1] + out[3] = (in[1] >> 29) & 0x7FFFFFFF + out[2] + out[4] = ((in[1] >> 60) | ((in[2] & 0x7FFFFFF) << 4)) + out[3] + out[5] = (in[2] >> 27) & 0x7FFFFFFF + out[4] + out[6] = ((in[2] >> 58) | ((in[3] & 0x1FFFFFF) << 6)) + out[5] + out[7] = (in[3] >> 25) & 0x7FFFFFFF + out[6] + out[8] = ((in[3] >> 56) | ((in[4] & 0x7FFFFF) << 8)) + out[7] + out[9] = (in[4] >> 23) & 0x7FFFFFFF + out[8] + out[10] = ((in[4] >> 54) | ((in[5] & 0x1FFFFF) << 10)) + out[9] + out[11] = (in[5] >> 21) & 0x7FFFFFFF + out[10] + out[12] = ((in[5] >> 52) | ((in[6] & 0x7FFFF) << 12)) + out[11] + out[13] = (in[6] >> 19) & 0x7FFFFFFF + out[12] + out[14] = ((in[6] >> 50) | ((in[7] & 0x1FFFF) << 14)) + out[13] + out[15] = (in[7] >> 17) & 0x7FFFFFFF + out[14] + out[16] = ((in[7] >> 48) | ((in[8] & 0x7FFF) << 16)) + out[15] + out[17] = (in[8] >> 15) & 0x7FFFFFFF + out[16] + out[18] = ((in[8] >> 46) | ((in[9] & 0x1FFF) << 18)) + out[17] + out[19] = (in[9] >> 13) & 0x7FFFFFFF + out[18] + out[20] = ((in[9] >> 44) | ((in[10] & 0x7FF) << 20)) + out[19] + out[21] = (in[10] >> 11) & 0x7FFFFFFF + out[20] + out[22] = ((in[10] >> 42) | ((in[11] & 0x1FF) << 22)) + out[21] + out[23] = (in[11] >> 9) & 0x7FFFFFFF + out[22] + out[24] = ((in[11] >> 40) | ((in[12] & 0x7F) << 24)) + out[23] + out[25] = (in[12] >> 7) & 0x7FFFFFFF + out[24] + out[26] = ((in[12] >> 38) | ((in[13] & 0x1F) << 26)) + out[25] + out[27] = (in[13] >> 5) & 0x7FFFFFFF + out[26] + out[28] = ((in[13] >> 36) | ((in[14] & 0x7) << 28)) + out[27] + out[29] = (in[14] >> 3) & 0x7FFFFFFF + out[28] + out[30] = ((in[14] >> 34) | ((in[15] & 0x1) << 30)) + out[29] + out[31] = (in[15] >> 1) & 0x7FFFFFFF + out[30] + out[32] = (in[15] >> 32) & 0x7FFFFFFF + out[31] + out[33] = ((in[15] >> 63) | ((in[16] & 0x3FFFFFFF) << 1)) + out[32] + out[34] = (in[16] >> 30) & 0x7FFFFFFF + out[33] + out[35] = ((in[16] >> 61) | ((in[17] & 0xFFFFFFF) << 3)) + out[34] + out[36] = (in[17] >> 28) & 0x7FFFFFFF + out[35] + out[37] = ((in[17] >> 59) | ((in[18] & 0x3FFFFFF) << 5)) + out[36] + out[38] = (in[18] >> 26) & 0x7FFFFFFF + out[37] + out[39] = ((in[18] >> 57) | ((in[19] & 0xFFFFFF) << 7)) + out[38] + out[40] = (in[19] >> 24) & 0x7FFFFFFF + out[39] + out[41] = ((in[19] >> 55) | ((in[20] & 0x3FFFFF) << 9)) + out[40] + out[42] = (in[20] >> 22) & 0x7FFFFFFF + out[41] + out[43] = ((in[20] >> 53) | ((in[21] & 0xFFFFF) << 11)) + out[42] + out[44] = (in[21] >> 20) & 0x7FFFFFFF + out[43] + out[45] = ((in[21] >> 51) | ((in[22] & 0x3FFFF) << 13)) + out[44] + out[46] = (in[22] >> 18) & 0x7FFFFFFF + out[45] + out[47] = ((in[22] >> 49) | ((in[23] & 0xFFFF) << 15)) + out[46] + out[48] = (in[23] >> 16) & 0x7FFFFFFF + out[47] + out[49] = ((in[23] >> 47) | ((in[24] & 0x3FFF) << 17)) + out[48] + out[50] = (in[24] >> 14) & 0x7FFFFFFF + out[49] + out[51] = ((in[24] >> 45) | ((in[25] & 0xFFF) << 19)) + out[50] + out[52] = (in[25] >> 12) & 0x7FFFFFFF + out[51] + out[53] = ((in[25] >> 43) | ((in[26] & 0x3FF) << 21)) + out[52] + out[54] = (in[26] >> 10) & 0x7FFFFFFF + out[53] + out[55] = ((in[26] >> 41) | ((in[27] & 0xFF) << 23)) + out[54] + out[56] = (in[27] >> 8) & 0x7FFFFFFF + out[55] + out[57] = ((in[27] >> 39) | ((in[28] & 0x3F) << 25)) + out[56] + out[58] = (in[28] >> 6) & 0x7FFFFFFF + out[57] + out[59] = ((in[28] >> 37) | ((in[29] & 0xF) << 27)) + out[58] + out[60] = (in[29] >> 4) & 0x7FFFFFFF + out[59] + out[61] = ((in[29] >> 35) | ((in[30] & 0x3) << 29)) + out[60] + out[62] = (in[30] >> 2) & 0x7FFFFFFF + out[61] + out[63] = (in[30] >> 33) + out[62] +} + +func deltaunpack_uint64_32(initoffset uint64, in *[32]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFF + initoffset + out[1] = (in[0] >> 32) + out[0] + out[2] = (in[1] >> 0) & 0xFFFFFFFF + out[1] + out[3] = (in[1] >> 32) + out[2] + out[4] = (in[2] >> 0) & 0xFFFFFFFF + out[3] + out[5] = (in[2] >> 32) + out[4] + out[6] = (in[3] >> 0) & 0xFFFFFFFF + out[5] + out[7] = (in[3] >> 32) + out[6] + out[8] = (in[4] >> 0) & 0xFFFFFFFF + out[7] + out[9] = (in[4] >> 32) + out[8] + out[10] = (in[5] >> 0) & 0xFFFFFFFF + out[9] + out[11] = (in[5] >> 32) + out[10] + out[12] = (in[6] >> 0) & 0xFFFFFFFF + out[11] + out[13] = (in[6] >> 32) + out[12] + out[14] = (in[7] >> 0) & 0xFFFFFFFF + out[13] + out[15] = (in[7] >> 32) + out[14] + out[16] = (in[8] >> 0) & 0xFFFFFFFF + out[15] + out[17] = (in[8] >> 32) + out[16] + out[18] = (in[9] >> 0) & 0xFFFFFFFF + out[17] + out[19] = (in[9] >> 32) + out[18] + out[20] = (in[10] >> 0) & 0xFFFFFFFF + out[19] + out[21] = (in[10] >> 32) + out[20] + out[22] = (in[11] >> 0) & 0xFFFFFFFF + out[21] + out[23] = (in[11] >> 32) + out[22] + out[24] = (in[12] >> 0) & 0xFFFFFFFF + out[23] + out[25] = (in[12] >> 32) + out[24] + out[26] = (in[13] >> 0) & 0xFFFFFFFF + out[25] + out[27] = (in[13] >> 32) + out[26] + out[28] = (in[14] >> 0) & 0xFFFFFFFF + out[27] + out[29] = (in[14] >> 32) + out[28] + out[30] = (in[15] >> 0) & 0xFFFFFFFF + out[29] + out[31] = (in[15] >> 32) + out[30] + out[32] = (in[16] >> 0) & 0xFFFFFFFF + out[31] + out[33] = (in[16] >> 32) + out[32] + out[34] = (in[17] >> 0) & 0xFFFFFFFF + out[33] + out[35] = (in[17] >> 32) + out[34] + out[36] = (in[18] >> 0) & 0xFFFFFFFF + out[35] + out[37] = (in[18] >> 32) + out[36] + out[38] = (in[19] >> 0) & 0xFFFFFFFF + out[37] + out[39] = (in[19] >> 32) + out[38] + out[40] = (in[20] >> 0) & 0xFFFFFFFF + out[39] + out[41] = (in[20] >> 32) + out[40] + out[42] = (in[21] >> 0) & 0xFFFFFFFF + out[41] + out[43] = (in[21] >> 32) + out[42] + out[44] = (in[22] >> 0) & 0xFFFFFFFF + out[43] + out[45] = (in[22] >> 32) + out[44] + out[46] = (in[23] >> 0) & 0xFFFFFFFF + out[45] + out[47] = (in[23] >> 32) + out[46] + out[48] = (in[24] >> 0) & 0xFFFFFFFF + out[47] + out[49] = (in[24] >> 32) + out[48] + out[50] = (in[25] >> 0) & 0xFFFFFFFF + out[49] + out[51] = (in[25] >> 32) + out[50] + out[52] = (in[26] >> 0) & 0xFFFFFFFF + out[51] + out[53] = (in[26] >> 32) + out[52] + out[54] = (in[27] >> 0) & 0xFFFFFFFF + out[53] + out[55] = (in[27] >> 32) + out[54] + out[56] = (in[28] >> 0) & 0xFFFFFFFF + out[55] + out[57] = (in[28] >> 32) + out[56] + out[58] = (in[29] >> 0) & 0xFFFFFFFF + out[57] + out[59] = (in[29] >> 32) + out[58] + out[60] = (in[30] >> 0) & 0xFFFFFFFF + out[59] + out[61] = (in[30] >> 32) + out[60] + out[62] = (in[31] >> 0) & 0xFFFFFFFF + out[61] + out[63] = (in[31] >> 32) + out[62] +} + +func deltaunpack_uint64_33(initoffset uint64, in *[33]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFF + initoffset + out[1] = ((in[0] >> 33) | ((in[1] & 0x3) << 31)) + out[0] + out[2] = (in[1] >> 2) & 0x1FFFFFFFF + out[1] + out[3] = ((in[1] >> 35) | ((in[2] & 0xF) << 29)) + out[2] + out[4] = (in[2] >> 4) & 0x1FFFFFFFF + out[3] + out[5] = ((in[2] >> 37) | ((in[3] & 0x3F) << 27)) + out[4] + out[6] = (in[3] >> 6) & 0x1FFFFFFFF + out[5] + out[7] = ((in[3] >> 39) | ((in[4] & 0xFF) << 25)) + out[6] + out[8] = (in[4] >> 8) & 0x1FFFFFFFF + out[7] + out[9] = ((in[4] >> 41) | ((in[5] & 0x3FF) << 23)) + out[8] + out[10] = (in[5] >> 10) & 0x1FFFFFFFF + out[9] + out[11] = ((in[5] >> 43) | ((in[6] & 0xFFF) << 21)) + out[10] + out[12] = (in[6] >> 12) & 0x1FFFFFFFF + out[11] + out[13] = ((in[6] >> 45) | ((in[7] & 0x3FFF) << 19)) + out[12] + out[14] = (in[7] >> 14) & 0x1FFFFFFFF + out[13] + out[15] = ((in[7] >> 47) | ((in[8] & 0xFFFF) << 17)) + out[14] + out[16] = (in[8] >> 16) & 0x1FFFFFFFF + out[15] + out[17] = ((in[8] >> 49) | ((in[9] & 0x3FFFF) << 15)) + out[16] + out[18] = (in[9] >> 18) & 0x1FFFFFFFF + out[17] + out[19] = ((in[9] >> 51) | ((in[10] & 0xFFFFF) << 13)) + out[18] + out[20] = (in[10] >> 20) & 0x1FFFFFFFF + out[19] + out[21] = ((in[10] >> 53) | ((in[11] & 0x3FFFFF) << 11)) + out[20] + out[22] = (in[11] >> 22) & 0x1FFFFFFFF + out[21] + out[23] = ((in[11] >> 55) | ((in[12] & 0xFFFFFF) << 9)) + out[22] + out[24] = (in[12] >> 24) & 0x1FFFFFFFF + out[23] + out[25] = ((in[12] >> 57) | ((in[13] & 0x3FFFFFF) << 7)) + out[24] + out[26] = (in[13] >> 26) & 0x1FFFFFFFF + out[25] + out[27] = ((in[13] >> 59) | ((in[14] & 0xFFFFFFF) << 5)) + out[26] + out[28] = (in[14] >> 28) & 0x1FFFFFFFF + out[27] + out[29] = ((in[14] >> 61) | ((in[15] & 0x3FFFFFFF) << 3)) + out[28] + out[30] = (in[15] >> 30) & 0x1FFFFFFFF + out[29] + out[31] = ((in[15] >> 63) | ((in[16] & 0xFFFFFFFF) << 1)) + out[30] + out[32] = ((in[16] >> 32) | ((in[17] & 0x1) << 32)) + out[31] + out[33] = (in[17] >> 1) & 0x1FFFFFFFF + out[32] + out[34] = ((in[17] >> 34) | ((in[18] & 0x7) << 30)) + out[33] + out[35] = (in[18] >> 3) & 0x1FFFFFFFF + out[34] + out[36] = ((in[18] >> 36) | ((in[19] & 0x1F) << 28)) + out[35] + out[37] = (in[19] >> 5) & 0x1FFFFFFFF + out[36] + out[38] = ((in[19] >> 38) | ((in[20] & 0x7F) << 26)) + out[37] + out[39] = (in[20] >> 7) & 0x1FFFFFFFF + out[38] + out[40] = ((in[20] >> 40) | ((in[21] & 0x1FF) << 24)) + out[39] + out[41] = (in[21] >> 9) & 0x1FFFFFFFF + out[40] + out[42] = ((in[21] >> 42) | ((in[22] & 0x7FF) << 22)) + out[41] + out[43] = (in[22] >> 11) & 0x1FFFFFFFF + out[42] + out[44] = ((in[22] >> 44) | ((in[23] & 0x1FFF) << 20)) + out[43] + out[45] = (in[23] >> 13) & 0x1FFFFFFFF + out[44] + out[46] = ((in[23] >> 46) | ((in[24] & 0x7FFF) << 18)) + out[45] + out[47] = (in[24] >> 15) & 0x1FFFFFFFF + out[46] + out[48] = ((in[24] >> 48) | ((in[25] & 0x1FFFF) << 16)) + out[47] + out[49] = (in[25] >> 17) & 0x1FFFFFFFF + out[48] + out[50] = ((in[25] >> 50) | ((in[26] & 0x7FFFF) << 14)) + out[49] + out[51] = (in[26] >> 19) & 0x1FFFFFFFF + out[50] + out[52] = ((in[26] >> 52) | ((in[27] & 0x1FFFFF) << 12)) + out[51] + out[53] = (in[27] >> 21) & 0x1FFFFFFFF + out[52] + out[54] = ((in[27] >> 54) | ((in[28] & 0x7FFFFF) << 10)) + out[53] + out[55] = (in[28] >> 23) & 0x1FFFFFFFF + out[54] + out[56] = ((in[28] >> 56) | ((in[29] & 0x1FFFFFF) << 8)) + out[55] + out[57] = (in[29] >> 25) & 0x1FFFFFFFF + out[56] + out[58] = ((in[29] >> 58) | ((in[30] & 0x7FFFFFF) << 6)) + out[57] + out[59] = (in[30] >> 27) & 0x1FFFFFFFF + out[58] + out[60] = ((in[30] >> 60) | ((in[31] & 0x1FFFFFFF) << 4)) + out[59] + out[61] = (in[31] >> 29) & 0x1FFFFFFFF + out[60] + out[62] = ((in[31] >> 62) | ((in[32] & 0x7FFFFFFF) << 2)) + out[61] + out[63] = (in[32] >> 31) + out[62] +} + +func deltaunpack_uint64_34(initoffset uint64, in *[34]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFF + initoffset + out[1] = ((in[0] >> 34) | ((in[1] & 0xF) << 30)) + out[0] + out[2] = (in[1] >> 4) & 0x3FFFFFFFF + out[1] + out[3] = ((in[1] >> 38) | ((in[2] & 0xFF) << 26)) + out[2] + out[4] = (in[2] >> 8) & 0x3FFFFFFFF + out[3] + out[5] = ((in[2] >> 42) | ((in[3] & 0xFFF) << 22)) + out[4] + out[6] = (in[3] >> 12) & 0x3FFFFFFFF + out[5] + out[7] = ((in[3] >> 46) | ((in[4] & 0xFFFF) << 18)) + out[6] + out[8] = (in[4] >> 16) & 0x3FFFFFFFF + out[7] + out[9] = ((in[4] >> 50) | ((in[5] & 0xFFFFF) << 14)) + out[8] + out[10] = (in[5] >> 20) & 0x3FFFFFFFF + out[9] + out[11] = ((in[5] >> 54) | ((in[6] & 0xFFFFFF) << 10)) + out[10] + out[12] = (in[6] >> 24) & 0x3FFFFFFFF + out[11] + out[13] = ((in[6] >> 58) | ((in[7] & 0xFFFFFFF) << 6)) + out[12] + out[14] = (in[7] >> 28) & 0x3FFFFFFFF + out[13] + out[15] = ((in[7] >> 62) | ((in[8] & 0xFFFFFFFF) << 2)) + out[14] + out[16] = ((in[8] >> 32) | ((in[9] & 0x3) << 32)) + out[15] + out[17] = (in[9] >> 2) & 0x3FFFFFFFF + out[16] + out[18] = ((in[9] >> 36) | ((in[10] & 0x3F) << 28)) + out[17] + out[19] = (in[10] >> 6) & 0x3FFFFFFFF + out[18] + out[20] = ((in[10] >> 40) | ((in[11] & 0x3FF) << 24)) + out[19] + out[21] = (in[11] >> 10) & 0x3FFFFFFFF + out[20] + out[22] = ((in[11] >> 44) | ((in[12] & 0x3FFF) << 20)) + out[21] + out[23] = (in[12] >> 14) & 0x3FFFFFFFF + out[22] + out[24] = ((in[12] >> 48) | ((in[13] & 0x3FFFF) << 16)) + out[23] + out[25] = (in[13] >> 18) & 0x3FFFFFFFF + out[24] + out[26] = ((in[13] >> 52) | ((in[14] & 0x3FFFFF) << 12)) + out[25] + out[27] = (in[14] >> 22) & 0x3FFFFFFFF + out[26] + out[28] = ((in[14] >> 56) | ((in[15] & 0x3FFFFFF) << 8)) + out[27] + out[29] = (in[15] >> 26) & 0x3FFFFFFFF + out[28] + out[30] = ((in[15] >> 60) | ((in[16] & 0x3FFFFFFF) << 4)) + out[29] + out[31] = (in[16] >> 30) + out[30] + out[32] = (in[17] >> 0) & 0x3FFFFFFFF + out[31] + out[33] = ((in[17] >> 34) | ((in[18] & 0xF) << 30)) + out[32] + out[34] = (in[18] >> 4) & 0x3FFFFFFFF + out[33] + out[35] = ((in[18] >> 38) | ((in[19] & 0xFF) << 26)) + out[34] + out[36] = (in[19] >> 8) & 0x3FFFFFFFF + out[35] + out[37] = ((in[19] >> 42) | ((in[20] & 0xFFF) << 22)) + out[36] + out[38] = (in[20] >> 12) & 0x3FFFFFFFF + out[37] + out[39] = ((in[20] >> 46) | ((in[21] & 0xFFFF) << 18)) + out[38] + out[40] = (in[21] >> 16) & 0x3FFFFFFFF + out[39] + out[41] = ((in[21] >> 50) | ((in[22] & 0xFFFFF) << 14)) + out[40] + out[42] = (in[22] >> 20) & 0x3FFFFFFFF + out[41] + out[43] = ((in[22] >> 54) | ((in[23] & 0xFFFFFF) << 10)) + out[42] + out[44] = (in[23] >> 24) & 0x3FFFFFFFF + out[43] + out[45] = ((in[23] >> 58) | ((in[24] & 0xFFFFFFF) << 6)) + out[44] + out[46] = (in[24] >> 28) & 0x3FFFFFFFF + out[45] + out[47] = ((in[24] >> 62) | ((in[25] & 0xFFFFFFFF) << 2)) + out[46] + out[48] = ((in[25] >> 32) | ((in[26] & 0x3) << 32)) + out[47] + out[49] = (in[26] >> 2) & 0x3FFFFFFFF + out[48] + out[50] = ((in[26] >> 36) | ((in[27] & 0x3F) << 28)) + out[49] + out[51] = (in[27] >> 6) & 0x3FFFFFFFF + out[50] + out[52] = ((in[27] >> 40) | ((in[28] & 0x3FF) << 24)) + out[51] + out[53] = (in[28] >> 10) & 0x3FFFFFFFF + out[52] + out[54] = ((in[28] >> 44) | ((in[29] & 0x3FFF) << 20)) + out[53] + out[55] = (in[29] >> 14) & 0x3FFFFFFFF + out[54] + out[56] = ((in[29] >> 48) | ((in[30] & 0x3FFFF) << 16)) + out[55] + out[57] = (in[30] >> 18) & 0x3FFFFFFFF + out[56] + out[58] = ((in[30] >> 52) | ((in[31] & 0x3FFFFF) << 12)) + out[57] + out[59] = (in[31] >> 22) & 0x3FFFFFFFF + out[58] + out[60] = ((in[31] >> 56) | ((in[32] & 0x3FFFFFF) << 8)) + out[59] + out[61] = (in[32] >> 26) & 0x3FFFFFFFF + out[60] + out[62] = ((in[32] >> 60) | ((in[33] & 0x3FFFFFFF) << 4)) + out[61] + out[63] = (in[33] >> 30) + out[62] +} + +func deltaunpack_uint64_35(initoffset uint64, in *[35]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFF + initoffset + out[1] = ((in[0] >> 35) | ((in[1] & 0x3F) << 29)) + out[0] + out[2] = (in[1] >> 6) & 0x7FFFFFFFF + out[1] + out[3] = ((in[1] >> 41) | ((in[2] & 0xFFF) << 23)) + out[2] + out[4] = (in[2] >> 12) & 0x7FFFFFFFF + out[3] + out[5] = ((in[2] >> 47) | ((in[3] & 0x3FFFF) << 17)) + out[4] + out[6] = (in[3] >> 18) & 0x7FFFFFFFF + out[5] + out[7] = ((in[3] >> 53) | ((in[4] & 0xFFFFFF) << 11)) + out[6] + out[8] = (in[4] >> 24) & 0x7FFFFFFFF + out[7] + out[9] = ((in[4] >> 59) | ((in[5] & 0x3FFFFFFF) << 5)) + out[8] + out[10] = ((in[5] >> 30) | ((in[6] & 0x1) << 34)) + out[9] + out[11] = (in[6] >> 1) & 0x7FFFFFFFF + out[10] + out[12] = ((in[6] >> 36) | ((in[7] & 0x7F) << 28)) + out[11] + out[13] = (in[7] >> 7) & 0x7FFFFFFFF + out[12] + out[14] = ((in[7] >> 42) | ((in[8] & 0x1FFF) << 22)) + out[13] + out[15] = (in[8] >> 13) & 0x7FFFFFFFF + out[14] + out[16] = ((in[8] >> 48) | ((in[9] & 0x7FFFF) << 16)) + out[15] + out[17] = (in[9] >> 19) & 0x7FFFFFFFF + out[16] + out[18] = ((in[9] >> 54) | ((in[10] & 0x1FFFFFF) << 10)) + out[17] + out[19] = (in[10] >> 25) & 0x7FFFFFFFF + out[18] + out[20] = ((in[10] >> 60) | ((in[11] & 0x7FFFFFFF) << 4)) + out[19] + out[21] = ((in[11] >> 31) | ((in[12] & 0x3) << 33)) + out[20] + out[22] = (in[12] >> 2) & 0x7FFFFFFFF + out[21] + out[23] = ((in[12] >> 37) | ((in[13] & 0xFF) << 27)) + out[22] + out[24] = (in[13] >> 8) & 0x7FFFFFFFF + out[23] + out[25] = ((in[13] >> 43) | ((in[14] & 0x3FFF) << 21)) + out[24] + out[26] = (in[14] >> 14) & 0x7FFFFFFFF + out[25] + out[27] = ((in[14] >> 49) | ((in[15] & 0xFFFFF) << 15)) + out[26] + out[28] = (in[15] >> 20) & 0x7FFFFFFFF + out[27] + out[29] = ((in[15] >> 55) | ((in[16] & 0x3FFFFFF) << 9)) + out[28] + out[30] = (in[16] >> 26) & 0x7FFFFFFFF + out[29] + out[31] = ((in[16] >> 61) | ((in[17] & 0xFFFFFFFF) << 3)) + out[30] + out[32] = ((in[17] >> 32) | ((in[18] & 0x7) << 32)) + out[31] + out[33] = (in[18] >> 3) & 0x7FFFFFFFF + out[32] + out[34] = ((in[18] >> 38) | ((in[19] & 0x1FF) << 26)) + out[33] + out[35] = (in[19] >> 9) & 0x7FFFFFFFF + out[34] + out[36] = ((in[19] >> 44) | ((in[20] & 0x7FFF) << 20)) + out[35] + out[37] = (in[20] >> 15) & 0x7FFFFFFFF + out[36] + out[38] = ((in[20] >> 50) | ((in[21] & 0x1FFFFF) << 14)) + out[37] + out[39] = (in[21] >> 21) & 0x7FFFFFFFF + out[38] + out[40] = ((in[21] >> 56) | ((in[22] & 0x7FFFFFF) << 8)) + out[39] + out[41] = (in[22] >> 27) & 0x7FFFFFFFF + out[40] + out[42] = ((in[22] >> 62) | ((in[23] & 0x1FFFFFFFF) << 2)) + out[41] + out[43] = ((in[23] >> 33) | ((in[24] & 0xF) << 31)) + out[42] + out[44] = (in[24] >> 4) & 0x7FFFFFFFF + out[43] + out[45] = ((in[24] >> 39) | ((in[25] & 0x3FF) << 25)) + out[44] + out[46] = (in[25] >> 10) & 0x7FFFFFFFF + out[45] + out[47] = ((in[25] >> 45) | ((in[26] & 0xFFFF) << 19)) + out[46] + out[48] = (in[26] >> 16) & 0x7FFFFFFFF + out[47] + out[49] = ((in[26] >> 51) | ((in[27] & 0x3FFFFF) << 13)) + out[48] + out[50] = (in[27] >> 22) & 0x7FFFFFFFF + out[49] + out[51] = ((in[27] >> 57) | ((in[28] & 0xFFFFFFF) << 7)) + out[50] + out[52] = (in[28] >> 28) & 0x7FFFFFFFF + out[51] + out[53] = ((in[28] >> 63) | ((in[29] & 0x3FFFFFFFF) << 1)) + out[52] + out[54] = ((in[29] >> 34) | ((in[30] & 0x1F) << 30)) + out[53] + out[55] = (in[30] >> 5) & 0x7FFFFFFFF + out[54] + out[56] = ((in[30] >> 40) | ((in[31] & 0x7FF) << 24)) + out[55] + out[57] = (in[31] >> 11) & 0x7FFFFFFFF + out[56] + out[58] = ((in[31] >> 46) | ((in[32] & 0x1FFFF) << 18)) + out[57] + out[59] = (in[32] >> 17) & 0x7FFFFFFFF + out[58] + out[60] = ((in[32] >> 52) | ((in[33] & 0x7FFFFF) << 12)) + out[59] + out[61] = (in[33] >> 23) & 0x7FFFFFFFF + out[60] + out[62] = ((in[33] >> 58) | ((in[34] & 0x1FFFFFFF) << 6)) + out[61] + out[63] = (in[34] >> 29) + out[62] +} + +func deltaunpack_uint64_36(initoffset uint64, in *[36]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFFF + initoffset + out[1] = ((in[0] >> 36) | ((in[1] & 0xFF) << 28)) + out[0] + out[2] = (in[1] >> 8) & 0xFFFFFFFFF + out[1] + out[3] = ((in[1] >> 44) | ((in[2] & 0xFFFF) << 20)) + out[2] + out[4] = (in[2] >> 16) & 0xFFFFFFFFF + out[3] + out[5] = ((in[2] >> 52) | ((in[3] & 0xFFFFFF) << 12)) + out[4] + out[6] = (in[3] >> 24) & 0xFFFFFFFFF + out[5] + out[7] = ((in[3] >> 60) | ((in[4] & 0xFFFFFFFF) << 4)) + out[6] + out[8] = ((in[4] >> 32) | ((in[5] & 0xF) << 32)) + out[7] + out[9] = (in[5] >> 4) & 0xFFFFFFFFF + out[8] + out[10] = ((in[5] >> 40) | ((in[6] & 0xFFF) << 24)) + out[9] + out[11] = (in[6] >> 12) & 0xFFFFFFFFF + out[10] + out[12] = ((in[6] >> 48) | ((in[7] & 0xFFFFF) << 16)) + out[11] + out[13] = (in[7] >> 20) & 0xFFFFFFFFF + out[12] + out[14] = ((in[7] >> 56) | ((in[8] & 0xFFFFFFF) << 8)) + out[13] + out[15] = (in[8] >> 28) + out[14] + out[16] = (in[9] >> 0) & 0xFFFFFFFFF + out[15] + out[17] = ((in[9] >> 36) | ((in[10] & 0xFF) << 28)) + out[16] + out[18] = (in[10] >> 8) & 0xFFFFFFFFF + out[17] + out[19] = ((in[10] >> 44) | ((in[11] & 0xFFFF) << 20)) + out[18] + out[20] = (in[11] >> 16) & 0xFFFFFFFFF + out[19] + out[21] = ((in[11] >> 52) | ((in[12] & 0xFFFFFF) << 12)) + out[20] + out[22] = (in[12] >> 24) & 0xFFFFFFFFF + out[21] + out[23] = ((in[12] >> 60) | ((in[13] & 0xFFFFFFFF) << 4)) + out[22] + out[24] = ((in[13] >> 32) | ((in[14] & 0xF) << 32)) + out[23] + out[25] = (in[14] >> 4) & 0xFFFFFFFFF + out[24] + out[26] = ((in[14] >> 40) | ((in[15] & 0xFFF) << 24)) + out[25] + out[27] = (in[15] >> 12) & 0xFFFFFFFFF + out[26] + out[28] = ((in[15] >> 48) | ((in[16] & 0xFFFFF) << 16)) + out[27] + out[29] = (in[16] >> 20) & 0xFFFFFFFFF + out[28] + out[30] = ((in[16] >> 56) | ((in[17] & 0xFFFFFFF) << 8)) + out[29] + out[31] = (in[17] >> 28) + out[30] + out[32] = (in[18] >> 0) & 0xFFFFFFFFF + out[31] + out[33] = ((in[18] >> 36) | ((in[19] & 0xFF) << 28)) + out[32] + out[34] = (in[19] >> 8) & 0xFFFFFFFFF + out[33] + out[35] = ((in[19] >> 44) | ((in[20] & 0xFFFF) << 20)) + out[34] + out[36] = (in[20] >> 16) & 0xFFFFFFFFF + out[35] + out[37] = ((in[20] >> 52) | ((in[21] & 0xFFFFFF) << 12)) + out[36] + out[38] = (in[21] >> 24) & 0xFFFFFFFFF + out[37] + out[39] = ((in[21] >> 60) | ((in[22] & 0xFFFFFFFF) << 4)) + out[38] + out[40] = ((in[22] >> 32) | ((in[23] & 0xF) << 32)) + out[39] + out[41] = (in[23] >> 4) & 0xFFFFFFFFF + out[40] + out[42] = ((in[23] >> 40) | ((in[24] & 0xFFF) << 24)) + out[41] + out[43] = (in[24] >> 12) & 0xFFFFFFFFF + out[42] + out[44] = ((in[24] >> 48) | ((in[25] & 0xFFFFF) << 16)) + out[43] + out[45] = (in[25] >> 20) & 0xFFFFFFFFF + out[44] + out[46] = ((in[25] >> 56) | ((in[26] & 0xFFFFFFF) << 8)) + out[45] + out[47] = (in[26] >> 28) + out[46] + out[48] = (in[27] >> 0) & 0xFFFFFFFFF + out[47] + out[49] = ((in[27] >> 36) | ((in[28] & 0xFF) << 28)) + out[48] + out[50] = (in[28] >> 8) & 0xFFFFFFFFF + out[49] + out[51] = ((in[28] >> 44) | ((in[29] & 0xFFFF) << 20)) + out[50] + out[52] = (in[29] >> 16) & 0xFFFFFFFFF + out[51] + out[53] = ((in[29] >> 52) | ((in[30] & 0xFFFFFF) << 12)) + out[52] + out[54] = (in[30] >> 24) & 0xFFFFFFFFF + out[53] + out[55] = ((in[30] >> 60) | ((in[31] & 0xFFFFFFFF) << 4)) + out[54] + out[56] = ((in[31] >> 32) | ((in[32] & 0xF) << 32)) + out[55] + out[57] = (in[32] >> 4) & 0xFFFFFFFFF + out[56] + out[58] = ((in[32] >> 40) | ((in[33] & 0xFFF) << 24)) + out[57] + out[59] = (in[33] >> 12) & 0xFFFFFFFFF + out[58] + out[60] = ((in[33] >> 48) | ((in[34] & 0xFFFFF) << 16)) + out[59] + out[61] = (in[34] >> 20) & 0xFFFFFFFFF + out[60] + out[62] = ((in[34] >> 56) | ((in[35] & 0xFFFFFFF) << 8)) + out[61] + out[63] = (in[35] >> 28) + out[62] +} + +func deltaunpack_uint64_37(initoffset uint64, in *[37]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFFF + initoffset + out[1] = ((in[0] >> 37) | ((in[1] & 0x3FF) << 27)) + out[0] + out[2] = (in[1] >> 10) & 0x1FFFFFFFFF + out[1] + out[3] = ((in[1] >> 47) | ((in[2] & 0xFFFFF) << 17)) + out[2] + out[4] = (in[2] >> 20) & 0x1FFFFFFFFF + out[3] + out[5] = ((in[2] >> 57) | ((in[3] & 0x3FFFFFFF) << 7)) + out[4] + out[6] = ((in[3] >> 30) | ((in[4] & 0x7) << 34)) + out[5] + out[7] = (in[4] >> 3) & 0x1FFFFFFFFF + out[6] + out[8] = ((in[4] >> 40) | ((in[5] & 0x1FFF) << 24)) + out[7] + out[9] = (in[5] >> 13) & 0x1FFFFFFFFF + out[8] + out[10] = ((in[5] >> 50) | ((in[6] & 0x7FFFFF) << 14)) + out[9] + out[11] = (in[6] >> 23) & 0x1FFFFFFFFF + out[10] + out[12] = ((in[6] >> 60) | ((in[7] & 0x1FFFFFFFF) << 4)) + out[11] + out[13] = ((in[7] >> 33) | ((in[8] & 0x3F) << 31)) + out[12] + out[14] = (in[8] >> 6) & 0x1FFFFFFFFF + out[13] + out[15] = ((in[8] >> 43) | ((in[9] & 0xFFFF) << 21)) + out[14] + out[16] = (in[9] >> 16) & 0x1FFFFFFFFF + out[15] + out[17] = ((in[9] >> 53) | ((in[10] & 0x3FFFFFF) << 11)) + out[16] + out[18] = (in[10] >> 26) & 0x1FFFFFFFFF + out[17] + out[19] = ((in[10] >> 63) | ((in[11] & 0xFFFFFFFFF) << 1)) + out[18] + out[20] = ((in[11] >> 36) | ((in[12] & 0x1FF) << 28)) + out[19] + out[21] = (in[12] >> 9) & 0x1FFFFFFFFF + out[20] + out[22] = ((in[12] >> 46) | ((in[13] & 0x7FFFF) << 18)) + out[21] + out[23] = (in[13] >> 19) & 0x1FFFFFFFFF + out[22] + out[24] = ((in[13] >> 56) | ((in[14] & 0x1FFFFFFF) << 8)) + out[23] + out[25] = ((in[14] >> 29) | ((in[15] & 0x3) << 35)) + out[24] + out[26] = (in[15] >> 2) & 0x1FFFFFFFFF + out[25] + out[27] = ((in[15] >> 39) | ((in[16] & 0xFFF) << 25)) + out[26] + out[28] = (in[16] >> 12) & 0x1FFFFFFFFF + out[27] + out[29] = ((in[16] >> 49) | ((in[17] & 0x3FFFFF) << 15)) + out[28] + out[30] = (in[17] >> 22) & 0x1FFFFFFFFF + out[29] + out[31] = ((in[17] >> 59) | ((in[18] & 0xFFFFFFFF) << 5)) + out[30] + out[32] = ((in[18] >> 32) | ((in[19] & 0x1F) << 32)) + out[31] + out[33] = (in[19] >> 5) & 0x1FFFFFFFFF + out[32] + out[34] = ((in[19] >> 42) | ((in[20] & 0x7FFF) << 22)) + out[33] + out[35] = (in[20] >> 15) & 0x1FFFFFFFFF + out[34] + out[36] = ((in[20] >> 52) | ((in[21] & 0x1FFFFFF) << 12)) + out[35] + out[37] = (in[21] >> 25) & 0x1FFFFFFFFF + out[36] + out[38] = ((in[21] >> 62) | ((in[22] & 0x7FFFFFFFF) << 2)) + out[37] + out[39] = ((in[22] >> 35) | ((in[23] & 0xFF) << 29)) + out[38] + out[40] = (in[23] >> 8) & 0x1FFFFFFFFF + out[39] + out[41] = ((in[23] >> 45) | ((in[24] & 0x3FFFF) << 19)) + out[40] + out[42] = (in[24] >> 18) & 0x1FFFFFFFFF + out[41] + out[43] = ((in[24] >> 55) | ((in[25] & 0xFFFFFFF) << 9)) + out[42] + out[44] = ((in[25] >> 28) | ((in[26] & 0x1) << 36)) + out[43] + out[45] = (in[26] >> 1) & 0x1FFFFFFFFF + out[44] + out[46] = ((in[26] >> 38) | ((in[27] & 0x7FF) << 26)) + out[45] + out[47] = (in[27] >> 11) & 0x1FFFFFFFFF + out[46] + out[48] = ((in[27] >> 48) | ((in[28] & 0x1FFFFF) << 16)) + out[47] + out[49] = (in[28] >> 21) & 0x1FFFFFFFFF + out[48] + out[50] = ((in[28] >> 58) | ((in[29] & 0x7FFFFFFF) << 6)) + out[49] + out[51] = ((in[29] >> 31) | ((in[30] & 0xF) << 33)) + out[50] + out[52] = (in[30] >> 4) & 0x1FFFFFFFFF + out[51] + out[53] = ((in[30] >> 41) | ((in[31] & 0x3FFF) << 23)) + out[52] + out[54] = (in[31] >> 14) & 0x1FFFFFFFFF + out[53] + out[55] = ((in[31] >> 51) | ((in[32] & 0xFFFFFF) << 13)) + out[54] + out[56] = (in[32] >> 24) & 0x1FFFFFFFFF + out[55] + out[57] = ((in[32] >> 61) | ((in[33] & 0x3FFFFFFFF) << 3)) + out[56] + out[58] = ((in[33] >> 34) | ((in[34] & 0x7F) << 30)) + out[57] + out[59] = (in[34] >> 7) & 0x1FFFFFFFFF + out[58] + out[60] = ((in[34] >> 44) | ((in[35] & 0x1FFFF) << 20)) + out[59] + out[61] = (in[35] >> 17) & 0x1FFFFFFFFF + out[60] + out[62] = ((in[35] >> 54) | ((in[36] & 0x7FFFFFF) << 10)) + out[61] + out[63] = (in[36] >> 27) + out[62] +} + +func deltaunpack_uint64_38(initoffset uint64, in *[38]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFFF + initoffset + out[1] = ((in[0] >> 38) | ((in[1] & 0xFFF) << 26)) + out[0] + out[2] = (in[1] >> 12) & 0x3FFFFFFFFF + out[1] + out[3] = ((in[1] >> 50) | ((in[2] & 0xFFFFFF) << 14)) + out[2] + out[4] = (in[2] >> 24) & 0x3FFFFFFFFF + out[3] + out[5] = ((in[2] >> 62) | ((in[3] & 0xFFFFFFFFF) << 2)) + out[4] + out[6] = ((in[3] >> 36) | ((in[4] & 0x3FF) << 28)) + out[5] + out[7] = (in[4] >> 10) & 0x3FFFFFFFFF + out[6] + out[8] = ((in[4] >> 48) | ((in[5] & 0x3FFFFF) << 16)) + out[7] + out[9] = (in[5] >> 22) & 0x3FFFFFFFFF + out[8] + out[10] = ((in[5] >> 60) | ((in[6] & 0x3FFFFFFFF) << 4)) + out[9] + out[11] = ((in[6] >> 34) | ((in[7] & 0xFF) << 30)) + out[10] + out[12] = (in[7] >> 8) & 0x3FFFFFFFFF + out[11] + out[13] = ((in[7] >> 46) | ((in[8] & 0xFFFFF) << 18)) + out[12] + out[14] = (in[8] >> 20) & 0x3FFFFFFFFF + out[13] + out[15] = ((in[8] >> 58) | ((in[9] & 0xFFFFFFFF) << 6)) + out[14] + out[16] = ((in[9] >> 32) | ((in[10] & 0x3F) << 32)) + out[15] + out[17] = (in[10] >> 6) & 0x3FFFFFFFFF + out[16] + out[18] = ((in[10] >> 44) | ((in[11] & 0x3FFFF) << 20)) + out[17] + out[19] = (in[11] >> 18) & 0x3FFFFFFFFF + out[18] + out[20] = ((in[11] >> 56) | ((in[12] & 0x3FFFFFFF) << 8)) + out[19] + out[21] = ((in[12] >> 30) | ((in[13] & 0xF) << 34)) + out[20] + out[22] = (in[13] >> 4) & 0x3FFFFFFFFF + out[21] + out[23] = ((in[13] >> 42) | ((in[14] & 0xFFFF) << 22)) + out[22] + out[24] = (in[14] >> 16) & 0x3FFFFFFFFF + out[23] + out[25] = ((in[14] >> 54) | ((in[15] & 0xFFFFFFF) << 10)) + out[24] + out[26] = ((in[15] >> 28) | ((in[16] & 0x3) << 36)) + out[25] + out[27] = (in[16] >> 2) & 0x3FFFFFFFFF + out[26] + out[28] = ((in[16] >> 40) | ((in[17] & 0x3FFF) << 24)) + out[27] + out[29] = (in[17] >> 14) & 0x3FFFFFFFFF + out[28] + out[30] = ((in[17] >> 52) | ((in[18] & 0x3FFFFFF) << 12)) + out[29] + out[31] = (in[18] >> 26) + out[30] + out[32] = (in[19] >> 0) & 0x3FFFFFFFFF + out[31] + out[33] = ((in[19] >> 38) | ((in[20] & 0xFFF) << 26)) + out[32] + out[34] = (in[20] >> 12) & 0x3FFFFFFFFF + out[33] + out[35] = ((in[20] >> 50) | ((in[21] & 0xFFFFFF) << 14)) + out[34] + out[36] = (in[21] >> 24) & 0x3FFFFFFFFF + out[35] + out[37] = ((in[21] >> 62) | ((in[22] & 0xFFFFFFFFF) << 2)) + out[36] + out[38] = ((in[22] >> 36) | ((in[23] & 0x3FF) << 28)) + out[37] + out[39] = (in[23] >> 10) & 0x3FFFFFFFFF + out[38] + out[40] = ((in[23] >> 48) | ((in[24] & 0x3FFFFF) << 16)) + out[39] + out[41] = (in[24] >> 22) & 0x3FFFFFFFFF + out[40] + out[42] = ((in[24] >> 60) | ((in[25] & 0x3FFFFFFFF) << 4)) + out[41] + out[43] = ((in[25] >> 34) | ((in[26] & 0xFF) << 30)) + out[42] + out[44] = (in[26] >> 8) & 0x3FFFFFFFFF + out[43] + out[45] = ((in[26] >> 46) | ((in[27] & 0xFFFFF) << 18)) + out[44] + out[46] = (in[27] >> 20) & 0x3FFFFFFFFF + out[45] + out[47] = ((in[27] >> 58) | ((in[28] & 0xFFFFFFFF) << 6)) + out[46] + out[48] = ((in[28] >> 32) | ((in[29] & 0x3F) << 32)) + out[47] + out[49] = (in[29] >> 6) & 0x3FFFFFFFFF + out[48] + out[50] = ((in[29] >> 44) | ((in[30] & 0x3FFFF) << 20)) + out[49] + out[51] = (in[30] >> 18) & 0x3FFFFFFFFF + out[50] + out[52] = ((in[30] >> 56) | ((in[31] & 0x3FFFFFFF) << 8)) + out[51] + out[53] = ((in[31] >> 30) | ((in[32] & 0xF) << 34)) + out[52] + out[54] = (in[32] >> 4) & 0x3FFFFFFFFF + out[53] + out[55] = ((in[32] >> 42) | ((in[33] & 0xFFFF) << 22)) + out[54] + out[56] = (in[33] >> 16) & 0x3FFFFFFFFF + out[55] + out[57] = ((in[33] >> 54) | ((in[34] & 0xFFFFFFF) << 10)) + out[56] + out[58] = ((in[34] >> 28) | ((in[35] & 0x3) << 36)) + out[57] + out[59] = (in[35] >> 2) & 0x3FFFFFFFFF + out[58] + out[60] = ((in[35] >> 40) | ((in[36] & 0x3FFF) << 24)) + out[59] + out[61] = (in[36] >> 14) & 0x3FFFFFFFFF + out[60] + out[62] = ((in[36] >> 52) | ((in[37] & 0x3FFFFFF) << 12)) + out[61] + out[63] = (in[37] >> 26) + out[62] +} + +func deltaunpack_uint64_39(initoffset uint64, in *[39]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFFF + initoffset + out[1] = ((in[0] >> 39) | ((in[1] & 0x3FFF) << 25)) + out[0] + out[2] = (in[1] >> 14) & 0x7FFFFFFFFF + out[1] + out[3] = ((in[1] >> 53) | ((in[2] & 0xFFFFFFF) << 11)) + out[2] + out[4] = ((in[2] >> 28) | ((in[3] & 0x7) << 36)) + out[3] + out[5] = (in[3] >> 3) & 0x7FFFFFFFFF + out[4] + out[6] = ((in[3] >> 42) | ((in[4] & 0x1FFFF) << 22)) + out[5] + out[7] = (in[4] >> 17) & 0x7FFFFFFFFF + out[6] + out[8] = ((in[4] >> 56) | ((in[5] & 0x7FFFFFFF) << 8)) + out[7] + out[9] = ((in[5] >> 31) | ((in[6] & 0x3F) << 33)) + out[8] + out[10] = (in[6] >> 6) & 0x7FFFFFFFFF + out[9] + out[11] = ((in[6] >> 45) | ((in[7] & 0xFFFFF) << 19)) + out[10] + out[12] = (in[7] >> 20) & 0x7FFFFFFFFF + out[11] + out[13] = ((in[7] >> 59) | ((in[8] & 0x3FFFFFFFF) << 5)) + out[12] + out[14] = ((in[8] >> 34) | ((in[9] & 0x1FF) << 30)) + out[13] + out[15] = (in[9] >> 9) & 0x7FFFFFFFFF + out[14] + out[16] = ((in[9] >> 48) | ((in[10] & 0x7FFFFF) << 16)) + out[15] + out[17] = (in[10] >> 23) & 0x7FFFFFFFFF + out[16] + out[18] = ((in[10] >> 62) | ((in[11] & 0x1FFFFFFFFF) << 2)) + out[17] + out[19] = ((in[11] >> 37) | ((in[12] & 0xFFF) << 27)) + out[18] + out[20] = (in[12] >> 12) & 0x7FFFFFFFFF + out[19] + out[21] = ((in[12] >> 51) | ((in[13] & 0x3FFFFFF) << 13)) + out[20] + out[22] = ((in[13] >> 26) | ((in[14] & 0x1) << 38)) + out[21] + out[23] = (in[14] >> 1) & 0x7FFFFFFFFF + out[22] + out[24] = ((in[14] >> 40) | ((in[15] & 0x7FFF) << 24)) + out[23] + out[25] = (in[15] >> 15) & 0x7FFFFFFFFF + out[24] + out[26] = ((in[15] >> 54) | ((in[16] & 0x1FFFFFFF) << 10)) + out[25] + out[27] = ((in[16] >> 29) | ((in[17] & 0xF) << 35)) + out[26] + out[28] = (in[17] >> 4) & 0x7FFFFFFFFF + out[27] + out[29] = ((in[17] >> 43) | ((in[18] & 0x3FFFF) << 21)) + out[28] + out[30] = (in[18] >> 18) & 0x7FFFFFFFFF + out[29] + out[31] = ((in[18] >> 57) | ((in[19] & 0xFFFFFFFF) << 7)) + out[30] + out[32] = ((in[19] >> 32) | ((in[20] & 0x7F) << 32)) + out[31] + out[33] = (in[20] >> 7) & 0x7FFFFFFFFF + out[32] + out[34] = ((in[20] >> 46) | ((in[21] & 0x1FFFFF) << 18)) + out[33] + out[35] = (in[21] >> 21) & 0x7FFFFFFFFF + out[34] + out[36] = ((in[21] >> 60) | ((in[22] & 0x7FFFFFFFF) << 4)) + out[35] + out[37] = ((in[22] >> 35) | ((in[23] & 0x3FF) << 29)) + out[36] + out[38] = (in[23] >> 10) & 0x7FFFFFFFFF + out[37] + out[39] = ((in[23] >> 49) | ((in[24] & 0xFFFFFF) << 15)) + out[38] + out[40] = (in[24] >> 24) & 0x7FFFFFFFFF + out[39] + out[41] = ((in[24] >> 63) | ((in[25] & 0x3FFFFFFFFF) << 1)) + out[40] + out[42] = ((in[25] >> 38) | ((in[26] & 0x1FFF) << 26)) + out[41] + out[43] = (in[26] >> 13) & 0x7FFFFFFFFF + out[42] + out[44] = ((in[26] >> 52) | ((in[27] & 0x7FFFFFF) << 12)) + out[43] + out[45] = ((in[27] >> 27) | ((in[28] & 0x3) << 37)) + out[44] + out[46] = (in[28] >> 2) & 0x7FFFFFFFFF + out[45] + out[47] = ((in[28] >> 41) | ((in[29] & 0xFFFF) << 23)) + out[46] + out[48] = (in[29] >> 16) & 0x7FFFFFFFFF + out[47] + out[49] = ((in[29] >> 55) | ((in[30] & 0x3FFFFFFF) << 9)) + out[48] + out[50] = ((in[30] >> 30) | ((in[31] & 0x1F) << 34)) + out[49] + out[51] = (in[31] >> 5) & 0x7FFFFFFFFF + out[50] + out[52] = ((in[31] >> 44) | ((in[32] & 0x7FFFF) << 20)) + out[51] + out[53] = (in[32] >> 19) & 0x7FFFFFFFFF + out[52] + out[54] = ((in[32] >> 58) | ((in[33] & 0x1FFFFFFFF) << 6)) + out[53] + out[55] = ((in[33] >> 33) | ((in[34] & 0xFF) << 31)) + out[54] + out[56] = (in[34] >> 8) & 0x7FFFFFFFFF + out[55] + out[57] = ((in[34] >> 47) | ((in[35] & 0x3FFFFF) << 17)) + out[56] + out[58] = (in[35] >> 22) & 0x7FFFFFFFFF + out[57] + out[59] = ((in[35] >> 61) | ((in[36] & 0xFFFFFFFFF) << 3)) + out[58] + out[60] = ((in[36] >> 36) | ((in[37] & 0x7FF) << 28)) + out[59] + out[61] = (in[37] >> 11) & 0x7FFFFFFFFF + out[60] + out[62] = ((in[37] >> 50) | ((in[38] & 0x1FFFFFF) << 14)) + out[61] + out[63] = (in[38] >> 25) + out[62] +} + +func deltaunpack_uint64_40(initoffset uint64, in *[40]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 40) | ((in[1] & 0xFFFF) << 24)) + out[0] + out[2] = (in[1] >> 16) & 0xFFFFFFFFFF + out[1] + out[3] = ((in[1] >> 56) | ((in[2] & 0xFFFFFFFF) << 8)) + out[2] + out[4] = ((in[2] >> 32) | ((in[3] & 0xFF) << 32)) + out[3] + out[5] = (in[3] >> 8) & 0xFFFFFFFFFF + out[4] + out[6] = ((in[3] >> 48) | ((in[4] & 0xFFFFFF) << 16)) + out[5] + out[7] = (in[4] >> 24) + out[6] + out[8] = (in[5] >> 0) & 0xFFFFFFFFFF + out[7] + out[9] = ((in[5] >> 40) | ((in[6] & 0xFFFF) << 24)) + out[8] + out[10] = (in[6] >> 16) & 0xFFFFFFFFFF + out[9] + out[11] = ((in[6] >> 56) | ((in[7] & 0xFFFFFFFF) << 8)) + out[10] + out[12] = ((in[7] >> 32) | ((in[8] & 0xFF) << 32)) + out[11] + out[13] = (in[8] >> 8) & 0xFFFFFFFFFF + out[12] + out[14] = ((in[8] >> 48) | ((in[9] & 0xFFFFFF) << 16)) + out[13] + out[15] = (in[9] >> 24) + out[14] + out[16] = (in[10] >> 0) & 0xFFFFFFFFFF + out[15] + out[17] = ((in[10] >> 40) | ((in[11] & 0xFFFF) << 24)) + out[16] + out[18] = (in[11] >> 16) & 0xFFFFFFFFFF + out[17] + out[19] = ((in[11] >> 56) | ((in[12] & 0xFFFFFFFF) << 8)) + out[18] + out[20] = ((in[12] >> 32) | ((in[13] & 0xFF) << 32)) + out[19] + out[21] = (in[13] >> 8) & 0xFFFFFFFFFF + out[20] + out[22] = ((in[13] >> 48) | ((in[14] & 0xFFFFFF) << 16)) + out[21] + out[23] = (in[14] >> 24) + out[22] + out[24] = (in[15] >> 0) & 0xFFFFFFFFFF + out[23] + out[25] = ((in[15] >> 40) | ((in[16] & 0xFFFF) << 24)) + out[24] + out[26] = (in[16] >> 16) & 0xFFFFFFFFFF + out[25] + out[27] = ((in[16] >> 56) | ((in[17] & 0xFFFFFFFF) << 8)) + out[26] + out[28] = ((in[17] >> 32) | ((in[18] & 0xFF) << 32)) + out[27] + out[29] = (in[18] >> 8) & 0xFFFFFFFFFF + out[28] + out[30] = ((in[18] >> 48) | ((in[19] & 0xFFFFFF) << 16)) + out[29] + out[31] = (in[19] >> 24) + out[30] + out[32] = (in[20] >> 0) & 0xFFFFFFFFFF + out[31] + out[33] = ((in[20] >> 40) | ((in[21] & 0xFFFF) << 24)) + out[32] + out[34] = (in[21] >> 16) & 0xFFFFFFFFFF + out[33] + out[35] = ((in[21] >> 56) | ((in[22] & 0xFFFFFFFF) << 8)) + out[34] + out[36] = ((in[22] >> 32) | ((in[23] & 0xFF) << 32)) + out[35] + out[37] = (in[23] >> 8) & 0xFFFFFFFFFF + out[36] + out[38] = ((in[23] >> 48) | ((in[24] & 0xFFFFFF) << 16)) + out[37] + out[39] = (in[24] >> 24) + out[38] + out[40] = (in[25] >> 0) & 0xFFFFFFFFFF + out[39] + out[41] = ((in[25] >> 40) | ((in[26] & 0xFFFF) << 24)) + out[40] + out[42] = (in[26] >> 16) & 0xFFFFFFFFFF + out[41] + out[43] = ((in[26] >> 56) | ((in[27] & 0xFFFFFFFF) << 8)) + out[42] + out[44] = ((in[27] >> 32) | ((in[28] & 0xFF) << 32)) + out[43] + out[45] = (in[28] >> 8) & 0xFFFFFFFFFF + out[44] + out[46] = ((in[28] >> 48) | ((in[29] & 0xFFFFFF) << 16)) + out[45] + out[47] = (in[29] >> 24) + out[46] + out[48] = (in[30] >> 0) & 0xFFFFFFFFFF + out[47] + out[49] = ((in[30] >> 40) | ((in[31] & 0xFFFF) << 24)) + out[48] + out[50] = (in[31] >> 16) & 0xFFFFFFFFFF + out[49] + out[51] = ((in[31] >> 56) | ((in[32] & 0xFFFFFFFF) << 8)) + out[50] + out[52] = ((in[32] >> 32) | ((in[33] & 0xFF) << 32)) + out[51] + out[53] = (in[33] >> 8) & 0xFFFFFFFFFF + out[52] + out[54] = ((in[33] >> 48) | ((in[34] & 0xFFFFFF) << 16)) + out[53] + out[55] = (in[34] >> 24) + out[54] + out[56] = (in[35] >> 0) & 0xFFFFFFFFFF + out[55] + out[57] = ((in[35] >> 40) | ((in[36] & 0xFFFF) << 24)) + out[56] + out[58] = (in[36] >> 16) & 0xFFFFFFFFFF + out[57] + out[59] = ((in[36] >> 56) | ((in[37] & 0xFFFFFFFF) << 8)) + out[58] + out[60] = ((in[37] >> 32) | ((in[38] & 0xFF) << 32)) + out[59] + out[61] = (in[38] >> 8) & 0xFFFFFFFFFF + out[60] + out[62] = ((in[38] >> 48) | ((in[39] & 0xFFFFFF) << 16)) + out[61] + out[63] = (in[39] >> 24) + out[62] +} + +func deltaunpack_uint64_41(initoffset uint64, in *[41]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFFFF + initoffset + out[1] = ((in[0] >> 41) | ((in[1] & 0x3FFFF) << 23)) + out[0] + out[2] = (in[1] >> 18) & 0x1FFFFFFFFFF + out[1] + out[3] = ((in[1] >> 59) | ((in[2] & 0xFFFFFFFFF) << 5)) + out[2] + out[4] = ((in[2] >> 36) | ((in[3] & 0x1FFF) << 28)) + out[3] + out[5] = (in[3] >> 13) & 0x1FFFFFFFFFF + out[4] + out[6] = ((in[3] >> 54) | ((in[4] & 0x7FFFFFFF) << 10)) + out[5] + out[7] = ((in[4] >> 31) | ((in[5] & 0xFF) << 33)) + out[6] + out[8] = (in[5] >> 8) & 0x1FFFFFFFFFF + out[7] + out[9] = ((in[5] >> 49) | ((in[6] & 0x3FFFFFF) << 15)) + out[8] + out[10] = ((in[6] >> 26) | ((in[7] & 0x7) << 38)) + out[9] + out[11] = (in[7] >> 3) & 0x1FFFFFFFFFF + out[10] + out[12] = ((in[7] >> 44) | ((in[8] & 0x1FFFFF) << 20)) + out[11] + out[13] = (in[8] >> 21) & 0x1FFFFFFFFFF + out[12] + out[14] = ((in[8] >> 62) | ((in[9] & 0x7FFFFFFFFF) << 2)) + out[13] + out[15] = ((in[9] >> 39) | ((in[10] & 0xFFFF) << 25)) + out[14] + out[16] = (in[10] >> 16) & 0x1FFFFFFFFFF + out[15] + out[17] = ((in[10] >> 57) | ((in[11] & 0x3FFFFFFFF) << 7)) + out[16] + out[18] = ((in[11] >> 34) | ((in[12] & 0x7FF) << 30)) + out[17] + out[19] = (in[12] >> 11) & 0x1FFFFFFFFFF + out[18] + out[20] = ((in[12] >> 52) | ((in[13] & 0x1FFFFFFF) << 12)) + out[19] + out[21] = ((in[13] >> 29) | ((in[14] & 0x3F) << 35)) + out[20] + out[22] = (in[14] >> 6) & 0x1FFFFFFFFFF + out[21] + out[23] = ((in[14] >> 47) | ((in[15] & 0xFFFFFF) << 17)) + out[22] + out[24] = ((in[15] >> 24) | ((in[16] & 0x1) << 40)) + out[23] + out[25] = (in[16] >> 1) & 0x1FFFFFFFFFF + out[24] + out[26] = ((in[16] >> 42) | ((in[17] & 0x7FFFF) << 22)) + out[25] + out[27] = (in[17] >> 19) & 0x1FFFFFFFFFF + out[26] + out[28] = ((in[17] >> 60) | ((in[18] & 0x1FFFFFFFFF) << 4)) + out[27] + out[29] = ((in[18] >> 37) | ((in[19] & 0x3FFF) << 27)) + out[28] + out[30] = (in[19] >> 14) & 0x1FFFFFFFFFF + out[29] + out[31] = ((in[19] >> 55) | ((in[20] & 0xFFFFFFFF) << 9)) + out[30] + out[32] = ((in[20] >> 32) | ((in[21] & 0x1FF) << 32)) + out[31] + out[33] = (in[21] >> 9) & 0x1FFFFFFFFFF + out[32] + out[34] = ((in[21] >> 50) | ((in[22] & 0x7FFFFFF) << 14)) + out[33] + out[35] = ((in[22] >> 27) | ((in[23] & 0xF) << 37)) + out[34] + out[36] = (in[23] >> 4) & 0x1FFFFFFFFFF + out[35] + out[37] = ((in[23] >> 45) | ((in[24] & 0x3FFFFF) << 19)) + out[36] + out[38] = (in[24] >> 22) & 0x1FFFFFFFFFF + out[37] + out[39] = ((in[24] >> 63) | ((in[25] & 0xFFFFFFFFFF) << 1)) + out[38] + out[40] = ((in[25] >> 40) | ((in[26] & 0x1FFFF) << 24)) + out[39] + out[41] = (in[26] >> 17) & 0x1FFFFFFFFFF + out[40] + out[42] = ((in[26] >> 58) | ((in[27] & 0x7FFFFFFFF) << 6)) + out[41] + out[43] = ((in[27] >> 35) | ((in[28] & 0xFFF) << 29)) + out[42] + out[44] = (in[28] >> 12) & 0x1FFFFFFFFFF + out[43] + out[45] = ((in[28] >> 53) | ((in[29] & 0x3FFFFFFF) << 11)) + out[44] + out[46] = ((in[29] >> 30) | ((in[30] & 0x7F) << 34)) + out[45] + out[47] = (in[30] >> 7) & 0x1FFFFFFFFFF + out[46] + out[48] = ((in[30] >> 48) | ((in[31] & 0x1FFFFFF) << 16)) + out[47] + out[49] = ((in[31] >> 25) | ((in[32] & 0x3) << 39)) + out[48] + out[50] = (in[32] >> 2) & 0x1FFFFFFFFFF + out[49] + out[51] = ((in[32] >> 43) | ((in[33] & 0xFFFFF) << 21)) + out[50] + out[52] = (in[33] >> 20) & 0x1FFFFFFFFFF + out[51] + out[53] = ((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFF) << 3)) + out[52] + out[54] = ((in[34] >> 38) | ((in[35] & 0x7FFF) << 26)) + out[53] + out[55] = (in[35] >> 15) & 0x1FFFFFFFFFF + out[54] + out[56] = ((in[35] >> 56) | ((in[36] & 0x1FFFFFFFF) << 8)) + out[55] + out[57] = ((in[36] >> 33) | ((in[37] & 0x3FF) << 31)) + out[56] + out[58] = (in[37] >> 10) & 0x1FFFFFFFFFF + out[57] + out[59] = ((in[37] >> 51) | ((in[38] & 0xFFFFFFF) << 13)) + out[58] + out[60] = ((in[38] >> 28) | ((in[39] & 0x1F) << 36)) + out[59] + out[61] = (in[39] >> 5) & 0x1FFFFFFFFFF + out[60] + out[62] = ((in[39] >> 46) | ((in[40] & 0x7FFFFF) << 18)) + out[61] + out[63] = (in[40] >> 23) + out[62] +} + +func deltaunpack_uint64_42(initoffset uint64, in *[42]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFFFF + initoffset + out[1] = ((in[0] >> 42) | ((in[1] & 0xFFFFF) << 22)) + out[0] + out[2] = (in[1] >> 20) & 0x3FFFFFFFFFF + out[1] + out[3] = ((in[1] >> 62) | ((in[2] & 0xFFFFFFFFFF) << 2)) + out[2] + out[4] = ((in[2] >> 40) | ((in[3] & 0x3FFFF) << 24)) + out[3] + out[5] = (in[3] >> 18) & 0x3FFFFFFFFFF + out[4] + out[6] = ((in[3] >> 60) | ((in[4] & 0x3FFFFFFFFF) << 4)) + out[5] + out[7] = ((in[4] >> 38) | ((in[5] & 0xFFFF) << 26)) + out[6] + out[8] = (in[5] >> 16) & 0x3FFFFFFFFFF + out[7] + out[9] = ((in[5] >> 58) | ((in[6] & 0xFFFFFFFFF) << 6)) + out[8] + out[10] = ((in[6] >> 36) | ((in[7] & 0x3FFF) << 28)) + out[9] + out[11] = (in[7] >> 14) & 0x3FFFFFFFFFF + out[10] + out[12] = ((in[7] >> 56) | ((in[8] & 0x3FFFFFFFF) << 8)) + out[11] + out[13] = ((in[8] >> 34) | ((in[9] & 0xFFF) << 30)) + out[12] + out[14] = (in[9] >> 12) & 0x3FFFFFFFFFF + out[13] + out[15] = ((in[9] >> 54) | ((in[10] & 0xFFFFFFFF) << 10)) + out[14] + out[16] = ((in[10] >> 32) | ((in[11] & 0x3FF) << 32)) + out[15] + out[17] = (in[11] >> 10) & 0x3FFFFFFFFFF + out[16] + out[18] = ((in[11] >> 52) | ((in[12] & 0x3FFFFFFF) << 12)) + out[17] + out[19] = ((in[12] >> 30) | ((in[13] & 0xFF) << 34)) + out[18] + out[20] = (in[13] >> 8) & 0x3FFFFFFFFFF + out[19] + out[21] = ((in[13] >> 50) | ((in[14] & 0xFFFFFFF) << 14)) + out[20] + out[22] = ((in[14] >> 28) | ((in[15] & 0x3F) << 36)) + out[21] + out[23] = (in[15] >> 6) & 0x3FFFFFFFFFF + out[22] + out[24] = ((in[15] >> 48) | ((in[16] & 0x3FFFFFF) << 16)) + out[23] + out[25] = ((in[16] >> 26) | ((in[17] & 0xF) << 38)) + out[24] + out[26] = (in[17] >> 4) & 0x3FFFFFFFFFF + out[25] + out[27] = ((in[17] >> 46) | ((in[18] & 0xFFFFFF) << 18)) + out[26] + out[28] = ((in[18] >> 24) | ((in[19] & 0x3) << 40)) + out[27] + out[29] = (in[19] >> 2) & 0x3FFFFFFFFFF + out[28] + out[30] = ((in[19] >> 44) | ((in[20] & 0x3FFFFF) << 20)) + out[29] + out[31] = (in[20] >> 22) + out[30] + out[32] = (in[21] >> 0) & 0x3FFFFFFFFFF + out[31] + out[33] = ((in[21] >> 42) | ((in[22] & 0xFFFFF) << 22)) + out[32] + out[34] = (in[22] >> 20) & 0x3FFFFFFFFFF + out[33] + out[35] = ((in[22] >> 62) | ((in[23] & 0xFFFFFFFFFF) << 2)) + out[34] + out[36] = ((in[23] >> 40) | ((in[24] & 0x3FFFF) << 24)) + out[35] + out[37] = (in[24] >> 18) & 0x3FFFFFFFFFF + out[36] + out[38] = ((in[24] >> 60) | ((in[25] & 0x3FFFFFFFFF) << 4)) + out[37] + out[39] = ((in[25] >> 38) | ((in[26] & 0xFFFF) << 26)) + out[38] + out[40] = (in[26] >> 16) & 0x3FFFFFFFFFF + out[39] + out[41] = ((in[26] >> 58) | ((in[27] & 0xFFFFFFFFF) << 6)) + out[40] + out[42] = ((in[27] >> 36) | ((in[28] & 0x3FFF) << 28)) + out[41] + out[43] = (in[28] >> 14) & 0x3FFFFFFFFFF + out[42] + out[44] = ((in[28] >> 56) | ((in[29] & 0x3FFFFFFFF) << 8)) + out[43] + out[45] = ((in[29] >> 34) | ((in[30] & 0xFFF) << 30)) + out[44] + out[46] = (in[30] >> 12) & 0x3FFFFFFFFFF + out[45] + out[47] = ((in[30] >> 54) | ((in[31] & 0xFFFFFFFF) << 10)) + out[46] + out[48] = ((in[31] >> 32) | ((in[32] & 0x3FF) << 32)) + out[47] + out[49] = (in[32] >> 10) & 0x3FFFFFFFFFF + out[48] + out[50] = ((in[32] >> 52) | ((in[33] & 0x3FFFFFFF) << 12)) + out[49] + out[51] = ((in[33] >> 30) | ((in[34] & 0xFF) << 34)) + out[50] + out[52] = (in[34] >> 8) & 0x3FFFFFFFFFF + out[51] + out[53] = ((in[34] >> 50) | ((in[35] & 0xFFFFFFF) << 14)) + out[52] + out[54] = ((in[35] >> 28) | ((in[36] & 0x3F) << 36)) + out[53] + out[55] = (in[36] >> 6) & 0x3FFFFFFFFFF + out[54] + out[56] = ((in[36] >> 48) | ((in[37] & 0x3FFFFFF) << 16)) + out[55] + out[57] = ((in[37] >> 26) | ((in[38] & 0xF) << 38)) + out[56] + out[58] = (in[38] >> 4) & 0x3FFFFFFFFFF + out[57] + out[59] = ((in[38] >> 46) | ((in[39] & 0xFFFFFF) << 18)) + out[58] + out[60] = ((in[39] >> 24) | ((in[40] & 0x3) << 40)) + out[59] + out[61] = (in[40] >> 2) & 0x3FFFFFFFFFF + out[60] + out[62] = ((in[40] >> 44) | ((in[41] & 0x3FFFFF) << 20)) + out[61] + out[63] = (in[41] >> 22) + out[62] +} + +func deltaunpack_uint64_43(initoffset uint64, in *[43]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFFFF + initoffset + out[1] = ((in[0] >> 43) | ((in[1] & 0x3FFFFF) << 21)) + out[0] + out[2] = ((in[1] >> 22) | ((in[2] & 0x1) << 42)) + out[1] + out[3] = (in[2] >> 1) & 0x7FFFFFFFFFF + out[2] + out[4] = ((in[2] >> 44) | ((in[3] & 0x7FFFFF) << 20)) + out[3] + out[5] = ((in[3] >> 23) | ((in[4] & 0x3) << 41)) + out[4] + out[6] = (in[4] >> 2) & 0x7FFFFFFFFFF + out[5] + out[7] = ((in[4] >> 45) | ((in[5] & 0xFFFFFF) << 19)) + out[6] + out[8] = ((in[5] >> 24) | ((in[6] & 0x7) << 40)) + out[7] + out[9] = (in[6] >> 3) & 0x7FFFFFFFFFF + out[8] + out[10] = ((in[6] >> 46) | ((in[7] & 0x1FFFFFF) << 18)) + out[9] + out[11] = ((in[7] >> 25) | ((in[8] & 0xF) << 39)) + out[10] + out[12] = (in[8] >> 4) & 0x7FFFFFFFFFF + out[11] + out[13] = ((in[8] >> 47) | ((in[9] & 0x3FFFFFF) << 17)) + out[12] + out[14] = ((in[9] >> 26) | ((in[10] & 0x1F) << 38)) + out[13] + out[15] = (in[10] >> 5) & 0x7FFFFFFFFFF + out[14] + out[16] = ((in[10] >> 48) | ((in[11] & 0x7FFFFFF) << 16)) + out[15] + out[17] = ((in[11] >> 27) | ((in[12] & 0x3F) << 37)) + out[16] + out[18] = (in[12] >> 6) & 0x7FFFFFFFFFF + out[17] + out[19] = ((in[12] >> 49) | ((in[13] & 0xFFFFFFF) << 15)) + out[18] + out[20] = ((in[13] >> 28) | ((in[14] & 0x7F) << 36)) + out[19] + out[21] = (in[14] >> 7) & 0x7FFFFFFFFFF + out[20] + out[22] = ((in[14] >> 50) | ((in[15] & 0x1FFFFFFF) << 14)) + out[21] + out[23] = ((in[15] >> 29) | ((in[16] & 0xFF) << 35)) + out[22] + out[24] = (in[16] >> 8) & 0x7FFFFFFFFFF + out[23] + out[25] = ((in[16] >> 51) | ((in[17] & 0x3FFFFFFF) << 13)) + out[24] + out[26] = ((in[17] >> 30) | ((in[18] & 0x1FF) << 34)) + out[25] + out[27] = (in[18] >> 9) & 0x7FFFFFFFFFF + out[26] + out[28] = ((in[18] >> 52) | ((in[19] & 0x7FFFFFFF) << 12)) + out[27] + out[29] = ((in[19] >> 31) | ((in[20] & 0x3FF) << 33)) + out[28] + out[30] = (in[20] >> 10) & 0x7FFFFFFFFFF + out[29] + out[31] = ((in[20] >> 53) | ((in[21] & 0xFFFFFFFF) << 11)) + out[30] + out[32] = ((in[21] >> 32) | ((in[22] & 0x7FF) << 32)) + out[31] + out[33] = (in[22] >> 11) & 0x7FFFFFFFFFF + out[32] + out[34] = ((in[22] >> 54) | ((in[23] & 0x1FFFFFFFF) << 10)) + out[33] + out[35] = ((in[23] >> 33) | ((in[24] & 0xFFF) << 31)) + out[34] + out[36] = (in[24] >> 12) & 0x7FFFFFFFFFF + out[35] + out[37] = ((in[24] >> 55) | ((in[25] & 0x3FFFFFFFF) << 9)) + out[36] + out[38] = ((in[25] >> 34) | ((in[26] & 0x1FFF) << 30)) + out[37] + out[39] = (in[26] >> 13) & 0x7FFFFFFFFFF + out[38] + out[40] = ((in[26] >> 56) | ((in[27] & 0x7FFFFFFFF) << 8)) + out[39] + out[41] = ((in[27] >> 35) | ((in[28] & 0x3FFF) << 29)) + out[40] + out[42] = (in[28] >> 14) & 0x7FFFFFFFFFF + out[41] + out[43] = ((in[28] >> 57) | ((in[29] & 0xFFFFFFFFF) << 7)) + out[42] + out[44] = ((in[29] >> 36) | ((in[30] & 0x7FFF) << 28)) + out[43] + out[45] = (in[30] >> 15) & 0x7FFFFFFFFFF + out[44] + out[46] = ((in[30] >> 58) | ((in[31] & 0x1FFFFFFFFF) << 6)) + out[45] + out[47] = ((in[31] >> 37) | ((in[32] & 0xFFFF) << 27)) + out[46] + out[48] = (in[32] >> 16) & 0x7FFFFFFFFFF + out[47] + out[49] = ((in[32] >> 59) | ((in[33] & 0x3FFFFFFFFF) << 5)) + out[48] + out[50] = ((in[33] >> 38) | ((in[34] & 0x1FFFF) << 26)) + out[49] + out[51] = (in[34] >> 17) & 0x7FFFFFFFFFF + out[50] + out[52] = ((in[34] >> 60) | ((in[35] & 0x7FFFFFFFFF) << 4)) + out[51] + out[53] = ((in[35] >> 39) | ((in[36] & 0x3FFFF) << 25)) + out[52] + out[54] = (in[36] >> 18) & 0x7FFFFFFFFFF + out[53] + out[55] = ((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFF) << 3)) + out[54] + out[56] = ((in[37] >> 40) | ((in[38] & 0x7FFFF) << 24)) + out[55] + out[57] = (in[38] >> 19) & 0x7FFFFFFFFFF + out[56] + out[58] = ((in[38] >> 62) | ((in[39] & 0x1FFFFFFFFFF) << 2)) + out[57] + out[59] = ((in[39] >> 41) | ((in[40] & 0xFFFFF) << 23)) + out[58] + out[60] = (in[40] >> 20) & 0x7FFFFFFFFFF + out[59] + out[61] = ((in[40] >> 63) | ((in[41] & 0x3FFFFFFFFFF) << 1)) + out[60] + out[62] = ((in[41] >> 42) | ((in[42] & 0x1FFFFF) << 22)) + out[61] + out[63] = (in[42] >> 21) + out[62] +} + +func deltaunpack_uint64_44(initoffset uint64, in *[44]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 44) | ((in[1] & 0xFFFFFF) << 20)) + out[0] + out[2] = ((in[1] >> 24) | ((in[2] & 0xF) << 40)) + out[1] + out[3] = (in[2] >> 4) & 0xFFFFFFFFFFF + out[2] + out[4] = ((in[2] >> 48) | ((in[3] & 0xFFFFFFF) << 16)) + out[3] + out[5] = ((in[3] >> 28) | ((in[4] & 0xFF) << 36)) + out[4] + out[6] = (in[4] >> 8) & 0xFFFFFFFFFFF + out[5] + out[7] = ((in[4] >> 52) | ((in[5] & 0xFFFFFFFF) << 12)) + out[6] + out[8] = ((in[5] >> 32) | ((in[6] & 0xFFF) << 32)) + out[7] + out[9] = (in[6] >> 12) & 0xFFFFFFFFFFF + out[8] + out[10] = ((in[6] >> 56) | ((in[7] & 0xFFFFFFFFF) << 8)) + out[9] + out[11] = ((in[7] >> 36) | ((in[8] & 0xFFFF) << 28)) + out[10] + out[12] = (in[8] >> 16) & 0xFFFFFFFFFFF + out[11] + out[13] = ((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFF) << 4)) + out[12] + out[14] = ((in[9] >> 40) | ((in[10] & 0xFFFFF) << 24)) + out[13] + out[15] = (in[10] >> 20) + out[14] + out[16] = (in[11] >> 0) & 0xFFFFFFFFFFF + out[15] + out[17] = ((in[11] >> 44) | ((in[12] & 0xFFFFFF) << 20)) + out[16] + out[18] = ((in[12] >> 24) | ((in[13] & 0xF) << 40)) + out[17] + out[19] = (in[13] >> 4) & 0xFFFFFFFFFFF + out[18] + out[20] = ((in[13] >> 48) | ((in[14] & 0xFFFFFFF) << 16)) + out[19] + out[21] = ((in[14] >> 28) | ((in[15] & 0xFF) << 36)) + out[20] + out[22] = (in[15] >> 8) & 0xFFFFFFFFFFF + out[21] + out[23] = ((in[15] >> 52) | ((in[16] & 0xFFFFFFFF) << 12)) + out[22] + out[24] = ((in[16] >> 32) | ((in[17] & 0xFFF) << 32)) + out[23] + out[25] = (in[17] >> 12) & 0xFFFFFFFFFFF + out[24] + out[26] = ((in[17] >> 56) | ((in[18] & 0xFFFFFFFFF) << 8)) + out[25] + out[27] = ((in[18] >> 36) | ((in[19] & 0xFFFF) << 28)) + out[26] + out[28] = (in[19] >> 16) & 0xFFFFFFFFFFF + out[27] + out[29] = ((in[19] >> 60) | ((in[20] & 0xFFFFFFFFFF) << 4)) + out[28] + out[30] = ((in[20] >> 40) | ((in[21] & 0xFFFFF) << 24)) + out[29] + out[31] = (in[21] >> 20) + out[30] + out[32] = (in[22] >> 0) & 0xFFFFFFFFFFF + out[31] + out[33] = ((in[22] >> 44) | ((in[23] & 0xFFFFFF) << 20)) + out[32] + out[34] = ((in[23] >> 24) | ((in[24] & 0xF) << 40)) + out[33] + out[35] = (in[24] >> 4) & 0xFFFFFFFFFFF + out[34] + out[36] = ((in[24] >> 48) | ((in[25] & 0xFFFFFFF) << 16)) + out[35] + out[37] = ((in[25] >> 28) | ((in[26] & 0xFF) << 36)) + out[36] + out[38] = (in[26] >> 8) & 0xFFFFFFFFFFF + out[37] + out[39] = ((in[26] >> 52) | ((in[27] & 0xFFFFFFFF) << 12)) + out[38] + out[40] = ((in[27] >> 32) | ((in[28] & 0xFFF) << 32)) + out[39] + out[41] = (in[28] >> 12) & 0xFFFFFFFFFFF + out[40] + out[42] = ((in[28] >> 56) | ((in[29] & 0xFFFFFFFFF) << 8)) + out[41] + out[43] = ((in[29] >> 36) | ((in[30] & 0xFFFF) << 28)) + out[42] + out[44] = (in[30] >> 16) & 0xFFFFFFFFFFF + out[43] + out[45] = ((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFF) << 4)) + out[44] + out[46] = ((in[31] >> 40) | ((in[32] & 0xFFFFF) << 24)) + out[45] + out[47] = (in[32] >> 20) + out[46] + out[48] = (in[33] >> 0) & 0xFFFFFFFFFFF + out[47] + out[49] = ((in[33] >> 44) | ((in[34] & 0xFFFFFF) << 20)) + out[48] + out[50] = ((in[34] >> 24) | ((in[35] & 0xF) << 40)) + out[49] + out[51] = (in[35] >> 4) & 0xFFFFFFFFFFF + out[50] + out[52] = ((in[35] >> 48) | ((in[36] & 0xFFFFFFF) << 16)) + out[51] + out[53] = ((in[36] >> 28) | ((in[37] & 0xFF) << 36)) + out[52] + out[54] = (in[37] >> 8) & 0xFFFFFFFFFFF + out[53] + out[55] = ((in[37] >> 52) | ((in[38] & 0xFFFFFFFF) << 12)) + out[54] + out[56] = ((in[38] >> 32) | ((in[39] & 0xFFF) << 32)) + out[55] + out[57] = (in[39] >> 12) & 0xFFFFFFFFFFF + out[56] + out[58] = ((in[39] >> 56) | ((in[40] & 0xFFFFFFFFF) << 8)) + out[57] + out[59] = ((in[40] >> 36) | ((in[41] & 0xFFFF) << 28)) + out[58] + out[60] = (in[41] >> 16) & 0xFFFFFFFFFFF + out[59] + out[61] = ((in[41] >> 60) | ((in[42] & 0xFFFFFFFFFF) << 4)) + out[60] + out[62] = ((in[42] >> 40) | ((in[43] & 0xFFFFF) << 24)) + out[61] + out[63] = (in[43] >> 20) + out[62] +} + +func deltaunpack_uint64_45(initoffset uint64, in *[45]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 45) | ((in[1] & 0x3FFFFFF) << 19)) + out[0] + out[2] = ((in[1] >> 26) | ((in[2] & 0x7F) << 38)) + out[1] + out[3] = (in[2] >> 7) & 0x1FFFFFFFFFFF + out[2] + out[4] = ((in[2] >> 52) | ((in[3] & 0x1FFFFFFFF) << 12)) + out[3] + out[5] = ((in[3] >> 33) | ((in[4] & 0x3FFF) << 31)) + out[4] + out[6] = (in[4] >> 14) & 0x1FFFFFFFFFFF + out[5] + out[7] = ((in[4] >> 59) | ((in[5] & 0xFFFFFFFFFF) << 5)) + out[6] + out[8] = ((in[5] >> 40) | ((in[6] & 0x1FFFFF) << 24)) + out[7] + out[9] = ((in[6] >> 21) | ((in[7] & 0x3) << 43)) + out[8] + out[10] = (in[7] >> 2) & 0x1FFFFFFFFFFF + out[9] + out[11] = ((in[7] >> 47) | ((in[8] & 0xFFFFFFF) << 17)) + out[10] + out[12] = ((in[8] >> 28) | ((in[9] & 0x1FF) << 36)) + out[11] + out[13] = (in[9] >> 9) & 0x1FFFFFFFFFFF + out[12] + out[14] = ((in[9] >> 54) | ((in[10] & 0x7FFFFFFFF) << 10)) + out[13] + out[15] = ((in[10] >> 35) | ((in[11] & 0xFFFF) << 29)) + out[14] + out[16] = (in[11] >> 16) & 0x1FFFFFFFFFFF + out[15] + out[17] = ((in[11] >> 61) | ((in[12] & 0x3FFFFFFFFFF) << 3)) + out[16] + out[18] = ((in[12] >> 42) | ((in[13] & 0x7FFFFF) << 22)) + out[17] + out[19] = ((in[13] >> 23) | ((in[14] & 0xF) << 41)) + out[18] + out[20] = (in[14] >> 4) & 0x1FFFFFFFFFFF + out[19] + out[21] = ((in[14] >> 49) | ((in[15] & 0x3FFFFFFF) << 15)) + out[20] + out[22] = ((in[15] >> 30) | ((in[16] & 0x7FF) << 34)) + out[21] + out[23] = (in[16] >> 11) & 0x1FFFFFFFFFFF + out[22] + out[24] = ((in[16] >> 56) | ((in[17] & 0x1FFFFFFFFF) << 8)) + out[23] + out[25] = ((in[17] >> 37) | ((in[18] & 0x3FFFF) << 27)) + out[24] + out[26] = (in[18] >> 18) & 0x1FFFFFFFFFFF + out[25] + out[27] = ((in[18] >> 63) | ((in[19] & 0xFFFFFFFFFFF) << 1)) + out[26] + out[28] = ((in[19] >> 44) | ((in[20] & 0x1FFFFFF) << 20)) + out[27] + out[29] = ((in[20] >> 25) | ((in[21] & 0x3F) << 39)) + out[28] + out[30] = (in[21] >> 6) & 0x1FFFFFFFFFFF + out[29] + out[31] = ((in[21] >> 51) | ((in[22] & 0xFFFFFFFF) << 13)) + out[30] + out[32] = ((in[22] >> 32) | ((in[23] & 0x1FFF) << 32)) + out[31] + out[33] = (in[23] >> 13) & 0x1FFFFFFFFFFF + out[32] + out[34] = ((in[23] >> 58) | ((in[24] & 0x7FFFFFFFFF) << 6)) + out[33] + out[35] = ((in[24] >> 39) | ((in[25] & 0xFFFFF) << 25)) + out[34] + out[36] = ((in[25] >> 20) | ((in[26] & 0x1) << 44)) + out[35] + out[37] = (in[26] >> 1) & 0x1FFFFFFFFFFF + out[36] + out[38] = ((in[26] >> 46) | ((in[27] & 0x7FFFFFF) << 18)) + out[37] + out[39] = ((in[27] >> 27) | ((in[28] & 0xFF) << 37)) + out[38] + out[40] = (in[28] >> 8) & 0x1FFFFFFFFFFF + out[39] + out[41] = ((in[28] >> 53) | ((in[29] & 0x3FFFFFFFF) << 11)) + out[40] + out[42] = ((in[29] >> 34) | ((in[30] & 0x7FFF) << 30)) + out[41] + out[43] = (in[30] >> 15) & 0x1FFFFFFFFFFF + out[42] + out[44] = ((in[30] >> 60) | ((in[31] & 0x1FFFFFFFFFF) << 4)) + out[43] + out[45] = ((in[31] >> 41) | ((in[32] & 0x3FFFFF) << 23)) + out[44] + out[46] = ((in[32] >> 22) | ((in[33] & 0x7) << 42)) + out[45] + out[47] = (in[33] >> 3) & 0x1FFFFFFFFFFF + out[46] + out[48] = ((in[33] >> 48) | ((in[34] & 0x1FFFFFFF) << 16)) + out[47] + out[49] = ((in[34] >> 29) | ((in[35] & 0x3FF) << 35)) + out[48] + out[50] = (in[35] >> 10) & 0x1FFFFFFFFFFF + out[49] + out[51] = ((in[35] >> 55) | ((in[36] & 0xFFFFFFFFF) << 9)) + out[50] + out[52] = ((in[36] >> 36) | ((in[37] & 0x1FFFF) << 28)) + out[51] + out[53] = (in[37] >> 17) & 0x1FFFFFFFFFFF + out[52] + out[54] = ((in[37] >> 62) | ((in[38] & 0x7FFFFFFFFFF) << 2)) + out[53] + out[55] = ((in[38] >> 43) | ((in[39] & 0xFFFFFF) << 21)) + out[54] + out[56] = ((in[39] >> 24) | ((in[40] & 0x1F) << 40)) + out[55] + out[57] = (in[40] >> 5) & 0x1FFFFFFFFFFF + out[56] + out[58] = ((in[40] >> 50) | ((in[41] & 0x7FFFFFFF) << 14)) + out[57] + out[59] = ((in[41] >> 31) | ((in[42] & 0xFFF) << 33)) + out[58] + out[60] = (in[42] >> 12) & 0x1FFFFFFFFFFF + out[59] + out[61] = ((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFF) << 7)) + out[60] + out[62] = ((in[43] >> 38) | ((in[44] & 0x7FFFF) << 26)) + out[61] + out[63] = (in[44] >> 19) + out[62] +} + +func deltaunpack_uint64_46(initoffset uint64, in *[46]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 46) | ((in[1] & 0xFFFFFFF) << 18)) + out[0] + out[2] = ((in[1] >> 28) | ((in[2] & 0x3FF) << 36)) + out[1] + out[3] = (in[2] >> 10) & 0x3FFFFFFFFFFF + out[2] + out[4] = ((in[2] >> 56) | ((in[3] & 0x3FFFFFFFFF) << 8)) + out[3] + out[5] = ((in[3] >> 38) | ((in[4] & 0xFFFFF) << 26)) + out[4] + out[6] = ((in[4] >> 20) | ((in[5] & 0x3) << 44)) + out[5] + out[7] = (in[5] >> 2) & 0x3FFFFFFFFFFF + out[6] + out[8] = ((in[5] >> 48) | ((in[6] & 0x3FFFFFFF) << 16)) + out[7] + out[9] = ((in[6] >> 30) | ((in[7] & 0xFFF) << 34)) + out[8] + out[10] = (in[7] >> 12) & 0x3FFFFFFFFFFF + out[9] + out[11] = ((in[7] >> 58) | ((in[8] & 0xFFFFFFFFFF) << 6)) + out[10] + out[12] = ((in[8] >> 40) | ((in[9] & 0x3FFFFF) << 24)) + out[11] + out[13] = ((in[9] >> 22) | ((in[10] & 0xF) << 42)) + out[12] + out[14] = (in[10] >> 4) & 0x3FFFFFFFFFFF + out[13] + out[15] = ((in[10] >> 50) | ((in[11] & 0xFFFFFFFF) << 14)) + out[14] + out[16] = ((in[11] >> 32) | ((in[12] & 0x3FFF) << 32)) + out[15] + out[17] = (in[12] >> 14) & 0x3FFFFFFFFFFF + out[16] + out[18] = ((in[12] >> 60) | ((in[13] & 0x3FFFFFFFFFF) << 4)) + out[17] + out[19] = ((in[13] >> 42) | ((in[14] & 0xFFFFFF) << 22)) + out[18] + out[20] = ((in[14] >> 24) | ((in[15] & 0x3F) << 40)) + out[19] + out[21] = (in[15] >> 6) & 0x3FFFFFFFFFFF + out[20] + out[22] = ((in[15] >> 52) | ((in[16] & 0x3FFFFFFFF) << 12)) + out[21] + out[23] = ((in[16] >> 34) | ((in[17] & 0xFFFF) << 30)) + out[22] + out[24] = (in[17] >> 16) & 0x3FFFFFFFFFFF + out[23] + out[25] = ((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFF) << 2)) + out[24] + out[26] = ((in[18] >> 44) | ((in[19] & 0x3FFFFFF) << 20)) + out[25] + out[27] = ((in[19] >> 26) | ((in[20] & 0xFF) << 38)) + out[26] + out[28] = (in[20] >> 8) & 0x3FFFFFFFFFFF + out[27] + out[29] = ((in[20] >> 54) | ((in[21] & 0xFFFFFFFFF) << 10)) + out[28] + out[30] = ((in[21] >> 36) | ((in[22] & 0x3FFFF) << 28)) + out[29] + out[31] = (in[22] >> 18) + out[30] + out[32] = (in[23] >> 0) & 0x3FFFFFFFFFFF + out[31] + out[33] = ((in[23] >> 46) | ((in[24] & 0xFFFFFFF) << 18)) + out[32] + out[34] = ((in[24] >> 28) | ((in[25] & 0x3FF) << 36)) + out[33] + out[35] = (in[25] >> 10) & 0x3FFFFFFFFFFF + out[34] + out[36] = ((in[25] >> 56) | ((in[26] & 0x3FFFFFFFFF) << 8)) + out[35] + out[37] = ((in[26] >> 38) | ((in[27] & 0xFFFFF) << 26)) + out[36] + out[38] = ((in[27] >> 20) | ((in[28] & 0x3) << 44)) + out[37] + out[39] = (in[28] >> 2) & 0x3FFFFFFFFFFF + out[38] + out[40] = ((in[28] >> 48) | ((in[29] & 0x3FFFFFFF) << 16)) + out[39] + out[41] = ((in[29] >> 30) | ((in[30] & 0xFFF) << 34)) + out[40] + out[42] = (in[30] >> 12) & 0x3FFFFFFFFFFF + out[41] + out[43] = ((in[30] >> 58) | ((in[31] & 0xFFFFFFFFFF) << 6)) + out[42] + out[44] = ((in[31] >> 40) | ((in[32] & 0x3FFFFF) << 24)) + out[43] + out[45] = ((in[32] >> 22) | ((in[33] & 0xF) << 42)) + out[44] + out[46] = (in[33] >> 4) & 0x3FFFFFFFFFFF + out[45] + out[47] = ((in[33] >> 50) | ((in[34] & 0xFFFFFFFF) << 14)) + out[46] + out[48] = ((in[34] >> 32) | ((in[35] & 0x3FFF) << 32)) + out[47] + out[49] = (in[35] >> 14) & 0x3FFFFFFFFFFF + out[48] + out[50] = ((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFF) << 4)) + out[49] + out[51] = ((in[36] >> 42) | ((in[37] & 0xFFFFFF) << 22)) + out[50] + out[52] = ((in[37] >> 24) | ((in[38] & 0x3F) << 40)) + out[51] + out[53] = (in[38] >> 6) & 0x3FFFFFFFFFFF + out[52] + out[54] = ((in[38] >> 52) | ((in[39] & 0x3FFFFFFFF) << 12)) + out[53] + out[55] = ((in[39] >> 34) | ((in[40] & 0xFFFF) << 30)) + out[54] + out[56] = (in[40] >> 16) & 0x3FFFFFFFFFFF + out[55] + out[57] = ((in[40] >> 62) | ((in[41] & 0xFFFFFFFFFFF) << 2)) + out[56] + out[58] = ((in[41] >> 44) | ((in[42] & 0x3FFFFFF) << 20)) + out[57] + out[59] = ((in[42] >> 26) | ((in[43] & 0xFF) << 38)) + out[58] + out[60] = (in[43] >> 8) & 0x3FFFFFFFFFFF + out[59] + out[61] = ((in[43] >> 54) | ((in[44] & 0xFFFFFFFFF) << 10)) + out[60] + out[62] = ((in[44] >> 36) | ((in[45] & 0x3FFFF) << 28)) + out[61] + out[63] = (in[45] >> 18) + out[62] +} + +func deltaunpack_uint64_47(initoffset uint64, in *[47]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 47) | ((in[1] & 0x3FFFFFFF) << 17)) + out[0] + out[2] = ((in[1] >> 30) | ((in[2] & 0x1FFF) << 34)) + out[1] + out[3] = (in[2] >> 13) & 0x7FFFFFFFFFFF + out[2] + out[4] = ((in[2] >> 60) | ((in[3] & 0x7FFFFFFFFFF) << 4)) + out[3] + out[5] = ((in[3] >> 43) | ((in[4] & 0x3FFFFFF) << 21)) + out[4] + out[6] = ((in[4] >> 26) | ((in[5] & 0x1FF) << 38)) + out[5] + out[7] = (in[5] >> 9) & 0x7FFFFFFFFFFF + out[6] + out[8] = ((in[5] >> 56) | ((in[6] & 0x7FFFFFFFFF) << 8)) + out[7] + out[9] = ((in[6] >> 39) | ((in[7] & 0x3FFFFF) << 25)) + out[8] + out[10] = ((in[7] >> 22) | ((in[8] & 0x1F) << 42)) + out[9] + out[11] = (in[8] >> 5) & 0x7FFFFFFFFFFF + out[10] + out[12] = ((in[8] >> 52) | ((in[9] & 0x7FFFFFFFF) << 12)) + out[11] + out[13] = ((in[9] >> 35) | ((in[10] & 0x3FFFF) << 29)) + out[12] + out[14] = ((in[10] >> 18) | ((in[11] & 0x1) << 46)) + out[13] + out[15] = (in[11] >> 1) & 0x7FFFFFFFFFFF + out[14] + out[16] = ((in[11] >> 48) | ((in[12] & 0x7FFFFFFF) << 16)) + out[15] + out[17] = ((in[12] >> 31) | ((in[13] & 0x3FFF) << 33)) + out[16] + out[18] = (in[13] >> 14) & 0x7FFFFFFFFFFF + out[17] + out[19] = ((in[13] >> 61) | ((in[14] & 0xFFFFFFFFFFF) << 3)) + out[18] + out[20] = ((in[14] >> 44) | ((in[15] & 0x7FFFFFF) << 20)) + out[19] + out[21] = ((in[15] >> 27) | ((in[16] & 0x3FF) << 37)) + out[20] + out[22] = (in[16] >> 10) & 0x7FFFFFFFFFFF + out[21] + out[23] = ((in[16] >> 57) | ((in[17] & 0xFFFFFFFFFF) << 7)) + out[22] + out[24] = ((in[17] >> 40) | ((in[18] & 0x7FFFFF) << 24)) + out[23] + out[25] = ((in[18] >> 23) | ((in[19] & 0x3F) << 41)) + out[24] + out[26] = (in[19] >> 6) & 0x7FFFFFFFFFFF + out[25] + out[27] = ((in[19] >> 53) | ((in[20] & 0xFFFFFFFFF) << 11)) + out[26] + out[28] = ((in[20] >> 36) | ((in[21] & 0x7FFFF) << 28)) + out[27] + out[29] = ((in[21] >> 19) | ((in[22] & 0x3) << 45)) + out[28] + out[30] = (in[22] >> 2) & 0x7FFFFFFFFFFF + out[29] + out[31] = ((in[22] >> 49) | ((in[23] & 0xFFFFFFFF) << 15)) + out[30] + out[32] = ((in[23] >> 32) | ((in[24] & 0x7FFF) << 32)) + out[31] + out[33] = (in[24] >> 15) & 0x7FFFFFFFFFFF + out[32] + out[34] = ((in[24] >> 62) | ((in[25] & 0x1FFFFFFFFFFF) << 2)) + out[33] + out[35] = ((in[25] >> 45) | ((in[26] & 0xFFFFFFF) << 19)) + out[34] + out[36] = ((in[26] >> 28) | ((in[27] & 0x7FF) << 36)) + out[35] + out[37] = (in[27] >> 11) & 0x7FFFFFFFFFFF + out[36] + out[38] = ((in[27] >> 58) | ((in[28] & 0x1FFFFFFFFFF) << 6)) + out[37] + out[39] = ((in[28] >> 41) | ((in[29] & 0xFFFFFF) << 23)) + out[38] + out[40] = ((in[29] >> 24) | ((in[30] & 0x7F) << 40)) + out[39] + out[41] = (in[30] >> 7) & 0x7FFFFFFFFFFF + out[40] + out[42] = ((in[30] >> 54) | ((in[31] & 0x1FFFFFFFFF) << 10)) + out[41] + out[43] = ((in[31] >> 37) | ((in[32] & 0xFFFFF) << 27)) + out[42] + out[44] = ((in[32] >> 20) | ((in[33] & 0x7) << 44)) + out[43] + out[45] = (in[33] >> 3) & 0x7FFFFFFFFFFF + out[44] + out[46] = ((in[33] >> 50) | ((in[34] & 0x1FFFFFFFF) << 14)) + out[45] + out[47] = ((in[34] >> 33) | ((in[35] & 0xFFFF) << 31)) + out[46] + out[48] = (in[35] >> 16) & 0x7FFFFFFFFFFF + out[47] + out[49] = ((in[35] >> 63) | ((in[36] & 0x3FFFFFFFFFFF) << 1)) + out[48] + out[50] = ((in[36] >> 46) | ((in[37] & 0x1FFFFFFF) << 18)) + out[49] + out[51] = ((in[37] >> 29) | ((in[38] & 0xFFF) << 35)) + out[50] + out[52] = (in[38] >> 12) & 0x7FFFFFFFFFFF + out[51] + out[53] = ((in[38] >> 59) | ((in[39] & 0x3FFFFFFFFFF) << 5)) + out[52] + out[54] = ((in[39] >> 42) | ((in[40] & 0x1FFFFFF) << 22)) + out[53] + out[55] = ((in[40] >> 25) | ((in[41] & 0xFF) << 39)) + out[54] + out[56] = (in[41] >> 8) & 0x7FFFFFFFFFFF + out[55] + out[57] = ((in[41] >> 55) | ((in[42] & 0x3FFFFFFFFF) << 9)) + out[56] + out[58] = ((in[42] >> 38) | ((in[43] & 0x1FFFFF) << 26)) + out[57] + out[59] = ((in[43] >> 21) | ((in[44] & 0xF) << 43)) + out[58] + out[60] = (in[44] >> 4) & 0x7FFFFFFFFFFF + out[59] + out[61] = ((in[44] >> 51) | ((in[45] & 0x3FFFFFFFF) << 13)) + out[60] + out[62] = ((in[45] >> 34) | ((in[46] & 0x1FFFF) << 30)) + out[61] + out[63] = (in[46] >> 17) + out[62] +} + +func deltaunpack_uint64_48(initoffset uint64, in *[48]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 48) | ((in[1] & 0xFFFFFFFF) << 16)) + out[0] + out[2] = ((in[1] >> 32) | ((in[2] & 0xFFFF) << 32)) + out[1] + out[3] = (in[2] >> 16) + out[2] + out[4] = (in[3] >> 0) & 0xFFFFFFFFFFFF + out[3] + out[5] = ((in[3] >> 48) | ((in[4] & 0xFFFFFFFF) << 16)) + out[4] + out[6] = ((in[4] >> 32) | ((in[5] & 0xFFFF) << 32)) + out[5] + out[7] = (in[5] >> 16) + out[6] + out[8] = (in[6] >> 0) & 0xFFFFFFFFFFFF + out[7] + out[9] = ((in[6] >> 48) | ((in[7] & 0xFFFFFFFF) << 16)) + out[8] + out[10] = ((in[7] >> 32) | ((in[8] & 0xFFFF) << 32)) + out[9] + out[11] = (in[8] >> 16) + out[10] + out[12] = (in[9] >> 0) & 0xFFFFFFFFFFFF + out[11] + out[13] = ((in[9] >> 48) | ((in[10] & 0xFFFFFFFF) << 16)) + out[12] + out[14] = ((in[10] >> 32) | ((in[11] & 0xFFFF) << 32)) + out[13] + out[15] = (in[11] >> 16) + out[14] + out[16] = (in[12] >> 0) & 0xFFFFFFFFFFFF + out[15] + out[17] = ((in[12] >> 48) | ((in[13] & 0xFFFFFFFF) << 16)) + out[16] + out[18] = ((in[13] >> 32) | ((in[14] & 0xFFFF) << 32)) + out[17] + out[19] = (in[14] >> 16) + out[18] + out[20] = (in[15] >> 0) & 0xFFFFFFFFFFFF + out[19] + out[21] = ((in[15] >> 48) | ((in[16] & 0xFFFFFFFF) << 16)) + out[20] + out[22] = ((in[16] >> 32) | ((in[17] & 0xFFFF) << 32)) + out[21] + out[23] = (in[17] >> 16) + out[22] + out[24] = (in[18] >> 0) & 0xFFFFFFFFFFFF + out[23] + out[25] = ((in[18] >> 48) | ((in[19] & 0xFFFFFFFF) << 16)) + out[24] + out[26] = ((in[19] >> 32) | ((in[20] & 0xFFFF) << 32)) + out[25] + out[27] = (in[20] >> 16) + out[26] + out[28] = (in[21] >> 0) & 0xFFFFFFFFFFFF + out[27] + out[29] = ((in[21] >> 48) | ((in[22] & 0xFFFFFFFF) << 16)) + out[28] + out[30] = ((in[22] >> 32) | ((in[23] & 0xFFFF) << 32)) + out[29] + out[31] = (in[23] >> 16) + out[30] + out[32] = (in[24] >> 0) & 0xFFFFFFFFFFFF + out[31] + out[33] = ((in[24] >> 48) | ((in[25] & 0xFFFFFFFF) << 16)) + out[32] + out[34] = ((in[25] >> 32) | ((in[26] & 0xFFFF) << 32)) + out[33] + out[35] = (in[26] >> 16) + out[34] + out[36] = (in[27] >> 0) & 0xFFFFFFFFFFFF + out[35] + out[37] = ((in[27] >> 48) | ((in[28] & 0xFFFFFFFF) << 16)) + out[36] + out[38] = ((in[28] >> 32) | ((in[29] & 0xFFFF) << 32)) + out[37] + out[39] = (in[29] >> 16) + out[38] + out[40] = (in[30] >> 0) & 0xFFFFFFFFFFFF + out[39] + out[41] = ((in[30] >> 48) | ((in[31] & 0xFFFFFFFF) << 16)) + out[40] + out[42] = ((in[31] >> 32) | ((in[32] & 0xFFFF) << 32)) + out[41] + out[43] = (in[32] >> 16) + out[42] + out[44] = (in[33] >> 0) & 0xFFFFFFFFFFFF + out[43] + out[45] = ((in[33] >> 48) | ((in[34] & 0xFFFFFFFF) << 16)) + out[44] + out[46] = ((in[34] >> 32) | ((in[35] & 0xFFFF) << 32)) + out[45] + out[47] = (in[35] >> 16) + out[46] + out[48] = (in[36] >> 0) & 0xFFFFFFFFFFFF + out[47] + out[49] = ((in[36] >> 48) | ((in[37] & 0xFFFFFFFF) << 16)) + out[48] + out[50] = ((in[37] >> 32) | ((in[38] & 0xFFFF) << 32)) + out[49] + out[51] = (in[38] >> 16) + out[50] + out[52] = (in[39] >> 0) & 0xFFFFFFFFFFFF + out[51] + out[53] = ((in[39] >> 48) | ((in[40] & 0xFFFFFFFF) << 16)) + out[52] + out[54] = ((in[40] >> 32) | ((in[41] & 0xFFFF) << 32)) + out[53] + out[55] = (in[41] >> 16) + out[54] + out[56] = (in[42] >> 0) & 0xFFFFFFFFFFFF + out[55] + out[57] = ((in[42] >> 48) | ((in[43] & 0xFFFFFFFF) << 16)) + out[56] + out[58] = ((in[43] >> 32) | ((in[44] & 0xFFFF) << 32)) + out[57] + out[59] = (in[44] >> 16) + out[58] + out[60] = (in[45] >> 0) & 0xFFFFFFFFFFFF + out[59] + out[61] = ((in[45] >> 48) | ((in[46] & 0xFFFFFFFF) << 16)) + out[60] + out[62] = ((in[46] >> 32) | ((in[47] & 0xFFFF) << 32)) + out[61] + out[63] = (in[47] >> 16) + out[62] +} + +func deltaunpack_uint64_49(initoffset uint64, in *[49]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 49) | ((in[1] & 0x3FFFFFFFF) << 15)) + out[0] + out[2] = ((in[1] >> 34) | ((in[2] & 0x7FFFF) << 30)) + out[1] + out[3] = ((in[2] >> 19) | ((in[3] & 0xF) << 45)) + out[2] + out[4] = (in[3] >> 4) & 0x1FFFFFFFFFFFF + out[3] + out[5] = ((in[3] >> 53) | ((in[4] & 0x3FFFFFFFFF) << 11)) + out[4] + out[6] = ((in[4] >> 38) | ((in[5] & 0x7FFFFF) << 26)) + out[5] + out[7] = ((in[5] >> 23) | ((in[6] & 0xFF) << 41)) + out[6] + out[8] = (in[6] >> 8) & 0x1FFFFFFFFFFFF + out[7] + out[9] = ((in[6] >> 57) | ((in[7] & 0x3FFFFFFFFFF) << 7)) + out[8] + out[10] = ((in[7] >> 42) | ((in[8] & 0x7FFFFFF) << 22)) + out[9] + out[11] = ((in[8] >> 27) | ((in[9] & 0xFFF) << 37)) + out[10] + out[12] = (in[9] >> 12) & 0x1FFFFFFFFFFFF + out[11] + out[13] = ((in[9] >> 61) | ((in[10] & 0x3FFFFFFFFFFF) << 3)) + out[12] + out[14] = ((in[10] >> 46) | ((in[11] & 0x7FFFFFFF) << 18)) + out[13] + out[15] = ((in[11] >> 31) | ((in[12] & 0xFFFF) << 33)) + out[14] + out[16] = ((in[12] >> 16) | ((in[13] & 0x1) << 48)) + out[15] + out[17] = (in[13] >> 1) & 0x1FFFFFFFFFFFF + out[16] + out[18] = ((in[13] >> 50) | ((in[14] & 0x7FFFFFFFF) << 14)) + out[17] + out[19] = ((in[14] >> 35) | ((in[15] & 0xFFFFF) << 29)) + out[18] + out[20] = ((in[15] >> 20) | ((in[16] & 0x1F) << 44)) + out[19] + out[21] = (in[16] >> 5) & 0x1FFFFFFFFFFFF + out[20] + out[22] = ((in[16] >> 54) | ((in[17] & 0x7FFFFFFFFF) << 10)) + out[21] + out[23] = ((in[17] >> 39) | ((in[18] & 0xFFFFFF) << 25)) + out[22] + out[24] = ((in[18] >> 24) | ((in[19] & 0x1FF) << 40)) + out[23] + out[25] = (in[19] >> 9) & 0x1FFFFFFFFFFFF + out[24] + out[26] = ((in[19] >> 58) | ((in[20] & 0x7FFFFFFFFFF) << 6)) + out[25] + out[27] = ((in[20] >> 43) | ((in[21] & 0xFFFFFFF) << 21)) + out[26] + out[28] = ((in[21] >> 28) | ((in[22] & 0x1FFF) << 36)) + out[27] + out[29] = (in[22] >> 13) & 0x1FFFFFFFFFFFF + out[28] + out[30] = ((in[22] >> 62) | ((in[23] & 0x7FFFFFFFFFFF) << 2)) + out[29] + out[31] = ((in[23] >> 47) | ((in[24] & 0xFFFFFFFF) << 17)) + out[30] + out[32] = ((in[24] >> 32) | ((in[25] & 0x1FFFF) << 32)) + out[31] + out[33] = ((in[25] >> 17) | ((in[26] & 0x3) << 47)) + out[32] + out[34] = (in[26] >> 2) & 0x1FFFFFFFFFFFF + out[33] + out[35] = ((in[26] >> 51) | ((in[27] & 0xFFFFFFFFF) << 13)) + out[34] + out[36] = ((in[27] >> 36) | ((in[28] & 0x1FFFFF) << 28)) + out[35] + out[37] = ((in[28] >> 21) | ((in[29] & 0x3F) << 43)) + out[36] + out[38] = (in[29] >> 6) & 0x1FFFFFFFFFFFF + out[37] + out[39] = ((in[29] >> 55) | ((in[30] & 0xFFFFFFFFFF) << 9)) + out[38] + out[40] = ((in[30] >> 40) | ((in[31] & 0x1FFFFFF) << 24)) + out[39] + out[41] = ((in[31] >> 25) | ((in[32] & 0x3FF) << 39)) + out[40] + out[42] = (in[32] >> 10) & 0x1FFFFFFFFFFFF + out[41] + out[43] = ((in[32] >> 59) | ((in[33] & 0xFFFFFFFFFFF) << 5)) + out[42] + out[44] = ((in[33] >> 44) | ((in[34] & 0x1FFFFFFF) << 20)) + out[43] + out[45] = ((in[34] >> 29) | ((in[35] & 0x3FFF) << 35)) + out[44] + out[46] = (in[35] >> 14) & 0x1FFFFFFFFFFFF + out[45] + out[47] = ((in[35] >> 63) | ((in[36] & 0xFFFFFFFFFFFF) << 1)) + out[46] + out[48] = ((in[36] >> 48) | ((in[37] & 0x1FFFFFFFF) << 16)) + out[47] + out[49] = ((in[37] >> 33) | ((in[38] & 0x3FFFF) << 31)) + out[48] + out[50] = ((in[38] >> 18) | ((in[39] & 0x7) << 46)) + out[49] + out[51] = (in[39] >> 3) & 0x1FFFFFFFFFFFF + out[50] + out[52] = ((in[39] >> 52) | ((in[40] & 0x1FFFFFFFFF) << 12)) + out[51] + out[53] = ((in[40] >> 37) | ((in[41] & 0x3FFFFF) << 27)) + out[52] + out[54] = ((in[41] >> 22) | ((in[42] & 0x7F) << 42)) + out[53] + out[55] = (in[42] >> 7) & 0x1FFFFFFFFFFFF + out[54] + out[56] = ((in[42] >> 56) | ((in[43] & 0x1FFFFFFFFFF) << 8)) + out[55] + out[57] = ((in[43] >> 41) | ((in[44] & 0x3FFFFFF) << 23)) + out[56] + out[58] = ((in[44] >> 26) | ((in[45] & 0x7FF) << 38)) + out[57] + out[59] = (in[45] >> 11) & 0x1FFFFFFFFFFFF + out[58] + out[60] = ((in[45] >> 60) | ((in[46] & 0x1FFFFFFFFFFF) << 4)) + out[59] + out[61] = ((in[46] >> 45) | ((in[47] & 0x3FFFFFFF) << 19)) + out[60] + out[62] = ((in[47] >> 30) | ((in[48] & 0x7FFF) << 34)) + out[61] + out[63] = (in[48] >> 15) + out[62] +} + +func deltaunpack_uint64_50(initoffset uint64, in *[50]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 50) | ((in[1] & 0xFFFFFFFFF) << 14)) + out[0] + out[2] = ((in[1] >> 36) | ((in[2] & 0x3FFFFF) << 28)) + out[1] + out[3] = ((in[2] >> 22) | ((in[3] & 0xFF) << 42)) + out[2] + out[4] = (in[3] >> 8) & 0x3FFFFFFFFFFFF + out[3] + out[5] = ((in[3] >> 58) | ((in[4] & 0xFFFFFFFFFFF) << 6)) + out[4] + out[6] = ((in[4] >> 44) | ((in[5] & 0x3FFFFFFF) << 20)) + out[5] + out[7] = ((in[5] >> 30) | ((in[6] & 0xFFFF) << 34)) + out[6] + out[8] = ((in[6] >> 16) | ((in[7] & 0x3) << 48)) + out[7] + out[9] = (in[7] >> 2) & 0x3FFFFFFFFFFFF + out[8] + out[10] = ((in[7] >> 52) | ((in[8] & 0x3FFFFFFFFF) << 12)) + out[9] + out[11] = ((in[8] >> 38) | ((in[9] & 0xFFFFFF) << 26)) + out[10] + out[12] = ((in[9] >> 24) | ((in[10] & 0x3FF) << 40)) + out[11] + out[13] = (in[10] >> 10) & 0x3FFFFFFFFFFFF + out[12] + out[14] = ((in[10] >> 60) | ((in[11] & 0x3FFFFFFFFFFF) << 4)) + out[13] + out[15] = ((in[11] >> 46) | ((in[12] & 0xFFFFFFFF) << 18)) + out[14] + out[16] = ((in[12] >> 32) | ((in[13] & 0x3FFFF) << 32)) + out[15] + out[17] = ((in[13] >> 18) | ((in[14] & 0xF) << 46)) + out[16] + out[18] = (in[14] >> 4) & 0x3FFFFFFFFFFFF + out[17] + out[19] = ((in[14] >> 54) | ((in[15] & 0xFFFFFFFFFF) << 10)) + out[18] + out[20] = ((in[15] >> 40) | ((in[16] & 0x3FFFFFF) << 24)) + out[19] + out[21] = ((in[16] >> 26) | ((in[17] & 0xFFF) << 38)) + out[20] + out[22] = (in[17] >> 12) & 0x3FFFFFFFFFFFF + out[21] + out[23] = ((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFFF) << 2)) + out[22] + out[24] = ((in[18] >> 48) | ((in[19] & 0x3FFFFFFFF) << 16)) + out[23] + out[25] = ((in[19] >> 34) | ((in[20] & 0xFFFFF) << 30)) + out[24] + out[26] = ((in[20] >> 20) | ((in[21] & 0x3F) << 44)) + out[25] + out[27] = (in[21] >> 6) & 0x3FFFFFFFFFFFF + out[26] + out[28] = ((in[21] >> 56) | ((in[22] & 0x3FFFFFFFFFF) << 8)) + out[27] + out[29] = ((in[22] >> 42) | ((in[23] & 0xFFFFFFF) << 22)) + out[28] + out[30] = ((in[23] >> 28) | ((in[24] & 0x3FFF) << 36)) + out[29] + out[31] = (in[24] >> 14) + out[30] + out[32] = (in[25] >> 0) & 0x3FFFFFFFFFFFF + out[31] + out[33] = ((in[25] >> 50) | ((in[26] & 0xFFFFFFFFF) << 14)) + out[32] + out[34] = ((in[26] >> 36) | ((in[27] & 0x3FFFFF) << 28)) + out[33] + out[35] = ((in[27] >> 22) | ((in[28] & 0xFF) << 42)) + out[34] + out[36] = (in[28] >> 8) & 0x3FFFFFFFFFFFF + out[35] + out[37] = ((in[28] >> 58) | ((in[29] & 0xFFFFFFFFFFF) << 6)) + out[36] + out[38] = ((in[29] >> 44) | ((in[30] & 0x3FFFFFFF) << 20)) + out[37] + out[39] = ((in[30] >> 30) | ((in[31] & 0xFFFF) << 34)) + out[38] + out[40] = ((in[31] >> 16) | ((in[32] & 0x3) << 48)) + out[39] + out[41] = (in[32] >> 2) & 0x3FFFFFFFFFFFF + out[40] + out[42] = ((in[32] >> 52) | ((in[33] & 0x3FFFFFFFFF) << 12)) + out[41] + out[43] = ((in[33] >> 38) | ((in[34] & 0xFFFFFF) << 26)) + out[42] + out[44] = ((in[34] >> 24) | ((in[35] & 0x3FF) << 40)) + out[43] + out[45] = (in[35] >> 10) & 0x3FFFFFFFFFFFF + out[44] + out[46] = ((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFFF) << 4)) + out[45] + out[47] = ((in[36] >> 46) | ((in[37] & 0xFFFFFFFF) << 18)) + out[46] + out[48] = ((in[37] >> 32) | ((in[38] & 0x3FFFF) << 32)) + out[47] + out[49] = ((in[38] >> 18) | ((in[39] & 0xF) << 46)) + out[48] + out[50] = (in[39] >> 4) & 0x3FFFFFFFFFFFF + out[49] + out[51] = ((in[39] >> 54) | ((in[40] & 0xFFFFFFFFFF) << 10)) + out[50] + out[52] = ((in[40] >> 40) | ((in[41] & 0x3FFFFFF) << 24)) + out[51] + out[53] = ((in[41] >> 26) | ((in[42] & 0xFFF) << 38)) + out[52] + out[54] = (in[42] >> 12) & 0x3FFFFFFFFFFFF + out[53] + out[55] = ((in[42] >> 62) | ((in[43] & 0xFFFFFFFFFFFF) << 2)) + out[54] + out[56] = ((in[43] >> 48) | ((in[44] & 0x3FFFFFFFF) << 16)) + out[55] + out[57] = ((in[44] >> 34) | ((in[45] & 0xFFFFF) << 30)) + out[56] + out[58] = ((in[45] >> 20) | ((in[46] & 0x3F) << 44)) + out[57] + out[59] = (in[46] >> 6) & 0x3FFFFFFFFFFFF + out[58] + out[60] = ((in[46] >> 56) | ((in[47] & 0x3FFFFFFFFFF) << 8)) + out[59] + out[61] = ((in[47] >> 42) | ((in[48] & 0xFFFFFFF) << 22)) + out[60] + out[62] = ((in[48] >> 28) | ((in[49] & 0x3FFF) << 36)) + out[61] + out[63] = (in[49] >> 14) + out[62] +} + +func deltaunpack_uint64_51(initoffset uint64, in *[51]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 51) | ((in[1] & 0x3FFFFFFFFF) << 13)) + out[0] + out[2] = ((in[1] >> 38) | ((in[2] & 0x1FFFFFF) << 26)) + out[1] + out[3] = ((in[2] >> 25) | ((in[3] & 0xFFF) << 39)) + out[2] + out[4] = (in[3] >> 12) & 0x7FFFFFFFFFFFF + out[3] + out[5] = ((in[3] >> 63) | ((in[4] & 0x3FFFFFFFFFFFF) << 1)) + out[4] + out[6] = ((in[4] >> 50) | ((in[5] & 0x1FFFFFFFFF) << 14)) + out[5] + out[7] = ((in[5] >> 37) | ((in[6] & 0xFFFFFF) << 27)) + out[6] + out[8] = ((in[6] >> 24) | ((in[7] & 0x7FF) << 40)) + out[7] + out[9] = (in[7] >> 11) & 0x7FFFFFFFFFFFF + out[8] + out[10] = ((in[7] >> 62) | ((in[8] & 0x1FFFFFFFFFFFF) << 2)) + out[9] + out[11] = ((in[8] >> 49) | ((in[9] & 0xFFFFFFFFF) << 15)) + out[10] + out[12] = ((in[9] >> 36) | ((in[10] & 0x7FFFFF) << 28)) + out[11] + out[13] = ((in[10] >> 23) | ((in[11] & 0x3FF) << 41)) + out[12] + out[14] = (in[11] >> 10) & 0x7FFFFFFFFFFFF + out[13] + out[15] = ((in[11] >> 61) | ((in[12] & 0xFFFFFFFFFFFF) << 3)) + out[14] + out[16] = ((in[12] >> 48) | ((in[13] & 0x7FFFFFFFF) << 16)) + out[15] + out[17] = ((in[13] >> 35) | ((in[14] & 0x3FFFFF) << 29)) + out[16] + out[18] = ((in[14] >> 22) | ((in[15] & 0x1FF) << 42)) + out[17] + out[19] = (in[15] >> 9) & 0x7FFFFFFFFFFFF + out[18] + out[20] = ((in[15] >> 60) | ((in[16] & 0x7FFFFFFFFFFF) << 4)) + out[19] + out[21] = ((in[16] >> 47) | ((in[17] & 0x3FFFFFFFF) << 17)) + out[20] + out[22] = ((in[17] >> 34) | ((in[18] & 0x1FFFFF) << 30)) + out[21] + out[23] = ((in[18] >> 21) | ((in[19] & 0xFF) << 43)) + out[22] + out[24] = (in[19] >> 8) & 0x7FFFFFFFFFFFF + out[23] + out[25] = ((in[19] >> 59) | ((in[20] & 0x3FFFFFFFFFFF) << 5)) + out[24] + out[26] = ((in[20] >> 46) | ((in[21] & 0x1FFFFFFFF) << 18)) + out[25] + out[27] = ((in[21] >> 33) | ((in[22] & 0xFFFFF) << 31)) + out[26] + out[28] = ((in[22] >> 20) | ((in[23] & 0x7F) << 44)) + out[27] + out[29] = (in[23] >> 7) & 0x7FFFFFFFFFFFF + out[28] + out[30] = ((in[23] >> 58) | ((in[24] & 0x1FFFFFFFFFFF) << 6)) + out[29] + out[31] = ((in[24] >> 45) | ((in[25] & 0xFFFFFFFF) << 19)) + out[30] + out[32] = ((in[25] >> 32) | ((in[26] & 0x7FFFF) << 32)) + out[31] + out[33] = ((in[26] >> 19) | ((in[27] & 0x3F) << 45)) + out[32] + out[34] = (in[27] >> 6) & 0x7FFFFFFFFFFFF + out[33] + out[35] = ((in[27] >> 57) | ((in[28] & 0xFFFFFFFFFFF) << 7)) + out[34] + out[36] = ((in[28] >> 44) | ((in[29] & 0x7FFFFFFF) << 20)) + out[35] + out[37] = ((in[29] >> 31) | ((in[30] & 0x3FFFF) << 33)) + out[36] + out[38] = ((in[30] >> 18) | ((in[31] & 0x1F) << 46)) + out[37] + out[39] = (in[31] >> 5) & 0x7FFFFFFFFFFFF + out[38] + out[40] = ((in[31] >> 56) | ((in[32] & 0x7FFFFFFFFFF) << 8)) + out[39] + out[41] = ((in[32] >> 43) | ((in[33] & 0x3FFFFFFF) << 21)) + out[40] + out[42] = ((in[33] >> 30) | ((in[34] & 0x1FFFF) << 34)) + out[41] + out[43] = ((in[34] >> 17) | ((in[35] & 0xF) << 47)) + out[42] + out[44] = (in[35] >> 4) & 0x7FFFFFFFFFFFF + out[43] + out[45] = ((in[35] >> 55) | ((in[36] & 0x3FFFFFFFFFF) << 9)) + out[44] + out[46] = ((in[36] >> 42) | ((in[37] & 0x1FFFFFFF) << 22)) + out[45] + out[47] = ((in[37] >> 29) | ((in[38] & 0xFFFF) << 35)) + out[46] + out[48] = ((in[38] >> 16) | ((in[39] & 0x7) << 48)) + out[47] + out[49] = (in[39] >> 3) & 0x7FFFFFFFFFFFF + out[48] + out[50] = ((in[39] >> 54) | ((in[40] & 0x1FFFFFFFFFF) << 10)) + out[49] + out[51] = ((in[40] >> 41) | ((in[41] & 0xFFFFFFF) << 23)) + out[50] + out[52] = ((in[41] >> 28) | ((in[42] & 0x7FFF) << 36)) + out[51] + out[53] = ((in[42] >> 15) | ((in[43] & 0x3) << 49)) + out[52] + out[54] = (in[43] >> 2) & 0x7FFFFFFFFFFFF + out[53] + out[55] = ((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFF) << 11)) + out[54] + out[56] = ((in[44] >> 40) | ((in[45] & 0x7FFFFFF) << 24)) + out[55] + out[57] = ((in[45] >> 27) | ((in[46] & 0x3FFF) << 37)) + out[56] + out[58] = ((in[46] >> 14) | ((in[47] & 0x1) << 50)) + out[57] + out[59] = (in[47] >> 1) & 0x7FFFFFFFFFFFF + out[58] + out[60] = ((in[47] >> 52) | ((in[48] & 0x7FFFFFFFFF) << 12)) + out[59] + out[61] = ((in[48] >> 39) | ((in[49] & 0x3FFFFFF) << 25)) + out[60] + out[62] = ((in[49] >> 26) | ((in[50] & 0x1FFF) << 38)) + out[61] + out[63] = (in[50] >> 13) + out[62] +} + +func deltaunpack_uint64_52(initoffset uint64, in *[52]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 52) | ((in[1] & 0xFFFFFFFFFF) << 12)) + out[0] + out[2] = ((in[1] >> 40) | ((in[2] & 0xFFFFFFF) << 24)) + out[1] + out[3] = ((in[2] >> 28) | ((in[3] & 0xFFFF) << 36)) + out[2] + out[4] = ((in[3] >> 16) | ((in[4] & 0xF) << 48)) + out[3] + out[5] = (in[4] >> 4) & 0xFFFFFFFFFFFFF + out[4] + out[6] = ((in[4] >> 56) | ((in[5] & 0xFFFFFFFFFFF) << 8)) + out[5] + out[7] = ((in[5] >> 44) | ((in[6] & 0xFFFFFFFF) << 20)) + out[6] + out[8] = ((in[6] >> 32) | ((in[7] & 0xFFFFF) << 32)) + out[7] + out[9] = ((in[7] >> 20) | ((in[8] & 0xFF) << 44)) + out[8] + out[10] = (in[8] >> 8) & 0xFFFFFFFFFFFFF + out[9] + out[11] = ((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFFFF) << 4)) + out[10] + out[12] = ((in[9] >> 48) | ((in[10] & 0xFFFFFFFFF) << 16)) + out[11] + out[13] = ((in[10] >> 36) | ((in[11] & 0xFFFFFF) << 28)) + out[12] + out[14] = ((in[11] >> 24) | ((in[12] & 0xFFF) << 40)) + out[13] + out[15] = (in[12] >> 12) + out[14] + out[16] = (in[13] >> 0) & 0xFFFFFFFFFFFFF + out[15] + out[17] = ((in[13] >> 52) | ((in[14] & 0xFFFFFFFFFF) << 12)) + out[16] + out[18] = ((in[14] >> 40) | ((in[15] & 0xFFFFFFF) << 24)) + out[17] + out[19] = ((in[15] >> 28) | ((in[16] & 0xFFFF) << 36)) + out[18] + out[20] = ((in[16] >> 16) | ((in[17] & 0xF) << 48)) + out[19] + out[21] = (in[17] >> 4) & 0xFFFFFFFFFFFFF + out[20] + out[22] = ((in[17] >> 56) | ((in[18] & 0xFFFFFFFFFFF) << 8)) + out[21] + out[23] = ((in[18] >> 44) | ((in[19] & 0xFFFFFFFF) << 20)) + out[22] + out[24] = ((in[19] >> 32) | ((in[20] & 0xFFFFF) << 32)) + out[23] + out[25] = ((in[20] >> 20) | ((in[21] & 0xFF) << 44)) + out[24] + out[26] = (in[21] >> 8) & 0xFFFFFFFFFFFFF + out[25] + out[27] = ((in[21] >> 60) | ((in[22] & 0xFFFFFFFFFFFF) << 4)) + out[26] + out[28] = ((in[22] >> 48) | ((in[23] & 0xFFFFFFFFF) << 16)) + out[27] + out[29] = ((in[23] >> 36) | ((in[24] & 0xFFFFFF) << 28)) + out[28] + out[30] = ((in[24] >> 24) | ((in[25] & 0xFFF) << 40)) + out[29] + out[31] = (in[25] >> 12) + out[30] + out[32] = (in[26] >> 0) & 0xFFFFFFFFFFFFF + out[31] + out[33] = ((in[26] >> 52) | ((in[27] & 0xFFFFFFFFFF) << 12)) + out[32] + out[34] = ((in[27] >> 40) | ((in[28] & 0xFFFFFFF) << 24)) + out[33] + out[35] = ((in[28] >> 28) | ((in[29] & 0xFFFF) << 36)) + out[34] + out[36] = ((in[29] >> 16) | ((in[30] & 0xF) << 48)) + out[35] + out[37] = (in[30] >> 4) & 0xFFFFFFFFFFFFF + out[36] + out[38] = ((in[30] >> 56) | ((in[31] & 0xFFFFFFFFFFF) << 8)) + out[37] + out[39] = ((in[31] >> 44) | ((in[32] & 0xFFFFFFFF) << 20)) + out[38] + out[40] = ((in[32] >> 32) | ((in[33] & 0xFFFFF) << 32)) + out[39] + out[41] = ((in[33] >> 20) | ((in[34] & 0xFF) << 44)) + out[40] + out[42] = (in[34] >> 8) & 0xFFFFFFFFFFFFF + out[41] + out[43] = ((in[34] >> 60) | ((in[35] & 0xFFFFFFFFFFFF) << 4)) + out[42] + out[44] = ((in[35] >> 48) | ((in[36] & 0xFFFFFFFFF) << 16)) + out[43] + out[45] = ((in[36] >> 36) | ((in[37] & 0xFFFFFF) << 28)) + out[44] + out[46] = ((in[37] >> 24) | ((in[38] & 0xFFF) << 40)) + out[45] + out[47] = (in[38] >> 12) + out[46] + out[48] = (in[39] >> 0) & 0xFFFFFFFFFFFFF + out[47] + out[49] = ((in[39] >> 52) | ((in[40] & 0xFFFFFFFFFF) << 12)) + out[48] + out[50] = ((in[40] >> 40) | ((in[41] & 0xFFFFFFF) << 24)) + out[49] + out[51] = ((in[41] >> 28) | ((in[42] & 0xFFFF) << 36)) + out[50] + out[52] = ((in[42] >> 16) | ((in[43] & 0xF) << 48)) + out[51] + out[53] = (in[43] >> 4) & 0xFFFFFFFFFFFFF + out[52] + out[54] = ((in[43] >> 56) | ((in[44] & 0xFFFFFFFFFFF) << 8)) + out[53] + out[55] = ((in[44] >> 44) | ((in[45] & 0xFFFFFFFF) << 20)) + out[54] + out[56] = ((in[45] >> 32) | ((in[46] & 0xFFFFF) << 32)) + out[55] + out[57] = ((in[46] >> 20) | ((in[47] & 0xFF) << 44)) + out[56] + out[58] = (in[47] >> 8) & 0xFFFFFFFFFFFFF + out[57] + out[59] = ((in[47] >> 60) | ((in[48] & 0xFFFFFFFFFFFF) << 4)) + out[58] + out[60] = ((in[48] >> 48) | ((in[49] & 0xFFFFFFFFF) << 16)) + out[59] + out[61] = ((in[49] >> 36) | ((in[50] & 0xFFFFFF) << 28)) + out[60] + out[62] = ((in[50] >> 24) | ((in[51] & 0xFFF) << 40)) + out[61] + out[63] = (in[51] >> 12) + out[62] +} + +func deltaunpack_uint64_53(initoffset uint64, in *[53]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 53) | ((in[1] & 0x3FFFFFFFFFF) << 11)) + out[0] + out[2] = ((in[1] >> 42) | ((in[2] & 0x7FFFFFFF) << 22)) + out[1] + out[3] = ((in[2] >> 31) | ((in[3] & 0xFFFFF) << 33)) + out[2] + out[4] = ((in[3] >> 20) | ((in[4] & 0x1FF) << 44)) + out[3] + out[5] = (in[4] >> 9) & 0x1FFFFFFFFFFFFF + out[4] + out[6] = ((in[4] >> 62) | ((in[5] & 0x7FFFFFFFFFFFF) << 2)) + out[5] + out[7] = ((in[5] >> 51) | ((in[6] & 0xFFFFFFFFFF) << 13)) + out[6] + out[8] = ((in[6] >> 40) | ((in[7] & 0x1FFFFFFF) << 24)) + out[7] + out[9] = ((in[7] >> 29) | ((in[8] & 0x3FFFF) << 35)) + out[8] + out[10] = ((in[8] >> 18) | ((in[9] & 0x7F) << 46)) + out[9] + out[11] = (in[9] >> 7) & 0x1FFFFFFFFFFFFF + out[10] + out[12] = ((in[9] >> 60) | ((in[10] & 0x1FFFFFFFFFFFF) << 4)) + out[11] + out[13] = ((in[10] >> 49) | ((in[11] & 0x3FFFFFFFFF) << 15)) + out[12] + out[14] = ((in[11] >> 38) | ((in[12] & 0x7FFFFFF) << 26)) + out[13] + out[15] = ((in[12] >> 27) | ((in[13] & 0xFFFF) << 37)) + out[14] + out[16] = ((in[13] >> 16) | ((in[14] & 0x1F) << 48)) + out[15] + out[17] = (in[14] >> 5) & 0x1FFFFFFFFFFFFF + out[16] + out[18] = ((in[14] >> 58) | ((in[15] & 0x7FFFFFFFFFFF) << 6)) + out[17] + out[19] = ((in[15] >> 47) | ((in[16] & 0xFFFFFFFFF) << 17)) + out[18] + out[20] = ((in[16] >> 36) | ((in[17] & 0x1FFFFFF) << 28)) + out[19] + out[21] = ((in[17] >> 25) | ((in[18] & 0x3FFF) << 39)) + out[20] + out[22] = ((in[18] >> 14) | ((in[19] & 0x7) << 50)) + out[21] + out[23] = (in[19] >> 3) & 0x1FFFFFFFFFFFFF + out[22] + out[24] = ((in[19] >> 56) | ((in[20] & 0x1FFFFFFFFFFF) << 8)) + out[23] + out[25] = ((in[20] >> 45) | ((in[21] & 0x3FFFFFFFF) << 19)) + out[24] + out[26] = ((in[21] >> 34) | ((in[22] & 0x7FFFFF) << 30)) + out[25] + out[27] = ((in[22] >> 23) | ((in[23] & 0xFFF) << 41)) + out[26] + out[28] = ((in[23] >> 12) | ((in[24] & 0x1) << 52)) + out[27] + out[29] = (in[24] >> 1) & 0x1FFFFFFFFFFFFF + out[28] + out[30] = ((in[24] >> 54) | ((in[25] & 0x7FFFFFFFFFF) << 10)) + out[29] + out[31] = ((in[25] >> 43) | ((in[26] & 0xFFFFFFFF) << 21)) + out[30] + out[32] = ((in[26] >> 32) | ((in[27] & 0x1FFFFF) << 32)) + out[31] + out[33] = ((in[27] >> 21) | ((in[28] & 0x3FF) << 43)) + out[32] + out[34] = (in[28] >> 10) & 0x1FFFFFFFFFFFFF + out[33] + out[35] = ((in[28] >> 63) | ((in[29] & 0xFFFFFFFFFFFFF) << 1)) + out[34] + out[36] = ((in[29] >> 52) | ((in[30] & 0x1FFFFFFFFFF) << 12)) + out[35] + out[37] = ((in[30] >> 41) | ((in[31] & 0x3FFFFFFF) << 23)) + out[36] + out[38] = ((in[31] >> 30) | ((in[32] & 0x7FFFF) << 34)) + out[37] + out[39] = ((in[32] >> 19) | ((in[33] & 0xFF) << 45)) + out[38] + out[40] = (in[33] >> 8) & 0x1FFFFFFFFFFFFF + out[39] + out[41] = ((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFFFFF) << 3)) + out[40] + out[42] = ((in[34] >> 50) | ((in[35] & 0x7FFFFFFFFF) << 14)) + out[41] + out[43] = ((in[35] >> 39) | ((in[36] & 0xFFFFFFF) << 25)) + out[42] + out[44] = ((in[36] >> 28) | ((in[37] & 0x1FFFF) << 36)) + out[43] + out[45] = ((in[37] >> 17) | ((in[38] & 0x3F) << 47)) + out[44] + out[46] = (in[38] >> 6) & 0x1FFFFFFFFFFFFF + out[45] + out[47] = ((in[38] >> 59) | ((in[39] & 0xFFFFFFFFFFFF) << 5)) + out[46] + out[48] = ((in[39] >> 48) | ((in[40] & 0x1FFFFFFFFF) << 16)) + out[47] + out[49] = ((in[40] >> 37) | ((in[41] & 0x3FFFFFF) << 27)) + out[48] + out[50] = ((in[41] >> 26) | ((in[42] & 0x7FFF) << 38)) + out[49] + out[51] = ((in[42] >> 15) | ((in[43] & 0xF) << 49)) + out[50] + out[52] = (in[43] >> 4) & 0x1FFFFFFFFFFFFF + out[51] + out[53] = ((in[43] >> 57) | ((in[44] & 0x3FFFFFFFFFFF) << 7)) + out[52] + out[54] = ((in[44] >> 46) | ((in[45] & 0x7FFFFFFFF) << 18)) + out[53] + out[55] = ((in[45] >> 35) | ((in[46] & 0xFFFFFF) << 29)) + out[54] + out[56] = ((in[46] >> 24) | ((in[47] & 0x1FFF) << 40)) + out[55] + out[57] = ((in[47] >> 13) | ((in[48] & 0x3) << 51)) + out[56] + out[58] = (in[48] >> 2) & 0x1FFFFFFFFFFFFF + out[57] + out[59] = ((in[48] >> 55) | ((in[49] & 0xFFFFFFFFFFF) << 9)) + out[58] + out[60] = ((in[49] >> 44) | ((in[50] & 0x1FFFFFFFF) << 20)) + out[59] + out[61] = ((in[50] >> 33) | ((in[51] & 0x3FFFFF) << 31)) + out[60] + out[62] = ((in[51] >> 22) | ((in[52] & 0x7FF) << 42)) + out[61] + out[63] = (in[52] >> 11) + out[62] +} + +func deltaunpack_uint64_54(initoffset uint64, in *[54]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 54) | ((in[1] & 0xFFFFFFFFFFF) << 10)) + out[0] + out[2] = ((in[1] >> 44) | ((in[2] & 0x3FFFFFFFF) << 20)) + out[1] + out[3] = ((in[2] >> 34) | ((in[3] & 0xFFFFFF) << 30)) + out[2] + out[4] = ((in[3] >> 24) | ((in[4] & 0x3FFF) << 40)) + out[3] + out[5] = ((in[4] >> 14) | ((in[5] & 0xF) << 50)) + out[4] + out[6] = (in[5] >> 4) & 0x3FFFFFFFFFFFFF + out[5] + out[7] = ((in[5] >> 58) | ((in[6] & 0xFFFFFFFFFFFF) << 6)) + out[6] + out[8] = ((in[6] >> 48) | ((in[7] & 0x3FFFFFFFFF) << 16)) + out[7] + out[9] = ((in[7] >> 38) | ((in[8] & 0xFFFFFFF) << 26)) + out[8] + out[10] = ((in[8] >> 28) | ((in[9] & 0x3FFFF) << 36)) + out[9] + out[11] = ((in[9] >> 18) | ((in[10] & 0xFF) << 46)) + out[10] + out[12] = (in[10] >> 8) & 0x3FFFFFFFFFFFFF + out[11] + out[13] = ((in[10] >> 62) | ((in[11] & 0xFFFFFFFFFFFFF) << 2)) + out[12] + out[14] = ((in[11] >> 52) | ((in[12] & 0x3FFFFFFFFFF) << 12)) + out[13] + out[15] = ((in[12] >> 42) | ((in[13] & 0xFFFFFFFF) << 22)) + out[14] + out[16] = ((in[13] >> 32) | ((in[14] & 0x3FFFFF) << 32)) + out[15] + out[17] = ((in[14] >> 22) | ((in[15] & 0xFFF) << 42)) + out[16] + out[18] = ((in[15] >> 12) | ((in[16] & 0x3) << 52)) + out[17] + out[19] = (in[16] >> 2) & 0x3FFFFFFFFFFFFF + out[18] + out[20] = ((in[16] >> 56) | ((in[17] & 0x3FFFFFFFFFFF) << 8)) + out[19] + out[21] = ((in[17] >> 46) | ((in[18] & 0xFFFFFFFFF) << 18)) + out[20] + out[22] = ((in[18] >> 36) | ((in[19] & 0x3FFFFFF) << 28)) + out[21] + out[23] = ((in[19] >> 26) | ((in[20] & 0xFFFF) << 38)) + out[22] + out[24] = ((in[20] >> 16) | ((in[21] & 0x3F) << 48)) + out[23] + out[25] = (in[21] >> 6) & 0x3FFFFFFFFFFFFF + out[24] + out[26] = ((in[21] >> 60) | ((in[22] & 0x3FFFFFFFFFFFF) << 4)) + out[25] + out[27] = ((in[22] >> 50) | ((in[23] & 0xFFFFFFFFFF) << 14)) + out[26] + out[28] = ((in[23] >> 40) | ((in[24] & 0x3FFFFFFF) << 24)) + out[27] + out[29] = ((in[24] >> 30) | ((in[25] & 0xFFFFF) << 34)) + out[28] + out[30] = ((in[25] >> 20) | ((in[26] & 0x3FF) << 44)) + out[29] + out[31] = (in[26] >> 10) + out[30] + out[32] = (in[27] >> 0) & 0x3FFFFFFFFFFFFF + out[31] + out[33] = ((in[27] >> 54) | ((in[28] & 0xFFFFFFFFFFF) << 10)) + out[32] + out[34] = ((in[28] >> 44) | ((in[29] & 0x3FFFFFFFF) << 20)) + out[33] + out[35] = ((in[29] >> 34) | ((in[30] & 0xFFFFFF) << 30)) + out[34] + out[36] = ((in[30] >> 24) | ((in[31] & 0x3FFF) << 40)) + out[35] + out[37] = ((in[31] >> 14) | ((in[32] & 0xF) << 50)) + out[36] + out[38] = (in[32] >> 4) & 0x3FFFFFFFFFFFFF + out[37] + out[39] = ((in[32] >> 58) | ((in[33] & 0xFFFFFFFFFFFF) << 6)) + out[38] + out[40] = ((in[33] >> 48) | ((in[34] & 0x3FFFFFFFFF) << 16)) + out[39] + out[41] = ((in[34] >> 38) | ((in[35] & 0xFFFFFFF) << 26)) + out[40] + out[42] = ((in[35] >> 28) | ((in[36] & 0x3FFFF) << 36)) + out[41] + out[43] = ((in[36] >> 18) | ((in[37] & 0xFF) << 46)) + out[42] + out[44] = (in[37] >> 8) & 0x3FFFFFFFFFFFFF + out[43] + out[45] = ((in[37] >> 62) | ((in[38] & 0xFFFFFFFFFFFFF) << 2)) + out[44] + out[46] = ((in[38] >> 52) | ((in[39] & 0x3FFFFFFFFFF) << 12)) + out[45] + out[47] = ((in[39] >> 42) | ((in[40] & 0xFFFFFFFF) << 22)) + out[46] + out[48] = ((in[40] >> 32) | ((in[41] & 0x3FFFFF) << 32)) + out[47] + out[49] = ((in[41] >> 22) | ((in[42] & 0xFFF) << 42)) + out[48] + out[50] = ((in[42] >> 12) | ((in[43] & 0x3) << 52)) + out[49] + out[51] = (in[43] >> 2) & 0x3FFFFFFFFFFFFF + out[50] + out[52] = ((in[43] >> 56) | ((in[44] & 0x3FFFFFFFFFFF) << 8)) + out[51] + out[53] = ((in[44] >> 46) | ((in[45] & 0xFFFFFFFFF) << 18)) + out[52] + out[54] = ((in[45] >> 36) | ((in[46] & 0x3FFFFFF) << 28)) + out[53] + out[55] = ((in[46] >> 26) | ((in[47] & 0xFFFF) << 38)) + out[54] + out[56] = ((in[47] >> 16) | ((in[48] & 0x3F) << 48)) + out[55] + out[57] = (in[48] >> 6) & 0x3FFFFFFFFFFFFF + out[56] + out[58] = ((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFF) << 4)) + out[57] + out[59] = ((in[49] >> 50) | ((in[50] & 0xFFFFFFFFFF) << 14)) + out[58] + out[60] = ((in[50] >> 40) | ((in[51] & 0x3FFFFFFF) << 24)) + out[59] + out[61] = ((in[51] >> 30) | ((in[52] & 0xFFFFF) << 34)) + out[60] + out[62] = ((in[52] >> 20) | ((in[53] & 0x3FF) << 44)) + out[61] + out[63] = (in[53] >> 10) + out[62] +} + +func deltaunpack_uint64_55(initoffset uint64, in *[55]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 55) | ((in[1] & 0x3FFFFFFFFFFF) << 9)) + out[0] + out[2] = ((in[1] >> 46) | ((in[2] & 0x1FFFFFFFFF) << 18)) + out[1] + out[3] = ((in[2] >> 37) | ((in[3] & 0xFFFFFFF) << 27)) + out[2] + out[4] = ((in[3] >> 28) | ((in[4] & 0x7FFFF) << 36)) + out[3] + out[5] = ((in[4] >> 19) | ((in[5] & 0x3FF) << 45)) + out[4] + out[6] = ((in[5] >> 10) | ((in[6] & 0x1) << 54)) + out[5] + out[7] = (in[6] >> 1) & 0x7FFFFFFFFFFFFF + out[6] + out[8] = ((in[6] >> 56) | ((in[7] & 0x7FFFFFFFFFFF) << 8)) + out[7] + out[9] = ((in[7] >> 47) | ((in[8] & 0x3FFFFFFFFF) << 17)) + out[8] + out[10] = ((in[8] >> 38) | ((in[9] & 0x1FFFFFFF) << 26)) + out[9] + out[11] = ((in[9] >> 29) | ((in[10] & 0xFFFFF) << 35)) + out[10] + out[12] = ((in[10] >> 20) | ((in[11] & 0x7FF) << 44)) + out[11] + out[13] = ((in[11] >> 11) | ((in[12] & 0x3) << 53)) + out[12] + out[14] = (in[12] >> 2) & 0x7FFFFFFFFFFFFF + out[13] + out[15] = ((in[12] >> 57) | ((in[13] & 0xFFFFFFFFFFFF) << 7)) + out[14] + out[16] = ((in[13] >> 48) | ((in[14] & 0x7FFFFFFFFF) << 16)) + out[15] + out[17] = ((in[14] >> 39) | ((in[15] & 0x3FFFFFFF) << 25)) + out[16] + out[18] = ((in[15] >> 30) | ((in[16] & 0x1FFFFF) << 34)) + out[17] + out[19] = ((in[16] >> 21) | ((in[17] & 0xFFF) << 43)) + out[18] + out[20] = ((in[17] >> 12) | ((in[18] & 0x7) << 52)) + out[19] + out[21] = (in[18] >> 3) & 0x7FFFFFFFFFFFFF + out[20] + out[22] = ((in[18] >> 58) | ((in[19] & 0x1FFFFFFFFFFFF) << 6)) + out[21] + out[23] = ((in[19] >> 49) | ((in[20] & 0xFFFFFFFFFF) << 15)) + out[22] + out[24] = ((in[20] >> 40) | ((in[21] & 0x7FFFFFFF) << 24)) + out[23] + out[25] = ((in[21] >> 31) | ((in[22] & 0x3FFFFF) << 33)) + out[24] + out[26] = ((in[22] >> 22) | ((in[23] & 0x1FFF) << 42)) + out[25] + out[27] = ((in[23] >> 13) | ((in[24] & 0xF) << 51)) + out[26] + out[28] = (in[24] >> 4) & 0x7FFFFFFFFFFFFF + out[27] + out[29] = ((in[24] >> 59) | ((in[25] & 0x3FFFFFFFFFFFF) << 5)) + out[28] + out[30] = ((in[25] >> 50) | ((in[26] & 0x1FFFFFFFFFF) << 14)) + out[29] + out[31] = ((in[26] >> 41) | ((in[27] & 0xFFFFFFFF) << 23)) + out[30] + out[32] = ((in[27] >> 32) | ((in[28] & 0x7FFFFF) << 32)) + out[31] + out[33] = ((in[28] >> 23) | ((in[29] & 0x3FFF) << 41)) + out[32] + out[34] = ((in[29] >> 14) | ((in[30] & 0x1F) << 50)) + out[33] + out[35] = (in[30] >> 5) & 0x7FFFFFFFFFFFFF + out[34] + out[36] = ((in[30] >> 60) | ((in[31] & 0x7FFFFFFFFFFFF) << 4)) + out[35] + out[37] = ((in[31] >> 51) | ((in[32] & 0x3FFFFFFFFFF) << 13)) + out[36] + out[38] = ((in[32] >> 42) | ((in[33] & 0x1FFFFFFFF) << 22)) + out[37] + out[39] = ((in[33] >> 33) | ((in[34] & 0xFFFFFF) << 31)) + out[38] + out[40] = ((in[34] >> 24) | ((in[35] & 0x7FFF) << 40)) + out[39] + out[41] = ((in[35] >> 15) | ((in[36] & 0x3F) << 49)) + out[40] + out[42] = (in[36] >> 6) & 0x7FFFFFFFFFFFFF + out[41] + out[43] = ((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFFFFF) << 3)) + out[42] + out[44] = ((in[37] >> 52) | ((in[38] & 0x7FFFFFFFFFF) << 12)) + out[43] + out[45] = ((in[38] >> 43) | ((in[39] & 0x3FFFFFFFF) << 21)) + out[44] + out[46] = ((in[39] >> 34) | ((in[40] & 0x1FFFFFF) << 30)) + out[45] + out[47] = ((in[40] >> 25) | ((in[41] & 0xFFFF) << 39)) + out[46] + out[48] = ((in[41] >> 16) | ((in[42] & 0x7F) << 48)) + out[47] + out[49] = (in[42] >> 7) & 0x7FFFFFFFFFFFFF + out[48] + out[50] = ((in[42] >> 62) | ((in[43] & 0x1FFFFFFFFFFFFF) << 2)) + out[49] + out[51] = ((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFFF) << 11)) + out[50] + out[52] = ((in[44] >> 44) | ((in[45] & 0x7FFFFFFFF) << 20)) + out[51] + out[53] = ((in[45] >> 35) | ((in[46] & 0x3FFFFFF) << 29)) + out[52] + out[54] = ((in[46] >> 26) | ((in[47] & 0x1FFFF) << 38)) + out[53] + out[55] = ((in[47] >> 17) | ((in[48] & 0xFF) << 47)) + out[54] + out[56] = (in[48] >> 8) & 0x7FFFFFFFFFFFFF + out[55] + out[57] = ((in[48] >> 63) | ((in[49] & 0x3FFFFFFFFFFFFF) << 1)) + out[56] + out[58] = ((in[49] >> 54) | ((in[50] & 0x1FFFFFFFFFFF) << 10)) + out[57] + out[59] = ((in[50] >> 45) | ((in[51] & 0xFFFFFFFFF) << 19)) + out[58] + out[60] = ((in[51] >> 36) | ((in[52] & 0x7FFFFFF) << 28)) + out[59] + out[61] = ((in[52] >> 27) | ((in[53] & 0x3FFFF) << 37)) + out[60] + out[62] = ((in[53] >> 18) | ((in[54] & 0x1FF) << 46)) + out[61] + out[63] = (in[54] >> 9) + out[62] +} + +func deltaunpack_uint64_56(initoffset uint64, in *[56]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 56) | ((in[1] & 0xFFFFFFFFFFFF) << 8)) + out[0] + out[2] = ((in[1] >> 48) | ((in[2] & 0xFFFFFFFFFF) << 16)) + out[1] + out[3] = ((in[2] >> 40) | ((in[3] & 0xFFFFFFFF) << 24)) + out[2] + out[4] = ((in[3] >> 32) | ((in[4] & 0xFFFFFF) << 32)) + out[3] + out[5] = ((in[4] >> 24) | ((in[5] & 0xFFFF) << 40)) + out[4] + out[6] = ((in[5] >> 16) | ((in[6] & 0xFF) << 48)) + out[5] + out[7] = (in[6] >> 8) + out[6] + out[8] = (in[7] >> 0) & 0xFFFFFFFFFFFFFF + out[7] + out[9] = ((in[7] >> 56) | ((in[8] & 0xFFFFFFFFFFFF) << 8)) + out[8] + out[10] = ((in[8] >> 48) | ((in[9] & 0xFFFFFFFFFF) << 16)) + out[9] + out[11] = ((in[9] >> 40) | ((in[10] & 0xFFFFFFFF) << 24)) + out[10] + out[12] = ((in[10] >> 32) | ((in[11] & 0xFFFFFF) << 32)) + out[11] + out[13] = ((in[11] >> 24) | ((in[12] & 0xFFFF) << 40)) + out[12] + out[14] = ((in[12] >> 16) | ((in[13] & 0xFF) << 48)) + out[13] + out[15] = (in[13] >> 8) + out[14] + out[16] = (in[14] >> 0) & 0xFFFFFFFFFFFFFF + out[15] + out[17] = ((in[14] >> 56) | ((in[15] & 0xFFFFFFFFFFFF) << 8)) + out[16] + out[18] = ((in[15] >> 48) | ((in[16] & 0xFFFFFFFFFF) << 16)) + out[17] + out[19] = ((in[16] >> 40) | ((in[17] & 0xFFFFFFFF) << 24)) + out[18] + out[20] = ((in[17] >> 32) | ((in[18] & 0xFFFFFF) << 32)) + out[19] + out[21] = ((in[18] >> 24) | ((in[19] & 0xFFFF) << 40)) + out[20] + out[22] = ((in[19] >> 16) | ((in[20] & 0xFF) << 48)) + out[21] + out[23] = (in[20] >> 8) + out[22] + out[24] = (in[21] >> 0) & 0xFFFFFFFFFFFFFF + out[23] + out[25] = ((in[21] >> 56) | ((in[22] & 0xFFFFFFFFFFFF) << 8)) + out[24] + out[26] = ((in[22] >> 48) | ((in[23] & 0xFFFFFFFFFF) << 16)) + out[25] + out[27] = ((in[23] >> 40) | ((in[24] & 0xFFFFFFFF) << 24)) + out[26] + out[28] = ((in[24] >> 32) | ((in[25] & 0xFFFFFF) << 32)) + out[27] + out[29] = ((in[25] >> 24) | ((in[26] & 0xFFFF) << 40)) + out[28] + out[30] = ((in[26] >> 16) | ((in[27] & 0xFF) << 48)) + out[29] + out[31] = (in[27] >> 8) + out[30] + out[32] = (in[28] >> 0) & 0xFFFFFFFFFFFFFF + out[31] + out[33] = ((in[28] >> 56) | ((in[29] & 0xFFFFFFFFFFFF) << 8)) + out[32] + out[34] = ((in[29] >> 48) | ((in[30] & 0xFFFFFFFFFF) << 16)) + out[33] + out[35] = ((in[30] >> 40) | ((in[31] & 0xFFFFFFFF) << 24)) + out[34] + out[36] = ((in[31] >> 32) | ((in[32] & 0xFFFFFF) << 32)) + out[35] + out[37] = ((in[32] >> 24) | ((in[33] & 0xFFFF) << 40)) + out[36] + out[38] = ((in[33] >> 16) | ((in[34] & 0xFF) << 48)) + out[37] + out[39] = (in[34] >> 8) + out[38] + out[40] = (in[35] >> 0) & 0xFFFFFFFFFFFFFF + out[39] + out[41] = ((in[35] >> 56) | ((in[36] & 0xFFFFFFFFFFFF) << 8)) + out[40] + out[42] = ((in[36] >> 48) | ((in[37] & 0xFFFFFFFFFF) << 16)) + out[41] + out[43] = ((in[37] >> 40) | ((in[38] & 0xFFFFFFFF) << 24)) + out[42] + out[44] = ((in[38] >> 32) | ((in[39] & 0xFFFFFF) << 32)) + out[43] + out[45] = ((in[39] >> 24) | ((in[40] & 0xFFFF) << 40)) + out[44] + out[46] = ((in[40] >> 16) | ((in[41] & 0xFF) << 48)) + out[45] + out[47] = (in[41] >> 8) + out[46] + out[48] = (in[42] >> 0) & 0xFFFFFFFFFFFFFF + out[47] + out[49] = ((in[42] >> 56) | ((in[43] & 0xFFFFFFFFFFFF) << 8)) + out[48] + out[50] = ((in[43] >> 48) | ((in[44] & 0xFFFFFFFFFF) << 16)) + out[49] + out[51] = ((in[44] >> 40) | ((in[45] & 0xFFFFFFFF) << 24)) + out[50] + out[52] = ((in[45] >> 32) | ((in[46] & 0xFFFFFF) << 32)) + out[51] + out[53] = ((in[46] >> 24) | ((in[47] & 0xFFFF) << 40)) + out[52] + out[54] = ((in[47] >> 16) | ((in[48] & 0xFF) << 48)) + out[53] + out[55] = (in[48] >> 8) + out[54] + out[56] = (in[49] >> 0) & 0xFFFFFFFFFFFFFF + out[55] + out[57] = ((in[49] >> 56) | ((in[50] & 0xFFFFFFFFFFFF) << 8)) + out[56] + out[58] = ((in[50] >> 48) | ((in[51] & 0xFFFFFFFFFF) << 16)) + out[57] + out[59] = ((in[51] >> 40) | ((in[52] & 0xFFFFFFFF) << 24)) + out[58] + out[60] = ((in[52] >> 32) | ((in[53] & 0xFFFFFF) << 32)) + out[59] + out[61] = ((in[53] >> 24) | ((in[54] & 0xFFFF) << 40)) + out[60] + out[62] = ((in[54] >> 16) | ((in[55] & 0xFF) << 48)) + out[61] + out[63] = (in[55] >> 8) + out[62] +} + +func deltaunpack_uint64_57(initoffset uint64, in *[57]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 57) | ((in[1] & 0x3FFFFFFFFFFFF) << 7)) + out[0] + out[2] = ((in[1] >> 50) | ((in[2] & 0x7FFFFFFFFFF) << 14)) + out[1] + out[3] = ((in[2] >> 43) | ((in[3] & 0xFFFFFFFFF) << 21)) + out[2] + out[4] = ((in[3] >> 36) | ((in[4] & 0x1FFFFFFF) << 28)) + out[3] + out[5] = ((in[4] >> 29) | ((in[5] & 0x3FFFFF) << 35)) + out[4] + out[6] = ((in[5] >> 22) | ((in[6] & 0x7FFF) << 42)) + out[5] + out[7] = ((in[6] >> 15) | ((in[7] & 0xFF) << 49)) + out[6] + out[8] = ((in[7] >> 8) | ((in[8] & 0x1) << 56)) + out[7] + out[9] = (in[8] >> 1) & 0x1FFFFFFFFFFFFFF + out[8] + out[10] = ((in[8] >> 58) | ((in[9] & 0x7FFFFFFFFFFFF) << 6)) + out[9] + out[11] = ((in[9] >> 51) | ((in[10] & 0xFFFFFFFFFFF) << 13)) + out[10] + out[12] = ((in[10] >> 44) | ((in[11] & 0x1FFFFFFFFF) << 20)) + out[11] + out[13] = ((in[11] >> 37) | ((in[12] & 0x3FFFFFFF) << 27)) + out[12] + out[14] = ((in[12] >> 30) | ((in[13] & 0x7FFFFF) << 34)) + out[13] + out[15] = ((in[13] >> 23) | ((in[14] & 0xFFFF) << 41)) + out[14] + out[16] = ((in[14] >> 16) | ((in[15] & 0x1FF) << 48)) + out[15] + out[17] = ((in[15] >> 9) | ((in[16] & 0x3) << 55)) + out[16] + out[18] = (in[16] >> 2) & 0x1FFFFFFFFFFFFFF + out[17] + out[19] = ((in[16] >> 59) | ((in[17] & 0xFFFFFFFFFFFFF) << 5)) + out[18] + out[20] = ((in[17] >> 52) | ((in[18] & 0x1FFFFFFFFFFF) << 12)) + out[19] + out[21] = ((in[18] >> 45) | ((in[19] & 0x3FFFFFFFFF) << 19)) + out[20] + out[22] = ((in[19] >> 38) | ((in[20] & 0x7FFFFFFF) << 26)) + out[21] + out[23] = ((in[20] >> 31) | ((in[21] & 0xFFFFFF) << 33)) + out[22] + out[24] = ((in[21] >> 24) | ((in[22] & 0x1FFFF) << 40)) + out[23] + out[25] = ((in[22] >> 17) | ((in[23] & 0x3FF) << 47)) + out[24] + out[26] = ((in[23] >> 10) | ((in[24] & 0x7) << 54)) + out[25] + out[27] = (in[24] >> 3) & 0x1FFFFFFFFFFFFFF + out[26] + out[28] = ((in[24] >> 60) | ((in[25] & 0x1FFFFFFFFFFFFF) << 4)) + out[27] + out[29] = ((in[25] >> 53) | ((in[26] & 0x3FFFFFFFFFFF) << 11)) + out[28] + out[30] = ((in[26] >> 46) | ((in[27] & 0x7FFFFFFFFF) << 18)) + out[29] + out[31] = ((in[27] >> 39) | ((in[28] & 0xFFFFFFFF) << 25)) + out[30] + out[32] = ((in[28] >> 32) | ((in[29] & 0x1FFFFFF) << 32)) + out[31] + out[33] = ((in[29] >> 25) | ((in[30] & 0x3FFFF) << 39)) + out[32] + out[34] = ((in[30] >> 18) | ((in[31] & 0x7FF) << 46)) + out[33] + out[35] = ((in[31] >> 11) | ((in[32] & 0xF) << 53)) + out[34] + out[36] = (in[32] >> 4) & 0x1FFFFFFFFFFFFFF + out[35] + out[37] = ((in[32] >> 61) | ((in[33] & 0x3FFFFFFFFFFFFF) << 3)) + out[36] + out[38] = ((in[33] >> 54) | ((in[34] & 0x7FFFFFFFFFFF) << 10)) + out[37] + out[39] = ((in[34] >> 47) | ((in[35] & 0xFFFFFFFFFF) << 17)) + out[38] + out[40] = ((in[35] >> 40) | ((in[36] & 0x1FFFFFFFF) << 24)) + out[39] + out[41] = ((in[36] >> 33) | ((in[37] & 0x3FFFFFF) << 31)) + out[40] + out[42] = ((in[37] >> 26) | ((in[38] & 0x7FFFF) << 38)) + out[41] + out[43] = ((in[38] >> 19) | ((in[39] & 0xFFF) << 45)) + out[42] + out[44] = ((in[39] >> 12) | ((in[40] & 0x1F) << 52)) + out[43] + out[45] = (in[40] >> 5) & 0x1FFFFFFFFFFFFFF + out[44] + out[46] = ((in[40] >> 62) | ((in[41] & 0x7FFFFFFFFFFFFF) << 2)) + out[45] + out[47] = ((in[41] >> 55) | ((in[42] & 0xFFFFFFFFFFFF) << 9)) + out[46] + out[48] = ((in[42] >> 48) | ((in[43] & 0x1FFFFFFFFFF) << 16)) + out[47] + out[49] = ((in[43] >> 41) | ((in[44] & 0x3FFFFFFFF) << 23)) + out[48] + out[50] = ((in[44] >> 34) | ((in[45] & 0x7FFFFFF) << 30)) + out[49] + out[51] = ((in[45] >> 27) | ((in[46] & 0xFFFFF) << 37)) + out[50] + out[52] = ((in[46] >> 20) | ((in[47] & 0x1FFF) << 44)) + out[51] + out[53] = ((in[47] >> 13) | ((in[48] & 0x3F) << 51)) + out[52] + out[54] = (in[48] >> 6) & 0x1FFFFFFFFFFFFFF + out[53] + out[55] = ((in[48] >> 63) | ((in[49] & 0xFFFFFFFFFFFFFF) << 1)) + out[54] + out[56] = ((in[49] >> 56) | ((in[50] & 0x1FFFFFFFFFFFF) << 8)) + out[55] + out[57] = ((in[50] >> 49) | ((in[51] & 0x3FFFFFFFFFF) << 15)) + out[56] + out[58] = ((in[51] >> 42) | ((in[52] & 0x7FFFFFFFF) << 22)) + out[57] + out[59] = ((in[52] >> 35) | ((in[53] & 0xFFFFFFF) << 29)) + out[58] + out[60] = ((in[53] >> 28) | ((in[54] & 0x1FFFFF) << 36)) + out[59] + out[61] = ((in[54] >> 21) | ((in[55] & 0x3FFF) << 43)) + out[60] + out[62] = ((in[55] >> 14) | ((in[56] & 0x7F) << 50)) + out[61] + out[63] = (in[56] >> 7) + out[62] +} + +func deltaunpack_uint64_58(initoffset uint64, in *[58]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 58) | ((in[1] & 0xFFFFFFFFFFFFF) << 6)) + out[0] + out[2] = ((in[1] >> 52) | ((in[2] & 0x3FFFFFFFFFFF) << 12)) + out[1] + out[3] = ((in[2] >> 46) | ((in[3] & 0xFFFFFFFFFF) << 18)) + out[2] + out[4] = ((in[3] >> 40) | ((in[4] & 0x3FFFFFFFF) << 24)) + out[3] + out[5] = ((in[4] >> 34) | ((in[5] & 0xFFFFFFF) << 30)) + out[4] + out[6] = ((in[5] >> 28) | ((in[6] & 0x3FFFFF) << 36)) + out[5] + out[7] = ((in[6] >> 22) | ((in[7] & 0xFFFF) << 42)) + out[6] + out[8] = ((in[7] >> 16) | ((in[8] & 0x3FF) << 48)) + out[7] + out[9] = ((in[8] >> 10) | ((in[9] & 0xF) << 54)) + out[8] + out[10] = (in[9] >> 4) & 0x3FFFFFFFFFFFFFF + out[9] + out[11] = ((in[9] >> 62) | ((in[10] & 0xFFFFFFFFFFFFFF) << 2)) + out[10] + out[12] = ((in[10] >> 56) | ((in[11] & 0x3FFFFFFFFFFFF) << 8)) + out[11] + out[13] = ((in[11] >> 50) | ((in[12] & 0xFFFFFFFFFFF) << 14)) + out[12] + out[14] = ((in[12] >> 44) | ((in[13] & 0x3FFFFFFFFF) << 20)) + out[13] + out[15] = ((in[13] >> 38) | ((in[14] & 0xFFFFFFFF) << 26)) + out[14] + out[16] = ((in[14] >> 32) | ((in[15] & 0x3FFFFFF) << 32)) + out[15] + out[17] = ((in[15] >> 26) | ((in[16] & 0xFFFFF) << 38)) + out[16] + out[18] = ((in[16] >> 20) | ((in[17] & 0x3FFF) << 44)) + out[17] + out[19] = ((in[17] >> 14) | ((in[18] & 0xFF) << 50)) + out[18] + out[20] = ((in[18] >> 8) | ((in[19] & 0x3) << 56)) + out[19] + out[21] = (in[19] >> 2) & 0x3FFFFFFFFFFFFFF + out[20] + out[22] = ((in[19] >> 60) | ((in[20] & 0x3FFFFFFFFFFFFF) << 4)) + out[21] + out[23] = ((in[20] >> 54) | ((in[21] & 0xFFFFFFFFFFFF) << 10)) + out[22] + out[24] = ((in[21] >> 48) | ((in[22] & 0x3FFFFFFFFFF) << 16)) + out[23] + out[25] = ((in[22] >> 42) | ((in[23] & 0xFFFFFFFFF) << 22)) + out[24] + out[26] = ((in[23] >> 36) | ((in[24] & 0x3FFFFFFF) << 28)) + out[25] + out[27] = ((in[24] >> 30) | ((in[25] & 0xFFFFFF) << 34)) + out[26] + out[28] = ((in[25] >> 24) | ((in[26] & 0x3FFFF) << 40)) + out[27] + out[29] = ((in[26] >> 18) | ((in[27] & 0xFFF) << 46)) + out[28] + out[30] = ((in[27] >> 12) | ((in[28] & 0x3F) << 52)) + out[29] + out[31] = (in[28] >> 6) + out[30] + out[32] = (in[29] >> 0) & 0x3FFFFFFFFFFFFFF + out[31] + out[33] = ((in[29] >> 58) | ((in[30] & 0xFFFFFFFFFFFFF) << 6)) + out[32] + out[34] = ((in[30] >> 52) | ((in[31] & 0x3FFFFFFFFFFF) << 12)) + out[33] + out[35] = ((in[31] >> 46) | ((in[32] & 0xFFFFFFFFFF) << 18)) + out[34] + out[36] = ((in[32] >> 40) | ((in[33] & 0x3FFFFFFFF) << 24)) + out[35] + out[37] = ((in[33] >> 34) | ((in[34] & 0xFFFFFFF) << 30)) + out[36] + out[38] = ((in[34] >> 28) | ((in[35] & 0x3FFFFF) << 36)) + out[37] + out[39] = ((in[35] >> 22) | ((in[36] & 0xFFFF) << 42)) + out[38] + out[40] = ((in[36] >> 16) | ((in[37] & 0x3FF) << 48)) + out[39] + out[41] = ((in[37] >> 10) | ((in[38] & 0xF) << 54)) + out[40] + out[42] = (in[38] >> 4) & 0x3FFFFFFFFFFFFFF + out[41] + out[43] = ((in[38] >> 62) | ((in[39] & 0xFFFFFFFFFFFFFF) << 2)) + out[42] + out[44] = ((in[39] >> 56) | ((in[40] & 0x3FFFFFFFFFFFF) << 8)) + out[43] + out[45] = ((in[40] >> 50) | ((in[41] & 0xFFFFFFFFFFF) << 14)) + out[44] + out[46] = ((in[41] >> 44) | ((in[42] & 0x3FFFFFFFFF) << 20)) + out[45] + out[47] = ((in[42] >> 38) | ((in[43] & 0xFFFFFFFF) << 26)) + out[46] + out[48] = ((in[43] >> 32) | ((in[44] & 0x3FFFFFF) << 32)) + out[47] + out[49] = ((in[44] >> 26) | ((in[45] & 0xFFFFF) << 38)) + out[48] + out[50] = ((in[45] >> 20) | ((in[46] & 0x3FFF) << 44)) + out[49] + out[51] = ((in[46] >> 14) | ((in[47] & 0xFF) << 50)) + out[50] + out[52] = ((in[47] >> 8) | ((in[48] & 0x3) << 56)) + out[51] + out[53] = (in[48] >> 2) & 0x3FFFFFFFFFFFFFF + out[52] + out[54] = ((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFFF) << 4)) + out[53] + out[55] = ((in[49] >> 54) | ((in[50] & 0xFFFFFFFFFFFF) << 10)) + out[54] + out[56] = ((in[50] >> 48) | ((in[51] & 0x3FFFFFFFFFF) << 16)) + out[55] + out[57] = ((in[51] >> 42) | ((in[52] & 0xFFFFFFFFF) << 22)) + out[56] + out[58] = ((in[52] >> 36) | ((in[53] & 0x3FFFFFFF) << 28)) + out[57] + out[59] = ((in[53] >> 30) | ((in[54] & 0xFFFFFF) << 34)) + out[58] + out[60] = ((in[54] >> 24) | ((in[55] & 0x3FFFF) << 40)) + out[59] + out[61] = ((in[55] >> 18) | ((in[56] & 0xFFF) << 46)) + out[60] + out[62] = ((in[56] >> 12) | ((in[57] & 0x3F) << 52)) + out[61] + out[63] = (in[57] >> 6) + out[62] +} + +func deltaunpack_uint64_59(initoffset uint64, in *[59]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 59) | ((in[1] & 0x3FFFFFFFFFFFFF) << 5)) + out[0] + out[2] = ((in[1] >> 54) | ((in[2] & 0x1FFFFFFFFFFFF) << 10)) + out[1] + out[3] = ((in[2] >> 49) | ((in[3] & 0xFFFFFFFFFFF) << 15)) + out[2] + out[4] = ((in[3] >> 44) | ((in[4] & 0x7FFFFFFFFF) << 20)) + out[3] + out[5] = ((in[4] >> 39) | ((in[5] & 0x3FFFFFFFF) << 25)) + out[4] + out[6] = ((in[5] >> 34) | ((in[6] & 0x1FFFFFFF) << 30)) + out[5] + out[7] = ((in[6] >> 29) | ((in[7] & 0xFFFFFF) << 35)) + out[6] + out[8] = ((in[7] >> 24) | ((in[8] & 0x7FFFF) << 40)) + out[7] + out[9] = ((in[8] >> 19) | ((in[9] & 0x3FFF) << 45)) + out[8] + out[10] = ((in[9] >> 14) | ((in[10] & 0x1FF) << 50)) + out[9] + out[11] = ((in[10] >> 9) | ((in[11] & 0xF) << 55)) + out[10] + out[12] = (in[11] >> 4) & 0x7FFFFFFFFFFFFFF + out[11] + out[13] = ((in[11] >> 63) | ((in[12] & 0x3FFFFFFFFFFFFFF) << 1)) + out[12] + out[14] = ((in[12] >> 58) | ((in[13] & 0x1FFFFFFFFFFFFF) << 6)) + out[13] + out[15] = ((in[13] >> 53) | ((in[14] & 0xFFFFFFFFFFFF) << 11)) + out[14] + out[16] = ((in[14] >> 48) | ((in[15] & 0x7FFFFFFFFFF) << 16)) + out[15] + out[17] = ((in[15] >> 43) | ((in[16] & 0x3FFFFFFFFF) << 21)) + out[16] + out[18] = ((in[16] >> 38) | ((in[17] & 0x1FFFFFFFF) << 26)) + out[17] + out[19] = ((in[17] >> 33) | ((in[18] & 0xFFFFFFF) << 31)) + out[18] + out[20] = ((in[18] >> 28) | ((in[19] & 0x7FFFFF) << 36)) + out[19] + out[21] = ((in[19] >> 23) | ((in[20] & 0x3FFFF) << 41)) + out[20] + out[22] = ((in[20] >> 18) | ((in[21] & 0x1FFF) << 46)) + out[21] + out[23] = ((in[21] >> 13) | ((in[22] & 0xFF) << 51)) + out[22] + out[24] = ((in[22] >> 8) | ((in[23] & 0x7) << 56)) + out[23] + out[25] = (in[23] >> 3) & 0x7FFFFFFFFFFFFFF + out[24] + out[26] = ((in[23] >> 62) | ((in[24] & 0x1FFFFFFFFFFFFFF) << 2)) + out[25] + out[27] = ((in[24] >> 57) | ((in[25] & 0xFFFFFFFFFFFFF) << 7)) + out[26] + out[28] = ((in[25] >> 52) | ((in[26] & 0x7FFFFFFFFFFF) << 12)) + out[27] + out[29] = ((in[26] >> 47) | ((in[27] & 0x3FFFFFFFFFF) << 17)) + out[28] + out[30] = ((in[27] >> 42) | ((in[28] & 0x1FFFFFFFFF) << 22)) + out[29] + out[31] = ((in[28] >> 37) | ((in[29] & 0xFFFFFFFF) << 27)) + out[30] + out[32] = ((in[29] >> 32) | ((in[30] & 0x7FFFFFF) << 32)) + out[31] + out[33] = ((in[30] >> 27) | ((in[31] & 0x3FFFFF) << 37)) + out[32] + out[34] = ((in[31] >> 22) | ((in[32] & 0x1FFFF) << 42)) + out[33] + out[35] = ((in[32] >> 17) | ((in[33] & 0xFFF) << 47)) + out[34] + out[36] = ((in[33] >> 12) | ((in[34] & 0x7F) << 52)) + out[35] + out[37] = ((in[34] >> 7) | ((in[35] & 0x3) << 57)) + out[36] + out[38] = (in[35] >> 2) & 0x7FFFFFFFFFFFFFF + out[37] + out[39] = ((in[35] >> 61) | ((in[36] & 0xFFFFFFFFFFFFFF) << 3)) + out[38] + out[40] = ((in[36] >> 56) | ((in[37] & 0x7FFFFFFFFFFFF) << 8)) + out[39] + out[41] = ((in[37] >> 51) | ((in[38] & 0x3FFFFFFFFFFF) << 13)) + out[40] + out[42] = ((in[38] >> 46) | ((in[39] & 0x1FFFFFFFFFF) << 18)) + out[41] + out[43] = ((in[39] >> 41) | ((in[40] & 0xFFFFFFFFF) << 23)) + out[42] + out[44] = ((in[40] >> 36) | ((in[41] & 0x7FFFFFFF) << 28)) + out[43] + out[45] = ((in[41] >> 31) | ((in[42] & 0x3FFFFFF) << 33)) + out[44] + out[46] = ((in[42] >> 26) | ((in[43] & 0x1FFFFF) << 38)) + out[45] + out[47] = ((in[43] >> 21) | ((in[44] & 0xFFFF) << 43)) + out[46] + out[48] = ((in[44] >> 16) | ((in[45] & 0x7FF) << 48)) + out[47] + out[49] = ((in[45] >> 11) | ((in[46] & 0x3F) << 53)) + out[48] + out[50] = ((in[46] >> 6) | ((in[47] & 0x1) << 58)) + out[49] + out[51] = (in[47] >> 1) & 0x7FFFFFFFFFFFFFF + out[50] + out[52] = ((in[47] >> 60) | ((in[48] & 0x7FFFFFFFFFFFFF) << 4)) + out[51] + out[53] = ((in[48] >> 55) | ((in[49] & 0x3FFFFFFFFFFFF) << 9)) + out[52] + out[54] = ((in[49] >> 50) | ((in[50] & 0x1FFFFFFFFFFF) << 14)) + out[53] + out[55] = ((in[50] >> 45) | ((in[51] & 0xFFFFFFFFFF) << 19)) + out[54] + out[56] = ((in[51] >> 40) | ((in[52] & 0x7FFFFFFFF) << 24)) + out[55] + out[57] = ((in[52] >> 35) | ((in[53] & 0x3FFFFFFF) << 29)) + out[56] + out[58] = ((in[53] >> 30) | ((in[54] & 0x1FFFFFF) << 34)) + out[57] + out[59] = ((in[54] >> 25) | ((in[55] & 0xFFFFF) << 39)) + out[58] + out[60] = ((in[55] >> 20) | ((in[56] & 0x7FFF) << 44)) + out[59] + out[61] = ((in[56] >> 15) | ((in[57] & 0x3FF) << 49)) + out[60] + out[62] = ((in[57] >> 10) | ((in[58] & 0x1F) << 54)) + out[61] + out[63] = (in[58] >> 5) + out[62] +} + +func deltaunpack_uint64_60(initoffset uint64, in *[60]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0xFFFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 60) | ((in[1] & 0xFFFFFFFFFFFFFF) << 4)) + out[0] + out[2] = ((in[1] >> 56) | ((in[2] & 0xFFFFFFFFFFFFF) << 8)) + out[1] + out[3] = ((in[2] >> 52) | ((in[3] & 0xFFFFFFFFFFFF) << 12)) + out[2] + out[4] = ((in[3] >> 48) | ((in[4] & 0xFFFFFFFFFFF) << 16)) + out[3] + out[5] = ((in[4] >> 44) | ((in[5] & 0xFFFFFFFFFF) << 20)) + out[4] + out[6] = ((in[5] >> 40) | ((in[6] & 0xFFFFFFFFF) << 24)) + out[5] + out[7] = ((in[6] >> 36) | ((in[7] & 0xFFFFFFFF) << 28)) + out[6] + out[8] = ((in[7] >> 32) | ((in[8] & 0xFFFFFFF) << 32)) + out[7] + out[9] = ((in[8] >> 28) | ((in[9] & 0xFFFFFF) << 36)) + out[8] + out[10] = ((in[9] >> 24) | ((in[10] & 0xFFFFF) << 40)) + out[9] + out[11] = ((in[10] >> 20) | ((in[11] & 0xFFFF) << 44)) + out[10] + out[12] = ((in[11] >> 16) | ((in[12] & 0xFFF) << 48)) + out[11] + out[13] = ((in[12] >> 12) | ((in[13] & 0xFF) << 52)) + out[12] + out[14] = ((in[13] >> 8) | ((in[14] & 0xF) << 56)) + out[13] + out[15] = (in[14] >> 4) + out[14] + out[16] = (in[15] >> 0) & 0xFFFFFFFFFFFFFFF + out[15] + out[17] = ((in[15] >> 60) | ((in[16] & 0xFFFFFFFFFFFFFF) << 4)) + out[16] + out[18] = ((in[16] >> 56) | ((in[17] & 0xFFFFFFFFFFFFF) << 8)) + out[17] + out[19] = ((in[17] >> 52) | ((in[18] & 0xFFFFFFFFFFFF) << 12)) + out[18] + out[20] = ((in[18] >> 48) | ((in[19] & 0xFFFFFFFFFFF) << 16)) + out[19] + out[21] = ((in[19] >> 44) | ((in[20] & 0xFFFFFFFFFF) << 20)) + out[20] + out[22] = ((in[20] >> 40) | ((in[21] & 0xFFFFFFFFF) << 24)) + out[21] + out[23] = ((in[21] >> 36) | ((in[22] & 0xFFFFFFFF) << 28)) + out[22] + out[24] = ((in[22] >> 32) | ((in[23] & 0xFFFFFFF) << 32)) + out[23] + out[25] = ((in[23] >> 28) | ((in[24] & 0xFFFFFF) << 36)) + out[24] + out[26] = ((in[24] >> 24) | ((in[25] & 0xFFFFF) << 40)) + out[25] + out[27] = ((in[25] >> 20) | ((in[26] & 0xFFFF) << 44)) + out[26] + out[28] = ((in[26] >> 16) | ((in[27] & 0xFFF) << 48)) + out[27] + out[29] = ((in[27] >> 12) | ((in[28] & 0xFF) << 52)) + out[28] + out[30] = ((in[28] >> 8) | ((in[29] & 0xF) << 56)) + out[29] + out[31] = (in[29] >> 4) + out[30] + out[32] = (in[30] >> 0) & 0xFFFFFFFFFFFFFFF + out[31] + out[33] = ((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFFFFFF) << 4)) + out[32] + out[34] = ((in[31] >> 56) | ((in[32] & 0xFFFFFFFFFFFFF) << 8)) + out[33] + out[35] = ((in[32] >> 52) | ((in[33] & 0xFFFFFFFFFFFF) << 12)) + out[34] + out[36] = ((in[33] >> 48) | ((in[34] & 0xFFFFFFFFFFF) << 16)) + out[35] + out[37] = ((in[34] >> 44) | ((in[35] & 0xFFFFFFFFFF) << 20)) + out[36] + out[38] = ((in[35] >> 40) | ((in[36] & 0xFFFFFFFFF) << 24)) + out[37] + out[39] = ((in[36] >> 36) | ((in[37] & 0xFFFFFFFF) << 28)) + out[38] + out[40] = ((in[37] >> 32) | ((in[38] & 0xFFFFFFF) << 32)) + out[39] + out[41] = ((in[38] >> 28) | ((in[39] & 0xFFFFFF) << 36)) + out[40] + out[42] = ((in[39] >> 24) | ((in[40] & 0xFFFFF) << 40)) + out[41] + out[43] = ((in[40] >> 20) | ((in[41] & 0xFFFF) << 44)) + out[42] + out[44] = ((in[41] >> 16) | ((in[42] & 0xFFF) << 48)) + out[43] + out[45] = ((in[42] >> 12) | ((in[43] & 0xFF) << 52)) + out[44] + out[46] = ((in[43] >> 8) | ((in[44] & 0xF) << 56)) + out[45] + out[47] = (in[44] >> 4) + out[46] + out[48] = (in[45] >> 0) & 0xFFFFFFFFFFFFFFF + out[47] + out[49] = ((in[45] >> 60) | ((in[46] & 0xFFFFFFFFFFFFFF) << 4)) + out[48] + out[50] = ((in[46] >> 56) | ((in[47] & 0xFFFFFFFFFFFFF) << 8)) + out[49] + out[51] = ((in[47] >> 52) | ((in[48] & 0xFFFFFFFFFFFF) << 12)) + out[50] + out[52] = ((in[48] >> 48) | ((in[49] & 0xFFFFFFFFFFF) << 16)) + out[51] + out[53] = ((in[49] >> 44) | ((in[50] & 0xFFFFFFFFFF) << 20)) + out[52] + out[54] = ((in[50] >> 40) | ((in[51] & 0xFFFFFFFFF) << 24)) + out[53] + out[55] = ((in[51] >> 36) | ((in[52] & 0xFFFFFFFF) << 28)) + out[54] + out[56] = ((in[52] >> 32) | ((in[53] & 0xFFFFFFF) << 32)) + out[55] + out[57] = ((in[53] >> 28) | ((in[54] & 0xFFFFFF) << 36)) + out[56] + out[58] = ((in[54] >> 24) | ((in[55] & 0xFFFFF) << 40)) + out[57] + out[59] = ((in[55] >> 20) | ((in[56] & 0xFFFF) << 44)) + out[58] + out[60] = ((in[56] >> 16) | ((in[57] & 0xFFF) << 48)) + out[59] + out[61] = ((in[57] >> 12) | ((in[58] & 0xFF) << 52)) + out[60] + out[62] = ((in[58] >> 8) | ((in[59] & 0xF) << 56)) + out[61] + out[63] = (in[59] >> 4) + out[62] +} + +func deltaunpack_uint64_61(initoffset uint64, in *[61]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x1FFFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 61) | ((in[1] & 0x3FFFFFFFFFFFFFF) << 3)) + out[0] + out[2] = ((in[1] >> 58) | ((in[2] & 0x7FFFFFFFFFFFFF) << 6)) + out[1] + out[3] = ((in[2] >> 55) | ((in[3] & 0xFFFFFFFFFFFFF) << 9)) + out[2] + out[4] = ((in[3] >> 52) | ((in[4] & 0x1FFFFFFFFFFFF) << 12)) + out[3] + out[5] = ((in[4] >> 49) | ((in[5] & 0x3FFFFFFFFFFF) << 15)) + out[4] + out[6] = ((in[5] >> 46) | ((in[6] & 0x7FFFFFFFFFF) << 18)) + out[5] + out[7] = ((in[6] >> 43) | ((in[7] & 0xFFFFFFFFFF) << 21)) + out[6] + out[8] = ((in[7] >> 40) | ((in[8] & 0x1FFFFFFFFF) << 24)) + out[7] + out[9] = ((in[8] >> 37) | ((in[9] & 0x3FFFFFFFF) << 27)) + out[8] + out[10] = ((in[9] >> 34) | ((in[10] & 0x7FFFFFFF) << 30)) + out[9] + out[11] = ((in[10] >> 31) | ((in[11] & 0xFFFFFFF) << 33)) + out[10] + out[12] = ((in[11] >> 28) | ((in[12] & 0x1FFFFFF) << 36)) + out[11] + out[13] = ((in[12] >> 25) | ((in[13] & 0x3FFFFF) << 39)) + out[12] + out[14] = ((in[13] >> 22) | ((in[14] & 0x7FFFF) << 42)) + out[13] + out[15] = ((in[14] >> 19) | ((in[15] & 0xFFFF) << 45)) + out[14] + out[16] = ((in[15] >> 16) | ((in[16] & 0x1FFF) << 48)) + out[15] + out[17] = ((in[16] >> 13) | ((in[17] & 0x3FF) << 51)) + out[16] + out[18] = ((in[17] >> 10) | ((in[18] & 0x7F) << 54)) + out[17] + out[19] = ((in[18] >> 7) | ((in[19] & 0xF) << 57)) + out[18] + out[20] = ((in[19] >> 4) | ((in[20] & 0x1) << 60)) + out[19] + out[21] = (in[20] >> 1) & 0x1FFFFFFFFFFFFFFF + out[20] + out[22] = ((in[20] >> 62) | ((in[21] & 0x7FFFFFFFFFFFFFF) << 2)) + out[21] + out[23] = ((in[21] >> 59) | ((in[22] & 0xFFFFFFFFFFFFFF) << 5)) + out[22] + out[24] = ((in[22] >> 56) | ((in[23] & 0x1FFFFFFFFFFFFF) << 8)) + out[23] + out[25] = ((in[23] >> 53) | ((in[24] & 0x3FFFFFFFFFFFF) << 11)) + out[24] + out[26] = ((in[24] >> 50) | ((in[25] & 0x7FFFFFFFFFFF) << 14)) + out[25] + out[27] = ((in[25] >> 47) | ((in[26] & 0xFFFFFFFFFFF) << 17)) + out[26] + out[28] = ((in[26] >> 44) | ((in[27] & 0x1FFFFFFFFFF) << 20)) + out[27] + out[29] = ((in[27] >> 41) | ((in[28] & 0x3FFFFFFFFF) << 23)) + out[28] + out[30] = ((in[28] >> 38) | ((in[29] & 0x7FFFFFFFF) << 26)) + out[29] + out[31] = ((in[29] >> 35) | ((in[30] & 0xFFFFFFFF) << 29)) + out[30] + out[32] = ((in[30] >> 32) | ((in[31] & 0x1FFFFFFF) << 32)) + out[31] + out[33] = ((in[31] >> 29) | ((in[32] & 0x3FFFFFF) << 35)) + out[32] + out[34] = ((in[32] >> 26) | ((in[33] & 0x7FFFFF) << 38)) + out[33] + out[35] = ((in[33] >> 23) | ((in[34] & 0xFFFFF) << 41)) + out[34] + out[36] = ((in[34] >> 20) | ((in[35] & 0x1FFFF) << 44)) + out[35] + out[37] = ((in[35] >> 17) | ((in[36] & 0x3FFF) << 47)) + out[36] + out[38] = ((in[36] >> 14) | ((in[37] & 0x7FF) << 50)) + out[37] + out[39] = ((in[37] >> 11) | ((in[38] & 0xFF) << 53)) + out[38] + out[40] = ((in[38] >> 8) | ((in[39] & 0x1F) << 56)) + out[39] + out[41] = ((in[39] >> 5) | ((in[40] & 0x3) << 59)) + out[40] + out[42] = (in[40] >> 2) & 0x1FFFFFFFFFFFFFFF + out[41] + out[43] = ((in[40] >> 63) | ((in[41] & 0xFFFFFFFFFFFFFFF) << 1)) + out[42] + out[44] = ((in[41] >> 60) | ((in[42] & 0x1FFFFFFFFFFFFFF) << 4)) + out[43] + out[45] = ((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFFFFFF) << 7)) + out[44] + out[46] = ((in[43] >> 54) | ((in[44] & 0x7FFFFFFFFFFFF) << 10)) + out[45] + out[47] = ((in[44] >> 51) | ((in[45] & 0xFFFFFFFFFFFF) << 13)) + out[46] + out[48] = ((in[45] >> 48) | ((in[46] & 0x1FFFFFFFFFFF) << 16)) + out[47] + out[49] = ((in[46] >> 45) | ((in[47] & 0x3FFFFFFFFFF) << 19)) + out[48] + out[50] = ((in[47] >> 42) | ((in[48] & 0x7FFFFFFFFF) << 22)) + out[49] + out[51] = ((in[48] >> 39) | ((in[49] & 0xFFFFFFFFF) << 25)) + out[50] + out[52] = ((in[49] >> 36) | ((in[50] & 0x1FFFFFFFF) << 28)) + out[51] + out[53] = ((in[50] >> 33) | ((in[51] & 0x3FFFFFFF) << 31)) + out[52] + out[54] = ((in[51] >> 30) | ((in[52] & 0x7FFFFFF) << 34)) + out[53] + out[55] = ((in[52] >> 27) | ((in[53] & 0xFFFFFF) << 37)) + out[54] + out[56] = ((in[53] >> 24) | ((in[54] & 0x1FFFFF) << 40)) + out[55] + out[57] = ((in[54] >> 21) | ((in[55] & 0x3FFFF) << 43)) + out[56] + out[58] = ((in[55] >> 18) | ((in[56] & 0x7FFF) << 46)) + out[57] + out[59] = ((in[56] >> 15) | ((in[57] & 0xFFF) << 49)) + out[58] + out[60] = ((in[57] >> 12) | ((in[58] & 0x1FF) << 52)) + out[59] + out[61] = ((in[58] >> 9) | ((in[59] & 0x3F) << 55)) + out[60] + out[62] = ((in[59] >> 6) | ((in[60] & 0x7) << 58)) + out[61] + out[63] = (in[60] >> 3) + out[62] +} + +func deltaunpack_uint64_62(initoffset uint64, in *[62]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x3FFFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 62) | ((in[1] & 0xFFFFFFFFFFFFFFF) << 2)) + out[0] + out[2] = ((in[1] >> 60) | ((in[2] & 0x3FFFFFFFFFFFFFF) << 4)) + out[1] + out[3] = ((in[2] >> 58) | ((in[3] & 0xFFFFFFFFFFFFFF) << 6)) + out[2] + out[4] = ((in[3] >> 56) | ((in[4] & 0x3FFFFFFFFFFFFF) << 8)) + out[3] + out[5] = ((in[4] >> 54) | ((in[5] & 0xFFFFFFFFFFFFF) << 10)) + out[4] + out[6] = ((in[5] >> 52) | ((in[6] & 0x3FFFFFFFFFFFF) << 12)) + out[5] + out[7] = ((in[6] >> 50) | ((in[7] & 0xFFFFFFFFFFFF) << 14)) + out[6] + out[8] = ((in[7] >> 48) | ((in[8] & 0x3FFFFFFFFFFF) << 16)) + out[7] + out[9] = ((in[8] >> 46) | ((in[9] & 0xFFFFFFFFFFF) << 18)) + out[8] + out[10] = ((in[9] >> 44) | ((in[10] & 0x3FFFFFFFFFF) << 20)) + out[9] + out[11] = ((in[10] >> 42) | ((in[11] & 0xFFFFFFFFFF) << 22)) + out[10] + out[12] = ((in[11] >> 40) | ((in[12] & 0x3FFFFFFFFF) << 24)) + out[11] + out[13] = ((in[12] >> 38) | ((in[13] & 0xFFFFFFFFF) << 26)) + out[12] + out[14] = ((in[13] >> 36) | ((in[14] & 0x3FFFFFFFF) << 28)) + out[13] + out[15] = ((in[14] >> 34) | ((in[15] & 0xFFFFFFFF) << 30)) + out[14] + out[16] = ((in[15] >> 32) | ((in[16] & 0x3FFFFFFF) << 32)) + out[15] + out[17] = ((in[16] >> 30) | ((in[17] & 0xFFFFFFF) << 34)) + out[16] + out[18] = ((in[17] >> 28) | ((in[18] & 0x3FFFFFF) << 36)) + out[17] + out[19] = ((in[18] >> 26) | ((in[19] & 0xFFFFFF) << 38)) + out[18] + out[20] = ((in[19] >> 24) | ((in[20] & 0x3FFFFF) << 40)) + out[19] + out[21] = ((in[20] >> 22) | ((in[21] & 0xFFFFF) << 42)) + out[20] + out[22] = ((in[21] >> 20) | ((in[22] & 0x3FFFF) << 44)) + out[21] + out[23] = ((in[22] >> 18) | ((in[23] & 0xFFFF) << 46)) + out[22] + out[24] = ((in[23] >> 16) | ((in[24] & 0x3FFF) << 48)) + out[23] + out[25] = ((in[24] >> 14) | ((in[25] & 0xFFF) << 50)) + out[24] + out[26] = ((in[25] >> 12) | ((in[26] & 0x3FF) << 52)) + out[25] + out[27] = ((in[26] >> 10) | ((in[27] & 0xFF) << 54)) + out[26] + out[28] = ((in[27] >> 8) | ((in[28] & 0x3F) << 56)) + out[27] + out[29] = ((in[28] >> 6) | ((in[29] & 0xF) << 58)) + out[28] + out[30] = ((in[29] >> 4) | ((in[30] & 0x3) << 60)) + out[29] + out[31] = (in[30] >> 2) + out[30] + out[32] = (in[31] >> 0) & 0x3FFFFFFFFFFFFFFF + out[31] + out[33] = ((in[31] >> 62) | ((in[32] & 0xFFFFFFFFFFFFFFF) << 2)) + out[32] + out[34] = ((in[32] >> 60) | ((in[33] & 0x3FFFFFFFFFFFFFF) << 4)) + out[33] + out[35] = ((in[33] >> 58) | ((in[34] & 0xFFFFFFFFFFFFFF) << 6)) + out[34] + out[36] = ((in[34] >> 56) | ((in[35] & 0x3FFFFFFFFFFFFF) << 8)) + out[35] + out[37] = ((in[35] >> 54) | ((in[36] & 0xFFFFFFFFFFFFF) << 10)) + out[36] + out[38] = ((in[36] >> 52) | ((in[37] & 0x3FFFFFFFFFFFF) << 12)) + out[37] + out[39] = ((in[37] >> 50) | ((in[38] & 0xFFFFFFFFFFFF) << 14)) + out[38] + out[40] = ((in[38] >> 48) | ((in[39] & 0x3FFFFFFFFFFF) << 16)) + out[39] + out[41] = ((in[39] >> 46) | ((in[40] & 0xFFFFFFFFFFF) << 18)) + out[40] + out[42] = ((in[40] >> 44) | ((in[41] & 0x3FFFFFFFFFF) << 20)) + out[41] + out[43] = ((in[41] >> 42) | ((in[42] & 0xFFFFFFFFFF) << 22)) + out[42] + out[44] = ((in[42] >> 40) | ((in[43] & 0x3FFFFFFFFF) << 24)) + out[43] + out[45] = ((in[43] >> 38) | ((in[44] & 0xFFFFFFFFF) << 26)) + out[44] + out[46] = ((in[44] >> 36) | ((in[45] & 0x3FFFFFFFF) << 28)) + out[45] + out[47] = ((in[45] >> 34) | ((in[46] & 0xFFFFFFFF) << 30)) + out[46] + out[48] = ((in[46] >> 32) | ((in[47] & 0x3FFFFFFF) << 32)) + out[47] + out[49] = ((in[47] >> 30) | ((in[48] & 0xFFFFFFF) << 34)) + out[48] + out[50] = ((in[48] >> 28) | ((in[49] & 0x3FFFFFF) << 36)) + out[49] + out[51] = ((in[49] >> 26) | ((in[50] & 0xFFFFFF) << 38)) + out[50] + out[52] = ((in[50] >> 24) | ((in[51] & 0x3FFFFF) << 40)) + out[51] + out[53] = ((in[51] >> 22) | ((in[52] & 0xFFFFF) << 42)) + out[52] + out[54] = ((in[52] >> 20) | ((in[53] & 0x3FFFF) << 44)) + out[53] + out[55] = ((in[53] >> 18) | ((in[54] & 0xFFFF) << 46)) + out[54] + out[56] = ((in[54] >> 16) | ((in[55] & 0x3FFF) << 48)) + out[55] + out[57] = ((in[55] >> 14) | ((in[56] & 0xFFF) << 50)) + out[56] + out[58] = ((in[56] >> 12) | ((in[57] & 0x3FF) << 52)) + out[57] + out[59] = ((in[57] >> 10) | ((in[58] & 0xFF) << 54)) + out[58] + out[60] = ((in[58] >> 8) | ((in[59] & 0x3F) << 56)) + out[59] + out[61] = ((in[59] >> 6) | ((in[60] & 0xF) << 58)) + out[60] + out[62] = ((in[60] >> 4) | ((in[61] & 0x3) << 60)) + out[61] + out[63] = (in[61] >> 2) + out[62] +} + +func deltaunpack_uint64_63(initoffset uint64, in *[63]uint64, out *[64]uint64) { + out[0] = (in[0] >> 0) & 0x7FFFFFFFFFFFFFFF + initoffset + out[1] = ((in[0] >> 63) | ((in[1] & 0x3FFFFFFFFFFFFFFF) << 1)) + out[0] + out[2] = ((in[1] >> 62) | ((in[2] & 0x1FFFFFFFFFFFFFFF) << 2)) + out[1] + out[3] = ((in[2] >> 61) | ((in[3] & 0xFFFFFFFFFFFFFFF) << 3)) + out[2] + out[4] = ((in[3] >> 60) | ((in[4] & 0x7FFFFFFFFFFFFFF) << 4)) + out[3] + out[5] = ((in[4] >> 59) | ((in[5] & 0x3FFFFFFFFFFFFFF) << 5)) + out[4] + out[6] = ((in[5] >> 58) | ((in[6] & 0x1FFFFFFFFFFFFFF) << 6)) + out[5] + out[7] = ((in[6] >> 57) | ((in[7] & 0xFFFFFFFFFFFFFF) << 7)) + out[6] + out[8] = ((in[7] >> 56) | ((in[8] & 0x7FFFFFFFFFFFFF) << 8)) + out[7] + out[9] = ((in[8] >> 55) | ((in[9] & 0x3FFFFFFFFFFFFF) << 9)) + out[8] + out[10] = ((in[9] >> 54) | ((in[10] & 0x1FFFFFFFFFFFFF) << 10)) + out[9] + out[11] = ((in[10] >> 53) | ((in[11] & 0xFFFFFFFFFFFFF) << 11)) + out[10] + out[12] = ((in[11] >> 52) | ((in[12] & 0x7FFFFFFFFFFFF) << 12)) + out[11] + out[13] = ((in[12] >> 51) | ((in[13] & 0x3FFFFFFFFFFFF) << 13)) + out[12] + out[14] = ((in[13] >> 50) | ((in[14] & 0x1FFFFFFFFFFFF) << 14)) + out[13] + out[15] = ((in[14] >> 49) | ((in[15] & 0xFFFFFFFFFFFF) << 15)) + out[14] + out[16] = ((in[15] >> 48) | ((in[16] & 0x7FFFFFFFFFFF) << 16)) + out[15] + out[17] = ((in[16] >> 47) | ((in[17] & 0x3FFFFFFFFFFF) << 17)) + out[16] + out[18] = ((in[17] >> 46) | ((in[18] & 0x1FFFFFFFFFFF) << 18)) + out[17] + out[19] = ((in[18] >> 45) | ((in[19] & 0xFFFFFFFFFFF) << 19)) + out[18] + out[20] = ((in[19] >> 44) | ((in[20] & 0x7FFFFFFFFFF) << 20)) + out[19] + out[21] = ((in[20] >> 43) | ((in[21] & 0x3FFFFFFFFFF) << 21)) + out[20] + out[22] = ((in[21] >> 42) | ((in[22] & 0x1FFFFFFFFFF) << 22)) + out[21] + out[23] = ((in[22] >> 41) | ((in[23] & 0xFFFFFFFFFF) << 23)) + out[22] + out[24] = ((in[23] >> 40) | ((in[24] & 0x7FFFFFFFFF) << 24)) + out[23] + out[25] = ((in[24] >> 39) | ((in[25] & 0x3FFFFFFFFF) << 25)) + out[24] + out[26] = ((in[25] >> 38) | ((in[26] & 0x1FFFFFFFFF) << 26)) + out[25] + out[27] = ((in[26] >> 37) | ((in[27] & 0xFFFFFFFFF) << 27)) + out[26] + out[28] = ((in[27] >> 36) | ((in[28] & 0x7FFFFFFFF) << 28)) + out[27] + out[29] = ((in[28] >> 35) | ((in[29] & 0x3FFFFFFFF) << 29)) + out[28] + out[30] = ((in[29] >> 34) | ((in[30] & 0x1FFFFFFFF) << 30)) + out[29] + out[31] = ((in[30] >> 33) | ((in[31] & 0xFFFFFFFF) << 31)) + out[30] + out[32] = ((in[31] >> 32) | ((in[32] & 0x7FFFFFFF) << 32)) + out[31] + out[33] = ((in[32] >> 31) | ((in[33] & 0x3FFFFFFF) << 33)) + out[32] + out[34] = ((in[33] >> 30) | ((in[34] & 0x1FFFFFFF) << 34)) + out[33] + out[35] = ((in[34] >> 29) | ((in[35] & 0xFFFFFFF) << 35)) + out[34] + out[36] = ((in[35] >> 28) | ((in[36] & 0x7FFFFFF) << 36)) + out[35] + out[37] = ((in[36] >> 27) | ((in[37] & 0x3FFFFFF) << 37)) + out[36] + out[38] = ((in[37] >> 26) | ((in[38] & 0x1FFFFFF) << 38)) + out[37] + out[39] = ((in[38] >> 25) | ((in[39] & 0xFFFFFF) << 39)) + out[38] + out[40] = ((in[39] >> 24) | ((in[40] & 0x7FFFFF) << 40)) + out[39] + out[41] = ((in[40] >> 23) | ((in[41] & 0x3FFFFF) << 41)) + out[40] + out[42] = ((in[41] >> 22) | ((in[42] & 0x1FFFFF) << 42)) + out[41] + out[43] = ((in[42] >> 21) | ((in[43] & 0xFFFFF) << 43)) + out[42] + out[44] = ((in[43] >> 20) | ((in[44] & 0x7FFFF) << 44)) + out[43] + out[45] = ((in[44] >> 19) | ((in[45] & 0x3FFFF) << 45)) + out[44] + out[46] = ((in[45] >> 18) | ((in[46] & 0x1FFFF) << 46)) + out[45] + out[47] = ((in[46] >> 17) | ((in[47] & 0xFFFF) << 47)) + out[46] + out[48] = ((in[47] >> 16) | ((in[48] & 0x7FFF) << 48)) + out[47] + out[49] = ((in[48] >> 15) | ((in[49] & 0x3FFF) << 49)) + out[48] + out[50] = ((in[49] >> 14) | ((in[50] & 0x1FFF) << 50)) + out[49] + out[51] = ((in[50] >> 13) | ((in[51] & 0xFFF) << 51)) + out[50] + out[52] = ((in[51] >> 12) | ((in[52] & 0x7FF) << 52)) + out[51] + out[53] = ((in[52] >> 11) | ((in[53] & 0x3FF) << 53)) + out[52] + out[54] = ((in[53] >> 10) | ((in[54] & 0x1FF) << 54)) + out[53] + out[55] = ((in[54] >> 9) | ((in[55] & 0xFF) << 55)) + out[54] + out[56] = ((in[55] >> 8) | ((in[56] & 0x7F) << 56)) + out[55] + out[57] = ((in[56] >> 7) | ((in[57] & 0x3F) << 57)) + out[56] + out[58] = ((in[57] >> 6) | ((in[58] & 0x1F) << 58)) + out[57] + out[59] = ((in[58] >> 5) | ((in[59] & 0xF) << 59)) + out[58] + out[60] = ((in[59] >> 4) | ((in[60] & 0x7) << 60)) + out[59] + out[61] = ((in[60] >> 3) | ((in[61] & 0x3) << 61)) + out[60] + out[62] = ((in[61] >> 2) | ((in[62] & 0x1) << 62)) + out[61] + out[63] = (in[62] >> 1) + out[62] +} + +// --- zigzag + +// deltaPackZigzag_uint64 Binary packing of one block of `in`, starting from `initoffset` +// to out. Differential coding is applied first, the difference is zigzag encoded. +// Caller must give the proper `bitlen` of the block +func deltaPackZigzag_uint64(initoffset uint64, in []uint64, out []uint64, bitlen int) { + switch bitlen { + case 0: + deltapackzigzag_uint64_0(initoffset, (*[64]uint64)(in), (*[0]uint64)(out)) + case 1: + deltapackzigzag_uint64_1(initoffset, (*[64]uint64)(in), (*[1]uint64)(out)) + case 2: + deltapackzigzag_uint64_2(initoffset, (*[64]uint64)(in), (*[2]uint64)(out)) + case 3: + deltapackzigzag_uint64_3(initoffset, (*[64]uint64)(in), (*[3]uint64)(out)) + case 4: + deltapackzigzag_uint64_4(initoffset, (*[64]uint64)(in), (*[4]uint64)(out)) + case 5: + deltapackzigzag_uint64_5(initoffset, (*[64]uint64)(in), (*[5]uint64)(out)) + case 6: + deltapackzigzag_uint64_6(initoffset, (*[64]uint64)(in), (*[6]uint64)(out)) + case 7: + deltapackzigzag_uint64_7(initoffset, (*[64]uint64)(in), (*[7]uint64)(out)) + case 8: + deltapackzigzag_uint64_8(initoffset, (*[64]uint64)(in), (*[8]uint64)(out)) + case 9: + deltapackzigzag_uint64_9(initoffset, (*[64]uint64)(in), (*[9]uint64)(out)) + case 10: + deltapackzigzag_uint64_10(initoffset, (*[64]uint64)(in), (*[10]uint64)(out)) + case 11: + deltapackzigzag_uint64_11(initoffset, (*[64]uint64)(in), (*[11]uint64)(out)) + case 12: + deltapackzigzag_uint64_12(initoffset, (*[64]uint64)(in), (*[12]uint64)(out)) + case 13: + deltapackzigzag_uint64_13(initoffset, (*[64]uint64)(in), (*[13]uint64)(out)) + case 14: + deltapackzigzag_uint64_14(initoffset, (*[64]uint64)(in), (*[14]uint64)(out)) + case 15: + deltapackzigzag_uint64_15(initoffset, (*[64]uint64)(in), (*[15]uint64)(out)) + case 16: + deltapackzigzag_uint64_16(initoffset, (*[64]uint64)(in), (*[16]uint64)(out)) + case 17: + deltapackzigzag_uint64_17(initoffset, (*[64]uint64)(in), (*[17]uint64)(out)) + case 18: + deltapackzigzag_uint64_18(initoffset, (*[64]uint64)(in), (*[18]uint64)(out)) + case 19: + deltapackzigzag_uint64_19(initoffset, (*[64]uint64)(in), (*[19]uint64)(out)) + case 20: + deltapackzigzag_uint64_20(initoffset, (*[64]uint64)(in), (*[20]uint64)(out)) + case 21: + deltapackzigzag_uint64_21(initoffset, (*[64]uint64)(in), (*[21]uint64)(out)) + case 22: + deltapackzigzag_uint64_22(initoffset, (*[64]uint64)(in), (*[22]uint64)(out)) + case 23: + deltapackzigzag_uint64_23(initoffset, (*[64]uint64)(in), (*[23]uint64)(out)) + case 24: + deltapackzigzag_uint64_24(initoffset, (*[64]uint64)(in), (*[24]uint64)(out)) + case 25: + deltapackzigzag_uint64_25(initoffset, (*[64]uint64)(in), (*[25]uint64)(out)) + case 26: + deltapackzigzag_uint64_26(initoffset, (*[64]uint64)(in), (*[26]uint64)(out)) + case 27: + deltapackzigzag_uint64_27(initoffset, (*[64]uint64)(in), (*[27]uint64)(out)) + case 28: + deltapackzigzag_uint64_28(initoffset, (*[64]uint64)(in), (*[28]uint64)(out)) + case 29: + deltapackzigzag_uint64_29(initoffset, (*[64]uint64)(in), (*[29]uint64)(out)) + case 30: + deltapackzigzag_uint64_30(initoffset, (*[64]uint64)(in), (*[30]uint64)(out)) + case 31: + deltapackzigzag_uint64_31(initoffset, (*[64]uint64)(in), (*[31]uint64)(out)) + case 32: + deltapackzigzag_uint64_32(initoffset, (*[64]uint64)(in), (*[32]uint64)(out)) + case 33: + deltapackzigzag_uint64_33(initoffset, (*[64]uint64)(in), (*[33]uint64)(out)) + case 34: + deltapackzigzag_uint64_34(initoffset, (*[64]uint64)(in), (*[34]uint64)(out)) + case 35: + deltapackzigzag_uint64_35(initoffset, (*[64]uint64)(in), (*[35]uint64)(out)) + case 36: + deltapackzigzag_uint64_36(initoffset, (*[64]uint64)(in), (*[36]uint64)(out)) + case 37: + deltapackzigzag_uint64_37(initoffset, (*[64]uint64)(in), (*[37]uint64)(out)) + case 38: + deltapackzigzag_uint64_38(initoffset, (*[64]uint64)(in), (*[38]uint64)(out)) + case 39: + deltapackzigzag_uint64_39(initoffset, (*[64]uint64)(in), (*[39]uint64)(out)) + case 40: + deltapackzigzag_uint64_40(initoffset, (*[64]uint64)(in), (*[40]uint64)(out)) + case 41: + deltapackzigzag_uint64_41(initoffset, (*[64]uint64)(in), (*[41]uint64)(out)) + case 42: + deltapackzigzag_uint64_42(initoffset, (*[64]uint64)(in), (*[42]uint64)(out)) + case 43: + deltapackzigzag_uint64_43(initoffset, (*[64]uint64)(in), (*[43]uint64)(out)) + case 44: + deltapackzigzag_uint64_44(initoffset, (*[64]uint64)(in), (*[44]uint64)(out)) + case 45: + deltapackzigzag_uint64_45(initoffset, (*[64]uint64)(in), (*[45]uint64)(out)) + case 46: + deltapackzigzag_uint64_46(initoffset, (*[64]uint64)(in), (*[46]uint64)(out)) + case 47: + deltapackzigzag_uint64_47(initoffset, (*[64]uint64)(in), (*[47]uint64)(out)) + case 48: + deltapackzigzag_uint64_48(initoffset, (*[64]uint64)(in), (*[48]uint64)(out)) + case 49: + deltapackzigzag_uint64_49(initoffset, (*[64]uint64)(in), (*[49]uint64)(out)) + case 50: + deltapackzigzag_uint64_50(initoffset, (*[64]uint64)(in), (*[50]uint64)(out)) + case 51: + deltapackzigzag_uint64_51(initoffset, (*[64]uint64)(in), (*[51]uint64)(out)) + case 52: + deltapackzigzag_uint64_52(initoffset, (*[64]uint64)(in), (*[52]uint64)(out)) + case 53: + deltapackzigzag_uint64_53(initoffset, (*[64]uint64)(in), (*[53]uint64)(out)) + case 54: + deltapackzigzag_uint64_54(initoffset, (*[64]uint64)(in), (*[54]uint64)(out)) + case 55: + deltapackzigzag_uint64_55(initoffset, (*[64]uint64)(in), (*[55]uint64)(out)) + case 56: + deltapackzigzag_uint64_56(initoffset, (*[64]uint64)(in), (*[56]uint64)(out)) + case 57: + deltapackzigzag_uint64_57(initoffset, (*[64]uint64)(in), (*[57]uint64)(out)) + case 58: + deltapackzigzag_uint64_58(initoffset, (*[64]uint64)(in), (*[58]uint64)(out)) + case 59: + deltapackzigzag_uint64_59(initoffset, (*[64]uint64)(in), (*[59]uint64)(out)) + case 60: + deltapackzigzag_uint64_60(initoffset, (*[64]uint64)(in), (*[60]uint64)(out)) + case 61: + deltapackzigzag_uint64_61(initoffset, (*[64]uint64)(in), (*[61]uint64)(out)) + case 62: + deltapackzigzag_uint64_62(initoffset, (*[64]uint64)(in), (*[62]uint64)(out)) + case 63: + deltapackzigzag_uint64_63(initoffset, (*[64]uint64)(in), (*[63]uint64)(out)) + case 64: + *(*[64]uint64)(out) = *((*[64]uint64)(unsafe.Pointer((*[64]uint64)(in)))) + default: + panic("unsupported bitlen") + } +} + +// deltaUnpackZigzag_uint64 Decoding operation for DeltaPackZigzag_uint64 +func deltaUnpackZigzag_uint64(initoffset uint64, in []uint64, out []uint64, bitlen int) { + switch bitlen { + case 0: + deltaunpackzigzag_uint64_0(initoffset, (*[0]uint64)(in), (*[64]uint64)(out)) + case 1: + deltaunpackzigzag_uint64_1(initoffset, (*[1]uint64)(in), (*[64]uint64)(out)) + case 2: + deltaunpackzigzag_uint64_2(initoffset, (*[2]uint64)(in), (*[64]uint64)(out)) + case 3: + deltaunpackzigzag_uint64_3(initoffset, (*[3]uint64)(in), (*[64]uint64)(out)) + case 4: + deltaunpackzigzag_uint64_4(initoffset, (*[4]uint64)(in), (*[64]uint64)(out)) + case 5: + deltaunpackzigzag_uint64_5(initoffset, (*[5]uint64)(in), (*[64]uint64)(out)) + case 6: + deltaunpackzigzag_uint64_6(initoffset, (*[6]uint64)(in), (*[64]uint64)(out)) + case 7: + deltaunpackzigzag_uint64_7(initoffset, (*[7]uint64)(in), (*[64]uint64)(out)) + case 8: + deltaunpackzigzag_uint64_8(initoffset, (*[8]uint64)(in), (*[64]uint64)(out)) + case 9: + deltaunpackzigzag_uint64_9(initoffset, (*[9]uint64)(in), (*[64]uint64)(out)) + case 10: + deltaunpackzigzag_uint64_10(initoffset, (*[10]uint64)(in), (*[64]uint64)(out)) + case 11: + deltaunpackzigzag_uint64_11(initoffset, (*[11]uint64)(in), (*[64]uint64)(out)) + case 12: + deltaunpackzigzag_uint64_12(initoffset, (*[12]uint64)(in), (*[64]uint64)(out)) + case 13: + deltaunpackzigzag_uint64_13(initoffset, (*[13]uint64)(in), (*[64]uint64)(out)) + case 14: + deltaunpackzigzag_uint64_14(initoffset, (*[14]uint64)(in), (*[64]uint64)(out)) + case 15: + deltaunpackzigzag_uint64_15(initoffset, (*[15]uint64)(in), (*[64]uint64)(out)) + case 16: + deltaunpackzigzag_uint64_16(initoffset, (*[16]uint64)(in), (*[64]uint64)(out)) + case 17: + deltaunpackzigzag_uint64_17(initoffset, (*[17]uint64)(in), (*[64]uint64)(out)) + case 18: + deltaunpackzigzag_uint64_18(initoffset, (*[18]uint64)(in), (*[64]uint64)(out)) + case 19: + deltaunpackzigzag_uint64_19(initoffset, (*[19]uint64)(in), (*[64]uint64)(out)) + case 20: + deltaunpackzigzag_uint64_20(initoffset, (*[20]uint64)(in), (*[64]uint64)(out)) + case 21: + deltaunpackzigzag_uint64_21(initoffset, (*[21]uint64)(in), (*[64]uint64)(out)) + case 22: + deltaunpackzigzag_uint64_22(initoffset, (*[22]uint64)(in), (*[64]uint64)(out)) + case 23: + deltaunpackzigzag_uint64_23(initoffset, (*[23]uint64)(in), (*[64]uint64)(out)) + case 24: + deltaunpackzigzag_uint64_24(initoffset, (*[24]uint64)(in), (*[64]uint64)(out)) + case 25: + deltaunpackzigzag_uint64_25(initoffset, (*[25]uint64)(in), (*[64]uint64)(out)) + case 26: + deltaunpackzigzag_uint64_26(initoffset, (*[26]uint64)(in), (*[64]uint64)(out)) + case 27: + deltaunpackzigzag_uint64_27(initoffset, (*[27]uint64)(in), (*[64]uint64)(out)) + case 28: + deltaunpackzigzag_uint64_28(initoffset, (*[28]uint64)(in), (*[64]uint64)(out)) + case 29: + deltaunpackzigzag_uint64_29(initoffset, (*[29]uint64)(in), (*[64]uint64)(out)) + case 30: + deltaunpackzigzag_uint64_30(initoffset, (*[30]uint64)(in), (*[64]uint64)(out)) + case 31: + deltaunpackzigzag_uint64_31(initoffset, (*[31]uint64)(in), (*[64]uint64)(out)) + case 32: + deltaunpackzigzag_uint64_32(initoffset, (*[32]uint64)(in), (*[64]uint64)(out)) + case 33: + deltaunpackzigzag_uint64_33(initoffset, (*[33]uint64)(in), (*[64]uint64)(out)) + case 34: + deltaunpackzigzag_uint64_34(initoffset, (*[34]uint64)(in), (*[64]uint64)(out)) + case 35: + deltaunpackzigzag_uint64_35(initoffset, (*[35]uint64)(in), (*[64]uint64)(out)) + case 36: + deltaunpackzigzag_uint64_36(initoffset, (*[36]uint64)(in), (*[64]uint64)(out)) + case 37: + deltaunpackzigzag_uint64_37(initoffset, (*[37]uint64)(in), (*[64]uint64)(out)) + case 38: + deltaunpackzigzag_uint64_38(initoffset, (*[38]uint64)(in), (*[64]uint64)(out)) + case 39: + deltaunpackzigzag_uint64_39(initoffset, (*[39]uint64)(in), (*[64]uint64)(out)) + case 40: + deltaunpackzigzag_uint64_40(initoffset, (*[40]uint64)(in), (*[64]uint64)(out)) + case 41: + deltaunpackzigzag_uint64_41(initoffset, (*[41]uint64)(in), (*[64]uint64)(out)) + case 42: + deltaunpackzigzag_uint64_42(initoffset, (*[42]uint64)(in), (*[64]uint64)(out)) + case 43: + deltaunpackzigzag_uint64_43(initoffset, (*[43]uint64)(in), (*[64]uint64)(out)) + case 44: + deltaunpackzigzag_uint64_44(initoffset, (*[44]uint64)(in), (*[64]uint64)(out)) + case 45: + deltaunpackzigzag_uint64_45(initoffset, (*[45]uint64)(in), (*[64]uint64)(out)) + case 46: + deltaunpackzigzag_uint64_46(initoffset, (*[46]uint64)(in), (*[64]uint64)(out)) + case 47: + deltaunpackzigzag_uint64_47(initoffset, (*[47]uint64)(in), (*[64]uint64)(out)) + case 48: + deltaunpackzigzag_uint64_48(initoffset, (*[48]uint64)(in), (*[64]uint64)(out)) + case 49: + deltaunpackzigzag_uint64_49(initoffset, (*[49]uint64)(in), (*[64]uint64)(out)) + case 50: + deltaunpackzigzag_uint64_50(initoffset, (*[50]uint64)(in), (*[64]uint64)(out)) + case 51: + deltaunpackzigzag_uint64_51(initoffset, (*[51]uint64)(in), (*[64]uint64)(out)) + case 52: + deltaunpackzigzag_uint64_52(initoffset, (*[52]uint64)(in), (*[64]uint64)(out)) + case 53: + deltaunpackzigzag_uint64_53(initoffset, (*[53]uint64)(in), (*[64]uint64)(out)) + case 54: + deltaunpackzigzag_uint64_54(initoffset, (*[54]uint64)(in), (*[64]uint64)(out)) + case 55: + deltaunpackzigzag_uint64_55(initoffset, (*[55]uint64)(in), (*[64]uint64)(out)) + case 56: + deltaunpackzigzag_uint64_56(initoffset, (*[56]uint64)(in), (*[64]uint64)(out)) + case 57: + deltaunpackzigzag_uint64_57(initoffset, (*[57]uint64)(in), (*[64]uint64)(out)) + case 58: + deltaunpackzigzag_uint64_58(initoffset, (*[58]uint64)(in), (*[64]uint64)(out)) + case 59: + deltaunpackzigzag_uint64_59(initoffset, (*[59]uint64)(in), (*[64]uint64)(out)) + case 60: + deltaunpackzigzag_uint64_60(initoffset, (*[60]uint64)(in), (*[64]uint64)(out)) + case 61: + deltaunpackzigzag_uint64_61(initoffset, (*[61]uint64)(in), (*[64]uint64)(out)) + case 62: + deltaunpackzigzag_uint64_62(initoffset, (*[62]uint64)(in), (*[64]uint64)(out)) + case 63: + deltaunpackzigzag_uint64_63(initoffset, (*[63]uint64)(in), (*[64]uint64)(out)) + case 64: + *(*[64]uint64)(out) = *(*[64]uint64)(unsafe.Pointer((*[64]uint64)(in))) + default: + panic("unsupported bitlen") + } +} + +func deltapackzigzag_uint64_0(initoffset uint64, in *[64]uint64, out *[0]uint64) { +} + +func deltapackzigzag_uint64_1(initoffset uint64, in *[64]uint64, out *[1]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 1) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 2) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 3) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 4) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 5) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 6) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 7) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 9) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 10) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 11) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 12) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 13) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 14) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 15) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 17) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 18) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 19) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 20) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 21) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 22) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 23) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 25) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 26) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 27) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 28) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 29) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 30) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 31) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 33) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 34) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 35) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 36) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 37) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 38) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 39) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 41) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 42) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 43) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 44) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 45) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 46) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 47) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 49) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 50) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 51) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 52) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 53) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 54) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 55) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 57) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 58) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 59) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 60) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 61) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 62) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 63) +} + +func deltapackzigzag_uint64_2(initoffset uint64, in *[64]uint64, out *[2]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 2) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 4) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 6) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 8) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 10) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 12) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 14) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 18) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 20) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 22) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 24) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 26) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 28) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 30) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 34) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 36) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 38) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 40) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 42) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 44) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 46) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 50) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 52) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 54) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 56) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 58) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 60) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 62) + out[1] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 2) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 4) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 6) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 8) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 10) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 12) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 14) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 18) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 20) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 22) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 24) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 26) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 28) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 30) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 34) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 36) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 38) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 40) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 42) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 44) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 46) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 50) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 52) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 54) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 56) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 58) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 60) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 62) +} + +func deltapackzigzag_uint64_3(initoffset uint64, in *[64]uint64, out *[3]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 3) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 6) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 9) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 12) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 15) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 18) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 21) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 27) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 30) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 33) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 36) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 39) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 42) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 45) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 51) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 54) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 57) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 60) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 63) + out[1] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 1 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 2) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 5) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 11) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 14) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 17) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 20) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 23) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 26) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 29) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 35) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 38) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 41) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 44) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 47) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 50) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 53) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 59) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 2 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 1) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 4) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 7) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 10) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 13) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 19) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 22) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 25) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 28) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 31) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 34) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 37) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 43) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 46) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 49) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 52) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 55) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 58) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 61) +} + +func deltapackzigzag_uint64_4(initoffset uint64, in *[64]uint64, out *[4]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 4) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 8) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 12) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 16) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 20) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 24) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 28) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 36) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 40) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 44) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 48) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 52) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 56) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 60) + out[1] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 4) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 8) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 12) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 16) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 20) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 24) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 28) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 36) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 40) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 44) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 48) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 52) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 56) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 60) + out[2] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 4) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 8) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 12) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 16) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 20) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 24) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 28) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 36) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 40) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 44) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 48) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 52) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 56) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 60) + out[3] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 4) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 8) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 12) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 16) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 20) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 24) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 28) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 36) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 40) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 44) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 48) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 52) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 56) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 60) +} + +func deltapackzigzag_uint64_5(initoffset uint64, in *[64]uint64, out *[5]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 5) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 10) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 15) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 20) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 25) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 30) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 35) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 45) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 50) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 55) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 4 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 1) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 6) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 11) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 21) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 26) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 31) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 36) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 41) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 46) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 51) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 61) + out[2] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 3 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 2) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 7) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 12) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 17) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 22) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 27) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 37) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 42) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 47) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 52) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 57) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 62) + out[3] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 2 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 3) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 13) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 18) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 23) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 28) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 33) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 38) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 43) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 53) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 58) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 63) + out[4] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 1 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 4) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 9) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 14) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 19) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 29) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 34) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 39) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 44) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 49) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 54) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 59) +} + +func deltapackzigzag_uint64_6(initoffset uint64, in *[64]uint64, out *[6]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 6) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 12) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 18) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 24) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 30) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 36) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 42) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 54) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 4 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 2) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 8) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 14) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 20) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 26) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 38) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 44) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 50) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 56) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 2 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 4) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 10) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 22) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 28) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 34) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 40) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 46) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 52) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 58) + out[3] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 6) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 12) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 18) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 24) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 30) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 36) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 42) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 54) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 4 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 2) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 8) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 14) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 20) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 26) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 38) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 44) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 50) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 56) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 62) + out[5] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 2 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 4) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 10) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 22) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 28) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 34) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 40) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 46) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 52) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 58) +} + +func deltapackzigzag_uint64_7(initoffset uint64, in *[64]uint64, out *[7]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 7) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 14) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 21) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 28) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 35) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 42) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 49) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 63) + out[1] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 1 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 6) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 13) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 20) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 27) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 34) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 41) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 55) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 2 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 5) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 12) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 19) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 26) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 33) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 47) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 54) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 61) + out[3] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 3 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 4) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 11) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 18) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 25) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 39) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 46) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 53) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 4 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 3) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 10) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 17) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 31) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 38) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 45) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 52) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 59) + out[5] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 5 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 2) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 9) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 23) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 30) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 37) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 44) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 51) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 6 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 1) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 15) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 22) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 29) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 36) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 43) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 50) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 57) +} + +func deltapackzigzag_uint64_8(initoffset uint64, in *[64]uint64, out *[8]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 8) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 16) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 24) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 32) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 40) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 48) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 56) + out[1] = + uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63)) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 8) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 16) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 24) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 32) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 40) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 48) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 56) + out[2] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 8) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 16) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 24) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 32) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 40) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 48) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 56) + out[3] = + uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63)) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 8) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 16) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 24) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 32) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 40) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 48) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 56) + out[4] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 8) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 16) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 24) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 32) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 40) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 48) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 56) + out[5] = + uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63)) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 8) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 16) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 24) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 32) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 40) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 48) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 56) + out[6] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 8) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 16) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 24) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 32) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 40) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 48) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 56) + out[7] = + uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63)) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 8) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 16) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 24) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 32) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 40) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 48) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 56) +} + +func deltapackzigzag_uint64_9(initoffset uint64, in *[64]uint64, out *[9]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 9) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 18) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 27) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 36) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 45) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 54) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 63) + out[1] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 1 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 17) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 26) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 35) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 44) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 53) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 2 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 7) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 25) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 34) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 43) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 52) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 61) + out[3] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 3 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 6) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 15) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 33) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 42) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 51) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 4 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 5) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 14) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 23) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 41) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 50) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 59) + out[5] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 5 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 4) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 13) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 22) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 31) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 49) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 6 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 3) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 12) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 21) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 30) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 39) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 57) + out[7] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 7 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 2) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 11) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 20) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 29) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 38) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 47) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 8 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 1) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 10) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 19) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 28) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 37) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 46) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 55) +} + +func deltapackzigzag_uint64_10(initoffset uint64, in *[64]uint64, out *[10]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 10) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 20) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 30) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 40) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 50) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 4 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 6) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 26) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 36) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 46) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 8 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 2) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 12) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 22) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 42) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 52) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 62) + out[3] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 2 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 8) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 18) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 28) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 38) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 58) + out[4] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 6 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 4) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 14) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 24) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 34) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 44) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 54) + out[5] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 10) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 20) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 30) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 40) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 50) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 60) + out[6] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 4 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 6) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 26) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 36) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 46) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 56) + out[7] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 8 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 2) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 12) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 22) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 42) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 52) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 62) + out[8] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 2 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 8) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 18) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 28) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 38) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 58) + out[9] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 6 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 4) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 14) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 24) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 34) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 44) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 54) +} + +func deltapackzigzag_uint64_11(initoffset uint64, in *[64]uint64, out *[11]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 11) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 22) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 33) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 44) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 55) + out[1] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 9 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 2) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 13) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 35) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 46) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 57) + out[2] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 7 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 4) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 15) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 26) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 37) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 59) + out[3] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 5 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 6) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 17) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 28) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 39) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 50) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 61) + out[4] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 3 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 19) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 30) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 41) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 52) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 63) + out[5] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 1 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 10) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 21) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 43) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 54) + out[6] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 10 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 1) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 12) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 23) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 34) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 45) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) + out[7] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 8 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 3) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 14) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 25) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 36) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 47) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 58) + out[8] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 6 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 5) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 27) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 38) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 49) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 60) + out[9] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 4 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 7) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 18) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 29) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 51) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 62) + out[10] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 2 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 9) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 20) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 31) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 42) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 53) +} + +func deltapackzigzag_uint64_12(initoffset uint64, in *[64]uint64, out *[12]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 12) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 24) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 36) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 48) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 4 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 8) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 20) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 44) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 8 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 4) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 16) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 28) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 40) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 52) + out[3] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 12) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 24) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 36) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 48) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 4 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 8) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 20) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 44) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 56) + out[5] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 8 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 4) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 16) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 28) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 40) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 52) + out[6] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 12) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 24) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 36) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 48) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 60) + out[7] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 4 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 8) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 20) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 44) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 8 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 4) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 16) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 28) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 40) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 52) + out[9] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 12) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 24) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 36) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 48) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 60) + out[10] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 4 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 8) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 20) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 44) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 56) + out[11] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 8 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 4) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 16) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 28) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 40) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 52) +} + +func deltapackzigzag_uint64_13(initoffset uint64, in *[64]uint64, out *[13]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 13) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 26) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 39) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 52) + out[1] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 12 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 1) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 14) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 27) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 53) + out[2] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 11 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 2) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 15) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 28) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 41) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 54) + out[3] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 10 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 3) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 29) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 42) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 55) + out[4] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 9 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 4) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 17) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 30) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 43) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) + out[5] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 8 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 5) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 18) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 31) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 44) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 57) + out[6] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 7 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 6) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 19) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 45) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 58) + out[7] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 6 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 7) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 20) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 33) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 46) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 59) + out[8] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 5 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 21) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 34) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 47) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 60) + out[9] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 4 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 9) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 22) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 35) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 61) + out[10] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 3 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 10) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 23) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 36) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 49) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 62) + out[11] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 2 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 11) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 37) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 50) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 63) + out[12] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 1 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 12) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 25) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 38) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 51) +} + +func deltapackzigzag_uint64_14(initoffset uint64, in *[64]uint64, out *[14]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 14) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 28) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 42) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 56) + out[1] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 8 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 6) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 20) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 34) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 2 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 12) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 26) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 40) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 54) + out[3] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 10 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 4) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 18) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 46) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 4 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 10) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 24) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 38) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 52) + out[5] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 12 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 2) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 30) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 44) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 6 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 8) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 22) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 36) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 50) + out[7] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 14) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 28) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 42) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 8 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 6) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 20) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 34) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 62) + out[9] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 2 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 12) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 26) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 40) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 10 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 4) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 18) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 46) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 60) + out[11] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 4 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 10) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 24) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 38) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 12 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 2) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 30) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 44) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 58) + out[13] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 6 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 8) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 22) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 36) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 50) +} + +func deltapackzigzag_uint64_15(initoffset uint64, in *[64]uint64, out *[15]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 15) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 30) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 45) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 4 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 11) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 26) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 41) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 8 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 7) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 22) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 37) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 52) + out[3] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 12 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 3) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 18) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 33) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 63) + out[4] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 1 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 14) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 29) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 44) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 59) + out[5] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 5 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 10) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 25) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 55) + out[6] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 9 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 6) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 21) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 36) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 51) + out[7] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 13 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 2) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 17) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 47) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 62) + out[8] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 2 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 13) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 28) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 43) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 58) + out[9] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 6 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 9) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 39) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 10 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 5) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 20) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 35) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 50) + out[11] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 14 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 1) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 31) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 46) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 61) + out[12] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 3 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 12) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 27) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 42) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 57) + out[13] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 7 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 23) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 38) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 53) + out[14] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 11 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 4) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 19) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 34) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 49) +} + +func deltapackzigzag_uint64_16(initoffset uint64, in *[64]uint64, out *[16]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 16) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 32) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 48) + out[1] = + uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63)) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 16) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 32) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 48) + out[2] = + uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63)) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 16) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 32) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 48) + out[3] = + uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63)) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 16) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 32) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 48) + out[4] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 16) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 32) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 48) + out[5] = + uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63)) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 16) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 32) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 48) + out[6] = + uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63)) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 16) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 32) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 48) + out[7] = + uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63)) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 16) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 32) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 48) + out[8] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 16) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 32) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 48) + out[9] = + uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63)) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 16) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 32) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 48) + out[10] = + uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63)) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 16) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 32) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 48) + out[11] = + uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63)) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 16) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 32) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 48) + out[12] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 16) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 32) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 48) + out[13] = + uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63)) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 16) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 32) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 48) + out[14] = + uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63)) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 16) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 32) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 48) + out[15] = + uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63)) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 16) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 32) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 48) +} + +func deltapackzigzag_uint64_17(initoffset uint64, in *[64]uint64, out *[17]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 17) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 34) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 51) + out[1] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 13 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 4) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 21) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 38) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 55) + out[2] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 9 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 25) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 42) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 59) + out[3] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 5 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 12) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 29) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 46) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 63) + out[4] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 1 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 33) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 50) + out[5] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 14 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 3) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 20) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 37) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 54) + out[6] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 10 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 7) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 41) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 58) + out[7] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 6 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 11) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 28) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 45) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 62) + out[8] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 2 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 15) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 49) + out[9] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 15 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 2) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 19) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 36) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 53) + out[10] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 11 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 6) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 23) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 57) + out[11] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 7 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 10) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 27) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 44) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 61) + out[12] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 3 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 14) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 31) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[13] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 1) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 18) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 35) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 52) + out[14] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 12 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 5) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 22) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 39) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) + out[15] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 8 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 9) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 26) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 43) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 60) + out[16] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 4 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 13) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 30) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 47) +} + +func deltapackzigzag_uint64_18(initoffset uint64, in *[64]uint64, out *[18]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 18) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 36) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 54) + out[1] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 10 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 8) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 26) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 44) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 2 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 34) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 52) + out[3] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 12 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 6) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 24) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 42) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 4 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 14) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 50) + out[5] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 14 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 4) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 22) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 40) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 6 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 12) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 30) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) + out[7] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 16 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 2) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 20) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 38) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 8 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 10) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 28) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 46) + out[9] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 18) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 36) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 10 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 8) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 26) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 44) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 62) + out[11] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 2 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 34) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 12 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 6) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 24) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 42) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 60) + out[13] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 4 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 14) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 50) + out[14] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 14 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 4) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 22) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 40) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 58) + out[15] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 6 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 12) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 30) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 16 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 2) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 20) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 38) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 8 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 10) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 28) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 46) +} + +func deltapackzigzag_uint64_19(initoffset uint64, in *[64]uint64, out *[19]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 19) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 38) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 57) + out[1] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 7 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 12) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 31) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 50) + out[2] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 14 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 5) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 43) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 62) + out[3] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 2 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 17) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 36) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 55) + out[4] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 9 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 10) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 29) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[5] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 3) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 22) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 41) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 60) + out[6] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 4 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 15) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 34) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 53) + out[7] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 11 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 27) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 46) + out[8] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 18 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 1) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 20) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 39) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 58) + out[9] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 6 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 13) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 51) + out[10] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 13 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 6) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 25) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 44) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 63) + out[11] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 1 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 18) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 37) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) + out[12] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 8 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 11) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 30) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 49) + out[13] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 15 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 4) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 23) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 42) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 61) + out[14] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 3 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 35) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 54) + out[15] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 10 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 9) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 28) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 47) + out[16] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 17 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 2) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 21) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 59) + out[17] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 5 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 14) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 33) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 52) + out[18] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 12 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 7) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 26) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 45) +} + +func deltapackzigzag_uint64_20(initoffset uint64, in *[64]uint64, out *[20]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 20) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 40) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 4 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 16) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 36) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 8 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 12) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 52) + out[3] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 12 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 8) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 28) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 48) + out[4] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 16 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 4) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 24) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 44) + out[5] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 20) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 40) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 60) + out[6] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 4 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 16) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 36) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 56) + out[7] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 8 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 12) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 52) + out[8] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 12 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 8) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 28) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 48) + out[9] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 16 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 4) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 24) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 44) + out[10] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 20) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 40) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 60) + out[11] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 4 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 16) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 36) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 56) + out[12] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 8 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 12) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 52) + out[13] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 12 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 8) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 28) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 48) + out[14] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 16 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 4) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 24) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 44) + out[15] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 20) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 40) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 60) + out[16] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 4 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 16) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 36) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 8 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 12) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 52) + out[18] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 12 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 8) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 28) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 16 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 4) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 24) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 44) +} + +func deltapackzigzag_uint64_21(initoffset uint64, in *[64]uint64, out *[21]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 21) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 42) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 63) + out[1] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 1 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 20) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 41) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 2 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 19) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 61) + out[3] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 3 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 18) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 39) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 4 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 17) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 38) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 59) + out[5] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 5 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 37) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 6 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 15) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 36) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 57) + out[7] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 7 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 14) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 35) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 8 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 13) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 34) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 55) + out[9] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 9 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 12) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 33) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 10 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 11) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 53) + out[11] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 11 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 10) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 31) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 12 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 9) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 30) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 51) + out[13] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 13 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 29) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 50) + out[14] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 14 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 7) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 28) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 49) + out[15] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 15 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 6) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 27) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 5) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 26) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 47) + out[17] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 17 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 4) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 25) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 46) + out[18] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 18 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 3) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 45) + out[19] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 19 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 2) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 23) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 20 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 1) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 22) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 43) +} + +func deltapackzigzag_uint64_22(initoffset uint64, in *[64]uint64, out *[22]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 22) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 44) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 20 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 2) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 24) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 46) + out[2] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 18 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 4) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 26) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) + out[3] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 16 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 6) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 28) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 50) + out[4] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 14 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 8) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 30) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 52) + out[5] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 12 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 10) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 54) + out[6] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 10 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 12) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 34) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 56) + out[7] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 8 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 14) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 36) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 58) + out[8] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 6 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 38) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 60) + out[9] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 4 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 18) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 40) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 62) + out[10] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 2 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 20) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 42) + out[11] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 22) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 44) + out[12] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 20 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 2) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 24) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 46) + out[13] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 18 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 4) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 26) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) + out[14] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 16 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 6) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 28) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 50) + out[15] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 14 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 8) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 30) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 52) + out[16] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 12 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 10) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 54) + out[17] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 10 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 12) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 34) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 56) + out[18] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 8 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 14) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 36) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 58) + out[19] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 6 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 38) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 60) + out[20] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 4 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 18) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 40) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 62) + out[21] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 2 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 20) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 42) +} + +func deltapackzigzag_uint64_23(initoffset uint64, in *[64]uint64, out *[23]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 23) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 46) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 18 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 5) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 28) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 51) + out[2] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 13 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 10) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 33) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) + out[3] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 8 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 15) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 38) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 61) + out[4] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 3 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 20) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 43) + out[5] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 21 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 2) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 25) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[6] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 7) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 30) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 53) + out[7] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 11 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 12) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 35) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 58) + out[8] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 6 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 17) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 63) + out[9] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 1 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 22) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 45) + out[10] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 19 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 4) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 27) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 50) + out[11] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 14 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 9) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 55) + out[12] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 9 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 14) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 37) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 60) + out[13] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 4 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 19) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 42) + out[14] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 22 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 1) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 47) + out[15] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 17 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 6) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 29) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 52) + out[16] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 12 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 11) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 34) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 57) + out[17] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 7 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 39) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 62) + out[18] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 2 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 21) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 44) + out[19] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 20 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 3) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 26) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 49) + out[20] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 15 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 31) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 54) + out[21] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 10 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 13) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 36) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 59) + out[22] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 5 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 18) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 41) +} + +func deltapackzigzag_uint64_24(initoffset uint64, in *[64]uint64, out *[24]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 24) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 48) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 16 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 8) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 32) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 8 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 16) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 40) + out[3] = + uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63)) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 24) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 48) + out[4] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 16 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 8) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 32) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 56) + out[5] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 8 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 16) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 40) + out[6] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 24) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 48) + out[7] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 16 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 8) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 32) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 8 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 16) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 40) + out[9] = + uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63)) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 24) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 48) + out[10] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 16 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 8) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 32) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 56) + out[11] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 8 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 16) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 40) + out[12] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 24) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 48) + out[13] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 16 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 8) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 32) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 56) + out[14] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 8 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 16) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 40) + out[15] = + uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63)) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 24) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 16 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 8) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 32) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 8 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 16) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 40) + out[18] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 24) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 16 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 8) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 32) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 56) + out[20] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 8 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 16) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 40) + out[21] = + uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63)) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 24) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 48) + out[22] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 16 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 8) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 32) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 56) + out[23] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 8 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 16) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 40) +} + +func deltapackzigzag_uint64_25(initoffset uint64, in *[64]uint64, out *[25]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 25) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 50) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 14 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 11) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 36) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 61) + out[2] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 3 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 22) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 47) + out[3] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 17 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 33) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 58) + out[4] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 6 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 19) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 44) + out[5] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 20 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 5) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 30) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 55) + out[6] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 9 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 41) + out[7] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 23 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 2) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 27) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 52) + out[8] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 12 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 13) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 38) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 63) + out[9] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 1 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 49) + out[10] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 15 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 10) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 35) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 60) + out[11] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 4 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 21) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 46) + out[12] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 18 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 7) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 57) + out[13] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 7 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 18) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 43) + out[14] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 21 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 4) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 29) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 54) + out[15] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 10 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 15) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) + out[16] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 24 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 1) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 26) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 51) + out[17] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 13 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 12) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 37) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 62) + out[18] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 2 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 23) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 9) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 34) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 59) + out[20] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 5 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 20) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 45) + out[21] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 19 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 6) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 31) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) + out[22] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 8 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 17) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 42) + out[23] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 22 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 3) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 28) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 53) + out[24] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 11 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 14) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 39) +} + +func deltapackzigzag_uint64_26(initoffset uint64, in *[64]uint64, out *[26]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 26) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 52) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 12 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 14) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 40) + out[2] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 24 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 2) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 28) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 54) + out[3] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 10 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 42) + out[4] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 22 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 4) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 30) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 56) + out[5] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 8 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 18) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 44) + out[6] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 20 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 6) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 58) + out[7] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 6 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 20) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 46) + out[8] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 18 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 8) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 34) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 60) + out[9] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 4 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 22) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) + out[10] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 16 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 10) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 36) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 62) + out[11] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 2 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 24) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 50) + out[12] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 14 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 12) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 38) + out[13] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 26) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 52) + out[14] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 12 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 14) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 40) + out[15] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 24 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 2) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 28) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 54) + out[16] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 10 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 42) + out[17] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 22 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 4) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 30) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 56) + out[18] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 8 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 18) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 44) + out[19] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 20 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 6) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 58) + out[20] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 6 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 20) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 46) + out[21] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 18 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 8) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 34) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 60) + out[22] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 4 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 22) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) + out[23] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 16 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 10) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 36) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 62) + out[24] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 2 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 24) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 50) + out[25] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 14 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 12) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 38) +} + +func deltapackzigzag_uint64_27(initoffset uint64, in *[64]uint64, out *[27]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 27) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 54) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 10 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 17) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 44) + out[2] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 20 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 7) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 34) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 61) + out[3] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 3 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 51) + out[4] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 13 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 14) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 41) + out[5] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 23 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 4) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 31) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 6 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 21) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[7] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 11) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 38) + out[8] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 26 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 1) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 28) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 55) + out[9] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 9 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 18) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 45) + out[10] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 19 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 35) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 62) + out[11] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 2 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 25) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 12 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 15) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 42) + out[13] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 22 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 5) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 59) + out[14] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 5 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 22) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 49) + out[15] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 15 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 12) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 39) + out[16] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 25 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 2) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 29) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 8 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 19) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 46) + out[18] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 18 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 9) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 36) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 63) + out[19] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 1 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 26) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 53) + out[20] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 11 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 43) + out[21] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 21 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 6) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 33) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 60) + out[22] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 4 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 23) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 50) + out[23] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 14 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 13) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) + out[24] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 24 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 3) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 30) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 57) + out[25] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 7 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 20) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 47) + out[26] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 17 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 10) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 37) +} + +func deltapackzigzag_uint64_28(initoffset uint64, in *[64]uint64, out *[28]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 28) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 56) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 8 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 20) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 48) + out[2] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 16 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 12) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 40) + out[3] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 24 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 4) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 4 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 24) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 52) + out[5] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 12 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 16) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 44) + out[6] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 20 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 8) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 36) + out[7] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 28) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 8 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 20) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 48) + out[9] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 16 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 12) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 40) + out[10] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 24 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 4) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 60) + out[11] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 4 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 24) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 12 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 16) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 44) + out[13] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 20 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 8) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 36) + out[14] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 28) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 56) + out[15] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 8 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 20) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 16 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 12) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 40) + out[17] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 24 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 4) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 60) + out[18] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 4 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 24) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 52) + out[19] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 12 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 16) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 20 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 8) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 36) + out[21] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 28) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 56) + out[22] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 8 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 20) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 48) + out[23] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 16 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 12) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 40) + out[24] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 24 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 4) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 60) + out[25] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 4 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 24) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 52) + out[26] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 12 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 16) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 44) + out[27] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 20 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 8) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 36) +} + +func deltapackzigzag_uint64_29(initoffset uint64, in *[64]uint64, out *[29]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 29) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 58) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 6 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 23) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 52) + out[2] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 12 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 17) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 46) + out[3] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 18 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 11) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) + out[4] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 24 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 5) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 34) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 63) + out[5] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 1 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 28) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 57) + out[6] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 7 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 22) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 51) + out[7] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 13 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 45) + out[8] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 19 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 10) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 39) + out[9] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 25 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 4) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 33) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 62) + out[10] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 2 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 27) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) + out[11] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 8 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 21) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 50) + out[12] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 14 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 15) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 44) + out[13] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 20 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 9) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 38) + out[14] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 26 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 3) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 61) + out[15] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 3 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 26) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 55) + out[16] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 9 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 20) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 49) + out[17] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 15 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 14) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 43) + out[18] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 21 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 37) + out[19] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 27 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 2) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 31) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 60) + out[20] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 4 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 25) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 54) + out[21] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 10 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 19) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[22] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 13) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 42) + out[23] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 22 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 7) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 36) + out[24] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 28 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 1) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 30) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 59) + out[25] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 5 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 53) + out[26] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 11 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 18) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 47) + out[27] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 17 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 12) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 41) + out[28] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 23 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 6) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 35) +} + +func deltapackzigzag_uint64_30(initoffset uint64, in *[64]uint64, out *[30]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 30) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 4 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 26) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 8 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 22) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 52) + out[3] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 12 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 18) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) + out[4] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 16 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 14) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 44) + out[5] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 20 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 10) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 40) + out[6] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 24 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 6) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 36) + out[7] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 28 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 2) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 62) + out[8] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 2 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 28) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 58) + out[9] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 6 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 24) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 10 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 20) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 50) + out[11] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 14 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 46) + out[12] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 18 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 12) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 42) + out[13] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 22 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 8) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 38) + out[14] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 26 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 4) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 34) + out[15] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 30) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 60) + out[16] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 4 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 26) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 8 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 22) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 52) + out[18] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 12 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 18) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 16 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 14) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 20 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 10) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 40) + out[21] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 24 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 6) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 36) + out[22] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 28 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 2) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 62) + out[23] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 2 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 28) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 58) + out[24] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 6 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 24) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 54) + out[25] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 10 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 20) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 50) + out[26] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 14 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 46) + out[27] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 18 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 12) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 42) + out[28] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 22 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 8) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 38) + out[29] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 26 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 4) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 34) +} + +func deltapackzigzag_uint64_31(initoffset uint64, in *[64]uint64, out *[31]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 31) | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 62) + out[1] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 2 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 29) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 60) + out[2] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 4 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 27) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 58) + out[3] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 6 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 25) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) + out[4] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 8 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 23) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 54) + out[5] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 10 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 21) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 52) + out[6] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 12 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 19) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 50) + out[7] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 14 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 17) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[8] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 15) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 46) + out[9] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 18 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 13) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 44) + out[10] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 20 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 11) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 42) + out[11] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 22 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 9) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) + out[12] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 24 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 7) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 38) + out[13] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 26 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 5) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 36) + out[14] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 28 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 3) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 34) + out[15] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 30 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 1) | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 63) + out[16] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 1 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 30) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 61) + out[17] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 3 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 28) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 59) + out[18] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 5 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 26) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 57) + out[19] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 7 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 55) + out[20] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 9 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 22) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 53) + out[21] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 11 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 20) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 51) + out[22] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 13 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 18) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 49) + out[23] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 15 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 47) + out[24] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 17 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 14) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 45) + out[25] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 19 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 12) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 43) + out[26] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 21 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 10) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 41) + out[27] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 23 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 39) + out[28] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 25 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 6) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 37) + out[29] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 27 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 4) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 35) + out[30] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 29 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 2) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 33) +} + +func deltapackzigzag_uint64_32(initoffset uint64, in *[64]uint64, out *[32]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 32) + out[1] = + uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63)) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 32) + out[2] = + uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63)) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 32) + out[3] = + uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63)) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 32) + out[4] = + uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63)) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 32) + out[5] = + uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63)) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 32) + out[6] = + uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63)) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 32) + out[7] = + uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63)) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 32) + out[8] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 32) + out[9] = + uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63)) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 32) + out[10] = + uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63)) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 32) + out[11] = + uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63)) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 32) + out[12] = + uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63)) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 32) + out[13] = + uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63)) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 32) + out[14] = + uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63)) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 32) + out[15] = + uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63)) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 32) + out[16] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 32) + out[17] = + uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63)) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 32) + out[18] = + uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63)) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 32) + out[19] = + uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63)) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 32) + out[20] = + uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63)) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 32) + out[21] = + uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63)) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 32) + out[22] = + uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63)) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 32) + out[23] = + uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63)) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 32) + out[24] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 32) + out[25] = + uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63)) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 32) + out[26] = + uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63)) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 32) + out[27] = + uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63)) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 32) + out[28] = + uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63)) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 32) + out[29] = + uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63)) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 32) + out[30] = + uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63)) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 32) + out[31] = + uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63)) | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 32) +} + +func deltapackzigzag_uint64_33(initoffset uint64, in *[64]uint64, out *[33]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 33) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 31 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 2) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 35) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 29 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 4) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 37) + out[3] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 27 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 6) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 39) + out[4] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 25 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 41) + out[5] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 23 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 10) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 43) + out[6] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 21 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 12) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 45) + out[7] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 19 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 14) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 47) + out[8] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 17 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 49) + out[9] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 15 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 18) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 51) + out[10] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 13 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 20) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 53) + out[11] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 11 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 22) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 55) + out[12] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 9 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 57) + out[13] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 7 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 26) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 59) + out[14] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 5 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 28) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 61) + out[15] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 3 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 30) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 63) + out[16] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 1 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[17] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 1) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 34) + out[18] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 30 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 3) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 36) + out[19] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 28 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 5) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 38) + out[20] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 26 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 7) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) + out[21] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 24 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 9) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 42) + out[22] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 22 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 11) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 44) + out[23] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 20 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 13) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 46) + out[24] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 18 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 15) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[25] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 17) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 50) + out[26] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 14 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 19) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 52) + out[27] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 12 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 21) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 54) + out[28] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 10 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 23) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) + out[29] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 8 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 25) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 58) + out[30] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 6 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 27) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 60) + out[31] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 4 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 29) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 62) + out[32] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 2 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 31) +} + +func deltapackzigzag_uint64_34(initoffset uint64, in *[64]uint64, out *[34]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 34) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 30 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 4) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 38) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 26 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 8) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 42) + out[3] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 22 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 12) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 46) + out[4] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 18 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 50) + out[5] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 14 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 20) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 54) + out[6] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 10 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 24) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 58) + out[7] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 6 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 28) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 62) + out[8] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 2 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[9] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 2) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 36) + out[10] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 28 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 6) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 40) + out[11] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 24 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 10) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 44) + out[12] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 20 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 14) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) + out[13] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 16 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 18) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 52) + out[14] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 12 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 22) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 56) + out[15] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 8 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 26) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 60) + out[16] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 4 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 30) + out[17] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 34) + out[18] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 30 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 4) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 38) + out[19] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 26 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 8) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 42) + out[20] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 22 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 12) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 46) + out[21] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 18 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 50) + out[22] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 14 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 20) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 54) + out[23] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 10 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 24) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 58) + out[24] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 6 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 28) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 62) + out[25] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 2 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[26] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 2) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 36) + out[27] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 28 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 6) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 40) + out[28] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 24 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 10) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 44) + out[29] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 20 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 14) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) + out[30] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 16 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 18) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 52) + out[31] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 12 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 22) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 56) + out[32] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 8 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 26) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 60) + out[33] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 4 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 30) +} + +func deltapackzigzag_uint64_35(initoffset uint64, in *[64]uint64, out *[35]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 35) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 29 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 6) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 41) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 23 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 12) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 47) + out[3] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 17 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 18) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 53) + out[4] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 11 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 59) + out[5] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 5 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 30) + out[6] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 34 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 1) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 36) + out[7] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 28 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 7) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 42) + out[8] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 22 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 13) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[9] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 19) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 10 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 25) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 60) + out[11] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 4 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 31) + out[12] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 33 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 2) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 37) + out[13] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 27 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 43) + out[14] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 21 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 14) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 49) + out[15] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 15 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 20) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 55) + out[16] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 9 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 26) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 61) + out[17] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 3 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[18] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 3) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 38) + out[19] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 26 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 9) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 20 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 15) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 50) + out[21] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 14 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 21) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) + out[22] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 8 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 27) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 62) + out[23] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 2 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 33) + out[24] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 31 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 4) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 39) + out[25] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 25 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 10) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 45) + out[26] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 19 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 51) + out[27] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 13 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 22) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 57) + out[28] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 7 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 28) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 63) + out[29] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 1 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 34) + out[30] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 30 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 5) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) + out[31] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 24 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 11) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 46) + out[32] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 18 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 17) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 52) + out[33] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 12 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 23) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 58) + out[34] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 6 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 29) +} + +func deltapackzigzag_uint64_36(initoffset uint64, in *[64]uint64, out *[36]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 36) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 28 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 8) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 44) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 20 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 16) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 52) + out[3] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 12 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 24) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 4 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) + out[5] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 32 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 4) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 40) + out[6] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 24 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 12) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 48) + out[7] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 16 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 20) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 8 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 28) + out[9] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 36) + out[10] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 28 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 8) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 44) + out[11] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 20 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 16) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 12 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 24) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 60) + out[13] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 4 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) + out[14] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 32 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 4) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 40) + out[15] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 24 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 12) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 16 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 20) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 8 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 28) + out[18] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 36) + out[19] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 28 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 8) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 20 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 16) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 52) + out[21] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 12 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 24) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 60) + out[22] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 4 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) + out[23] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 32 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 4) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 40) + out[24] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 24 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 12) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 48) + out[25] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 16 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 20) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 56) + out[26] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 8 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 28) + out[27] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 36) + out[28] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 28 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 8) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 44) + out[29] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 20 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 16) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 52) + out[30] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 12 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 24) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 60) + out[31] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 4 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) + out[32] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 32 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 4) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 40) + out[33] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 24 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 12) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 48) + out[34] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 16 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 20) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 56) + out[35] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 8 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 28) +} + +func deltapackzigzag_uint64_37(initoffset uint64, in *[64]uint64, out *[37]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 37) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 27 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 10) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 47) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 17 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 20) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 57) + out[3] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 7 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 30) + out[4] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 34 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 3) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) + out[5] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 24 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 13) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 50) + out[6] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 14 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 23) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 60) + out[7] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 4 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 33) + out[8] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 31 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 6) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 43) + out[9] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 21 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 53) + out[10] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 11 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 26) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 63) + out[11] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 1 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 36) + out[12] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 28 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 9) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 46) + out[13] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 18 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 19) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) + out[14] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 8 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 29) + out[15] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 35 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 2) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 39) + out[16] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 25 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 12) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 49) + out[17] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 15 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 22) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 59) + out[18] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 5 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[19] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 5) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 42) + out[20] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 22 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 15) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 52) + out[21] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 12 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 25) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 62) + out[22] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 2 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 35) + out[23] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 29 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 45) + out[24] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 19 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 18) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 55) + out[25] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 9 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 28) + out[26] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 36 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 1) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 38) + out[27] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 26 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 11) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[28] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 21) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 58) + out[29] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 6 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 31) + out[30] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 33 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 4) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 41) + out[31] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 23 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 14) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 51) + out[32] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 13 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 61) + out[33] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 3 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 34) + out[34] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 30 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 7) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 44) + out[35] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 20 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 17) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 54) + out[36] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 10 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 27) +} + +func deltapackzigzag_uint64_38(initoffset uint64, in *[64]uint64, out *[38]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 38) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 26 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 12) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 50) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 14 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 24) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 62) + out[3] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 2 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 36) + out[4] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 28 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 10) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) + out[5] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 16 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 22) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 60) + out[6] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 4 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 34) + out[7] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 30 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 8) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 46) + out[8] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 18 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 20) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 58) + out[9] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 6 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[10] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 6) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 44) + out[11] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 20 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 18) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 56) + out[12] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 8 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 30) + out[13] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 34 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 4) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 42) + out[14] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 22 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 54) + out[15] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 10 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 28) + out[16] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 36 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 2) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 40) + out[17] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 24 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 14) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 52) + out[18] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 12 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 26) + out[19] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 38) + out[20] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 26 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 12) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 50) + out[21] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 14 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 24) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 62) + out[22] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 2 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 36) + out[23] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 28 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 10) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) + out[24] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 16 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 22) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 60) + out[25] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 4 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 34) + out[26] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 30 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 8) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 46) + out[27] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 18 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 20) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 58) + out[28] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 6 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[29] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 6) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 44) + out[30] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 20 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 18) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 56) + out[31] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 8 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 30) + out[32] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 34 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 4) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 42) + out[33] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 22 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 54) + out[34] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 10 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 28) + out[35] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 36 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 2) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 40) + out[36] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 24 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 14) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 52) + out[37] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 12 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 26) +} + +func deltapackzigzag_uint64_39(initoffset uint64, in *[64]uint64, out *[39]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 39) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 25 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 14) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 53) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 11 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 28) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 36 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 3) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 42) + out[4] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 22 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 17) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) + out[5] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 8 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 31) + out[6] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 33 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 6) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 45) + out[7] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 19 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 20) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 59) + out[8] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 5 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 34) + out[9] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 30 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 9) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[10] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 23) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 62) + out[11] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 2 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 37) + out[12] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 27 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 12) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 51) + out[13] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 13 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 26) + out[14] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 38 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 1) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) + out[15] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 24 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 15) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 54) + out[16] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 10 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 29) + out[17] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 35 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 4) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 43) + out[18] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 21 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 18) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 57) + out[19] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 7 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[20] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 7) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 46) + out[21] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 18 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 21) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 60) + out[22] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 4 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 35) + out[23] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 29 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 10) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 49) + out[24] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 15 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 63) + out[25] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 1 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 38) + out[26] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 26 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 13) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 52) + out[27] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 12 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 27) + out[28] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 37 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 2) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 41) + out[29] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 23 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 55) + out[30] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 9 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 30) + out[31] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 34 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 5) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 44) + out[32] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 20 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 19) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 58) + out[33] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 6 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 33) + out[34] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 31 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 47) + out[35] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 17 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 22) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 61) + out[36] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 3 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 36) + out[37] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 28 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 11) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 50) + out[38] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 14 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 25) +} + +func deltapackzigzag_uint64_40(initoffset uint64, in *[64]uint64, out *[40]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 40) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 24 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 16) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 8 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 32) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 32 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 8) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 48) + out[4] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 16 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 24) + out[5] = + uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63)) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 40) + out[6] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 24 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 16) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 56) + out[7] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 8 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 32) + out[8] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 32 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 8) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 48) + out[9] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 16 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 24) + out[10] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 40) + out[11] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 24 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 16) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 56) + out[12] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 8 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 32) + out[13] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 32 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 8) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 48) + out[14] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 16 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 24) + out[15] = + uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63)) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 40) + out[16] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 24 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 16) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 8 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 32) + out[18] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 32 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 8) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 16 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 24) + out[20] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 40) + out[21] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 24 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 16) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 56) + out[22] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 8 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 32) + out[23] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 32 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 8) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 48) + out[24] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 16 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 24) + out[25] = + uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63)) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 40) + out[26] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 24 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 16) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 56) + out[27] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 8 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 32) + out[28] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 32 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 8) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 48) + out[29] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 16 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 24) + out[30] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 40) + out[31] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 24 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 16) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 56) + out[32] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 8 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 32) + out[33] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 32 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 8) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 48) + out[34] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 16 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 24) + out[35] = + uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63)) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 40) + out[36] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 24 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 16) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 56) + out[37] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 8 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 32) + out[38] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 32 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 8) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 48) + out[39] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 16 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 24) +} + +func deltapackzigzag_uint64_41(initoffset uint64, in *[64]uint64, out *[41]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 41) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 23 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 18) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 59) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 5 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 36) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 28 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 13) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 54) + out[4] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 10 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 31) + out[5] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 33 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 49) + out[6] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 15 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 26) + out[7] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 38 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 3) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 44) + out[8] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 20 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 21) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 62) + out[9] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 2 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 39) + out[10] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 25 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 57) + out[11] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 7 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 34) + out[12] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 30 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 11) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 52) + out[13] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 12 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 29) + out[14] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 35 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 6) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 47) + out[15] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 17 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) + out[16] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 40 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 1) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 42) + out[17] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 22 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 19) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 60) + out[18] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 4 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 37) + out[19] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 27 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 14) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 55) + out[20] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 9 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[21] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 9) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 50) + out[22] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 14 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 27) + out[23] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 37 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 4) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 45) + out[24] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 19 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 22) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 63) + out[25] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 1 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) + out[26] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 24 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 17) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 58) + out[27] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 6 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 35) + out[28] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 29 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 12) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 53) + out[29] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 11 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 30) + out[30] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 34 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 7) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[31] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 25) + out[32] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 39 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 2) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 43) + out[33] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 21 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 20) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 61) + out[34] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 3 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 38) + out[35] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 26 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 15) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) + out[36] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 8 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 33) + out[37] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 31 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 10) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 51) + out[38] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 13 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 28) + out[39] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 36 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 5) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 46) + out[40] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 18 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 23) +} + +func deltapackzigzag_uint64_42(initoffset uint64, in *[64]uint64, out *[42]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 42) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 22 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 20) | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 2 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 40) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 24 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 18) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 4 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 38) + out[5] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 26 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 6 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 36) + out[7] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 28 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 14) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 8 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 34) + out[9] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 30 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 12) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 10 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[11] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 10) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 12 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 30) + out[13] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 34 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 8) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 50) + out[14] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 14 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 28) + out[15] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 36 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 6) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 16 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 26) + out[17] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 38 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 4) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 46) + out[18] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 18 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 24) + out[19] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 40 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 2) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 20 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 22) + out[21] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 42) + out[22] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 22 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 20) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 62) + out[23] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 2 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 40) + out[24] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 24 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 18) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 60) + out[25] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 4 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 38) + out[26] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 26 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 58) + out[27] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 6 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 36) + out[28] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 28 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 14) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 56) + out[29] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 8 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 34) + out[30] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 30 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 12) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 54) + out[31] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 10 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[32] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 10) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 52) + out[33] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 12 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 30) + out[34] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 34 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 8) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 50) + out[35] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 14 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 28) + out[36] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 36 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 6) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) + out[37] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 16 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 26) + out[38] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 38 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 4) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 46) + out[39] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 18 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 24) + out[40] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 40 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 2) | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 44) + out[41] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 20 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 22) +} + +func deltapackzigzag_uint64_43(initoffset uint64, in *[64]uint64, out *[43]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 43) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 21 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 22) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 42 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 1) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 44) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 20 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 23) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 41 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 2) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 45) + out[5] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 19 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) + out[6] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 40 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 3) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 46) + out[7] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 18 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 25) + out[8] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 39 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 4) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 47) + out[9] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 17 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 26) + out[10] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 38 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 5) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[11] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 27) + out[12] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 37 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 6) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 49) + out[13] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 15 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 28) + out[14] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 36 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 7) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 50) + out[15] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 14 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 29) + out[16] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 35 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 51) + out[17] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 13 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 30) + out[18] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 34 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 9) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 52) + out[19] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 12 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 31) + out[20] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 33 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 10) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 53) + out[21] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 11 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[22] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 11) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 54) + out[23] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 10 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 33) + out[24] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 31 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 12) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 55) + out[25] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 9 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 34) + out[26] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 30 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 13) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) + out[27] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 8 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 35) + out[28] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 29 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 14) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 57) + out[29] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 7 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 36) + out[30] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 28 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 15) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 58) + out[31] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 6 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 37) + out[32] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 27 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 59) + out[33] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 5 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 38) + out[34] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 26 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 17) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 60) + out[35] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 4 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 39) + out[36] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 25 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 18) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 61) + out[37] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 3 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) + out[38] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 24 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 19) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 62) + out[39] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 2 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 41) + out[40] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 23 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 20) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 63) + out[41] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 1 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 42) + out[42] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 22 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 21) +} + +func deltapackzigzag_uint64_44(initoffset uint64, in *[64]uint64, out *[44]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 44) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 20 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 24) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 40 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 4) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 48) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 16 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 28) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 36 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 8) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 52) + out[5] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 12 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) + out[6] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 32 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 12) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 56) + out[7] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 8 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 36) + out[8] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 28 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 16) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 60) + out[9] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 4 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 40) + out[10] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 24 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 20) + out[11] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 44) + out[12] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 20 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 24) + out[13] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 40 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 4) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 48) + out[14] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 16 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 28) + out[15] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 36 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 8) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 52) + out[16] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 12 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) + out[17] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 32 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 12) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 56) + out[18] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 8 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 36) + out[19] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 28 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 16) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 60) + out[20] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 4 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 40) + out[21] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 24 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 20) + out[22] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 44) + out[23] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 20 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 24) + out[24] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 40 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 4) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 48) + out[25] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 16 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 28) + out[26] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 36 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 8) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 52) + out[27] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 12 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) + out[28] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 32 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 12) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 56) + out[29] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 8 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 36) + out[30] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 28 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 16) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 60) + out[31] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 4 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 40) + out[32] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 24 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 20) + out[33] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 44) + out[34] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 20 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 24) + out[35] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 40 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 4) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 48) + out[36] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 16 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 28) + out[37] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 36 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 8) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 52) + out[38] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 12 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) + out[39] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 32 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 12) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 56) + out[40] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 8 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 36) + out[41] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 28 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 16) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 60) + out[42] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 4 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 40) + out[43] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 24 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 20) +} + +func deltapackzigzag_uint64_45(initoffset uint64, in *[64]uint64, out *[45]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 45) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 19 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 26) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 38 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 7) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 52) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 12 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 33) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 31 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 14) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 59) + out[5] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 5 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) + out[6] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 24 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 21) + out[7] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 43 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 2) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 47) + out[8] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 17 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 28) + out[9] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 36 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 9) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 10 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 35) + out[11] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 29 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 61) + out[12] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 3 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 42) + out[13] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 22 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 23) + out[14] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 41 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 4) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 49) + out[15] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 15 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 30) + out[16] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 34 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 11) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 8 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 37) + out[18] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 27 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 18) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 63) + out[19] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 1 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 20 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 25) + out[21] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 39 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 6) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 51) + out[22] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 13 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[23] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 13) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 58) + out[24] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 6 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 39) + out[25] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 25 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 20) + out[26] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 44 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 1) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 46) + out[27] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 18 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 27) + out[28] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 37 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 53) + out[29] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 11 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 34) + out[30] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 30 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 15) | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 60) + out[31] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 4 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 41) + out[32] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 23 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 22) + out[33] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 42 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 3) | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[34] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 29) + out[35] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 35 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 10) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 55) + out[36] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 9 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 36) + out[37] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 28 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 17) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 62) + out[38] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 2 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 43) + out[39] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 21 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) + out[40] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 40 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 5) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 50) + out[41] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 14 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 31) + out[42] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 33 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 12) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 57) + out[43] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 7 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 38) + out[44] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 26 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 19) +} + +func deltapackzigzag_uint64_46(initoffset uint64, in *[64]uint64, out *[46]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 46) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 18 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 28) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 36 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 10) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 56) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 8 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 38) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 26 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 20) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 44 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 2) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) + out[6] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 16 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 30) + out[7] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 34 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 12) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 58) + out[8] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 6 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 40) + out[9] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 24 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 22) + out[10] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 42 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 4) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 50) + out[11] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 14 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[12] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 14) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 60) + out[13] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 4 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 42) + out[14] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 22 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 24) + out[15] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 40 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 6) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 52) + out[16] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 12 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 34) + out[17] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 30 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 62) + out[18] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 2 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 44) + out[19] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 20 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 26) + out[20] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 38 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 8) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 54) + out[21] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 10 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 36) + out[22] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 28 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 18) + out[23] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 46) + out[24] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 18 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 28) + out[25] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 36 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 10) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 56) + out[26] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 8 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 38) + out[27] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 26 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 20) + out[28] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 44 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 2) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) + out[29] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 16 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 30) + out[30] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 34 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 12) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 58) + out[31] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 6 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 40) + out[32] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 24 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 22) + out[33] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 42 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 4) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 50) + out[34] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 14 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[35] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 14) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 60) + out[36] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 4 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 42) + out[37] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 22 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 24) + out[38] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 40 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 6) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 52) + out[39] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 12 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 34) + out[40] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 30 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 62) + out[41] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 2 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 44) + out[42] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 20 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 26) + out[43] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 38 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 8) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 54) + out[44] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 10 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 36) + out[45] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 28 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 18) +} + +func deltapackzigzag_uint64_47(initoffset uint64, in *[64]uint64, out *[47]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 47) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 17 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 30) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 34 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 13) | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 60) + out[3] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 4 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 43) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 21 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 26) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 38 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 9) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) + out[6] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 8 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 39) + out[7] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 25 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 22) + out[8] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 42 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 5) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 52) + out[9] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 12 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 35) + out[10] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 29 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 18) + out[11] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 46 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 1) | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[12] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 31) + out[13] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 33 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 14) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 61) + out[14] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 3 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 44) + out[15] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 20 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 27) + out[16] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 37 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 10) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 57) + out[17] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 7 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) + out[18] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 24 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 23) + out[19] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 41 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 6) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 53) + out[20] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 11 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 36) + out[21] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 28 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 19) + out[22] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 45 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 2) | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 49) + out[23] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 15 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[24] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 15) | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 62) + out[25] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 2 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 45) + out[26] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 19 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 28) + out[27] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 36 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 11) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 58) + out[28] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 6 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 41) + out[29] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 23 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) + out[30] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 40 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 7) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 54) + out[31] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 10 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 37) + out[32] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 27 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 20) + out[33] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 44 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 3) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 50) + out[34] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 14 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 33) + out[35] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 31 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 63) + out[36] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 1 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 46) + out[37] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 18 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 29) + out[38] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 35 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 12) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 59) + out[39] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 5 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 42) + out[40] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 22 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 25) + out[41] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 39 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 55) + out[42] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 9 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 38) + out[43] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 26 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 21) + out[44] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 43 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 4) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 51) + out[45] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 13 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 34) + out[46] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 30 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 17) +} + +func deltapackzigzag_uint64_48(initoffset uint64, in *[64]uint64, out *[48]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 48) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 16 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 32) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 32 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 16) + out[3] = + uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63)) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 48) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 16 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 32) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 32 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 16) + out[6] = + uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63)) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 48) + out[7] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 16 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 32) + out[8] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 32 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 16) + out[9] = + uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63)) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 48) + out[10] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 16 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 32) + out[11] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 32 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 16) + out[12] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 48) + out[13] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 16 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 32) + out[14] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 32 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 16) + out[15] = + uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63)) | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 16 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 32) + out[17] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 32 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 16) + out[18] = + uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63)) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 16 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 32) + out[20] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 32 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 16) + out[21] = + uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63)) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 48) + out[22] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 16 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 32) + out[23] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 32 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 16) + out[24] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 48) + out[25] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 16 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 32) + out[26] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 32 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 16) + out[27] = + uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63)) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 48) + out[28] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 16 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 32) + out[29] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 32 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 16) + out[30] = + uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63)) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 48) + out[31] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 16 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 32) + out[32] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 32 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 16) + out[33] = + uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63)) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 48) + out[34] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 16 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 32) + out[35] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 32 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 16) + out[36] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 48) + out[37] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 16 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 32) + out[38] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 32 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 16) + out[39] = + uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63)) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 48) + out[40] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 16 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 32) + out[41] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 32 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 16) + out[42] = + uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63)) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 48) + out[43] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 16 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 32) + out[44] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 32 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 16) + out[45] = + uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63)) | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 48) + out[46] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 16 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 32) + out[47] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 32 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 16) +} + +func deltapackzigzag_uint64_49(initoffset uint64, in *[64]uint64, out *[49]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 49) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 15 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 34) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 30 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 19) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 45 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 4) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 53) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 11 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 38) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 26 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 23) + out[6] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 41 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 57) + out[7] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 7 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 42) + out[8] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 22 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 27) + out[9] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 37 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 12) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 61) + out[10] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 3 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 46) + out[11] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 18 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 31) + out[12] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 33 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) + out[13] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 48 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 1) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 50) + out[14] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 14 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 35) + out[15] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 29 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 20) + out[16] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 44 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 5) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 54) + out[17] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 10 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 39) + out[18] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 25 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) + out[19] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 40 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 9) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 58) + out[20] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 6 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 43) + out[21] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 21 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 28) + out[22] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 36 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 13) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 62) + out[23] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 2 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 47) + out[24] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 17 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[25] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 17) + out[26] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 47 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 2) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 51) + out[27] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 13 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 36) + out[28] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 28 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 21) + out[29] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 43 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 6) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 55) + out[30] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 9 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) + out[31] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 24 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 25) + out[32] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 39 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 10) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 59) + out[33] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 5 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 44) + out[34] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 20 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 29) + out[35] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 35 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 14) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 63) + out[36] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 1 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[37] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 33) + out[38] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 31 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 18) + out[39] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 46 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 3) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 52) + out[40] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 12 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 37) + out[41] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 27 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 22) + out[42] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 42 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 7) | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) + out[43] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 8 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 41) + out[44] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 23 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 26) + out[45] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 38 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 11) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 60) + out[46] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 4 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 45) + out[47] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 19 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 30) + out[48] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 34 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 15) +} + +func deltapackzigzag_uint64_50(initoffset uint64, in *[64]uint64, out *[50]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 50) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 14 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 36) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 28 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 22) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 42 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 8) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 58) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 6 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 44) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 20 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 30) + out[6] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 34 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) + out[7] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 48 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 2) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 52) + out[8] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 12 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 38) + out[9] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 26 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 24) + out[10] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 40 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 10) | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 60) + out[11] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 4 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 46) + out[12] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 18 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[13] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 18) + out[14] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 46 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 4) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 54) + out[15] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 10 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 40) + out[16] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 24 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 26) + out[17] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 38 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 12) | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 62) + out[18] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 2 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 16 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 34) + out[20] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 30 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 20) + out[21] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 44 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 6) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 56) + out[22] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 8 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 42) + out[23] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 22 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 28) + out[24] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 36 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 14) + out[25] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 50) + out[26] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 14 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 36) + out[27] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 28 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 22) + out[28] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 42 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 8) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 58) + out[29] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 6 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 44) + out[30] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 20 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 30) + out[31] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 34 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) + out[32] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 48 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 2) | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 52) + out[33] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 12 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 38) + out[34] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 26 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 24) + out[35] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 40 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 10) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 60) + out[36] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 4 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 46) + out[37] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 18 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[38] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 18) + out[39] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 46 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 4) | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 54) + out[40] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 10 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 40) + out[41] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 24 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 26) + out[42] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 38 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 12) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 62) + out[43] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 2 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) + out[44] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 16 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 34) + out[45] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 30 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 20) + out[46] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 44 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 6) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 56) + out[47] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 8 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 42) + out[48] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 22 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 28) + out[49] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 36 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 14) +} + +func deltapackzigzag_uint64_51(initoffset uint64, in *[64]uint64, out *[51]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 51) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 13 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 38) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 26 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 25) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 39 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 12) | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 63) + out[4] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 1 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 50) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 14 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 37) + out[6] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 27 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) + out[7] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 40 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 11) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 62) + out[8] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 2 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 49) + out[9] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 15 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 36) + out[10] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 28 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 23) + out[11] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 41 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 10) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 61) + out[12] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 3 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[13] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 35) + out[14] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 29 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 22) + out[15] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 42 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 9) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 60) + out[16] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 4 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 47) + out[17] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 17 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 34) + out[18] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 30 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 21) + out[19] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 43 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 59) + out[20] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 5 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 46) + out[21] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 18 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 33) + out[22] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 31 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 20) + out[23] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 44 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 7) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 58) + out[24] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 6 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 45) + out[25] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 19 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[26] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 19) + out[27] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 45 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 6) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 57) + out[28] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 7 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 44) + out[29] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 20 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 31) + out[30] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 33 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 18) + out[31] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 46 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 5) | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) + out[32] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 8 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 43) + out[33] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 21 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 30) + out[34] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 34 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 17) + out[35] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 47 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 4) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 55) + out[36] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 9 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 42) + out[37] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 22 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 29) + out[38] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 35 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) + out[39] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 48 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 3) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 54) + out[40] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 10 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 41) + out[41] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 23 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 28) + out[42] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 36 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 15) + out[43] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 49 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 2) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 53) + out[44] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 11 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) + out[45] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 24 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 27) + out[46] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 37 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 14) + out[47] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 50 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 1) | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 52) + out[48] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 12 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 39) + out[49] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 25 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 26) + out[50] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 38 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 13) +} + +func deltapackzigzag_uint64_52(initoffset uint64, in *[64]uint64, out *[52]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 52) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 12 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 40) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 24 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 28) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 36 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 16) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 48 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 4) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 56) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 8 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 44) + out[6] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 20 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) + out[7] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 32 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 20) + out[8] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 44 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 8) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 60) + out[9] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 4 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 48) + out[10] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 16 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 36) + out[11] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 28 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 24) + out[12] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 40 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 12) + out[13] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 52) + out[14] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 12 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 40) + out[15] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 24 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 28) + out[16] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 36 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 16) + out[17] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 48 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 4) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 56) + out[18] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 8 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 44) + out[19] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 20 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) + out[20] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 32 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 20) + out[21] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 44 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 8) | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 60) + out[22] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 4 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 48) + out[23] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 16 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 36) + out[24] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 28 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 24) + out[25] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 40 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 12) + out[26] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 52) + out[27] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 12 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 40) + out[28] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 24 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 28) + out[29] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 36 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 16) + out[30] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 48 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 4) | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 56) + out[31] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 8 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 44) + out[32] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 20 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) + out[33] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 32 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 20) + out[34] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 44 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 8) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 60) + out[35] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 4 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 48) + out[36] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 16 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 36) + out[37] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 28 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 24) + out[38] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 40 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 12) + out[39] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 52) + out[40] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 12 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 40) + out[41] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 24 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 28) + out[42] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 36 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 16) + out[43] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 48 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 4) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 56) + out[44] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 8 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 44) + out[45] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 20 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) + out[46] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 32 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 20) + out[47] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 44 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 8) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 60) + out[48] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 4 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 48) + out[49] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 16 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 36) + out[50] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 28 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 24) + out[51] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 40 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 12) +} + +func deltapackzigzag_uint64_53(initoffset uint64, in *[64]uint64, out *[53]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 53) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 11 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 42) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 22 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 31) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 33 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 20) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 44 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 9) | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 62) + out[5] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 2 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 51) + out[6] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 13 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) + out[7] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 24 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 29) + out[8] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 35 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 18) + out[9] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 46 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 7) | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 60) + out[10] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 4 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 49) + out[11] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 15 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 38) + out[12] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 26 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 27) + out[13] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 37 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) + out[14] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 48 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 5) | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 58) + out[15] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 6 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 47) + out[16] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 17 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 36) + out[17] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 28 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 25) + out[18] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 39 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 14) + out[19] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 50 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 3) | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) + out[20] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 8 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 45) + out[21] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 19 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 34) + out[22] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 30 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 23) + out[23] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 41 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 12) + out[24] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 52 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 1) | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 54) + out[25] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 10 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 43) + out[26] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 21 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[27] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 21) + out[28] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 43 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 10) | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 63) + out[29] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 1 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 52) + out[30] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 12 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 41) + out[31] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 23 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 30) + out[32] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 34 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 19) + out[33] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 45 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 61) + out[34] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 3 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 50) + out[35] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 14 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 39) + out[36] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 25 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 28) + out[37] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 36 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 17) + out[38] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 47 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 6) | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 59) + out[39] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 5 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[40] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 37) + out[41] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 27 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 26) + out[42] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 38 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 15) + out[43] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 49 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 4) | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 57) + out[44] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 7 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 46) + out[45] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 18 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 35) + out[46] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 29 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) + out[47] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 40 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 13) + out[48] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 51 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 2) | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 55) + out[49] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 9 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 44) + out[50] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 20 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 33) + out[51] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 31 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 22) + out[52] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 42 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 11) +} + +func deltapackzigzag_uint64_54(initoffset uint64, in *[64]uint64, out *[54]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 54) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 10 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 44) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 20 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 34) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 30 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 24) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 40 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 14) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 50 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 4) | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 6 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) + out[7] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 16 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 38) + out[8] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 26 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 28) + out[9] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 36 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 18) + out[10] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 46 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 8) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 62) + out[11] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 2 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 12 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 42) + out[13] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 22 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[14] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 22) + out[15] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 42 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 12) + out[16] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 52 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 2) | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 8 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 46) + out[18] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 18 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 36) + out[19] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 28 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 26) + out[20] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 38 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) + out[21] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 48 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 6) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 60) + out[22] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 4 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 50) + out[23] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 14 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 40) + out[24] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 24 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 30) + out[25] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 34 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 20) + out[26] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 44 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 10) + out[27] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 54) + out[28] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 10 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 44) + out[29] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 20 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 34) + out[30] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 30 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 24) + out[31] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 40 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 14) + out[32] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 50 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 4) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 58) + out[33] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 6 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) + out[34] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 16 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 38) + out[35] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 26 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 28) + out[36] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 36 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 18) + out[37] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 46 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 8) | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 62) + out[38] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 2 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 52) + out[39] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 12 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 42) + out[40] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 22 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[41] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 22) + out[42] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 42 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 12) + out[43] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 52 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 2) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 56) + out[44] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 8 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 46) + out[45] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 18 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 36) + out[46] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 28 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 26) + out[47] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 38 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) + out[48] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 48 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 6) | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 60) + out[49] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 4 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 50) + out[50] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 14 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 40) + out[51] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 24 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 30) + out[52] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 34 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 20) + out[53] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 44 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 10) +} + +func deltapackzigzag_uint64_55(initoffset uint64, in *[64]uint64, out *[55]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 55) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 9 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 46) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 18 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 37) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 27 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 28) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 36 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 19) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 45 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 10) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 54 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 1) | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) + out[7] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 8 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 47) + out[8] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 17 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 38) + out[9] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 26 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 29) + out[10] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 35 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 20) + out[11] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 44 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 11) + out[12] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 53 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 2) | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 57) + out[13] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 7 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[14] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 39) + out[15] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 25 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 30) + out[16] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 34 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 21) + out[17] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 43 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 12) + out[18] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 52 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 3) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 58) + out[19] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 6 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 49) + out[20] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 15 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) + out[21] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 24 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 31) + out[22] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 33 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 22) + out[23] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 42 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 13) + out[24] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 51 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 4) | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 59) + out[25] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 5 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 50) + out[26] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 14 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 41) + out[27] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 23 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[28] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 23) + out[29] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 41 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 14) + out[30] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 50 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 5) | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 60) + out[31] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 4 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 51) + out[32] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 13 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 42) + out[33] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 22 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 33) + out[34] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 31 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) + out[35] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 40 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 15) + out[36] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 49 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 6) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 61) + out[37] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 3 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 52) + out[38] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 12 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 43) + out[39] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 21 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 34) + out[40] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 30 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 25) + out[41] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 39 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) + out[42] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 48 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 7) | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 62) + out[43] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 2 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 53) + out[44] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 11 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 44) + out[45] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 20 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 35) + out[46] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 29 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 26) + out[47] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 38 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 17) + out[48] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 47 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 63) + out[49] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 1 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 54) + out[50] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 10 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 45) + out[51] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 19 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 36) + out[52] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 28 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 27) + out[53] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 37 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 18) + out[54] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 46 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 9) +} + +func deltapackzigzag_uint64_56(initoffset uint64, in *[64]uint64, out *[56]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 56) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 8 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 48) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 16 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 40) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 24 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 32) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 32 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 24) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 40 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 16) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 48 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 8) + out[7] = + uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63)) | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 8 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 48) + out[9] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 16 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 40) + out[10] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 24 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 32) + out[11] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 32 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 24) + out[12] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 40 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 16) + out[13] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 48 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 8) + out[14] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 56) + out[15] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 8 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 16 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 40) + out[17] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 24 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 32) + out[18] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 32 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 24) + out[19] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 40 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 16) + out[20] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 48 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 8) + out[21] = + uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63)) | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 56) + out[22] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 8 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 48) + out[23] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 16 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 40) + out[24] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 24 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 32) + out[25] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 32 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 24) + out[26] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 40 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 16) + out[27] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 48 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 8) + out[28] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 56) + out[29] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 8 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 48) + out[30] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 16 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 40) + out[31] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 24 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 32) + out[32] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 32 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 24) + out[33] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 40 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 16) + out[34] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 48 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 8) + out[35] = + uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63)) | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 56) + out[36] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 8 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 48) + out[37] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 16 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 40) + out[38] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 24 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 32) + out[39] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 32 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 24) + out[40] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 40 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 16) + out[41] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 48 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 8) + out[42] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 56) + out[43] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 8 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 48) + out[44] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 16 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 40) + out[45] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 24 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 32) + out[46] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 32 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 24) + out[47] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 40 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 16) + out[48] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 48 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 8) + out[49] = + uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63)) | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 56) + out[50] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 8 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 48) + out[51] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 16 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 40) + out[52] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 24 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 32) + out[53] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 32 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 24) + out[54] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 40 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 16) + out[55] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 48 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 8) +} + +func deltapackzigzag_uint64_57(initoffset uint64, in *[64]uint64, out *[57]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 57) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 7 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 50) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 14 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 43) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 21 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 36) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 28 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 29) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 35 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 22) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 42 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 15) + out[7] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 49 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 8) + out[8] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 56 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 1) | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 58) + out[9] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 6 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 51) + out[10] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 13 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 44) + out[11] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 20 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 37) + out[12] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 27 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 30) + out[13] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 34 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 23) + out[14] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 41 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) + out[15] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 48 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 9) + out[16] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 55 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 2) | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 59) + out[17] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 5 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 52) + out[18] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 12 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 45) + out[19] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 19 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 38) + out[20] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 26 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 31) + out[21] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 33 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 24) + out[22] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 40 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 17) + out[23] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 47 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 10) + out[24] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 54 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 3) | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 60) + out[25] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 4 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 53) + out[26] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 11 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 46) + out[27] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 18 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 39) + out[28] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 25 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[29] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 25) + out[30] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 39 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 18) + out[31] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 46 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 11) + out[32] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 53 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 4) | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 61) + out[33] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 3 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 54) + out[34] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 10 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 47) + out[35] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 17 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 40) + out[36] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 24 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 33) + out[37] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 31 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 26) + out[38] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 38 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 19) + out[39] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 45 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 12) + out[40] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 52 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 5) | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 62) + out[41] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 2 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 55) + out[42] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 9 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[43] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 41) + out[44] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 23 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 34) + out[45] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 30 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 27) + out[46] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 37 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 20) + out[47] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 44 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 13) + out[48] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 51 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 6) | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 63) + out[49] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 1 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 56) + out[50] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 8 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 49) + out[51] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 15 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 42) + out[52] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 22 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 35) + out[53] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 29 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 28) + out[54] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 36 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 21) + out[55] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 43 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 14) + out[56] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 50 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 7) +} + +func deltapackzigzag_uint64_58(initoffset uint64, in *[64]uint64, out *[58]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 58) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 6 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 52) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 12 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 46) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 18 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 40) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 24 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 34) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 30 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 28) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 36 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 22) + out[7] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 42 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 16) + out[8] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 48 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 10) + out[9] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 54 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 4) | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 62) + out[10] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 2 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 56) + out[11] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 8 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 50) + out[12] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 14 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 44) + out[13] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 20 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 38) + out[14] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 26 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[15] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 26) + out[16] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 38 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 20) + out[17] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 44 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 14) + out[18] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 50 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 8) + out[19] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 56 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 2) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 60) + out[20] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 4 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 54) + out[21] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 10 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 48) + out[22] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 16 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 42) + out[23] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 22 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 36) + out[24] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 28 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 30) + out[25] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 34 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 24) + out[26] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 40 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 18) + out[27] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 46 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 12) + out[28] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 52 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 6) + out[29] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 58) + out[30] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 6 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 52) + out[31] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 12 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 46) + out[32] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 18 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 40) + out[33] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 24 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 34) + out[34] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 30 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 28) + out[35] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 36 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 22) + out[36] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 42 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 16) + out[37] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 48 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 10) + out[38] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 54 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 4) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 62) + out[39] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 2 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 56) + out[40] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 8 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 50) + out[41] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 14 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 44) + out[42] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 20 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 38) + out[43] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 26 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[44] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 26) + out[45] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 38 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 20) + out[46] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 44 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 14) + out[47] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 50 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 8) + out[48] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 56 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 2) | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 60) + out[49] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 4 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 54) + out[50] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 10 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 48) + out[51] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 16 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 42) + out[52] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 22 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 36) + out[53] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 28 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 30) + out[54] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 34 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 24) + out[55] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 40 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 18) + out[56] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 46 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 12) + out[57] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 52 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 6) +} + +func deltapackzigzag_uint64_59(initoffset uint64, in *[64]uint64, out *[59]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 59) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 5 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 54) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 10 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 49) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 15 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 44) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 20 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 39) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 25 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 34) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 30 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 29) + out[7] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 35 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 24) + out[8] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 40 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 19) + out[9] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 45 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 14) + out[10] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 50 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 9) + out[11] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 55 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 4) | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 63) + out[12] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 1 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 58) + out[13] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 6 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 53) + out[14] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 11 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[15] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 43) + out[16] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 21 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 38) + out[17] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 26 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 33) + out[18] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 31 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 28) + out[19] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 36 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 23) + out[20] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 41 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 18) + out[21] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 46 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 13) + out[22] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 51 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 8) + out[23] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 56 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 3) | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 62) + out[24] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 2 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 57) + out[25] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 7 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 52) + out[26] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 12 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 47) + out[27] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 17 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 42) + out[28] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 22 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 37) + out[29] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 27 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[30] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 27) + out[31] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 37 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 22) + out[32] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 42 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 17) + out[33] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 47 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 12) + out[34] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 52 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 7) + out[35] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 57 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 2) | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 61) + out[36] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 3 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 56) + out[37] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 8 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 51) + out[38] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 13 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 46) + out[39] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 18 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 41) + out[40] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 23 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 36) + out[41] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 28 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 31) + out[42] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 33 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 26) + out[43] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 38 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 21) + out[44] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 43 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) + out[45] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 48 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 11) + out[46] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 53 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 6) + out[47] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 58 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 1) | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 60) + out[48] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 4 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 55) + out[49] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 9 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 50) + out[50] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 14 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 45) + out[51] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 19 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 40) + out[52] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 24 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 35) + out[53] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 29 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 30) + out[54] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 34 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 25) + out[55] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 39 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 20) + out[56] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 44 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 15) + out[57] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 49 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 10) + out[58] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 54 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 5) +} + +func deltapackzigzag_uint64_60(initoffset uint64, in *[64]uint64, out *[60]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 60) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 4 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 56) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 8 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 52) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 12 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 48) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 16 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 44) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 20 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 40) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 24 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 36) + out[7] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 28 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 32) + out[8] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 32 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 28) + out[9] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 36 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 24) + out[10] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 40 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 20) + out[11] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 44 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 16) + out[12] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 48 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 12) + out[13] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 52 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 8) + out[14] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 56 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 4) + out[15] = + uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63)) | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 60) + out[16] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 4 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 56) + out[17] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 8 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 52) + out[18] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 12 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 48) + out[19] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 16 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 20 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 40) + out[21] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 24 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 36) + out[22] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 28 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 32) + out[23] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 32 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 28) + out[24] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 36 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 24) + out[25] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 40 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 20) + out[26] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 44 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 16) + out[27] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 48 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 12) + out[28] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 52 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 8) + out[29] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 56 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 4) + out[30] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 60) + out[31] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 4 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 56) + out[32] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 8 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 52) + out[33] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 12 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 48) + out[34] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 16 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 44) + out[35] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 20 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 40) + out[36] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 24 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 36) + out[37] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 28 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 32) + out[38] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 32 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 28) + out[39] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 36 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 24) + out[40] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 40 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 20) + out[41] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 44 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 16) + out[42] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 48 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 12) + out[43] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 52 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 8) + out[44] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 56 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 4) + out[45] = + uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63)) | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 60) + out[46] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 4 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 56) + out[47] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 8 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 52) + out[48] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 12 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 48) + out[49] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 16 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 44) + out[50] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 20 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 40) + out[51] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 24 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 36) + out[52] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 28 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 32) + out[53] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 32 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 28) + out[54] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 36 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 24) + out[55] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 40 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 20) + out[56] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 44 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 16) + out[57] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 48 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 12) + out[58] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 52 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 8) + out[59] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 56 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 4) +} + +func deltapackzigzag_uint64_61(initoffset uint64, in *[64]uint64, out *[61]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 61) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 3 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 58) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 6 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 55) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 9 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 52) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 12 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 49) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 15 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 46) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 18 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 43) + out[7] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 21 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 40) + out[8] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 24 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 37) + out[9] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 27 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 34) + out[10] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 30 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 31) + out[11] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 33 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 28) + out[12] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 36 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 25) + out[13] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 39 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 22) + out[14] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 42 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 19) + out[15] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 45 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 16) + out[16] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 48 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 13) + out[17] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 51 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 10) + out[18] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 54 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 7) + out[19] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 57 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 4) + out[20] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 60 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 1) | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 62) + out[21] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 2 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 59) + out[22] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 5 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 56) + out[23] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 8 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 53) + out[24] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 11 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 50) + out[25] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 14 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 47) + out[26] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 17 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 44) + out[27] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 20 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 41) + out[28] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 23 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 38) + out[29] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 26 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 35) + out[30] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 29 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[31] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 29) + out[32] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 35 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 26) + out[33] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 38 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 23) + out[34] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 41 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 20) + out[35] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 44 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 17) + out[36] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 47 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 14) + out[37] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 50 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 11) + out[38] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 53 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 8) + out[39] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 56 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 5) + out[40] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 59 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 2) | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 63) + out[41] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 1 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 60) + out[42] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 4 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 57) + out[43] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 7 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 54) + out[44] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 10 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 51) + out[45] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 13 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 48) + out[46] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 16 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 45) + out[47] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 19 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 42) + out[48] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 22 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 39) + out[49] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 25 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 36) + out[50] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 28 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 33) + out[51] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 31 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 30) + out[52] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 34 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 27) + out[53] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 37 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 24) + out[54] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 40 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 21) + out[55] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 43 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 18) + out[56] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 46 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 15) + out[57] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 49 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 12) + out[58] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 52 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 9) + out[59] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 55 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 6) + out[60] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 58 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 3) +} + +func deltapackzigzag_uint64_62(initoffset uint64, in *[64]uint64, out *[62]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 62) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 2 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 60) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 4 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 58) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 6 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 56) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 8 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 54) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 10 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 52) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 12 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 50) + out[7] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 14 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 48) + out[8] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 16 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 46) + out[9] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 18 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 44) + out[10] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 20 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 42) + out[11] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 22 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 40) + out[12] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 24 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 38) + out[13] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 26 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 36) + out[14] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 28 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 34) + out[15] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 30 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 32) + out[16] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 32 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 30) + out[17] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 34 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 28) + out[18] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 36 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 26) + out[19] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 38 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 24) + out[20] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 40 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 22) + out[21] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 42 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 20) + out[22] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 44 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 18) + out[23] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 46 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 16) + out[24] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 48 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 14) + out[25] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 50 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 12) + out[26] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 52 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 10) + out[27] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 54 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 8) + out[28] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 56 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 6) + out[29] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 58 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 4) + out[30] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 60 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 2) + out[31] = + uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63)) | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 62) + out[32] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 2 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 60) + out[33] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 4 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 58) + out[34] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 6 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 56) + out[35] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 8 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 54) + out[36] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 10 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 52) + out[37] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 12 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 50) + out[38] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 14 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 48) + out[39] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 16 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 46) + out[40] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 18 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 44) + out[41] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 20 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 42) + out[42] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 22 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 40) + out[43] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 24 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 38) + out[44] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 26 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 36) + out[45] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 28 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 34) + out[46] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 30 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 32) + out[47] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 32 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 30) + out[48] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 34 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 28) + out[49] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 36 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 26) + out[50] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 38 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 24) + out[51] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 40 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 22) + out[52] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 42 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 20) + out[53] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 44 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 18) + out[54] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 46 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 16) + out[55] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 48 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 14) + out[56] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 50 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 12) + out[57] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 52 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 10) + out[58] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 54 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 8) + out[59] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 56 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 6) + out[60] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 58 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 4) + out[61] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 60 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 2) +} + +func deltapackzigzag_uint64_63(initoffset uint64, in *[64]uint64, out *[63]uint64) { + out[0] = + uint64(((int64(in[0] - initoffset)) << 1) ^ ((int64(in[0] - initoffset)) >> 63)) | + ((uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) << 63) + out[1] = + (uint64(((int64(in[1] - in[0])) << 1) ^ ((int64(in[1] - in[0])) >> 63))) >> 1 | + ((uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) << 62) + out[2] = + (uint64(((int64(in[2] - in[1])) << 1) ^ ((int64(in[2] - in[1])) >> 63))) >> 2 | + ((uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) << 61) + out[3] = + (uint64(((int64(in[3] - in[2])) << 1) ^ ((int64(in[3] - in[2])) >> 63))) >> 3 | + ((uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) << 60) + out[4] = + (uint64(((int64(in[4] - in[3])) << 1) ^ ((int64(in[4] - in[3])) >> 63))) >> 4 | + ((uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) << 59) + out[5] = + (uint64(((int64(in[5] - in[4])) << 1) ^ ((int64(in[5] - in[4])) >> 63))) >> 5 | + ((uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) << 58) + out[6] = + (uint64(((int64(in[6] - in[5])) << 1) ^ ((int64(in[6] - in[5])) >> 63))) >> 6 | + ((uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) << 57) + out[7] = + (uint64(((int64(in[7] - in[6])) << 1) ^ ((int64(in[7] - in[6])) >> 63))) >> 7 | + ((uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) << 56) + out[8] = + (uint64(((int64(in[8] - in[7])) << 1) ^ ((int64(in[8] - in[7])) >> 63))) >> 8 | + ((uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) << 55) + out[9] = + (uint64(((int64(in[9] - in[8])) << 1) ^ ((int64(in[9] - in[8])) >> 63))) >> 9 | + ((uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) << 54) + out[10] = + (uint64(((int64(in[10] - in[9])) << 1) ^ ((int64(in[10] - in[9])) >> 63))) >> 10 | + ((uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) << 53) + out[11] = + (uint64(((int64(in[11] - in[10])) << 1) ^ ((int64(in[11] - in[10])) >> 63))) >> 11 | + ((uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) << 52) + out[12] = + (uint64(((int64(in[12] - in[11])) << 1) ^ ((int64(in[12] - in[11])) >> 63))) >> 12 | + ((uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) << 51) + out[13] = + (uint64(((int64(in[13] - in[12])) << 1) ^ ((int64(in[13] - in[12])) >> 63))) >> 13 | + ((uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) << 50) + out[14] = + (uint64(((int64(in[14] - in[13])) << 1) ^ ((int64(in[14] - in[13])) >> 63))) >> 14 | + ((uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) << 49) + out[15] = + (uint64(((int64(in[15] - in[14])) << 1) ^ ((int64(in[15] - in[14])) >> 63))) >> 15 | + ((uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) << 48) + out[16] = + (uint64(((int64(in[16] - in[15])) << 1) ^ ((int64(in[16] - in[15])) >> 63))) >> 16 | + ((uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) << 47) + out[17] = + (uint64(((int64(in[17] - in[16])) << 1) ^ ((int64(in[17] - in[16])) >> 63))) >> 17 | + ((uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) << 46) + out[18] = + (uint64(((int64(in[18] - in[17])) << 1) ^ ((int64(in[18] - in[17])) >> 63))) >> 18 | + ((uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) << 45) + out[19] = + (uint64(((int64(in[19] - in[18])) << 1) ^ ((int64(in[19] - in[18])) >> 63))) >> 19 | + ((uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) << 44) + out[20] = + (uint64(((int64(in[20] - in[19])) << 1) ^ ((int64(in[20] - in[19])) >> 63))) >> 20 | + ((uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) << 43) + out[21] = + (uint64(((int64(in[21] - in[20])) << 1) ^ ((int64(in[21] - in[20])) >> 63))) >> 21 | + ((uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) << 42) + out[22] = + (uint64(((int64(in[22] - in[21])) << 1) ^ ((int64(in[22] - in[21])) >> 63))) >> 22 | + ((uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) << 41) + out[23] = + (uint64(((int64(in[23] - in[22])) << 1) ^ ((int64(in[23] - in[22])) >> 63))) >> 23 | + ((uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) << 40) + out[24] = + (uint64(((int64(in[24] - in[23])) << 1) ^ ((int64(in[24] - in[23])) >> 63))) >> 24 | + ((uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) << 39) + out[25] = + (uint64(((int64(in[25] - in[24])) << 1) ^ ((int64(in[25] - in[24])) >> 63))) >> 25 | + ((uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) << 38) + out[26] = + (uint64(((int64(in[26] - in[25])) << 1) ^ ((int64(in[26] - in[25])) >> 63))) >> 26 | + ((uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) << 37) + out[27] = + (uint64(((int64(in[27] - in[26])) << 1) ^ ((int64(in[27] - in[26])) >> 63))) >> 27 | + ((uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) << 36) + out[28] = + (uint64(((int64(in[28] - in[27])) << 1) ^ ((int64(in[28] - in[27])) >> 63))) >> 28 | + ((uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) << 35) + out[29] = + (uint64(((int64(in[29] - in[28])) << 1) ^ ((int64(in[29] - in[28])) >> 63))) >> 29 | + ((uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) << 34) + out[30] = + (uint64(((int64(in[30] - in[29])) << 1) ^ ((int64(in[30] - in[29])) >> 63))) >> 30 | + ((uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) << 33) + out[31] = + (uint64(((int64(in[31] - in[30])) << 1) ^ ((int64(in[31] - in[30])) >> 63))) >> 31 | + ((uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) << 32) + out[32] = + (uint64(((int64(in[32] - in[31])) << 1) ^ ((int64(in[32] - in[31])) >> 63))) >> 32 | + ((uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) << 31) + out[33] = + (uint64(((int64(in[33] - in[32])) << 1) ^ ((int64(in[33] - in[32])) >> 63))) >> 33 | + ((uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) << 30) + out[34] = + (uint64(((int64(in[34] - in[33])) << 1) ^ ((int64(in[34] - in[33])) >> 63))) >> 34 | + ((uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) << 29) + out[35] = + (uint64(((int64(in[35] - in[34])) << 1) ^ ((int64(in[35] - in[34])) >> 63))) >> 35 | + ((uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) << 28) + out[36] = + (uint64(((int64(in[36] - in[35])) << 1) ^ ((int64(in[36] - in[35])) >> 63))) >> 36 | + ((uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) << 27) + out[37] = + (uint64(((int64(in[37] - in[36])) << 1) ^ ((int64(in[37] - in[36])) >> 63))) >> 37 | + ((uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) << 26) + out[38] = + (uint64(((int64(in[38] - in[37])) << 1) ^ ((int64(in[38] - in[37])) >> 63))) >> 38 | + ((uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) << 25) + out[39] = + (uint64(((int64(in[39] - in[38])) << 1) ^ ((int64(in[39] - in[38])) >> 63))) >> 39 | + ((uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) << 24) + out[40] = + (uint64(((int64(in[40] - in[39])) << 1) ^ ((int64(in[40] - in[39])) >> 63))) >> 40 | + ((uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) << 23) + out[41] = + (uint64(((int64(in[41] - in[40])) << 1) ^ ((int64(in[41] - in[40])) >> 63))) >> 41 | + ((uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) << 22) + out[42] = + (uint64(((int64(in[42] - in[41])) << 1) ^ ((int64(in[42] - in[41])) >> 63))) >> 42 | + ((uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) << 21) + out[43] = + (uint64(((int64(in[43] - in[42])) << 1) ^ ((int64(in[43] - in[42])) >> 63))) >> 43 | + ((uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) << 20) + out[44] = + (uint64(((int64(in[44] - in[43])) << 1) ^ ((int64(in[44] - in[43])) >> 63))) >> 44 | + ((uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) << 19) + out[45] = + (uint64(((int64(in[45] - in[44])) << 1) ^ ((int64(in[45] - in[44])) >> 63))) >> 45 | + ((uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) << 18) + out[46] = + (uint64(((int64(in[46] - in[45])) << 1) ^ ((int64(in[46] - in[45])) >> 63))) >> 46 | + ((uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) << 17) + out[47] = + (uint64(((int64(in[47] - in[46])) << 1) ^ ((int64(in[47] - in[46])) >> 63))) >> 47 | + ((uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) << 16) + out[48] = + (uint64(((int64(in[48] - in[47])) << 1) ^ ((int64(in[48] - in[47])) >> 63))) >> 48 | + ((uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) << 15) + out[49] = + (uint64(((int64(in[49] - in[48])) << 1) ^ ((int64(in[49] - in[48])) >> 63))) >> 49 | + ((uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) << 14) + out[50] = + (uint64(((int64(in[50] - in[49])) << 1) ^ ((int64(in[50] - in[49])) >> 63))) >> 50 | + ((uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) << 13) + out[51] = + (uint64(((int64(in[51] - in[50])) << 1) ^ ((int64(in[51] - in[50])) >> 63))) >> 51 | + ((uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) << 12) + out[52] = + (uint64(((int64(in[52] - in[51])) << 1) ^ ((int64(in[52] - in[51])) >> 63))) >> 52 | + ((uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) << 11) + out[53] = + (uint64(((int64(in[53] - in[52])) << 1) ^ ((int64(in[53] - in[52])) >> 63))) >> 53 | + ((uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) << 10) + out[54] = + (uint64(((int64(in[54] - in[53])) << 1) ^ ((int64(in[54] - in[53])) >> 63))) >> 54 | + ((uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) << 9) + out[55] = + (uint64(((int64(in[55] - in[54])) << 1) ^ ((int64(in[55] - in[54])) >> 63))) >> 55 | + ((uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) << 8) + out[56] = + (uint64(((int64(in[56] - in[55])) << 1) ^ ((int64(in[56] - in[55])) >> 63))) >> 56 | + ((uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) << 7) + out[57] = + (uint64(((int64(in[57] - in[56])) << 1) ^ ((int64(in[57] - in[56])) >> 63))) >> 57 | + ((uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) << 6) + out[58] = + (uint64(((int64(in[58] - in[57])) << 1) ^ ((int64(in[58] - in[57])) >> 63))) >> 58 | + ((uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) << 5) + out[59] = + (uint64(((int64(in[59] - in[58])) << 1) ^ ((int64(in[59] - in[58])) >> 63))) >> 59 | + ((uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) << 4) + out[60] = + (uint64(((int64(in[60] - in[59])) << 1) ^ ((int64(in[60] - in[59])) >> 63))) >> 60 | + ((uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) << 3) + out[61] = + (uint64(((int64(in[61] - in[60])) << 1) ^ ((int64(in[61] - in[60])) >> 63))) >> 61 | + ((uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) << 2) + out[62] = + (uint64(((int64(in[62] - in[61])) << 1) ^ ((int64(in[62] - in[61])) >> 63))) >> 62 | + ((uint64(((int64(in[63] - in[62])) << 1) ^ ((int64(in[63] - in[62])) >> 63))) << 1) +} + +func deltaunpackzigzag_uint64_0(initoffset uint64, in *[0]uint64, out *[64]uint64) { + out[0] = initoffset + out[1] = initoffset + out[2] = initoffset + out[3] = initoffset + out[4] = initoffset + out[5] = initoffset + out[6] = initoffset + out[7] = initoffset + out[8] = initoffset + out[9] = initoffset + out[10] = initoffset + out[11] = initoffset + out[12] = initoffset + out[13] = initoffset + out[14] = initoffset + out[15] = initoffset + out[16] = initoffset + out[17] = initoffset + out[18] = initoffset + out[19] = initoffset + out[20] = initoffset + out[21] = initoffset + out[22] = initoffset + out[23] = initoffset + out[24] = initoffset + out[25] = initoffset + out[26] = initoffset + out[27] = initoffset + out[28] = initoffset + out[29] = initoffset + out[30] = initoffset + out[31] = initoffset + out[32] = initoffset + out[33] = initoffset + out[34] = initoffset + out[35] = initoffset + out[36] = initoffset + out[37] = initoffset + out[38] = initoffset + out[39] = initoffset + out[40] = initoffset + out[41] = initoffset + out[42] = initoffset + out[43] = initoffset + out[44] = initoffset + out[45] = initoffset + out[46] = initoffset + out[47] = initoffset + out[48] = initoffset + out[49] = initoffset + out[50] = initoffset + out[51] = initoffset + out[52] = initoffset + out[53] = initoffset + out[54] = initoffset + out[55] = initoffset + out[56] = initoffset + out[57] = initoffset + out[58] = initoffset + out[59] = initoffset + out[60] = initoffset + out[61] = initoffset + out[62] = initoffset + out[63] = initoffset +} + +func deltaunpackzigzag_uint64_1(initoffset uint64, in *[1]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1)) & 1))^((int64((in[0] >> 0) & 0x1))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 1) & 0x1)) & 1))^((int64((in[0] >> 1) & 0x1))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 2) & 0x1)) & 1))^((int64((in[0] >> 2) & 0x1))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 3) & 0x1)) & 1))^((int64((in[0] >> 3) & 0x1))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 4) & 0x1)) & 1))^((int64((in[0] >> 4) & 0x1))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 5) & 0x1)) & 1))^((int64((in[0] >> 5) & 0x1))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 6) & 0x1)) & 1))^((int64((in[0] >> 6) & 0x1))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 7) & 0x1)) & 1))^((int64((in[0] >> 7) & 0x1))>>1))) + out[6] + out[8] = uint64(((-((int64((in[0] >> 8) & 0x1)) & 1))^((int64((in[0] >> 8) & 0x1))>>1))) + out[7] + out[9] = uint64(((-((int64((in[0] >> 9) & 0x1)) & 1))^((int64((in[0] >> 9) & 0x1))>>1))) + out[8] + out[10] = uint64(((-((int64((in[0] >> 10) & 0x1)) & 1))^((int64((in[0] >> 10) & 0x1))>>1))) + out[9] + out[11] = uint64(((-((int64((in[0] >> 11) & 0x1)) & 1))^((int64((in[0] >> 11) & 0x1))>>1))) + out[10] + out[12] = uint64(((-((int64((in[0] >> 12) & 0x1)) & 1))^((int64((in[0] >> 12) & 0x1))>>1))) + out[11] + out[13] = uint64(((-((int64((in[0] >> 13) & 0x1)) & 1))^((int64((in[0] >> 13) & 0x1))>>1))) + out[12] + out[14] = uint64(((-((int64((in[0] >> 14) & 0x1)) & 1))^((int64((in[0] >> 14) & 0x1))>>1))) + out[13] + out[15] = uint64(((-((int64((in[0] >> 15) & 0x1)) & 1))^((int64((in[0] >> 15) & 0x1))>>1))) + out[14] + out[16] = uint64(((-((int64((in[0] >> 16) & 0x1)) & 1))^((int64((in[0] >> 16) & 0x1))>>1))) + out[15] + out[17] = uint64(((-((int64((in[0] >> 17) & 0x1)) & 1))^((int64((in[0] >> 17) & 0x1))>>1))) + out[16] + out[18] = uint64(((-((int64((in[0] >> 18) & 0x1)) & 1))^((int64((in[0] >> 18) & 0x1))>>1))) + out[17] + out[19] = uint64(((-((int64((in[0] >> 19) & 0x1)) & 1))^((int64((in[0] >> 19) & 0x1))>>1))) + out[18] + out[20] = uint64(((-((int64((in[0] >> 20) & 0x1)) & 1))^((int64((in[0] >> 20) & 0x1))>>1))) + out[19] + out[21] = uint64(((-((int64((in[0] >> 21) & 0x1)) & 1))^((int64((in[0] >> 21) & 0x1))>>1))) + out[20] + out[22] = uint64(((-((int64((in[0] >> 22) & 0x1)) & 1))^((int64((in[0] >> 22) & 0x1))>>1))) + out[21] + out[23] = uint64(((-((int64((in[0] >> 23) & 0x1)) & 1))^((int64((in[0] >> 23) & 0x1))>>1))) + out[22] + out[24] = uint64(((-((int64((in[0] >> 24) & 0x1)) & 1))^((int64((in[0] >> 24) & 0x1))>>1))) + out[23] + out[25] = uint64(((-((int64((in[0] >> 25) & 0x1)) & 1))^((int64((in[0] >> 25) & 0x1))>>1))) + out[24] + out[26] = uint64(((-((int64((in[0] >> 26) & 0x1)) & 1))^((int64((in[0] >> 26) & 0x1))>>1))) + out[25] + out[27] = uint64(((-((int64((in[0] >> 27) & 0x1)) & 1))^((int64((in[0] >> 27) & 0x1))>>1))) + out[26] + out[28] = uint64(((-((int64((in[0] >> 28) & 0x1)) & 1))^((int64((in[0] >> 28) & 0x1))>>1))) + out[27] + out[29] = uint64(((-((int64((in[0] >> 29) & 0x1)) & 1))^((int64((in[0] >> 29) & 0x1))>>1))) + out[28] + out[30] = uint64(((-((int64((in[0] >> 30) & 0x1)) & 1))^((int64((in[0] >> 30) & 0x1))>>1))) + out[29] + out[31] = uint64(((-((int64((in[0] >> 31) & 0x1)) & 1))^((int64((in[0] >> 31) & 0x1))>>1))) + out[30] + out[32] = uint64(((-((int64((in[0] >> 32) & 0x1)) & 1))^((int64((in[0] >> 32) & 0x1))>>1))) + out[31] + out[33] = uint64(((-((int64((in[0] >> 33) & 0x1)) & 1))^((int64((in[0] >> 33) & 0x1))>>1))) + out[32] + out[34] = uint64(((-((int64((in[0] >> 34) & 0x1)) & 1))^((int64((in[0] >> 34) & 0x1))>>1))) + out[33] + out[35] = uint64(((-((int64((in[0] >> 35) & 0x1)) & 1))^((int64((in[0] >> 35) & 0x1))>>1))) + out[34] + out[36] = uint64(((-((int64((in[0] >> 36) & 0x1)) & 1))^((int64((in[0] >> 36) & 0x1))>>1))) + out[35] + out[37] = uint64(((-((int64((in[0] >> 37) & 0x1)) & 1))^((int64((in[0] >> 37) & 0x1))>>1))) + out[36] + out[38] = uint64(((-((int64((in[0] >> 38) & 0x1)) & 1))^((int64((in[0] >> 38) & 0x1))>>1))) + out[37] + out[39] = uint64(((-((int64((in[0] >> 39) & 0x1)) & 1))^((int64((in[0] >> 39) & 0x1))>>1))) + out[38] + out[40] = uint64(((-((int64((in[0] >> 40) & 0x1)) & 1))^((int64((in[0] >> 40) & 0x1))>>1))) + out[39] + out[41] = uint64(((-((int64((in[0] >> 41) & 0x1)) & 1))^((int64((in[0] >> 41) & 0x1))>>1))) + out[40] + out[42] = uint64(((-((int64((in[0] >> 42) & 0x1)) & 1))^((int64((in[0] >> 42) & 0x1))>>1))) + out[41] + out[43] = uint64(((-((int64((in[0] >> 43) & 0x1)) & 1))^((int64((in[0] >> 43) & 0x1))>>1))) + out[42] + out[44] = uint64(((-((int64((in[0] >> 44) & 0x1)) & 1))^((int64((in[0] >> 44) & 0x1))>>1))) + out[43] + out[45] = uint64(((-((int64((in[0] >> 45) & 0x1)) & 1))^((int64((in[0] >> 45) & 0x1))>>1))) + out[44] + out[46] = uint64(((-((int64((in[0] >> 46) & 0x1)) & 1))^((int64((in[0] >> 46) & 0x1))>>1))) + out[45] + out[47] = uint64(((-((int64((in[0] >> 47) & 0x1)) & 1))^((int64((in[0] >> 47) & 0x1))>>1))) + out[46] + out[48] = uint64(((-((int64((in[0] >> 48) & 0x1)) & 1))^((int64((in[0] >> 48) & 0x1))>>1))) + out[47] + out[49] = uint64(((-((int64((in[0] >> 49) & 0x1)) & 1))^((int64((in[0] >> 49) & 0x1))>>1))) + out[48] + out[50] = uint64(((-((int64((in[0] >> 50) & 0x1)) & 1))^((int64((in[0] >> 50) & 0x1))>>1))) + out[49] + out[51] = uint64(((-((int64((in[0] >> 51) & 0x1)) & 1))^((int64((in[0] >> 51) & 0x1))>>1))) + out[50] + out[52] = uint64(((-((int64((in[0] >> 52) & 0x1)) & 1))^((int64((in[0] >> 52) & 0x1))>>1))) + out[51] + out[53] = uint64(((-((int64((in[0] >> 53) & 0x1)) & 1))^((int64((in[0] >> 53) & 0x1))>>1))) + out[52] + out[54] = uint64(((-((int64((in[0] >> 54) & 0x1)) & 1))^((int64((in[0] >> 54) & 0x1))>>1))) + out[53] + out[55] = uint64(((-((int64((in[0] >> 55) & 0x1)) & 1))^((int64((in[0] >> 55) & 0x1))>>1))) + out[54] + out[56] = uint64(((-((int64((in[0] >> 56) & 0x1)) & 1))^((int64((in[0] >> 56) & 0x1))>>1))) + out[55] + out[57] = uint64(((-((int64((in[0] >> 57) & 0x1)) & 1))^((int64((in[0] >> 57) & 0x1))>>1))) + out[56] + out[58] = uint64(((-((int64((in[0] >> 58) & 0x1)) & 1))^((int64((in[0] >> 58) & 0x1))>>1))) + out[57] + out[59] = uint64(((-((int64((in[0] >> 59) & 0x1)) & 1))^((int64((in[0] >> 59) & 0x1))>>1))) + out[58] + out[60] = uint64(((-((int64((in[0] >> 60) & 0x1)) & 1))^((int64((in[0] >> 60) & 0x1))>>1))) + out[59] + out[61] = uint64(((-((int64((in[0] >> 61) & 0x1)) & 1))^((int64((in[0] >> 61) & 0x1))>>1))) + out[60] + out[62] = uint64(((-((int64((in[0] >> 62) & 0x1)) & 1))^((int64((in[0] >> 62) & 0x1))>>1))) + out[61] + out[63] = uint64(((-((int64((in[0] >> 63))) & 1))^((int64((in[0] >> 63)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_2(initoffset uint64, in *[2]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3)) & 1))^((int64((in[0] >> 0) & 0x3))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 2) & 0x3)) & 1))^((int64((in[0] >> 2) & 0x3))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 4) & 0x3)) & 1))^((int64((in[0] >> 4) & 0x3))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 6) & 0x3)) & 1))^((int64((in[0] >> 6) & 0x3))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 8) & 0x3)) & 1))^((int64((in[0] >> 8) & 0x3))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 10) & 0x3)) & 1))^((int64((in[0] >> 10) & 0x3))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 12) & 0x3)) & 1))^((int64((in[0] >> 12) & 0x3))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 14) & 0x3)) & 1))^((int64((in[0] >> 14) & 0x3))>>1))) + out[6] + out[8] = uint64(((-((int64((in[0] >> 16) & 0x3)) & 1))^((int64((in[0] >> 16) & 0x3))>>1))) + out[7] + out[9] = uint64(((-((int64((in[0] >> 18) & 0x3)) & 1))^((int64((in[0] >> 18) & 0x3))>>1))) + out[8] + out[10] = uint64(((-((int64((in[0] >> 20) & 0x3)) & 1))^((int64((in[0] >> 20) & 0x3))>>1))) + out[9] + out[11] = uint64(((-((int64((in[0] >> 22) & 0x3)) & 1))^((int64((in[0] >> 22) & 0x3))>>1))) + out[10] + out[12] = uint64(((-((int64((in[0] >> 24) & 0x3)) & 1))^((int64((in[0] >> 24) & 0x3))>>1))) + out[11] + out[13] = uint64(((-((int64((in[0] >> 26) & 0x3)) & 1))^((int64((in[0] >> 26) & 0x3))>>1))) + out[12] + out[14] = uint64(((-((int64((in[0] >> 28) & 0x3)) & 1))^((int64((in[0] >> 28) & 0x3))>>1))) + out[13] + out[15] = uint64(((-((int64((in[0] >> 30) & 0x3)) & 1))^((int64((in[0] >> 30) & 0x3))>>1))) + out[14] + out[16] = uint64(((-((int64((in[0] >> 32) & 0x3)) & 1))^((int64((in[0] >> 32) & 0x3))>>1))) + out[15] + out[17] = uint64(((-((int64((in[0] >> 34) & 0x3)) & 1))^((int64((in[0] >> 34) & 0x3))>>1))) + out[16] + out[18] = uint64(((-((int64((in[0] >> 36) & 0x3)) & 1))^((int64((in[0] >> 36) & 0x3))>>1))) + out[17] + out[19] = uint64(((-((int64((in[0] >> 38) & 0x3)) & 1))^((int64((in[0] >> 38) & 0x3))>>1))) + out[18] + out[20] = uint64(((-((int64((in[0] >> 40) & 0x3)) & 1))^((int64((in[0] >> 40) & 0x3))>>1))) + out[19] + out[21] = uint64(((-((int64((in[0] >> 42) & 0x3)) & 1))^((int64((in[0] >> 42) & 0x3))>>1))) + out[20] + out[22] = uint64(((-((int64((in[0] >> 44) & 0x3)) & 1))^((int64((in[0] >> 44) & 0x3))>>1))) + out[21] + out[23] = uint64(((-((int64((in[0] >> 46) & 0x3)) & 1))^((int64((in[0] >> 46) & 0x3))>>1))) + out[22] + out[24] = uint64(((-((int64((in[0] >> 48) & 0x3)) & 1))^((int64((in[0] >> 48) & 0x3))>>1))) + out[23] + out[25] = uint64(((-((int64((in[0] >> 50) & 0x3)) & 1))^((int64((in[0] >> 50) & 0x3))>>1))) + out[24] + out[26] = uint64(((-((int64((in[0] >> 52) & 0x3)) & 1))^((int64((in[0] >> 52) & 0x3))>>1))) + out[25] + out[27] = uint64(((-((int64((in[0] >> 54) & 0x3)) & 1))^((int64((in[0] >> 54) & 0x3))>>1))) + out[26] + out[28] = uint64(((-((int64((in[0] >> 56) & 0x3)) & 1))^((int64((in[0] >> 56) & 0x3))>>1))) + out[27] + out[29] = uint64(((-((int64((in[0] >> 58) & 0x3)) & 1))^((int64((in[0] >> 58) & 0x3))>>1))) + out[28] + out[30] = uint64(((-((int64((in[0] >> 60) & 0x3)) & 1))^((int64((in[0] >> 60) & 0x3))>>1))) + out[29] + out[31] = uint64(((-((int64((in[0] >> 62))) & 1))^((int64((in[0] >> 62)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[1] >> 0) & 0x3)) & 1))^((int64((in[1] >> 0) & 0x3))>>1))) + out[31] + out[33] = uint64(((-((int64((in[1] >> 2) & 0x3)) & 1))^((int64((in[1] >> 2) & 0x3))>>1))) + out[32] + out[34] = uint64(((-((int64((in[1] >> 4) & 0x3)) & 1))^((int64((in[1] >> 4) & 0x3))>>1))) + out[33] + out[35] = uint64(((-((int64((in[1] >> 6) & 0x3)) & 1))^((int64((in[1] >> 6) & 0x3))>>1))) + out[34] + out[36] = uint64(((-((int64((in[1] >> 8) & 0x3)) & 1))^((int64((in[1] >> 8) & 0x3))>>1))) + out[35] + out[37] = uint64(((-((int64((in[1] >> 10) & 0x3)) & 1))^((int64((in[1] >> 10) & 0x3))>>1))) + out[36] + out[38] = uint64(((-((int64((in[1] >> 12) & 0x3)) & 1))^((int64((in[1] >> 12) & 0x3))>>1))) + out[37] + out[39] = uint64(((-((int64((in[1] >> 14) & 0x3)) & 1))^((int64((in[1] >> 14) & 0x3))>>1))) + out[38] + out[40] = uint64(((-((int64((in[1] >> 16) & 0x3)) & 1))^((int64((in[1] >> 16) & 0x3))>>1))) + out[39] + out[41] = uint64(((-((int64((in[1] >> 18) & 0x3)) & 1))^((int64((in[1] >> 18) & 0x3))>>1))) + out[40] + out[42] = uint64(((-((int64((in[1] >> 20) & 0x3)) & 1))^((int64((in[1] >> 20) & 0x3))>>1))) + out[41] + out[43] = uint64(((-((int64((in[1] >> 22) & 0x3)) & 1))^((int64((in[1] >> 22) & 0x3))>>1))) + out[42] + out[44] = uint64(((-((int64((in[1] >> 24) & 0x3)) & 1))^((int64((in[1] >> 24) & 0x3))>>1))) + out[43] + out[45] = uint64(((-((int64((in[1] >> 26) & 0x3)) & 1))^((int64((in[1] >> 26) & 0x3))>>1))) + out[44] + out[46] = uint64(((-((int64((in[1] >> 28) & 0x3)) & 1))^((int64((in[1] >> 28) & 0x3))>>1))) + out[45] + out[47] = uint64(((-((int64((in[1] >> 30) & 0x3)) & 1))^((int64((in[1] >> 30) & 0x3))>>1))) + out[46] + out[48] = uint64(((-((int64((in[1] >> 32) & 0x3)) & 1))^((int64((in[1] >> 32) & 0x3))>>1))) + out[47] + out[49] = uint64(((-((int64((in[1] >> 34) & 0x3)) & 1))^((int64((in[1] >> 34) & 0x3))>>1))) + out[48] + out[50] = uint64(((-((int64((in[1] >> 36) & 0x3)) & 1))^((int64((in[1] >> 36) & 0x3))>>1))) + out[49] + out[51] = uint64(((-((int64((in[1] >> 38) & 0x3)) & 1))^((int64((in[1] >> 38) & 0x3))>>1))) + out[50] + out[52] = uint64(((-((int64((in[1] >> 40) & 0x3)) & 1))^((int64((in[1] >> 40) & 0x3))>>1))) + out[51] + out[53] = uint64(((-((int64((in[1] >> 42) & 0x3)) & 1))^((int64((in[1] >> 42) & 0x3))>>1))) + out[52] + out[54] = uint64(((-((int64((in[1] >> 44) & 0x3)) & 1))^((int64((in[1] >> 44) & 0x3))>>1))) + out[53] + out[55] = uint64(((-((int64((in[1] >> 46) & 0x3)) & 1))^((int64((in[1] >> 46) & 0x3))>>1))) + out[54] + out[56] = uint64(((-((int64((in[1] >> 48) & 0x3)) & 1))^((int64((in[1] >> 48) & 0x3))>>1))) + out[55] + out[57] = uint64(((-((int64((in[1] >> 50) & 0x3)) & 1))^((int64((in[1] >> 50) & 0x3))>>1))) + out[56] + out[58] = uint64(((-((int64((in[1] >> 52) & 0x3)) & 1))^((int64((in[1] >> 52) & 0x3))>>1))) + out[57] + out[59] = uint64(((-((int64((in[1] >> 54) & 0x3)) & 1))^((int64((in[1] >> 54) & 0x3))>>1))) + out[58] + out[60] = uint64(((-((int64((in[1] >> 56) & 0x3)) & 1))^((int64((in[1] >> 56) & 0x3))>>1))) + out[59] + out[61] = uint64(((-((int64((in[1] >> 58) & 0x3)) & 1))^((int64((in[1] >> 58) & 0x3))>>1))) + out[60] + out[62] = uint64(((-((int64((in[1] >> 60) & 0x3)) & 1))^((int64((in[1] >> 60) & 0x3))>>1))) + out[61] + out[63] = uint64(((-((int64((in[1] >> 62))) & 1))^((int64((in[1] >> 62)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_3(initoffset uint64, in *[3]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7)) & 1))^((int64((in[0] >> 0) & 0x7))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 3) & 0x7)) & 1))^((int64((in[0] >> 3) & 0x7))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 6) & 0x7)) & 1))^((int64((in[0] >> 6) & 0x7))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 9) & 0x7)) & 1))^((int64((in[0] >> 9) & 0x7))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 12) & 0x7)) & 1))^((int64((in[0] >> 12) & 0x7))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 15) & 0x7)) & 1))^((int64((in[0] >> 15) & 0x7))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 18) & 0x7)) & 1))^((int64((in[0] >> 18) & 0x7))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 21) & 0x7)) & 1))^((int64((in[0] >> 21) & 0x7))>>1))) + out[6] + out[8] = uint64(((-((int64((in[0] >> 24) & 0x7)) & 1))^((int64((in[0] >> 24) & 0x7))>>1))) + out[7] + out[9] = uint64(((-((int64((in[0] >> 27) & 0x7)) & 1))^((int64((in[0] >> 27) & 0x7))>>1))) + out[8] + out[10] = uint64(((-((int64((in[0] >> 30) & 0x7)) & 1))^((int64((in[0] >> 30) & 0x7))>>1))) + out[9] + out[11] = uint64(((-((int64((in[0] >> 33) & 0x7)) & 1))^((int64((in[0] >> 33) & 0x7))>>1))) + out[10] + out[12] = uint64(((-((int64((in[0] >> 36) & 0x7)) & 1))^((int64((in[0] >> 36) & 0x7))>>1))) + out[11] + out[13] = uint64(((-((int64((in[0] >> 39) & 0x7)) & 1))^((int64((in[0] >> 39) & 0x7))>>1))) + out[12] + out[14] = uint64(((-((int64((in[0] >> 42) & 0x7)) & 1))^((int64((in[0] >> 42) & 0x7))>>1))) + out[13] + out[15] = uint64(((-((int64((in[0] >> 45) & 0x7)) & 1))^((int64((in[0] >> 45) & 0x7))>>1))) + out[14] + out[16] = uint64(((-((int64((in[0] >> 48) & 0x7)) & 1))^((int64((in[0] >> 48) & 0x7))>>1))) + out[15] + out[17] = uint64(((-((int64((in[0] >> 51) & 0x7)) & 1))^((int64((in[0] >> 51) & 0x7))>>1))) + out[16] + out[18] = uint64(((-((int64((in[0] >> 54) & 0x7)) & 1))^((int64((in[0] >> 54) & 0x7))>>1))) + out[17] + out[19] = uint64(((-((int64((in[0] >> 57) & 0x7)) & 1))^((int64((in[0] >> 57) & 0x7))>>1))) + out[18] + out[20] = uint64(((-((int64((in[0] >> 60) & 0x7)) & 1))^((int64((in[0] >> 60) & 0x7))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[0] >> 63) | ((in[1] & 0x3) << 1)))) & 1))^((int64(((in[0] >> 63) | ((in[1] & 0x3) << 1))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[1] >> 2) & 0x7)) & 1))^((int64((in[1] >> 2) & 0x7))>>1))) + out[21] + out[23] = uint64(((-((int64((in[1] >> 5) & 0x7)) & 1))^((int64((in[1] >> 5) & 0x7))>>1))) + out[22] + out[24] = uint64(((-((int64((in[1] >> 8) & 0x7)) & 1))^((int64((in[1] >> 8) & 0x7))>>1))) + out[23] + out[25] = uint64(((-((int64((in[1] >> 11) & 0x7)) & 1))^((int64((in[1] >> 11) & 0x7))>>1))) + out[24] + out[26] = uint64(((-((int64((in[1] >> 14) & 0x7)) & 1))^((int64((in[1] >> 14) & 0x7))>>1))) + out[25] + out[27] = uint64(((-((int64((in[1] >> 17) & 0x7)) & 1))^((int64((in[1] >> 17) & 0x7))>>1))) + out[26] + out[28] = uint64(((-((int64((in[1] >> 20) & 0x7)) & 1))^((int64((in[1] >> 20) & 0x7))>>1))) + out[27] + out[29] = uint64(((-((int64((in[1] >> 23) & 0x7)) & 1))^((int64((in[1] >> 23) & 0x7))>>1))) + out[28] + out[30] = uint64(((-((int64((in[1] >> 26) & 0x7)) & 1))^((int64((in[1] >> 26) & 0x7))>>1))) + out[29] + out[31] = uint64(((-((int64((in[1] >> 29) & 0x7)) & 1))^((int64((in[1] >> 29) & 0x7))>>1))) + out[30] + out[32] = uint64(((-((int64((in[1] >> 32) & 0x7)) & 1))^((int64((in[1] >> 32) & 0x7))>>1))) + out[31] + out[33] = uint64(((-((int64((in[1] >> 35) & 0x7)) & 1))^((int64((in[1] >> 35) & 0x7))>>1))) + out[32] + out[34] = uint64(((-((int64((in[1] >> 38) & 0x7)) & 1))^((int64((in[1] >> 38) & 0x7))>>1))) + out[33] + out[35] = uint64(((-((int64((in[1] >> 41) & 0x7)) & 1))^((int64((in[1] >> 41) & 0x7))>>1))) + out[34] + out[36] = uint64(((-((int64((in[1] >> 44) & 0x7)) & 1))^((int64((in[1] >> 44) & 0x7))>>1))) + out[35] + out[37] = uint64(((-((int64((in[1] >> 47) & 0x7)) & 1))^((int64((in[1] >> 47) & 0x7))>>1))) + out[36] + out[38] = uint64(((-((int64((in[1] >> 50) & 0x7)) & 1))^((int64((in[1] >> 50) & 0x7))>>1))) + out[37] + out[39] = uint64(((-((int64((in[1] >> 53) & 0x7)) & 1))^((int64((in[1] >> 53) & 0x7))>>1))) + out[38] + out[40] = uint64(((-((int64((in[1] >> 56) & 0x7)) & 1))^((int64((in[1] >> 56) & 0x7))>>1))) + out[39] + out[41] = uint64(((-((int64((in[1] >> 59) & 0x7)) & 1))^((int64((in[1] >> 59) & 0x7))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0x1) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0x1) << 2))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[2] >> 1) & 0x7)) & 1))^((int64((in[2] >> 1) & 0x7))>>1))) + out[42] + out[44] = uint64(((-((int64((in[2] >> 4) & 0x7)) & 1))^((int64((in[2] >> 4) & 0x7))>>1))) + out[43] + out[45] = uint64(((-((int64((in[2] >> 7) & 0x7)) & 1))^((int64((in[2] >> 7) & 0x7))>>1))) + out[44] + out[46] = uint64(((-((int64((in[2] >> 10) & 0x7)) & 1))^((int64((in[2] >> 10) & 0x7))>>1))) + out[45] + out[47] = uint64(((-((int64((in[2] >> 13) & 0x7)) & 1))^((int64((in[2] >> 13) & 0x7))>>1))) + out[46] + out[48] = uint64(((-((int64((in[2] >> 16) & 0x7)) & 1))^((int64((in[2] >> 16) & 0x7))>>1))) + out[47] + out[49] = uint64(((-((int64((in[2] >> 19) & 0x7)) & 1))^((int64((in[2] >> 19) & 0x7))>>1))) + out[48] + out[50] = uint64(((-((int64((in[2] >> 22) & 0x7)) & 1))^((int64((in[2] >> 22) & 0x7))>>1))) + out[49] + out[51] = uint64(((-((int64((in[2] >> 25) & 0x7)) & 1))^((int64((in[2] >> 25) & 0x7))>>1))) + out[50] + out[52] = uint64(((-((int64((in[2] >> 28) & 0x7)) & 1))^((int64((in[2] >> 28) & 0x7))>>1))) + out[51] + out[53] = uint64(((-((int64((in[2] >> 31) & 0x7)) & 1))^((int64((in[2] >> 31) & 0x7))>>1))) + out[52] + out[54] = uint64(((-((int64((in[2] >> 34) & 0x7)) & 1))^((int64((in[2] >> 34) & 0x7))>>1))) + out[53] + out[55] = uint64(((-((int64((in[2] >> 37) & 0x7)) & 1))^((int64((in[2] >> 37) & 0x7))>>1))) + out[54] + out[56] = uint64(((-((int64((in[2] >> 40) & 0x7)) & 1))^((int64((in[2] >> 40) & 0x7))>>1))) + out[55] + out[57] = uint64(((-((int64((in[2] >> 43) & 0x7)) & 1))^((int64((in[2] >> 43) & 0x7))>>1))) + out[56] + out[58] = uint64(((-((int64((in[2] >> 46) & 0x7)) & 1))^((int64((in[2] >> 46) & 0x7))>>1))) + out[57] + out[59] = uint64(((-((int64((in[2] >> 49) & 0x7)) & 1))^((int64((in[2] >> 49) & 0x7))>>1))) + out[58] + out[60] = uint64(((-((int64((in[2] >> 52) & 0x7)) & 1))^((int64((in[2] >> 52) & 0x7))>>1))) + out[59] + out[61] = uint64(((-((int64((in[2] >> 55) & 0x7)) & 1))^((int64((in[2] >> 55) & 0x7))>>1))) + out[60] + out[62] = uint64(((-((int64((in[2] >> 58) & 0x7)) & 1))^((int64((in[2] >> 58) & 0x7))>>1))) + out[61] + out[63] = uint64(((-((int64((in[2] >> 61))) & 1))^((int64((in[2] >> 61)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_4(initoffset uint64, in *[4]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xF)) & 1))^((int64((in[0] >> 0) & 0xF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 4) & 0xF)) & 1))^((int64((in[0] >> 4) & 0xF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 8) & 0xF)) & 1))^((int64((in[0] >> 8) & 0xF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 12) & 0xF)) & 1))^((int64((in[0] >> 12) & 0xF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 16) & 0xF)) & 1))^((int64((in[0] >> 16) & 0xF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 20) & 0xF)) & 1))^((int64((in[0] >> 20) & 0xF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 24) & 0xF)) & 1))^((int64((in[0] >> 24) & 0xF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 28) & 0xF)) & 1))^((int64((in[0] >> 28) & 0xF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[0] >> 32) & 0xF)) & 1))^((int64((in[0] >> 32) & 0xF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[0] >> 36) & 0xF)) & 1))^((int64((in[0] >> 36) & 0xF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[0] >> 40) & 0xF)) & 1))^((int64((in[0] >> 40) & 0xF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[0] >> 44) & 0xF)) & 1))^((int64((in[0] >> 44) & 0xF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[0] >> 48) & 0xF)) & 1))^((int64((in[0] >> 48) & 0xF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[0] >> 52) & 0xF)) & 1))^((int64((in[0] >> 52) & 0xF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[0] >> 56) & 0xF)) & 1))^((int64((in[0] >> 56) & 0xF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[0] >> 60))) & 1))^((int64((in[0] >> 60)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[1] >> 0) & 0xF)) & 1))^((int64((in[1] >> 0) & 0xF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[1] >> 4) & 0xF)) & 1))^((int64((in[1] >> 4) & 0xF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[1] >> 8) & 0xF)) & 1))^((int64((in[1] >> 8) & 0xF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[1] >> 12) & 0xF)) & 1))^((int64((in[1] >> 12) & 0xF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[1] >> 16) & 0xF)) & 1))^((int64((in[1] >> 16) & 0xF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[1] >> 20) & 0xF)) & 1))^((int64((in[1] >> 20) & 0xF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[1] >> 24) & 0xF)) & 1))^((int64((in[1] >> 24) & 0xF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[1] >> 28) & 0xF)) & 1))^((int64((in[1] >> 28) & 0xF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[1] >> 32) & 0xF)) & 1))^((int64((in[1] >> 32) & 0xF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[1] >> 36) & 0xF)) & 1))^((int64((in[1] >> 36) & 0xF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[1] >> 40) & 0xF)) & 1))^((int64((in[1] >> 40) & 0xF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[1] >> 44) & 0xF)) & 1))^((int64((in[1] >> 44) & 0xF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[1] >> 48) & 0xF)) & 1))^((int64((in[1] >> 48) & 0xF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[1] >> 52) & 0xF)) & 1))^((int64((in[1] >> 52) & 0xF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[1] >> 56) & 0xF)) & 1))^((int64((in[1] >> 56) & 0xF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[1] >> 60))) & 1))^((int64((in[1] >> 60)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[2] >> 0) & 0xF)) & 1))^((int64((in[2] >> 0) & 0xF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[2] >> 4) & 0xF)) & 1))^((int64((in[2] >> 4) & 0xF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[2] >> 8) & 0xF)) & 1))^((int64((in[2] >> 8) & 0xF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[2] >> 12) & 0xF)) & 1))^((int64((in[2] >> 12) & 0xF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[2] >> 16) & 0xF)) & 1))^((int64((in[2] >> 16) & 0xF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[2] >> 20) & 0xF)) & 1))^((int64((in[2] >> 20) & 0xF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[2] >> 24) & 0xF)) & 1))^((int64((in[2] >> 24) & 0xF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[2] >> 28) & 0xF)) & 1))^((int64((in[2] >> 28) & 0xF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[2] >> 32) & 0xF)) & 1))^((int64((in[2] >> 32) & 0xF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[2] >> 36) & 0xF)) & 1))^((int64((in[2] >> 36) & 0xF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[2] >> 40) & 0xF)) & 1))^((int64((in[2] >> 40) & 0xF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[2] >> 44) & 0xF)) & 1))^((int64((in[2] >> 44) & 0xF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[2] >> 48) & 0xF)) & 1))^((int64((in[2] >> 48) & 0xF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[2] >> 52) & 0xF)) & 1))^((int64((in[2] >> 52) & 0xF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[2] >> 56) & 0xF)) & 1))^((int64((in[2] >> 56) & 0xF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[2] >> 60))) & 1))^((int64((in[2] >> 60)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[3] >> 0) & 0xF)) & 1))^((int64((in[3] >> 0) & 0xF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[3] >> 4) & 0xF)) & 1))^((int64((in[3] >> 4) & 0xF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[3] >> 8) & 0xF)) & 1))^((int64((in[3] >> 8) & 0xF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[3] >> 12) & 0xF)) & 1))^((int64((in[3] >> 12) & 0xF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[3] >> 16) & 0xF)) & 1))^((int64((in[3] >> 16) & 0xF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[3] >> 20) & 0xF)) & 1))^((int64((in[3] >> 20) & 0xF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[3] >> 24) & 0xF)) & 1))^((int64((in[3] >> 24) & 0xF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[3] >> 28) & 0xF)) & 1))^((int64((in[3] >> 28) & 0xF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[3] >> 32) & 0xF)) & 1))^((int64((in[3] >> 32) & 0xF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[3] >> 36) & 0xF)) & 1))^((int64((in[3] >> 36) & 0xF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[3] >> 40) & 0xF)) & 1))^((int64((in[3] >> 40) & 0xF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[3] >> 44) & 0xF)) & 1))^((int64((in[3] >> 44) & 0xF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[3] >> 48) & 0xF)) & 1))^((int64((in[3] >> 48) & 0xF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[3] >> 52) & 0xF)) & 1))^((int64((in[3] >> 52) & 0xF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[3] >> 56) & 0xF)) & 1))^((int64((in[3] >> 56) & 0xF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[3] >> 60))) & 1))^((int64((in[3] >> 60)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_5(initoffset uint64, in *[5]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1F)) & 1))^((int64((in[0] >> 0) & 0x1F))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 5) & 0x1F)) & 1))^((int64((in[0] >> 5) & 0x1F))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 10) & 0x1F)) & 1))^((int64((in[0] >> 10) & 0x1F))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 15) & 0x1F)) & 1))^((int64((in[0] >> 15) & 0x1F))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 20) & 0x1F)) & 1))^((int64((in[0] >> 20) & 0x1F))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 25) & 0x1F)) & 1))^((int64((in[0] >> 25) & 0x1F))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 30) & 0x1F)) & 1))^((int64((in[0] >> 30) & 0x1F))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 35) & 0x1F)) & 1))^((int64((in[0] >> 35) & 0x1F))>>1))) + out[6] + out[8] = uint64(((-((int64((in[0] >> 40) & 0x1F)) & 1))^((int64((in[0] >> 40) & 0x1F))>>1))) + out[7] + out[9] = uint64(((-((int64((in[0] >> 45) & 0x1F)) & 1))^((int64((in[0] >> 45) & 0x1F))>>1))) + out[8] + out[10] = uint64(((-((int64((in[0] >> 50) & 0x1F)) & 1))^((int64((in[0] >> 50) & 0x1F))>>1))) + out[9] + out[11] = uint64(((-((int64((in[0] >> 55) & 0x1F)) & 1))^((int64((in[0] >> 55) & 0x1F))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0x1) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0x1) << 4))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[1] >> 1) & 0x1F)) & 1))^((int64((in[1] >> 1) & 0x1F))>>1))) + out[12] + out[14] = uint64(((-((int64((in[1] >> 6) & 0x1F)) & 1))^((int64((in[1] >> 6) & 0x1F))>>1))) + out[13] + out[15] = uint64(((-((int64((in[1] >> 11) & 0x1F)) & 1))^((int64((in[1] >> 11) & 0x1F))>>1))) + out[14] + out[16] = uint64(((-((int64((in[1] >> 16) & 0x1F)) & 1))^((int64((in[1] >> 16) & 0x1F))>>1))) + out[15] + out[17] = uint64(((-((int64((in[1] >> 21) & 0x1F)) & 1))^((int64((in[1] >> 21) & 0x1F))>>1))) + out[16] + out[18] = uint64(((-((int64((in[1] >> 26) & 0x1F)) & 1))^((int64((in[1] >> 26) & 0x1F))>>1))) + out[17] + out[19] = uint64(((-((int64((in[1] >> 31) & 0x1F)) & 1))^((int64((in[1] >> 31) & 0x1F))>>1))) + out[18] + out[20] = uint64(((-((int64((in[1] >> 36) & 0x1F)) & 1))^((int64((in[1] >> 36) & 0x1F))>>1))) + out[19] + out[21] = uint64(((-((int64((in[1] >> 41) & 0x1F)) & 1))^((int64((in[1] >> 41) & 0x1F))>>1))) + out[20] + out[22] = uint64(((-((int64((in[1] >> 46) & 0x1F)) & 1))^((int64((in[1] >> 46) & 0x1F))>>1))) + out[21] + out[23] = uint64(((-((int64((in[1] >> 51) & 0x1F)) & 1))^((int64((in[1] >> 51) & 0x1F))>>1))) + out[22] + out[24] = uint64(((-((int64((in[1] >> 56) & 0x1F)) & 1))^((int64((in[1] >> 56) & 0x1F))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[1] >> 61) | ((in[2] & 0x3) << 3)))) & 1))^((int64(((in[1] >> 61) | ((in[2] & 0x3) << 3))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[2] >> 2) & 0x1F)) & 1))^((int64((in[2] >> 2) & 0x1F))>>1))) + out[25] + out[27] = uint64(((-((int64((in[2] >> 7) & 0x1F)) & 1))^((int64((in[2] >> 7) & 0x1F))>>1))) + out[26] + out[28] = uint64(((-((int64((in[2] >> 12) & 0x1F)) & 1))^((int64((in[2] >> 12) & 0x1F))>>1))) + out[27] + out[29] = uint64(((-((int64((in[2] >> 17) & 0x1F)) & 1))^((int64((in[2] >> 17) & 0x1F))>>1))) + out[28] + out[30] = uint64(((-((int64((in[2] >> 22) & 0x1F)) & 1))^((int64((in[2] >> 22) & 0x1F))>>1))) + out[29] + out[31] = uint64(((-((int64((in[2] >> 27) & 0x1F)) & 1))^((int64((in[2] >> 27) & 0x1F))>>1))) + out[30] + out[32] = uint64(((-((int64((in[2] >> 32) & 0x1F)) & 1))^((int64((in[2] >> 32) & 0x1F))>>1))) + out[31] + out[33] = uint64(((-((int64((in[2] >> 37) & 0x1F)) & 1))^((int64((in[2] >> 37) & 0x1F))>>1))) + out[32] + out[34] = uint64(((-((int64((in[2] >> 42) & 0x1F)) & 1))^((int64((in[2] >> 42) & 0x1F))>>1))) + out[33] + out[35] = uint64(((-((int64((in[2] >> 47) & 0x1F)) & 1))^((int64((in[2] >> 47) & 0x1F))>>1))) + out[34] + out[36] = uint64(((-((int64((in[2] >> 52) & 0x1F)) & 1))^((int64((in[2] >> 52) & 0x1F))>>1))) + out[35] + out[37] = uint64(((-((int64((in[2] >> 57) & 0x1F)) & 1))^((int64((in[2] >> 57) & 0x1F))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[2] >> 62) | ((in[3] & 0x7) << 2)))) & 1))^((int64(((in[2] >> 62) | ((in[3] & 0x7) << 2))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[3] >> 3) & 0x1F)) & 1))^((int64((in[3] >> 3) & 0x1F))>>1))) + out[38] + out[40] = uint64(((-((int64((in[3] >> 8) & 0x1F)) & 1))^((int64((in[3] >> 8) & 0x1F))>>1))) + out[39] + out[41] = uint64(((-((int64((in[3] >> 13) & 0x1F)) & 1))^((int64((in[3] >> 13) & 0x1F))>>1))) + out[40] + out[42] = uint64(((-((int64((in[3] >> 18) & 0x1F)) & 1))^((int64((in[3] >> 18) & 0x1F))>>1))) + out[41] + out[43] = uint64(((-((int64((in[3] >> 23) & 0x1F)) & 1))^((int64((in[3] >> 23) & 0x1F))>>1))) + out[42] + out[44] = uint64(((-((int64((in[3] >> 28) & 0x1F)) & 1))^((int64((in[3] >> 28) & 0x1F))>>1))) + out[43] + out[45] = uint64(((-((int64((in[3] >> 33) & 0x1F)) & 1))^((int64((in[3] >> 33) & 0x1F))>>1))) + out[44] + out[46] = uint64(((-((int64((in[3] >> 38) & 0x1F)) & 1))^((int64((in[3] >> 38) & 0x1F))>>1))) + out[45] + out[47] = uint64(((-((int64((in[3] >> 43) & 0x1F)) & 1))^((int64((in[3] >> 43) & 0x1F))>>1))) + out[46] + out[48] = uint64(((-((int64((in[3] >> 48) & 0x1F)) & 1))^((int64((in[3] >> 48) & 0x1F))>>1))) + out[47] + out[49] = uint64(((-((int64((in[3] >> 53) & 0x1F)) & 1))^((int64((in[3] >> 53) & 0x1F))>>1))) + out[48] + out[50] = uint64(((-((int64((in[3] >> 58) & 0x1F)) & 1))^((int64((in[3] >> 58) & 0x1F))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[3] >> 63) | ((in[4] & 0xF) << 1)))) & 1))^((int64(((in[3] >> 63) | ((in[4] & 0xF) << 1))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[4] >> 4) & 0x1F)) & 1))^((int64((in[4] >> 4) & 0x1F))>>1))) + out[51] + out[53] = uint64(((-((int64((in[4] >> 9) & 0x1F)) & 1))^((int64((in[4] >> 9) & 0x1F))>>1))) + out[52] + out[54] = uint64(((-((int64((in[4] >> 14) & 0x1F)) & 1))^((int64((in[4] >> 14) & 0x1F))>>1))) + out[53] + out[55] = uint64(((-((int64((in[4] >> 19) & 0x1F)) & 1))^((int64((in[4] >> 19) & 0x1F))>>1))) + out[54] + out[56] = uint64(((-((int64((in[4] >> 24) & 0x1F)) & 1))^((int64((in[4] >> 24) & 0x1F))>>1))) + out[55] + out[57] = uint64(((-((int64((in[4] >> 29) & 0x1F)) & 1))^((int64((in[4] >> 29) & 0x1F))>>1))) + out[56] + out[58] = uint64(((-((int64((in[4] >> 34) & 0x1F)) & 1))^((int64((in[4] >> 34) & 0x1F))>>1))) + out[57] + out[59] = uint64(((-((int64((in[4] >> 39) & 0x1F)) & 1))^((int64((in[4] >> 39) & 0x1F))>>1))) + out[58] + out[60] = uint64(((-((int64((in[4] >> 44) & 0x1F)) & 1))^((int64((in[4] >> 44) & 0x1F))>>1))) + out[59] + out[61] = uint64(((-((int64((in[4] >> 49) & 0x1F)) & 1))^((int64((in[4] >> 49) & 0x1F))>>1))) + out[60] + out[62] = uint64(((-((int64((in[4] >> 54) & 0x1F)) & 1))^((int64((in[4] >> 54) & 0x1F))>>1))) + out[61] + out[63] = uint64(((-((int64((in[4] >> 59))) & 1))^((int64((in[4] >> 59)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_6(initoffset uint64, in *[6]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3F)) & 1))^((int64((in[0] >> 0) & 0x3F))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 6) & 0x3F)) & 1))^((int64((in[0] >> 6) & 0x3F))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 12) & 0x3F)) & 1))^((int64((in[0] >> 12) & 0x3F))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 18) & 0x3F)) & 1))^((int64((in[0] >> 18) & 0x3F))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 24) & 0x3F)) & 1))^((int64((in[0] >> 24) & 0x3F))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 30) & 0x3F)) & 1))^((int64((in[0] >> 30) & 0x3F))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 36) & 0x3F)) & 1))^((int64((in[0] >> 36) & 0x3F))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 42) & 0x3F)) & 1))^((int64((in[0] >> 42) & 0x3F))>>1))) + out[6] + out[8] = uint64(((-((int64((in[0] >> 48) & 0x3F)) & 1))^((int64((in[0] >> 48) & 0x3F))>>1))) + out[7] + out[9] = uint64(((-((int64((in[0] >> 54) & 0x3F)) & 1))^((int64((in[0] >> 54) & 0x3F))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0x3) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0x3) << 4))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[1] >> 2) & 0x3F)) & 1))^((int64((in[1] >> 2) & 0x3F))>>1))) + out[10] + out[12] = uint64(((-((int64((in[1] >> 8) & 0x3F)) & 1))^((int64((in[1] >> 8) & 0x3F))>>1))) + out[11] + out[13] = uint64(((-((int64((in[1] >> 14) & 0x3F)) & 1))^((int64((in[1] >> 14) & 0x3F))>>1))) + out[12] + out[14] = uint64(((-((int64((in[1] >> 20) & 0x3F)) & 1))^((int64((in[1] >> 20) & 0x3F))>>1))) + out[13] + out[15] = uint64(((-((int64((in[1] >> 26) & 0x3F)) & 1))^((int64((in[1] >> 26) & 0x3F))>>1))) + out[14] + out[16] = uint64(((-((int64((in[1] >> 32) & 0x3F)) & 1))^((int64((in[1] >> 32) & 0x3F))>>1))) + out[15] + out[17] = uint64(((-((int64((in[1] >> 38) & 0x3F)) & 1))^((int64((in[1] >> 38) & 0x3F))>>1))) + out[16] + out[18] = uint64(((-((int64((in[1] >> 44) & 0x3F)) & 1))^((int64((in[1] >> 44) & 0x3F))>>1))) + out[17] + out[19] = uint64(((-((int64((in[1] >> 50) & 0x3F)) & 1))^((int64((in[1] >> 50) & 0x3F))>>1))) + out[18] + out[20] = uint64(((-((int64((in[1] >> 56) & 0x3F)) & 1))^((int64((in[1] >> 56) & 0x3F))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0xF) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0xF) << 2))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[2] >> 4) & 0x3F)) & 1))^((int64((in[2] >> 4) & 0x3F))>>1))) + out[21] + out[23] = uint64(((-((int64((in[2] >> 10) & 0x3F)) & 1))^((int64((in[2] >> 10) & 0x3F))>>1))) + out[22] + out[24] = uint64(((-((int64((in[2] >> 16) & 0x3F)) & 1))^((int64((in[2] >> 16) & 0x3F))>>1))) + out[23] + out[25] = uint64(((-((int64((in[2] >> 22) & 0x3F)) & 1))^((int64((in[2] >> 22) & 0x3F))>>1))) + out[24] + out[26] = uint64(((-((int64((in[2] >> 28) & 0x3F)) & 1))^((int64((in[2] >> 28) & 0x3F))>>1))) + out[25] + out[27] = uint64(((-((int64((in[2] >> 34) & 0x3F)) & 1))^((int64((in[2] >> 34) & 0x3F))>>1))) + out[26] + out[28] = uint64(((-((int64((in[2] >> 40) & 0x3F)) & 1))^((int64((in[2] >> 40) & 0x3F))>>1))) + out[27] + out[29] = uint64(((-((int64((in[2] >> 46) & 0x3F)) & 1))^((int64((in[2] >> 46) & 0x3F))>>1))) + out[28] + out[30] = uint64(((-((int64((in[2] >> 52) & 0x3F)) & 1))^((int64((in[2] >> 52) & 0x3F))>>1))) + out[29] + out[31] = uint64(((-((int64((in[2] >> 58))) & 1))^((int64((in[2] >> 58)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[3] >> 0) & 0x3F)) & 1))^((int64((in[3] >> 0) & 0x3F))>>1))) + out[31] + out[33] = uint64(((-((int64((in[3] >> 6) & 0x3F)) & 1))^((int64((in[3] >> 6) & 0x3F))>>1))) + out[32] + out[34] = uint64(((-((int64((in[3] >> 12) & 0x3F)) & 1))^((int64((in[3] >> 12) & 0x3F))>>1))) + out[33] + out[35] = uint64(((-((int64((in[3] >> 18) & 0x3F)) & 1))^((int64((in[3] >> 18) & 0x3F))>>1))) + out[34] + out[36] = uint64(((-((int64((in[3] >> 24) & 0x3F)) & 1))^((int64((in[3] >> 24) & 0x3F))>>1))) + out[35] + out[37] = uint64(((-((int64((in[3] >> 30) & 0x3F)) & 1))^((int64((in[3] >> 30) & 0x3F))>>1))) + out[36] + out[38] = uint64(((-((int64((in[3] >> 36) & 0x3F)) & 1))^((int64((in[3] >> 36) & 0x3F))>>1))) + out[37] + out[39] = uint64(((-((int64((in[3] >> 42) & 0x3F)) & 1))^((int64((in[3] >> 42) & 0x3F))>>1))) + out[38] + out[40] = uint64(((-((int64((in[3] >> 48) & 0x3F)) & 1))^((int64((in[3] >> 48) & 0x3F))>>1))) + out[39] + out[41] = uint64(((-((int64((in[3] >> 54) & 0x3F)) & 1))^((int64((in[3] >> 54) & 0x3F))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x3) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x3) << 4))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[4] >> 2) & 0x3F)) & 1))^((int64((in[4] >> 2) & 0x3F))>>1))) + out[42] + out[44] = uint64(((-((int64((in[4] >> 8) & 0x3F)) & 1))^((int64((in[4] >> 8) & 0x3F))>>1))) + out[43] + out[45] = uint64(((-((int64((in[4] >> 14) & 0x3F)) & 1))^((int64((in[4] >> 14) & 0x3F))>>1))) + out[44] + out[46] = uint64(((-((int64((in[4] >> 20) & 0x3F)) & 1))^((int64((in[4] >> 20) & 0x3F))>>1))) + out[45] + out[47] = uint64(((-((int64((in[4] >> 26) & 0x3F)) & 1))^((int64((in[4] >> 26) & 0x3F))>>1))) + out[46] + out[48] = uint64(((-((int64((in[4] >> 32) & 0x3F)) & 1))^((int64((in[4] >> 32) & 0x3F))>>1))) + out[47] + out[49] = uint64(((-((int64((in[4] >> 38) & 0x3F)) & 1))^((int64((in[4] >> 38) & 0x3F))>>1))) + out[48] + out[50] = uint64(((-((int64((in[4] >> 44) & 0x3F)) & 1))^((int64((in[4] >> 44) & 0x3F))>>1))) + out[49] + out[51] = uint64(((-((int64((in[4] >> 50) & 0x3F)) & 1))^((int64((in[4] >> 50) & 0x3F))>>1))) + out[50] + out[52] = uint64(((-((int64((in[4] >> 56) & 0x3F)) & 1))^((int64((in[4] >> 56) & 0x3F))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[4] >> 62) | ((in[5] & 0xF) << 2)))) & 1))^((int64(((in[4] >> 62) | ((in[5] & 0xF) << 2))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[5] >> 4) & 0x3F)) & 1))^((int64((in[5] >> 4) & 0x3F))>>1))) + out[53] + out[55] = uint64(((-((int64((in[5] >> 10) & 0x3F)) & 1))^((int64((in[5] >> 10) & 0x3F))>>1))) + out[54] + out[56] = uint64(((-((int64((in[5] >> 16) & 0x3F)) & 1))^((int64((in[5] >> 16) & 0x3F))>>1))) + out[55] + out[57] = uint64(((-((int64((in[5] >> 22) & 0x3F)) & 1))^((int64((in[5] >> 22) & 0x3F))>>1))) + out[56] + out[58] = uint64(((-((int64((in[5] >> 28) & 0x3F)) & 1))^((int64((in[5] >> 28) & 0x3F))>>1))) + out[57] + out[59] = uint64(((-((int64((in[5] >> 34) & 0x3F)) & 1))^((int64((in[5] >> 34) & 0x3F))>>1))) + out[58] + out[60] = uint64(((-((int64((in[5] >> 40) & 0x3F)) & 1))^((int64((in[5] >> 40) & 0x3F))>>1))) + out[59] + out[61] = uint64(((-((int64((in[5] >> 46) & 0x3F)) & 1))^((int64((in[5] >> 46) & 0x3F))>>1))) + out[60] + out[62] = uint64(((-((int64((in[5] >> 52) & 0x3F)) & 1))^((int64((in[5] >> 52) & 0x3F))>>1))) + out[61] + out[63] = uint64(((-((int64((in[5] >> 58))) & 1))^((int64((in[5] >> 58)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_7(initoffset uint64, in *[7]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7F)) & 1))^((int64((in[0] >> 0) & 0x7F))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 7) & 0x7F)) & 1))^((int64((in[0] >> 7) & 0x7F))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 14) & 0x7F)) & 1))^((int64((in[0] >> 14) & 0x7F))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 21) & 0x7F)) & 1))^((int64((in[0] >> 21) & 0x7F))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 28) & 0x7F)) & 1))^((int64((in[0] >> 28) & 0x7F))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 35) & 0x7F)) & 1))^((int64((in[0] >> 35) & 0x7F))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 42) & 0x7F)) & 1))^((int64((in[0] >> 42) & 0x7F))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 49) & 0x7F)) & 1))^((int64((in[0] >> 49) & 0x7F))>>1))) + out[6] + out[8] = uint64(((-((int64((in[0] >> 56) & 0x7F)) & 1))^((int64((in[0] >> 56) & 0x7F))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[0] >> 63) | ((in[1] & 0x3F) << 1)))) & 1))^((int64(((in[0] >> 63) | ((in[1] & 0x3F) << 1))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[1] >> 6) & 0x7F)) & 1))^((int64((in[1] >> 6) & 0x7F))>>1))) + out[9] + out[11] = uint64(((-((int64((in[1] >> 13) & 0x7F)) & 1))^((int64((in[1] >> 13) & 0x7F))>>1))) + out[10] + out[12] = uint64(((-((int64((in[1] >> 20) & 0x7F)) & 1))^((int64((in[1] >> 20) & 0x7F))>>1))) + out[11] + out[13] = uint64(((-((int64((in[1] >> 27) & 0x7F)) & 1))^((int64((in[1] >> 27) & 0x7F))>>1))) + out[12] + out[14] = uint64(((-((int64((in[1] >> 34) & 0x7F)) & 1))^((int64((in[1] >> 34) & 0x7F))>>1))) + out[13] + out[15] = uint64(((-((int64((in[1] >> 41) & 0x7F)) & 1))^((int64((in[1] >> 41) & 0x7F))>>1))) + out[14] + out[16] = uint64(((-((int64((in[1] >> 48) & 0x7F)) & 1))^((int64((in[1] >> 48) & 0x7F))>>1))) + out[15] + out[17] = uint64(((-((int64((in[1] >> 55) & 0x7F)) & 1))^((int64((in[1] >> 55) & 0x7F))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0x1F) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0x1F) << 2))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[2] >> 5) & 0x7F)) & 1))^((int64((in[2] >> 5) & 0x7F))>>1))) + out[18] + out[20] = uint64(((-((int64((in[2] >> 12) & 0x7F)) & 1))^((int64((in[2] >> 12) & 0x7F))>>1))) + out[19] + out[21] = uint64(((-((int64((in[2] >> 19) & 0x7F)) & 1))^((int64((in[2] >> 19) & 0x7F))>>1))) + out[20] + out[22] = uint64(((-((int64((in[2] >> 26) & 0x7F)) & 1))^((int64((in[2] >> 26) & 0x7F))>>1))) + out[21] + out[23] = uint64(((-((int64((in[2] >> 33) & 0x7F)) & 1))^((int64((in[2] >> 33) & 0x7F))>>1))) + out[22] + out[24] = uint64(((-((int64((in[2] >> 40) & 0x7F)) & 1))^((int64((in[2] >> 40) & 0x7F))>>1))) + out[23] + out[25] = uint64(((-((int64((in[2] >> 47) & 0x7F)) & 1))^((int64((in[2] >> 47) & 0x7F))>>1))) + out[24] + out[26] = uint64(((-((int64((in[2] >> 54) & 0x7F)) & 1))^((int64((in[2] >> 54) & 0x7F))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[2] >> 61) | ((in[3] & 0xF) << 3)))) & 1))^((int64(((in[2] >> 61) | ((in[3] & 0xF) << 3))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[3] >> 4) & 0x7F)) & 1))^((int64((in[3] >> 4) & 0x7F))>>1))) + out[27] + out[29] = uint64(((-((int64((in[3] >> 11) & 0x7F)) & 1))^((int64((in[3] >> 11) & 0x7F))>>1))) + out[28] + out[30] = uint64(((-((int64((in[3] >> 18) & 0x7F)) & 1))^((int64((in[3] >> 18) & 0x7F))>>1))) + out[29] + out[31] = uint64(((-((int64((in[3] >> 25) & 0x7F)) & 1))^((int64((in[3] >> 25) & 0x7F))>>1))) + out[30] + out[32] = uint64(((-((int64((in[3] >> 32) & 0x7F)) & 1))^((int64((in[3] >> 32) & 0x7F))>>1))) + out[31] + out[33] = uint64(((-((int64((in[3] >> 39) & 0x7F)) & 1))^((int64((in[3] >> 39) & 0x7F))>>1))) + out[32] + out[34] = uint64(((-((int64((in[3] >> 46) & 0x7F)) & 1))^((int64((in[3] >> 46) & 0x7F))>>1))) + out[33] + out[35] = uint64(((-((int64((in[3] >> 53) & 0x7F)) & 1))^((int64((in[3] >> 53) & 0x7F))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x7) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x7) << 4))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[4] >> 3) & 0x7F)) & 1))^((int64((in[4] >> 3) & 0x7F))>>1))) + out[36] + out[38] = uint64(((-((int64((in[4] >> 10) & 0x7F)) & 1))^((int64((in[4] >> 10) & 0x7F))>>1))) + out[37] + out[39] = uint64(((-((int64((in[4] >> 17) & 0x7F)) & 1))^((int64((in[4] >> 17) & 0x7F))>>1))) + out[38] + out[40] = uint64(((-((int64((in[4] >> 24) & 0x7F)) & 1))^((int64((in[4] >> 24) & 0x7F))>>1))) + out[39] + out[41] = uint64(((-((int64((in[4] >> 31) & 0x7F)) & 1))^((int64((in[4] >> 31) & 0x7F))>>1))) + out[40] + out[42] = uint64(((-((int64((in[4] >> 38) & 0x7F)) & 1))^((int64((in[4] >> 38) & 0x7F))>>1))) + out[41] + out[43] = uint64(((-((int64((in[4] >> 45) & 0x7F)) & 1))^((int64((in[4] >> 45) & 0x7F))>>1))) + out[42] + out[44] = uint64(((-((int64((in[4] >> 52) & 0x7F)) & 1))^((int64((in[4] >> 52) & 0x7F))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[4] >> 59) | ((in[5] & 0x3) << 5)))) & 1))^((int64(((in[4] >> 59) | ((in[5] & 0x3) << 5))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[5] >> 2) & 0x7F)) & 1))^((int64((in[5] >> 2) & 0x7F))>>1))) + out[45] + out[47] = uint64(((-((int64((in[5] >> 9) & 0x7F)) & 1))^((int64((in[5] >> 9) & 0x7F))>>1))) + out[46] + out[48] = uint64(((-((int64((in[5] >> 16) & 0x7F)) & 1))^((int64((in[5] >> 16) & 0x7F))>>1))) + out[47] + out[49] = uint64(((-((int64((in[5] >> 23) & 0x7F)) & 1))^((int64((in[5] >> 23) & 0x7F))>>1))) + out[48] + out[50] = uint64(((-((int64((in[5] >> 30) & 0x7F)) & 1))^((int64((in[5] >> 30) & 0x7F))>>1))) + out[49] + out[51] = uint64(((-((int64((in[5] >> 37) & 0x7F)) & 1))^((int64((in[5] >> 37) & 0x7F))>>1))) + out[50] + out[52] = uint64(((-((int64((in[5] >> 44) & 0x7F)) & 1))^((int64((in[5] >> 44) & 0x7F))>>1))) + out[51] + out[53] = uint64(((-((int64((in[5] >> 51) & 0x7F)) & 1))^((int64((in[5] >> 51) & 0x7F))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0x1) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0x1) << 6))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[6] >> 1) & 0x7F)) & 1))^((int64((in[6] >> 1) & 0x7F))>>1))) + out[54] + out[56] = uint64(((-((int64((in[6] >> 8) & 0x7F)) & 1))^((int64((in[6] >> 8) & 0x7F))>>1))) + out[55] + out[57] = uint64(((-((int64((in[6] >> 15) & 0x7F)) & 1))^((int64((in[6] >> 15) & 0x7F))>>1))) + out[56] + out[58] = uint64(((-((int64((in[6] >> 22) & 0x7F)) & 1))^((int64((in[6] >> 22) & 0x7F))>>1))) + out[57] + out[59] = uint64(((-((int64((in[6] >> 29) & 0x7F)) & 1))^((int64((in[6] >> 29) & 0x7F))>>1))) + out[58] + out[60] = uint64(((-((int64((in[6] >> 36) & 0x7F)) & 1))^((int64((in[6] >> 36) & 0x7F))>>1))) + out[59] + out[61] = uint64(((-((int64((in[6] >> 43) & 0x7F)) & 1))^((int64((in[6] >> 43) & 0x7F))>>1))) + out[60] + out[62] = uint64(((-((int64((in[6] >> 50) & 0x7F)) & 1))^((int64((in[6] >> 50) & 0x7F))>>1))) + out[61] + out[63] = uint64(((-((int64((in[6] >> 57))) & 1))^((int64((in[6] >> 57)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_8(initoffset uint64, in *[8]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFF)) & 1))^((int64((in[0] >> 0) & 0xFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 8) & 0xFF)) & 1))^((int64((in[0] >> 8) & 0xFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 16) & 0xFF)) & 1))^((int64((in[0] >> 16) & 0xFF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 24) & 0xFF)) & 1))^((int64((in[0] >> 24) & 0xFF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 32) & 0xFF)) & 1))^((int64((in[0] >> 32) & 0xFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 40) & 0xFF)) & 1))^((int64((in[0] >> 40) & 0xFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 48) & 0xFF)) & 1))^((int64((in[0] >> 48) & 0xFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[0] >> 56))) & 1))^((int64((in[0] >> 56)))>>1))) + out[6] + out[8] = uint64(((-((int64((in[1] >> 0) & 0xFF)) & 1))^((int64((in[1] >> 0) & 0xFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[1] >> 8) & 0xFF)) & 1))^((int64((in[1] >> 8) & 0xFF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[1] >> 16) & 0xFF)) & 1))^((int64((in[1] >> 16) & 0xFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[1] >> 24) & 0xFF)) & 1))^((int64((in[1] >> 24) & 0xFF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[1] >> 32) & 0xFF)) & 1))^((int64((in[1] >> 32) & 0xFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[1] >> 40) & 0xFF)) & 1))^((int64((in[1] >> 40) & 0xFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[1] >> 48) & 0xFF)) & 1))^((int64((in[1] >> 48) & 0xFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[1] >> 56))) & 1))^((int64((in[1] >> 56)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[2] >> 0) & 0xFF)) & 1))^((int64((in[2] >> 0) & 0xFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[2] >> 8) & 0xFF)) & 1))^((int64((in[2] >> 8) & 0xFF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[2] >> 16) & 0xFF)) & 1))^((int64((in[2] >> 16) & 0xFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[2] >> 24) & 0xFF)) & 1))^((int64((in[2] >> 24) & 0xFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[2] >> 32) & 0xFF)) & 1))^((int64((in[2] >> 32) & 0xFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[2] >> 40) & 0xFF)) & 1))^((int64((in[2] >> 40) & 0xFF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[2] >> 48) & 0xFF)) & 1))^((int64((in[2] >> 48) & 0xFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[2] >> 56))) & 1))^((int64((in[2] >> 56)))>>1))) + out[22] + out[24] = uint64(((-((int64((in[3] >> 0) & 0xFF)) & 1))^((int64((in[3] >> 0) & 0xFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[3] >> 8) & 0xFF)) & 1))^((int64((in[3] >> 8) & 0xFF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[3] >> 16) & 0xFF)) & 1))^((int64((in[3] >> 16) & 0xFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[3] >> 24) & 0xFF)) & 1))^((int64((in[3] >> 24) & 0xFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[3] >> 32) & 0xFF)) & 1))^((int64((in[3] >> 32) & 0xFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[3] >> 40) & 0xFF)) & 1))^((int64((in[3] >> 40) & 0xFF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[3] >> 48) & 0xFF)) & 1))^((int64((in[3] >> 48) & 0xFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[3] >> 56))) & 1))^((int64((in[3] >> 56)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[4] >> 0) & 0xFF)) & 1))^((int64((in[4] >> 0) & 0xFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[4] >> 8) & 0xFF)) & 1))^((int64((in[4] >> 8) & 0xFF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[4] >> 16) & 0xFF)) & 1))^((int64((in[4] >> 16) & 0xFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[4] >> 24) & 0xFF)) & 1))^((int64((in[4] >> 24) & 0xFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[4] >> 32) & 0xFF)) & 1))^((int64((in[4] >> 32) & 0xFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[4] >> 40) & 0xFF)) & 1))^((int64((in[4] >> 40) & 0xFF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[4] >> 48) & 0xFF)) & 1))^((int64((in[4] >> 48) & 0xFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[4] >> 56))) & 1))^((int64((in[4] >> 56)))>>1))) + out[38] + out[40] = uint64(((-((int64((in[5] >> 0) & 0xFF)) & 1))^((int64((in[5] >> 0) & 0xFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[5] >> 8) & 0xFF)) & 1))^((int64((in[5] >> 8) & 0xFF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[5] >> 16) & 0xFF)) & 1))^((int64((in[5] >> 16) & 0xFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[5] >> 24) & 0xFF)) & 1))^((int64((in[5] >> 24) & 0xFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[5] >> 32) & 0xFF)) & 1))^((int64((in[5] >> 32) & 0xFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[5] >> 40) & 0xFF)) & 1))^((int64((in[5] >> 40) & 0xFF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[5] >> 48) & 0xFF)) & 1))^((int64((in[5] >> 48) & 0xFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[5] >> 56))) & 1))^((int64((in[5] >> 56)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[6] >> 0) & 0xFF)) & 1))^((int64((in[6] >> 0) & 0xFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[6] >> 8) & 0xFF)) & 1))^((int64((in[6] >> 8) & 0xFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[6] >> 16) & 0xFF)) & 1))^((int64((in[6] >> 16) & 0xFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[6] >> 24) & 0xFF)) & 1))^((int64((in[6] >> 24) & 0xFF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[6] >> 32) & 0xFF)) & 1))^((int64((in[6] >> 32) & 0xFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[6] >> 40) & 0xFF)) & 1))^((int64((in[6] >> 40) & 0xFF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[6] >> 48) & 0xFF)) & 1))^((int64((in[6] >> 48) & 0xFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[6] >> 56))) & 1))^((int64((in[6] >> 56)))>>1))) + out[54] + out[56] = uint64(((-((int64((in[7] >> 0) & 0xFF)) & 1))^((int64((in[7] >> 0) & 0xFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[7] >> 8) & 0xFF)) & 1))^((int64((in[7] >> 8) & 0xFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[7] >> 16) & 0xFF)) & 1))^((int64((in[7] >> 16) & 0xFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[7] >> 24) & 0xFF)) & 1))^((int64((in[7] >> 24) & 0xFF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[7] >> 32) & 0xFF)) & 1))^((int64((in[7] >> 32) & 0xFF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[7] >> 40) & 0xFF)) & 1))^((int64((in[7] >> 40) & 0xFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[7] >> 48) & 0xFF)) & 1))^((int64((in[7] >> 48) & 0xFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[7] >> 56))) & 1))^((int64((in[7] >> 56)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_9(initoffset uint64, in *[9]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FF)) & 1))^((int64((in[0] >> 0) & 0x1FF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 9) & 0x1FF)) & 1))^((int64((in[0] >> 9) & 0x1FF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 18) & 0x1FF)) & 1))^((int64((in[0] >> 18) & 0x1FF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 27) & 0x1FF)) & 1))^((int64((in[0] >> 27) & 0x1FF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 36) & 0x1FF)) & 1))^((int64((in[0] >> 36) & 0x1FF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 45) & 0x1FF)) & 1))^((int64((in[0] >> 45) & 0x1FF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[0] >> 54) & 0x1FF)) & 1))^((int64((in[0] >> 54) & 0x1FF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[0] >> 63) | ((in[1] & 0xFF) << 1)))) & 1))^((int64(((in[0] >> 63) | ((in[1] & 0xFF) << 1))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[1] >> 8) & 0x1FF)) & 1))^((int64((in[1] >> 8) & 0x1FF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[1] >> 17) & 0x1FF)) & 1))^((int64((in[1] >> 17) & 0x1FF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[1] >> 26) & 0x1FF)) & 1))^((int64((in[1] >> 26) & 0x1FF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[1] >> 35) & 0x1FF)) & 1))^((int64((in[1] >> 35) & 0x1FF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[1] >> 44) & 0x1FF)) & 1))^((int64((in[1] >> 44) & 0x1FF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[1] >> 53) & 0x1FF)) & 1))^((int64((in[1] >> 53) & 0x1FF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0x7F) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0x7F) << 2))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[2] >> 7) & 0x1FF)) & 1))^((int64((in[2] >> 7) & 0x1FF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[2] >> 16) & 0x1FF)) & 1))^((int64((in[2] >> 16) & 0x1FF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[2] >> 25) & 0x1FF)) & 1))^((int64((in[2] >> 25) & 0x1FF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[2] >> 34) & 0x1FF)) & 1))^((int64((in[2] >> 34) & 0x1FF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[2] >> 43) & 0x1FF)) & 1))^((int64((in[2] >> 43) & 0x1FF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[2] >> 52) & 0x1FF)) & 1))^((int64((in[2] >> 52) & 0x1FF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[2] >> 61) | ((in[3] & 0x3F) << 3)))) & 1))^((int64(((in[2] >> 61) | ((in[3] & 0x3F) << 3))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[3] >> 6) & 0x1FF)) & 1))^((int64((in[3] >> 6) & 0x1FF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[3] >> 15) & 0x1FF)) & 1))^((int64((in[3] >> 15) & 0x1FF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[3] >> 24) & 0x1FF)) & 1))^((int64((in[3] >> 24) & 0x1FF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[3] >> 33) & 0x1FF)) & 1))^((int64((in[3] >> 33) & 0x1FF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[3] >> 42) & 0x1FF)) & 1))^((int64((in[3] >> 42) & 0x1FF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[3] >> 51) & 0x1FF)) & 1))^((int64((in[3] >> 51) & 0x1FF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x1F) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x1F) << 4))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[4] >> 5) & 0x1FF)) & 1))^((int64((in[4] >> 5) & 0x1FF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[4] >> 14) & 0x1FF)) & 1))^((int64((in[4] >> 14) & 0x1FF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[4] >> 23) & 0x1FF)) & 1))^((int64((in[4] >> 23) & 0x1FF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[4] >> 32) & 0x1FF)) & 1))^((int64((in[4] >> 32) & 0x1FF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[4] >> 41) & 0x1FF)) & 1))^((int64((in[4] >> 41) & 0x1FF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[4] >> 50) & 0x1FF)) & 1))^((int64((in[4] >> 50) & 0x1FF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[4] >> 59) | ((in[5] & 0xF) << 5)))) & 1))^((int64(((in[4] >> 59) | ((in[5] & 0xF) << 5))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[5] >> 4) & 0x1FF)) & 1))^((int64((in[5] >> 4) & 0x1FF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[5] >> 13) & 0x1FF)) & 1))^((int64((in[5] >> 13) & 0x1FF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[5] >> 22) & 0x1FF)) & 1))^((int64((in[5] >> 22) & 0x1FF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[5] >> 31) & 0x1FF)) & 1))^((int64((in[5] >> 31) & 0x1FF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[5] >> 40) & 0x1FF)) & 1))^((int64((in[5] >> 40) & 0x1FF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[5] >> 49) & 0x1FF)) & 1))^((int64((in[5] >> 49) & 0x1FF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0x7) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0x7) << 6))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[6] >> 3) & 0x1FF)) & 1))^((int64((in[6] >> 3) & 0x1FF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[6] >> 12) & 0x1FF)) & 1))^((int64((in[6] >> 12) & 0x1FF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[6] >> 21) & 0x1FF)) & 1))^((int64((in[6] >> 21) & 0x1FF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[6] >> 30) & 0x1FF)) & 1))^((int64((in[6] >> 30) & 0x1FF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[6] >> 39) & 0x1FF)) & 1))^((int64((in[6] >> 39) & 0x1FF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[6] >> 48) & 0x1FF)) & 1))^((int64((in[6] >> 48) & 0x1FF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[6] >> 57) | ((in[7] & 0x3) << 7)))) & 1))^((int64(((in[6] >> 57) | ((in[7] & 0x3) << 7))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[7] >> 2) & 0x1FF)) & 1))^((int64((in[7] >> 2) & 0x1FF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[7] >> 11) & 0x1FF)) & 1))^((int64((in[7] >> 11) & 0x1FF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[7] >> 20) & 0x1FF)) & 1))^((int64((in[7] >> 20) & 0x1FF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[7] >> 29) & 0x1FF)) & 1))^((int64((in[7] >> 29) & 0x1FF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[7] >> 38) & 0x1FF)) & 1))^((int64((in[7] >> 38) & 0x1FF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[7] >> 47) & 0x1FF)) & 1))^((int64((in[7] >> 47) & 0x1FF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0x1) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0x1) << 8))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[8] >> 1) & 0x1FF)) & 1))^((int64((in[8] >> 1) & 0x1FF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[8] >> 10) & 0x1FF)) & 1))^((int64((in[8] >> 10) & 0x1FF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[8] >> 19) & 0x1FF)) & 1))^((int64((in[8] >> 19) & 0x1FF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[8] >> 28) & 0x1FF)) & 1))^((int64((in[8] >> 28) & 0x1FF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[8] >> 37) & 0x1FF)) & 1))^((int64((in[8] >> 37) & 0x1FF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[8] >> 46) & 0x1FF)) & 1))^((int64((in[8] >> 46) & 0x1FF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[8] >> 55))) & 1))^((int64((in[8] >> 55)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_10(initoffset uint64, in *[10]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FF)) & 1))^((int64((in[0] >> 0) & 0x3FF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 10) & 0x3FF)) & 1))^((int64((in[0] >> 10) & 0x3FF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 20) & 0x3FF)) & 1))^((int64((in[0] >> 20) & 0x3FF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 30) & 0x3FF)) & 1))^((int64((in[0] >> 30) & 0x3FF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 40) & 0x3FF)) & 1))^((int64((in[0] >> 40) & 0x3FF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[0] >> 50) & 0x3FF)) & 1))^((int64((in[0] >> 50) & 0x3FF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0x3F) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0x3F) << 4))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[1] >> 6) & 0x3FF)) & 1))^((int64((in[1] >> 6) & 0x3FF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[1] >> 16) & 0x3FF)) & 1))^((int64((in[1] >> 16) & 0x3FF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[1] >> 26) & 0x3FF)) & 1))^((int64((in[1] >> 26) & 0x3FF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[1] >> 36) & 0x3FF)) & 1))^((int64((in[1] >> 36) & 0x3FF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[1] >> 46) & 0x3FF)) & 1))^((int64((in[1] >> 46) & 0x3FF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0x3) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0x3) << 8))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[2] >> 2) & 0x3FF)) & 1))^((int64((in[2] >> 2) & 0x3FF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[2] >> 12) & 0x3FF)) & 1))^((int64((in[2] >> 12) & 0x3FF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[2] >> 22) & 0x3FF)) & 1))^((int64((in[2] >> 22) & 0x3FF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[2] >> 32) & 0x3FF)) & 1))^((int64((in[2] >> 32) & 0x3FF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[2] >> 42) & 0x3FF)) & 1))^((int64((in[2] >> 42) & 0x3FF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[2] >> 52) & 0x3FF)) & 1))^((int64((in[2] >> 52) & 0x3FF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[2] >> 62) | ((in[3] & 0xFF) << 2)))) & 1))^((int64(((in[2] >> 62) | ((in[3] & 0xFF) << 2))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[3] >> 8) & 0x3FF)) & 1))^((int64((in[3] >> 8) & 0x3FF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[3] >> 18) & 0x3FF)) & 1))^((int64((in[3] >> 18) & 0x3FF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[3] >> 28) & 0x3FF)) & 1))^((int64((in[3] >> 28) & 0x3FF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[3] >> 38) & 0x3FF)) & 1))^((int64((in[3] >> 38) & 0x3FF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[3] >> 48) & 0x3FF)) & 1))^((int64((in[3] >> 48) & 0x3FF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[3] >> 58) | ((in[4] & 0xF) << 6)))) & 1))^((int64(((in[3] >> 58) | ((in[4] & 0xF) << 6))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[4] >> 4) & 0x3FF)) & 1))^((int64((in[4] >> 4) & 0x3FF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[4] >> 14) & 0x3FF)) & 1))^((int64((in[4] >> 14) & 0x3FF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[4] >> 24) & 0x3FF)) & 1))^((int64((in[4] >> 24) & 0x3FF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[4] >> 34) & 0x3FF)) & 1))^((int64((in[4] >> 34) & 0x3FF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[4] >> 44) & 0x3FF)) & 1))^((int64((in[4] >> 44) & 0x3FF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[4] >> 54))) & 1))^((int64((in[4] >> 54)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[5] >> 0) & 0x3FF)) & 1))^((int64((in[5] >> 0) & 0x3FF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[5] >> 10) & 0x3FF)) & 1))^((int64((in[5] >> 10) & 0x3FF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[5] >> 20) & 0x3FF)) & 1))^((int64((in[5] >> 20) & 0x3FF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[5] >> 30) & 0x3FF)) & 1))^((int64((in[5] >> 30) & 0x3FF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[5] >> 40) & 0x3FF)) & 1))^((int64((in[5] >> 40) & 0x3FF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[5] >> 50) & 0x3FF)) & 1))^((int64((in[5] >> 50) & 0x3FF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[5] >> 60) | ((in[6] & 0x3F) << 4)))) & 1))^((int64(((in[5] >> 60) | ((in[6] & 0x3F) << 4))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[6] >> 6) & 0x3FF)) & 1))^((int64((in[6] >> 6) & 0x3FF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[6] >> 16) & 0x3FF)) & 1))^((int64((in[6] >> 16) & 0x3FF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[6] >> 26) & 0x3FF)) & 1))^((int64((in[6] >> 26) & 0x3FF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[6] >> 36) & 0x3FF)) & 1))^((int64((in[6] >> 36) & 0x3FF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[6] >> 46) & 0x3FF)) & 1))^((int64((in[6] >> 46) & 0x3FF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[6] >> 56) | ((in[7] & 0x3) << 8)))) & 1))^((int64(((in[6] >> 56) | ((in[7] & 0x3) << 8))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[7] >> 2) & 0x3FF)) & 1))^((int64((in[7] >> 2) & 0x3FF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[7] >> 12) & 0x3FF)) & 1))^((int64((in[7] >> 12) & 0x3FF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[7] >> 22) & 0x3FF)) & 1))^((int64((in[7] >> 22) & 0x3FF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[7] >> 32) & 0x3FF)) & 1))^((int64((in[7] >> 32) & 0x3FF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[7] >> 42) & 0x3FF)) & 1))^((int64((in[7] >> 42) & 0x3FF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[7] >> 52) & 0x3FF)) & 1))^((int64((in[7] >> 52) & 0x3FF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[7] >> 62) | ((in[8] & 0xFF) << 2)))) & 1))^((int64(((in[7] >> 62) | ((in[8] & 0xFF) << 2))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[8] >> 8) & 0x3FF)) & 1))^((int64((in[8] >> 8) & 0x3FF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[8] >> 18) & 0x3FF)) & 1))^((int64((in[8] >> 18) & 0x3FF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[8] >> 28) & 0x3FF)) & 1))^((int64((in[8] >> 28) & 0x3FF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[8] >> 38) & 0x3FF)) & 1))^((int64((in[8] >> 38) & 0x3FF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[8] >> 48) & 0x3FF)) & 1))^((int64((in[8] >> 48) & 0x3FF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[8] >> 58) | ((in[9] & 0xF) << 6)))) & 1))^((int64(((in[8] >> 58) | ((in[9] & 0xF) << 6))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[9] >> 4) & 0x3FF)) & 1))^((int64((in[9] >> 4) & 0x3FF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[9] >> 14) & 0x3FF)) & 1))^((int64((in[9] >> 14) & 0x3FF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[9] >> 24) & 0x3FF)) & 1))^((int64((in[9] >> 24) & 0x3FF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[9] >> 34) & 0x3FF)) & 1))^((int64((in[9] >> 34) & 0x3FF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[9] >> 44) & 0x3FF)) & 1))^((int64((in[9] >> 44) & 0x3FF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[9] >> 54))) & 1))^((int64((in[9] >> 54)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_11(initoffset uint64, in *[11]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FF)) & 1))^((int64((in[0] >> 0) & 0x7FF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 11) & 0x7FF)) & 1))^((int64((in[0] >> 11) & 0x7FF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 22) & 0x7FF)) & 1))^((int64((in[0] >> 22) & 0x7FF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 33) & 0x7FF)) & 1))^((int64((in[0] >> 33) & 0x7FF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 44) & 0x7FF)) & 1))^((int64((in[0] >> 44) & 0x7FF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[0] >> 55) | ((in[1] & 0x3) << 9)))) & 1))^((int64(((in[0] >> 55) | ((in[1] & 0x3) << 9))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 2) & 0x7FF)) & 1))^((int64((in[1] >> 2) & 0x7FF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[1] >> 13) & 0x7FF)) & 1))^((int64((in[1] >> 13) & 0x7FF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[1] >> 24) & 0x7FF)) & 1))^((int64((in[1] >> 24) & 0x7FF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[1] >> 35) & 0x7FF)) & 1))^((int64((in[1] >> 35) & 0x7FF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[1] >> 46) & 0x7FF)) & 1))^((int64((in[1] >> 46) & 0x7FF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[1] >> 57) | ((in[2] & 0xF) << 7)))) & 1))^((int64(((in[1] >> 57) | ((in[2] & 0xF) << 7))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[2] >> 4) & 0x7FF)) & 1))^((int64((in[2] >> 4) & 0x7FF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[2] >> 15) & 0x7FF)) & 1))^((int64((in[2] >> 15) & 0x7FF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[2] >> 26) & 0x7FF)) & 1))^((int64((in[2] >> 26) & 0x7FF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[2] >> 37) & 0x7FF)) & 1))^((int64((in[2] >> 37) & 0x7FF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[2] >> 48) & 0x7FF)) & 1))^((int64((in[2] >> 48) & 0x7FF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[2] >> 59) | ((in[3] & 0x3F) << 5)))) & 1))^((int64(((in[2] >> 59) | ((in[3] & 0x3F) << 5))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[3] >> 6) & 0x7FF)) & 1))^((int64((in[3] >> 6) & 0x7FF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[3] >> 17) & 0x7FF)) & 1))^((int64((in[3] >> 17) & 0x7FF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[3] >> 28) & 0x7FF)) & 1))^((int64((in[3] >> 28) & 0x7FF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[3] >> 39) & 0x7FF)) & 1))^((int64((in[3] >> 39) & 0x7FF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[3] >> 50) & 0x7FF)) & 1))^((int64((in[3] >> 50) & 0x7FF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[3] >> 61) | ((in[4] & 0xFF) << 3)))) & 1))^((int64(((in[3] >> 61) | ((in[4] & 0xFF) << 3))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[4] >> 8) & 0x7FF)) & 1))^((int64((in[4] >> 8) & 0x7FF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[4] >> 19) & 0x7FF)) & 1))^((int64((in[4] >> 19) & 0x7FF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[4] >> 30) & 0x7FF)) & 1))^((int64((in[4] >> 30) & 0x7FF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[4] >> 41) & 0x7FF)) & 1))^((int64((in[4] >> 41) & 0x7FF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[4] >> 52) & 0x7FF)) & 1))^((int64((in[4] >> 52) & 0x7FF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[4] >> 63) | ((in[5] & 0x3FF) << 1)))) & 1))^((int64(((in[4] >> 63) | ((in[5] & 0x3FF) << 1))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[5] >> 10) & 0x7FF)) & 1))^((int64((in[5] >> 10) & 0x7FF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[5] >> 21) & 0x7FF)) & 1))^((int64((in[5] >> 21) & 0x7FF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[5] >> 32) & 0x7FF)) & 1))^((int64((in[5] >> 32) & 0x7FF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[5] >> 43) & 0x7FF)) & 1))^((int64((in[5] >> 43) & 0x7FF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[5] >> 54) | ((in[6] & 0x1) << 10)))) & 1))^((int64(((in[5] >> 54) | ((in[6] & 0x1) << 10))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[6] >> 1) & 0x7FF)) & 1))^((int64((in[6] >> 1) & 0x7FF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[6] >> 12) & 0x7FF)) & 1))^((int64((in[6] >> 12) & 0x7FF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[6] >> 23) & 0x7FF)) & 1))^((int64((in[6] >> 23) & 0x7FF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[6] >> 34) & 0x7FF)) & 1))^((int64((in[6] >> 34) & 0x7FF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[6] >> 45) & 0x7FF)) & 1))^((int64((in[6] >> 45) & 0x7FF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[6] >> 56) | ((in[7] & 0x7) << 8)))) & 1))^((int64(((in[6] >> 56) | ((in[7] & 0x7) << 8))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[7] >> 3) & 0x7FF)) & 1))^((int64((in[7] >> 3) & 0x7FF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[7] >> 14) & 0x7FF)) & 1))^((int64((in[7] >> 14) & 0x7FF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[7] >> 25) & 0x7FF)) & 1))^((int64((in[7] >> 25) & 0x7FF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[7] >> 36) & 0x7FF)) & 1))^((int64((in[7] >> 36) & 0x7FF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[7] >> 47) & 0x7FF)) & 1))^((int64((in[7] >> 47) & 0x7FF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[7] >> 58) | ((in[8] & 0x1F) << 6)))) & 1))^((int64(((in[7] >> 58) | ((in[8] & 0x1F) << 6))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[8] >> 5) & 0x7FF)) & 1))^((int64((in[8] >> 5) & 0x7FF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[8] >> 16) & 0x7FF)) & 1))^((int64((in[8] >> 16) & 0x7FF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[8] >> 27) & 0x7FF)) & 1))^((int64((in[8] >> 27) & 0x7FF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[8] >> 38) & 0x7FF)) & 1))^((int64((in[8] >> 38) & 0x7FF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[8] >> 49) & 0x7FF)) & 1))^((int64((in[8] >> 49) & 0x7FF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[8] >> 60) | ((in[9] & 0x7F) << 4)))) & 1))^((int64(((in[8] >> 60) | ((in[9] & 0x7F) << 4))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[9] >> 7) & 0x7FF)) & 1))^((int64((in[9] >> 7) & 0x7FF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[9] >> 18) & 0x7FF)) & 1))^((int64((in[9] >> 18) & 0x7FF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[9] >> 29) & 0x7FF)) & 1))^((int64((in[9] >> 29) & 0x7FF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[9] >> 40) & 0x7FF)) & 1))^((int64((in[9] >> 40) & 0x7FF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[9] >> 51) & 0x7FF)) & 1))^((int64((in[9] >> 51) & 0x7FF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[9] >> 62) | ((in[10] & 0x1FF) << 2)))) & 1))^((int64(((in[9] >> 62) | ((in[10] & 0x1FF) << 2))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[10] >> 9) & 0x7FF)) & 1))^((int64((in[10] >> 9) & 0x7FF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[10] >> 20) & 0x7FF)) & 1))^((int64((in[10] >> 20) & 0x7FF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[10] >> 31) & 0x7FF)) & 1))^((int64((in[10] >> 31) & 0x7FF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[10] >> 42) & 0x7FF)) & 1))^((int64((in[10] >> 42) & 0x7FF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[10] >> 53))) & 1))^((int64((in[10] >> 53)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_12(initoffset uint64, in *[12]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFF)) & 1))^((int64((in[0] >> 0) & 0xFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 12) & 0xFFF)) & 1))^((int64((in[0] >> 12) & 0xFFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 24) & 0xFFF)) & 1))^((int64((in[0] >> 24) & 0xFFF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 36) & 0xFFF)) & 1))^((int64((in[0] >> 36) & 0xFFF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[0] >> 48) & 0xFFF)) & 1))^((int64((in[0] >> 48) & 0xFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0xFF) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0xFF) << 4))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 8) & 0xFFF)) & 1))^((int64((in[1] >> 8) & 0xFFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[1] >> 20) & 0xFFF)) & 1))^((int64((in[1] >> 20) & 0xFFF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[1] >> 32) & 0xFFF)) & 1))^((int64((in[1] >> 32) & 0xFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[1] >> 44) & 0xFFF)) & 1))^((int64((in[1] >> 44) & 0xFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0xF) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0xF) << 8))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[2] >> 4) & 0xFFF)) & 1))^((int64((in[2] >> 4) & 0xFFF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[2] >> 16) & 0xFFF)) & 1))^((int64((in[2] >> 16) & 0xFFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[2] >> 28) & 0xFFF)) & 1))^((int64((in[2] >> 28) & 0xFFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[2] >> 40) & 0xFFF)) & 1))^((int64((in[2] >> 40) & 0xFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[2] >> 52))) & 1))^((int64((in[2] >> 52)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[3] >> 0) & 0xFFF)) & 1))^((int64((in[3] >> 0) & 0xFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[3] >> 12) & 0xFFF)) & 1))^((int64((in[3] >> 12) & 0xFFF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[3] >> 24) & 0xFFF)) & 1))^((int64((in[3] >> 24) & 0xFFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[3] >> 36) & 0xFFF)) & 1))^((int64((in[3] >> 36) & 0xFFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[3] >> 48) & 0xFFF)) & 1))^((int64((in[3] >> 48) & 0xFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0xFF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0xFF) << 4))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[4] >> 8) & 0xFFF)) & 1))^((int64((in[4] >> 8) & 0xFFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[4] >> 20) & 0xFFF)) & 1))^((int64((in[4] >> 20) & 0xFFF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[4] >> 32) & 0xFFF)) & 1))^((int64((in[4] >> 32) & 0xFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[4] >> 44) & 0xFFF)) & 1))^((int64((in[4] >> 44) & 0xFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[4] >> 56) | ((in[5] & 0xF) << 8)))) & 1))^((int64(((in[4] >> 56) | ((in[5] & 0xF) << 8))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[5] >> 4) & 0xFFF)) & 1))^((int64((in[5] >> 4) & 0xFFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[5] >> 16) & 0xFFF)) & 1))^((int64((in[5] >> 16) & 0xFFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[5] >> 28) & 0xFFF)) & 1))^((int64((in[5] >> 28) & 0xFFF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[5] >> 40) & 0xFFF)) & 1))^((int64((in[5] >> 40) & 0xFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[5] >> 52))) & 1))^((int64((in[5] >> 52)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[6] >> 0) & 0xFFF)) & 1))^((int64((in[6] >> 0) & 0xFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[6] >> 12) & 0xFFF)) & 1))^((int64((in[6] >> 12) & 0xFFF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[6] >> 24) & 0xFFF)) & 1))^((int64((in[6] >> 24) & 0xFFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[6] >> 36) & 0xFFF)) & 1))^((int64((in[6] >> 36) & 0xFFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[6] >> 48) & 0xFFF)) & 1))^((int64((in[6] >> 48) & 0xFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[6] >> 60) | ((in[7] & 0xFF) << 4)))) & 1))^((int64(((in[6] >> 60) | ((in[7] & 0xFF) << 4))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[7] >> 8) & 0xFFF)) & 1))^((int64((in[7] >> 8) & 0xFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[7] >> 20) & 0xFFF)) & 1))^((int64((in[7] >> 20) & 0xFFF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[7] >> 32) & 0xFFF)) & 1))^((int64((in[7] >> 32) & 0xFFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[7] >> 44) & 0xFFF)) & 1))^((int64((in[7] >> 44) & 0xFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0xF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0xF) << 8))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[8] >> 4) & 0xFFF)) & 1))^((int64((in[8] >> 4) & 0xFFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[8] >> 16) & 0xFFF)) & 1))^((int64((in[8] >> 16) & 0xFFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[8] >> 28) & 0xFFF)) & 1))^((int64((in[8] >> 28) & 0xFFF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[8] >> 40) & 0xFFF)) & 1))^((int64((in[8] >> 40) & 0xFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[8] >> 52))) & 1))^((int64((in[8] >> 52)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[9] >> 0) & 0xFFF)) & 1))^((int64((in[9] >> 0) & 0xFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[9] >> 12) & 0xFFF)) & 1))^((int64((in[9] >> 12) & 0xFFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[9] >> 24) & 0xFFF)) & 1))^((int64((in[9] >> 24) & 0xFFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[9] >> 36) & 0xFFF)) & 1))^((int64((in[9] >> 36) & 0xFFF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[9] >> 48) & 0xFFF)) & 1))^((int64((in[9] >> 48) & 0xFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[9] >> 60) | ((in[10] & 0xFF) << 4)))) & 1))^((int64(((in[9] >> 60) | ((in[10] & 0xFF) << 4))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[10] >> 8) & 0xFFF)) & 1))^((int64((in[10] >> 8) & 0xFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[10] >> 20) & 0xFFF)) & 1))^((int64((in[10] >> 20) & 0xFFF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[10] >> 32) & 0xFFF)) & 1))^((int64((in[10] >> 32) & 0xFFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[10] >> 44) & 0xFFF)) & 1))^((int64((in[10] >> 44) & 0xFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[10] >> 56) | ((in[11] & 0xF) << 8)))) & 1))^((int64(((in[10] >> 56) | ((in[11] & 0xF) << 8))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[11] >> 4) & 0xFFF)) & 1))^((int64((in[11] >> 4) & 0xFFF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[11] >> 16) & 0xFFF)) & 1))^((int64((in[11] >> 16) & 0xFFF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[11] >> 28) & 0xFFF)) & 1))^((int64((in[11] >> 28) & 0xFFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[11] >> 40) & 0xFFF)) & 1))^((int64((in[11] >> 40) & 0xFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[11] >> 52))) & 1))^((int64((in[11] >> 52)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_13(initoffset uint64, in *[13]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFF)) & 1))^((int64((in[0] >> 0) & 0x1FFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 13) & 0x1FFF)) & 1))^((int64((in[0] >> 13) & 0x1FFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 26) & 0x1FFF)) & 1))^((int64((in[0] >> 26) & 0x1FFF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 39) & 0x1FFF)) & 1))^((int64((in[0] >> 39) & 0x1FFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[0] >> 52) | ((in[1] & 0x1) << 12)))) & 1))^((int64(((in[0] >> 52) | ((in[1] & 0x1) << 12))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 1) & 0x1FFF)) & 1))^((int64((in[1] >> 1) & 0x1FFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 14) & 0x1FFF)) & 1))^((int64((in[1] >> 14) & 0x1FFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[1] >> 27) & 0x1FFF)) & 1))^((int64((in[1] >> 27) & 0x1FFF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[1] >> 40) & 0x1FFF)) & 1))^((int64((in[1] >> 40) & 0x1FFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[1] >> 53) | ((in[2] & 0x3) << 11)))) & 1))^((int64(((in[1] >> 53) | ((in[2] & 0x3) << 11))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[2] >> 2) & 0x1FFF)) & 1))^((int64((in[2] >> 2) & 0x1FFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[2] >> 15) & 0x1FFF)) & 1))^((int64((in[2] >> 15) & 0x1FFF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[2] >> 28) & 0x1FFF)) & 1))^((int64((in[2] >> 28) & 0x1FFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[2] >> 41) & 0x1FFF)) & 1))^((int64((in[2] >> 41) & 0x1FFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[2] >> 54) | ((in[3] & 0x7) << 10)))) & 1))^((int64(((in[2] >> 54) | ((in[3] & 0x7) << 10))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[3] >> 3) & 0x1FFF)) & 1))^((int64((in[3] >> 3) & 0x1FFF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[3] >> 16) & 0x1FFF)) & 1))^((int64((in[3] >> 16) & 0x1FFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[3] >> 29) & 0x1FFF)) & 1))^((int64((in[3] >> 29) & 0x1FFF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[3] >> 42) & 0x1FFF)) & 1))^((int64((in[3] >> 42) & 0x1FFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[3] >> 55) | ((in[4] & 0xF) << 9)))) & 1))^((int64(((in[3] >> 55) | ((in[4] & 0xF) << 9))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[4] >> 4) & 0x1FFF)) & 1))^((int64((in[4] >> 4) & 0x1FFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[4] >> 17) & 0x1FFF)) & 1))^((int64((in[4] >> 17) & 0x1FFF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[4] >> 30) & 0x1FFF)) & 1))^((int64((in[4] >> 30) & 0x1FFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[4] >> 43) & 0x1FFF)) & 1))^((int64((in[4] >> 43) & 0x1FFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[4] >> 56) | ((in[5] & 0x1F) << 8)))) & 1))^((int64(((in[4] >> 56) | ((in[5] & 0x1F) << 8))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[5] >> 5) & 0x1FFF)) & 1))^((int64((in[5] >> 5) & 0x1FFF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[5] >> 18) & 0x1FFF)) & 1))^((int64((in[5] >> 18) & 0x1FFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[5] >> 31) & 0x1FFF)) & 1))^((int64((in[5] >> 31) & 0x1FFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[5] >> 44) & 0x1FFF)) & 1))^((int64((in[5] >> 44) & 0x1FFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[5] >> 57) | ((in[6] & 0x3F) << 7)))) & 1))^((int64(((in[5] >> 57) | ((in[6] & 0x3F) << 7))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[6] >> 6) & 0x1FFF)) & 1))^((int64((in[6] >> 6) & 0x1FFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[6] >> 19) & 0x1FFF)) & 1))^((int64((in[6] >> 19) & 0x1FFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[6] >> 32) & 0x1FFF)) & 1))^((int64((in[6] >> 32) & 0x1FFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[6] >> 45) & 0x1FFF)) & 1))^((int64((in[6] >> 45) & 0x1FFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[6] >> 58) | ((in[7] & 0x7F) << 6)))) & 1))^((int64(((in[6] >> 58) | ((in[7] & 0x7F) << 6))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[7] >> 7) & 0x1FFF)) & 1))^((int64((in[7] >> 7) & 0x1FFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[7] >> 20) & 0x1FFF)) & 1))^((int64((in[7] >> 20) & 0x1FFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[7] >> 33) & 0x1FFF)) & 1))^((int64((in[7] >> 33) & 0x1FFF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[7] >> 46) & 0x1FFF)) & 1))^((int64((in[7] >> 46) & 0x1FFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[7] >> 59) | ((in[8] & 0xFF) << 5)))) & 1))^((int64(((in[7] >> 59) | ((in[8] & 0xFF) << 5))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[8] >> 8) & 0x1FFF)) & 1))^((int64((in[8] >> 8) & 0x1FFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[8] >> 21) & 0x1FFF)) & 1))^((int64((in[8] >> 21) & 0x1FFF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[8] >> 34) & 0x1FFF)) & 1))^((int64((in[8] >> 34) & 0x1FFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[8] >> 47) & 0x1FFF)) & 1))^((int64((in[8] >> 47) & 0x1FFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[8] >> 60) | ((in[9] & 0x1FF) << 4)))) & 1))^((int64(((in[8] >> 60) | ((in[9] & 0x1FF) << 4))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[9] >> 9) & 0x1FFF)) & 1))^((int64((in[9] >> 9) & 0x1FFF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[9] >> 22) & 0x1FFF)) & 1))^((int64((in[9] >> 22) & 0x1FFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[9] >> 35) & 0x1FFF)) & 1))^((int64((in[9] >> 35) & 0x1FFF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[9] >> 48) & 0x1FFF)) & 1))^((int64((in[9] >> 48) & 0x1FFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[9] >> 61) | ((in[10] & 0x3FF) << 3)))) & 1))^((int64(((in[9] >> 61) | ((in[10] & 0x3FF) << 3))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[10] >> 10) & 0x1FFF)) & 1))^((int64((in[10] >> 10) & 0x1FFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[10] >> 23) & 0x1FFF)) & 1))^((int64((in[10] >> 23) & 0x1FFF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[10] >> 36) & 0x1FFF)) & 1))^((int64((in[10] >> 36) & 0x1FFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[10] >> 49) & 0x1FFF)) & 1))^((int64((in[10] >> 49) & 0x1FFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[10] >> 62) | ((in[11] & 0x7FF) << 2)))) & 1))^((int64(((in[10] >> 62) | ((in[11] & 0x7FF) << 2))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[11] >> 11) & 0x1FFF)) & 1))^((int64((in[11] >> 11) & 0x1FFF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[11] >> 24) & 0x1FFF)) & 1))^((int64((in[11] >> 24) & 0x1FFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[11] >> 37) & 0x1FFF)) & 1))^((int64((in[11] >> 37) & 0x1FFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[11] >> 50) & 0x1FFF)) & 1))^((int64((in[11] >> 50) & 0x1FFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[11] >> 63) | ((in[12] & 0xFFF) << 1)))) & 1))^((int64(((in[11] >> 63) | ((in[12] & 0xFFF) << 1))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[12] >> 12) & 0x1FFF)) & 1))^((int64((in[12] >> 12) & 0x1FFF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[12] >> 25) & 0x1FFF)) & 1))^((int64((in[12] >> 25) & 0x1FFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[12] >> 38) & 0x1FFF)) & 1))^((int64((in[12] >> 38) & 0x1FFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[12] >> 51))) & 1))^((int64((in[12] >> 51)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_14(initoffset uint64, in *[14]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFF)) & 1))^((int64((in[0] >> 0) & 0x3FFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 14) & 0x3FFF)) & 1))^((int64((in[0] >> 14) & 0x3FFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 28) & 0x3FFF)) & 1))^((int64((in[0] >> 28) & 0x3FFF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 42) & 0x3FFF)) & 1))^((int64((in[0] >> 42) & 0x3FFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[0] >> 56) | ((in[1] & 0x3F) << 8)))) & 1))^((int64(((in[0] >> 56) | ((in[1] & 0x3F) << 8))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 6) & 0x3FFF)) & 1))^((int64((in[1] >> 6) & 0x3FFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 20) & 0x3FFF)) & 1))^((int64((in[1] >> 20) & 0x3FFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[1] >> 34) & 0x3FFF)) & 1))^((int64((in[1] >> 34) & 0x3FFF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[1] >> 48) & 0x3FFF)) & 1))^((int64((in[1] >> 48) & 0x3FFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0xFFF) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0xFFF) << 2))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[2] >> 12) & 0x3FFF)) & 1))^((int64((in[2] >> 12) & 0x3FFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[2] >> 26) & 0x3FFF)) & 1))^((int64((in[2] >> 26) & 0x3FFF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[2] >> 40) & 0x3FFF)) & 1))^((int64((in[2] >> 40) & 0x3FFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[2] >> 54) | ((in[3] & 0xF) << 10)))) & 1))^((int64(((in[2] >> 54) | ((in[3] & 0xF) << 10))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[3] >> 4) & 0x3FFF)) & 1))^((int64((in[3] >> 4) & 0x3FFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[3] >> 18) & 0x3FFF)) & 1))^((int64((in[3] >> 18) & 0x3FFF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[3] >> 32) & 0x3FFF)) & 1))^((int64((in[3] >> 32) & 0x3FFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[3] >> 46) & 0x3FFF)) & 1))^((int64((in[3] >> 46) & 0x3FFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x3FF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x3FF) << 4))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[4] >> 10) & 0x3FFF)) & 1))^((int64((in[4] >> 10) & 0x3FFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[4] >> 24) & 0x3FFF)) & 1))^((int64((in[4] >> 24) & 0x3FFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[4] >> 38) & 0x3FFF)) & 1))^((int64((in[4] >> 38) & 0x3FFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[4] >> 52) | ((in[5] & 0x3) << 12)))) & 1))^((int64(((in[4] >> 52) | ((in[5] & 0x3) << 12))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[5] >> 2) & 0x3FFF)) & 1))^((int64((in[5] >> 2) & 0x3FFF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[5] >> 16) & 0x3FFF)) & 1))^((int64((in[5] >> 16) & 0x3FFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[5] >> 30) & 0x3FFF)) & 1))^((int64((in[5] >> 30) & 0x3FFF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[5] >> 44) & 0x3FFF)) & 1))^((int64((in[5] >> 44) & 0x3FFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0xFF) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0xFF) << 6))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[6] >> 8) & 0x3FFF)) & 1))^((int64((in[6] >> 8) & 0x3FFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[6] >> 22) & 0x3FFF)) & 1))^((int64((in[6] >> 22) & 0x3FFF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[6] >> 36) & 0x3FFF)) & 1))^((int64((in[6] >> 36) & 0x3FFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[6] >> 50))) & 1))^((int64((in[6] >> 50)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[7] >> 0) & 0x3FFF)) & 1))^((int64((in[7] >> 0) & 0x3FFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[7] >> 14) & 0x3FFF)) & 1))^((int64((in[7] >> 14) & 0x3FFF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[7] >> 28) & 0x3FFF)) & 1))^((int64((in[7] >> 28) & 0x3FFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[7] >> 42) & 0x3FFF)) & 1))^((int64((in[7] >> 42) & 0x3FFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0x3F) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0x3F) << 8))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[8] >> 6) & 0x3FFF)) & 1))^((int64((in[8] >> 6) & 0x3FFF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[8] >> 20) & 0x3FFF)) & 1))^((int64((in[8] >> 20) & 0x3FFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[8] >> 34) & 0x3FFF)) & 1))^((int64((in[8] >> 34) & 0x3FFF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[8] >> 48) & 0x3FFF)) & 1))^((int64((in[8] >> 48) & 0x3FFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[8] >> 62) | ((in[9] & 0xFFF) << 2)))) & 1))^((int64(((in[8] >> 62) | ((in[9] & 0xFFF) << 2))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[9] >> 12) & 0x3FFF)) & 1))^((int64((in[9] >> 12) & 0x3FFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[9] >> 26) & 0x3FFF)) & 1))^((int64((in[9] >> 26) & 0x3FFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[9] >> 40) & 0x3FFF)) & 1))^((int64((in[9] >> 40) & 0x3FFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0xF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0xF) << 10))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[10] >> 4) & 0x3FFF)) & 1))^((int64((in[10] >> 4) & 0x3FFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[10] >> 18) & 0x3FFF)) & 1))^((int64((in[10] >> 18) & 0x3FFF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[10] >> 32) & 0x3FFF)) & 1))^((int64((in[10] >> 32) & 0x3FFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[10] >> 46) & 0x3FFF)) & 1))^((int64((in[10] >> 46) & 0x3FFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[10] >> 60) | ((in[11] & 0x3FF) << 4)))) & 1))^((int64(((in[10] >> 60) | ((in[11] & 0x3FF) << 4))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[11] >> 10) & 0x3FFF)) & 1))^((int64((in[11] >> 10) & 0x3FFF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[11] >> 24) & 0x3FFF)) & 1))^((int64((in[11] >> 24) & 0x3FFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[11] >> 38) & 0x3FFF)) & 1))^((int64((in[11] >> 38) & 0x3FFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0x3) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0x3) << 12))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[12] >> 2) & 0x3FFF)) & 1))^((int64((in[12] >> 2) & 0x3FFF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[12] >> 16) & 0x3FFF)) & 1))^((int64((in[12] >> 16) & 0x3FFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[12] >> 30) & 0x3FFF)) & 1))^((int64((in[12] >> 30) & 0x3FFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[12] >> 44) & 0x3FFF)) & 1))^((int64((in[12] >> 44) & 0x3FFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[12] >> 58) | ((in[13] & 0xFF) << 6)))) & 1))^((int64(((in[12] >> 58) | ((in[13] & 0xFF) << 6))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[13] >> 8) & 0x3FFF)) & 1))^((int64((in[13] >> 8) & 0x3FFF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[13] >> 22) & 0x3FFF)) & 1))^((int64((in[13] >> 22) & 0x3FFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[13] >> 36) & 0x3FFF)) & 1))^((int64((in[13] >> 36) & 0x3FFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[13] >> 50))) & 1))^((int64((in[13] >> 50)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_15(initoffset uint64, in *[15]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFF)) & 1))^((int64((in[0] >> 0) & 0x7FFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 15) & 0x7FFF)) & 1))^((int64((in[0] >> 15) & 0x7FFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 30) & 0x7FFF)) & 1))^((int64((in[0] >> 30) & 0x7FFF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 45) & 0x7FFF)) & 1))^((int64((in[0] >> 45) & 0x7FFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0x7FF) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0x7FF) << 4))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 11) & 0x7FFF)) & 1))^((int64((in[1] >> 11) & 0x7FFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 26) & 0x7FFF)) & 1))^((int64((in[1] >> 26) & 0x7FFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[1] >> 41) & 0x7FFF)) & 1))^((int64((in[1] >> 41) & 0x7FFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0x7F) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0x7F) << 8))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[2] >> 7) & 0x7FFF)) & 1))^((int64((in[2] >> 7) & 0x7FFF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[2] >> 22) & 0x7FFF)) & 1))^((int64((in[2] >> 22) & 0x7FFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[2] >> 37) & 0x7FFF)) & 1))^((int64((in[2] >> 37) & 0x7FFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[2] >> 52) | ((in[3] & 0x7) << 12)))) & 1))^((int64(((in[2] >> 52) | ((in[3] & 0x7) << 12))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[3] >> 3) & 0x7FFF)) & 1))^((int64((in[3] >> 3) & 0x7FFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[3] >> 18) & 0x7FFF)) & 1))^((int64((in[3] >> 18) & 0x7FFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[3] >> 33) & 0x7FFF)) & 1))^((int64((in[3] >> 33) & 0x7FFF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[3] >> 48) & 0x7FFF)) & 1))^((int64((in[3] >> 48) & 0x7FFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[3] >> 63) | ((in[4] & 0x3FFF) << 1)))) & 1))^((int64(((in[3] >> 63) | ((in[4] & 0x3FFF) << 1))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[4] >> 14) & 0x7FFF)) & 1))^((int64((in[4] >> 14) & 0x7FFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[4] >> 29) & 0x7FFF)) & 1))^((int64((in[4] >> 29) & 0x7FFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[4] >> 44) & 0x7FFF)) & 1))^((int64((in[4] >> 44) & 0x7FFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[4] >> 59) | ((in[5] & 0x3FF) << 5)))) & 1))^((int64(((in[4] >> 59) | ((in[5] & 0x3FF) << 5))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[5] >> 10) & 0x7FFF)) & 1))^((int64((in[5] >> 10) & 0x7FFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[5] >> 25) & 0x7FFF)) & 1))^((int64((in[5] >> 25) & 0x7FFF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[5] >> 40) & 0x7FFF)) & 1))^((int64((in[5] >> 40) & 0x7FFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[5] >> 55) | ((in[6] & 0x3F) << 9)))) & 1))^((int64(((in[5] >> 55) | ((in[6] & 0x3F) << 9))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[6] >> 6) & 0x7FFF)) & 1))^((int64((in[6] >> 6) & 0x7FFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[6] >> 21) & 0x7FFF)) & 1))^((int64((in[6] >> 21) & 0x7FFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[6] >> 36) & 0x7FFF)) & 1))^((int64((in[6] >> 36) & 0x7FFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[6] >> 51) | ((in[7] & 0x3) << 13)))) & 1))^((int64(((in[6] >> 51) | ((in[7] & 0x3) << 13))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[7] >> 2) & 0x7FFF)) & 1))^((int64((in[7] >> 2) & 0x7FFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[7] >> 17) & 0x7FFF)) & 1))^((int64((in[7] >> 17) & 0x7FFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[7] >> 32) & 0x7FFF)) & 1))^((int64((in[7] >> 32) & 0x7FFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[7] >> 47) & 0x7FFF)) & 1))^((int64((in[7] >> 47) & 0x7FFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[7] >> 62) | ((in[8] & 0x1FFF) << 2)))) & 1))^((int64(((in[7] >> 62) | ((in[8] & 0x1FFF) << 2))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[8] >> 13) & 0x7FFF)) & 1))^((int64((in[8] >> 13) & 0x7FFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[8] >> 28) & 0x7FFF)) & 1))^((int64((in[8] >> 28) & 0x7FFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[8] >> 43) & 0x7FFF)) & 1))^((int64((in[8] >> 43) & 0x7FFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[8] >> 58) | ((in[9] & 0x1FF) << 6)))) & 1))^((int64(((in[8] >> 58) | ((in[9] & 0x1FF) << 6))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[9] >> 9) & 0x7FFF)) & 1))^((int64((in[9] >> 9) & 0x7FFF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[9] >> 24) & 0x7FFF)) & 1))^((int64((in[9] >> 24) & 0x7FFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[9] >> 39) & 0x7FFF)) & 1))^((int64((in[9] >> 39) & 0x7FFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0x1F) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0x1F) << 10))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[10] >> 5) & 0x7FFF)) & 1))^((int64((in[10] >> 5) & 0x7FFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[10] >> 20) & 0x7FFF)) & 1))^((int64((in[10] >> 20) & 0x7FFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[10] >> 35) & 0x7FFF)) & 1))^((int64((in[10] >> 35) & 0x7FFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[10] >> 50) | ((in[11] & 0x1) << 14)))) & 1))^((int64(((in[10] >> 50) | ((in[11] & 0x1) << 14))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[11] >> 1) & 0x7FFF)) & 1))^((int64((in[11] >> 1) & 0x7FFF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[11] >> 16) & 0x7FFF)) & 1))^((int64((in[11] >> 16) & 0x7FFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[11] >> 31) & 0x7FFF)) & 1))^((int64((in[11] >> 31) & 0x7FFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[11] >> 46) & 0x7FFF)) & 1))^((int64((in[11] >> 46) & 0x7FFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[11] >> 61) | ((in[12] & 0xFFF) << 3)))) & 1))^((int64(((in[11] >> 61) | ((in[12] & 0xFFF) << 3))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[12] >> 12) & 0x7FFF)) & 1))^((int64((in[12] >> 12) & 0x7FFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[12] >> 27) & 0x7FFF)) & 1))^((int64((in[12] >> 27) & 0x7FFF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[12] >> 42) & 0x7FFF)) & 1))^((int64((in[12] >> 42) & 0x7FFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[12] >> 57) | ((in[13] & 0xFF) << 7)))) & 1))^((int64(((in[12] >> 57) | ((in[13] & 0xFF) << 7))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[13] >> 8) & 0x7FFF)) & 1))^((int64((in[13] >> 8) & 0x7FFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[13] >> 23) & 0x7FFF)) & 1))^((int64((in[13] >> 23) & 0x7FFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[13] >> 38) & 0x7FFF)) & 1))^((int64((in[13] >> 38) & 0x7FFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[13] >> 53) | ((in[14] & 0xF) << 11)))) & 1))^((int64(((in[13] >> 53) | ((in[14] & 0xF) << 11))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[14] >> 4) & 0x7FFF)) & 1))^((int64((in[14] >> 4) & 0x7FFF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[14] >> 19) & 0x7FFF)) & 1))^((int64((in[14] >> 19) & 0x7FFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[14] >> 34) & 0x7FFF)) & 1))^((int64((in[14] >> 34) & 0x7FFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[14] >> 49))) & 1))^((int64((in[14] >> 49)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_16(initoffset uint64, in *[16]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 16) & 0xFFFF)) & 1))^((int64((in[0] >> 16) & 0xFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 32) & 0xFFFF)) & 1))^((int64((in[0] >> 32) & 0xFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[0] >> 48))) & 1))^((int64((in[0] >> 48)))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 0) & 0xFFFF)) & 1))^((int64((in[1] >> 0) & 0xFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 16) & 0xFFFF)) & 1))^((int64((in[1] >> 16) & 0xFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 32) & 0xFFFF)) & 1))^((int64((in[1] >> 32) & 0xFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[1] >> 48))) & 1))^((int64((in[1] >> 48)))>>1))) + out[6] + out[8] = uint64(((-((int64((in[2] >> 0) & 0xFFFF)) & 1))^((int64((in[2] >> 0) & 0xFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[2] >> 16) & 0xFFFF)) & 1))^((int64((in[2] >> 16) & 0xFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[2] >> 32) & 0xFFFF)) & 1))^((int64((in[2] >> 32) & 0xFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[2] >> 48))) & 1))^((int64((in[2] >> 48)))>>1))) + out[10] + out[12] = uint64(((-((int64((in[3] >> 0) & 0xFFFF)) & 1))^((int64((in[3] >> 0) & 0xFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[3] >> 16) & 0xFFFF)) & 1))^((int64((in[3] >> 16) & 0xFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[3] >> 32) & 0xFFFF)) & 1))^((int64((in[3] >> 32) & 0xFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[3] >> 48))) & 1))^((int64((in[3] >> 48)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[4] >> 0) & 0xFFFF)) & 1))^((int64((in[4] >> 0) & 0xFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[4] >> 16) & 0xFFFF)) & 1))^((int64((in[4] >> 16) & 0xFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[4] >> 32) & 0xFFFF)) & 1))^((int64((in[4] >> 32) & 0xFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[4] >> 48))) & 1))^((int64((in[4] >> 48)))>>1))) + out[18] + out[20] = uint64(((-((int64((in[5] >> 0) & 0xFFFF)) & 1))^((int64((in[5] >> 0) & 0xFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[5] >> 16) & 0xFFFF)) & 1))^((int64((in[5] >> 16) & 0xFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[5] >> 32) & 0xFFFF)) & 1))^((int64((in[5] >> 32) & 0xFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[5] >> 48))) & 1))^((int64((in[5] >> 48)))>>1))) + out[22] + out[24] = uint64(((-((int64((in[6] >> 0) & 0xFFFF)) & 1))^((int64((in[6] >> 0) & 0xFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[6] >> 16) & 0xFFFF)) & 1))^((int64((in[6] >> 16) & 0xFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[6] >> 32) & 0xFFFF)) & 1))^((int64((in[6] >> 32) & 0xFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[6] >> 48))) & 1))^((int64((in[6] >> 48)))>>1))) + out[26] + out[28] = uint64(((-((int64((in[7] >> 0) & 0xFFFF)) & 1))^((int64((in[7] >> 0) & 0xFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[7] >> 16) & 0xFFFF)) & 1))^((int64((in[7] >> 16) & 0xFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[7] >> 32) & 0xFFFF)) & 1))^((int64((in[7] >> 32) & 0xFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[7] >> 48))) & 1))^((int64((in[7] >> 48)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[8] >> 0) & 0xFFFF)) & 1))^((int64((in[8] >> 0) & 0xFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[8] >> 16) & 0xFFFF)) & 1))^((int64((in[8] >> 16) & 0xFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[8] >> 32) & 0xFFFF)) & 1))^((int64((in[8] >> 32) & 0xFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[8] >> 48))) & 1))^((int64((in[8] >> 48)))>>1))) + out[34] + out[36] = uint64(((-((int64((in[9] >> 0) & 0xFFFF)) & 1))^((int64((in[9] >> 0) & 0xFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[9] >> 16) & 0xFFFF)) & 1))^((int64((in[9] >> 16) & 0xFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[9] >> 32) & 0xFFFF)) & 1))^((int64((in[9] >> 32) & 0xFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[9] >> 48))) & 1))^((int64((in[9] >> 48)))>>1))) + out[38] + out[40] = uint64(((-((int64((in[10] >> 0) & 0xFFFF)) & 1))^((int64((in[10] >> 0) & 0xFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[10] >> 16) & 0xFFFF)) & 1))^((int64((in[10] >> 16) & 0xFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[10] >> 32) & 0xFFFF)) & 1))^((int64((in[10] >> 32) & 0xFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[10] >> 48))) & 1))^((int64((in[10] >> 48)))>>1))) + out[42] + out[44] = uint64(((-((int64((in[11] >> 0) & 0xFFFF)) & 1))^((int64((in[11] >> 0) & 0xFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[11] >> 16) & 0xFFFF)) & 1))^((int64((in[11] >> 16) & 0xFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[11] >> 32) & 0xFFFF)) & 1))^((int64((in[11] >> 32) & 0xFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[11] >> 48))) & 1))^((int64((in[11] >> 48)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[12] >> 0) & 0xFFFF)) & 1))^((int64((in[12] >> 0) & 0xFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[12] >> 16) & 0xFFFF)) & 1))^((int64((in[12] >> 16) & 0xFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[12] >> 32) & 0xFFFF)) & 1))^((int64((in[12] >> 32) & 0xFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[12] >> 48))) & 1))^((int64((in[12] >> 48)))>>1))) + out[50] + out[52] = uint64(((-((int64((in[13] >> 0) & 0xFFFF)) & 1))^((int64((in[13] >> 0) & 0xFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[13] >> 16) & 0xFFFF)) & 1))^((int64((in[13] >> 16) & 0xFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[13] >> 32) & 0xFFFF)) & 1))^((int64((in[13] >> 32) & 0xFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[13] >> 48))) & 1))^((int64((in[13] >> 48)))>>1))) + out[54] + out[56] = uint64(((-((int64((in[14] >> 0) & 0xFFFF)) & 1))^((int64((in[14] >> 0) & 0xFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[14] >> 16) & 0xFFFF)) & 1))^((int64((in[14] >> 16) & 0xFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[14] >> 32) & 0xFFFF)) & 1))^((int64((in[14] >> 32) & 0xFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[14] >> 48))) & 1))^((int64((in[14] >> 48)))>>1))) + out[58] + out[60] = uint64(((-((int64((in[15] >> 0) & 0xFFFF)) & 1))^((int64((in[15] >> 0) & 0xFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[15] >> 16) & 0xFFFF)) & 1))^((int64((in[15] >> 16) & 0xFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[15] >> 32) & 0xFFFF)) & 1))^((int64((in[15] >> 32) & 0xFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[15] >> 48))) & 1))^((int64((in[15] >> 48)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_17(initoffset uint64, in *[17]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 17) & 0x1FFFF)) & 1))^((int64((in[0] >> 17) & 0x1FFFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 34) & 0x1FFFF)) & 1))^((int64((in[0] >> 34) & 0x1FFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[0] >> 51) | ((in[1] & 0xF) << 13)))) & 1))^((int64(((in[0] >> 51) | ((in[1] & 0xF) << 13))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 4) & 0x1FFFF)) & 1))^((int64((in[1] >> 4) & 0x1FFFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 21) & 0x1FFFF)) & 1))^((int64((in[1] >> 21) & 0x1FFFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 38) & 0x1FFFF)) & 1))^((int64((in[1] >> 38) & 0x1FFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[1] >> 55) | ((in[2] & 0xFF) << 9)))) & 1))^((int64(((in[1] >> 55) | ((in[2] & 0xFF) << 9))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[2] >> 8) & 0x1FFFF)) & 1))^((int64((in[2] >> 8) & 0x1FFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[2] >> 25) & 0x1FFFF)) & 1))^((int64((in[2] >> 25) & 0x1FFFF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[2] >> 42) & 0x1FFFF)) & 1))^((int64((in[2] >> 42) & 0x1FFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[2] >> 59) | ((in[3] & 0xFFF) << 5)))) & 1))^((int64(((in[2] >> 59) | ((in[3] & 0xFFF) << 5))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[3] >> 12) & 0x1FFFF)) & 1))^((int64((in[3] >> 12) & 0x1FFFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[3] >> 29) & 0x1FFFF)) & 1))^((int64((in[3] >> 29) & 0x1FFFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[3] >> 46) & 0x1FFFF)) & 1))^((int64((in[3] >> 46) & 0x1FFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[3] >> 63) | ((in[4] & 0xFFFF) << 1)))) & 1))^((int64(((in[3] >> 63) | ((in[4] & 0xFFFF) << 1))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[4] >> 16) & 0x1FFFF)) & 1))^((int64((in[4] >> 16) & 0x1FFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[4] >> 33) & 0x1FFFF)) & 1))^((int64((in[4] >> 33) & 0x1FFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[4] >> 50) | ((in[5] & 0x7) << 14)))) & 1))^((int64(((in[4] >> 50) | ((in[5] & 0x7) << 14))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[5] >> 3) & 0x1FFFF)) & 1))^((int64((in[5] >> 3) & 0x1FFFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[5] >> 20) & 0x1FFFF)) & 1))^((int64((in[5] >> 20) & 0x1FFFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[5] >> 37) & 0x1FFFF)) & 1))^((int64((in[5] >> 37) & 0x1FFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[5] >> 54) | ((in[6] & 0x7F) << 10)))) & 1))^((int64(((in[5] >> 54) | ((in[6] & 0x7F) << 10))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[6] >> 7) & 0x1FFFF)) & 1))^((int64((in[6] >> 7) & 0x1FFFF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[6] >> 24) & 0x1FFFF)) & 1))^((int64((in[6] >> 24) & 0x1FFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[6] >> 41) & 0x1FFFF)) & 1))^((int64((in[6] >> 41) & 0x1FFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[6] >> 58) | ((in[7] & 0x7FF) << 6)))) & 1))^((int64(((in[6] >> 58) | ((in[7] & 0x7FF) << 6))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[7] >> 11) & 0x1FFFF)) & 1))^((int64((in[7] >> 11) & 0x1FFFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[7] >> 28) & 0x1FFFF)) & 1))^((int64((in[7] >> 28) & 0x1FFFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[7] >> 45) & 0x1FFFF)) & 1))^((int64((in[7] >> 45) & 0x1FFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[7] >> 62) | ((in[8] & 0x7FFF) << 2)))) & 1))^((int64(((in[7] >> 62) | ((in[8] & 0x7FFF) << 2))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[8] >> 15) & 0x1FFFF)) & 1))^((int64((in[8] >> 15) & 0x1FFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[8] >> 32) & 0x1FFFF)) & 1))^((int64((in[8] >> 32) & 0x1FFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[8] >> 49) | ((in[9] & 0x3) << 15)))) & 1))^((int64(((in[8] >> 49) | ((in[9] & 0x3) << 15))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[9] >> 2) & 0x1FFFF)) & 1))^((int64((in[9] >> 2) & 0x1FFFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[9] >> 19) & 0x1FFFF)) & 1))^((int64((in[9] >> 19) & 0x1FFFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[9] >> 36) & 0x1FFFF)) & 1))^((int64((in[9] >> 36) & 0x1FFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[9] >> 53) | ((in[10] & 0x3F) << 11)))) & 1))^((int64(((in[9] >> 53) | ((in[10] & 0x3F) << 11))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[10] >> 6) & 0x1FFFF)) & 1))^((int64((in[10] >> 6) & 0x1FFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[10] >> 23) & 0x1FFFF)) & 1))^((int64((in[10] >> 23) & 0x1FFFF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[10] >> 40) & 0x1FFFF)) & 1))^((int64((in[10] >> 40) & 0x1FFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[10] >> 57) | ((in[11] & 0x3FF) << 7)))) & 1))^((int64(((in[10] >> 57) | ((in[11] & 0x3FF) << 7))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[11] >> 10) & 0x1FFFF)) & 1))^((int64((in[11] >> 10) & 0x1FFFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[11] >> 27) & 0x1FFFF)) & 1))^((int64((in[11] >> 27) & 0x1FFFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[11] >> 44) & 0x1FFFF)) & 1))^((int64((in[11] >> 44) & 0x1FFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[11] >> 61) | ((in[12] & 0x3FFF) << 3)))) & 1))^((int64(((in[11] >> 61) | ((in[12] & 0x3FFF) << 3))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[12] >> 14) & 0x1FFFF)) & 1))^((int64((in[12] >> 14) & 0x1FFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[12] >> 31) & 0x1FFFF)) & 1))^((int64((in[12] >> 31) & 0x1FFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[12] >> 48) | ((in[13] & 0x1) << 16)))) & 1))^((int64(((in[12] >> 48) | ((in[13] & 0x1) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[13] >> 1) & 0x1FFFF)) & 1))^((int64((in[13] >> 1) & 0x1FFFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[13] >> 18) & 0x1FFFF)) & 1))^((int64((in[13] >> 18) & 0x1FFFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[13] >> 35) & 0x1FFFF)) & 1))^((int64((in[13] >> 35) & 0x1FFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[13] >> 52) | ((in[14] & 0x1F) << 12)))) & 1))^((int64(((in[13] >> 52) | ((in[14] & 0x1F) << 12))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[14] >> 5) & 0x1FFFF)) & 1))^((int64((in[14] >> 5) & 0x1FFFF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[14] >> 22) & 0x1FFFF)) & 1))^((int64((in[14] >> 22) & 0x1FFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[14] >> 39) & 0x1FFFF)) & 1))^((int64((in[14] >> 39) & 0x1FFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[14] >> 56) | ((in[15] & 0x1FF) << 8)))) & 1))^((int64(((in[14] >> 56) | ((in[15] & 0x1FF) << 8))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[15] >> 9) & 0x1FFFF)) & 1))^((int64((in[15] >> 9) & 0x1FFFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[15] >> 26) & 0x1FFFF)) & 1))^((int64((in[15] >> 26) & 0x1FFFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[15] >> 43) & 0x1FFFF)) & 1))^((int64((in[15] >> 43) & 0x1FFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[15] >> 60) | ((in[16] & 0x1FFF) << 4)))) & 1))^((int64(((in[15] >> 60) | ((in[16] & 0x1FFF) << 4))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[16] >> 13) & 0x1FFFF)) & 1))^((int64((in[16] >> 13) & 0x1FFFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[16] >> 30) & 0x1FFFF)) & 1))^((int64((in[16] >> 30) & 0x1FFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[16] >> 47))) & 1))^((int64((in[16] >> 47)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_18(initoffset uint64, in *[18]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 18) & 0x3FFFF)) & 1))^((int64((in[0] >> 18) & 0x3FFFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 36) & 0x3FFFF)) & 1))^((int64((in[0] >> 36) & 0x3FFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[0] >> 54) | ((in[1] & 0xFF) << 10)))) & 1))^((int64(((in[0] >> 54) | ((in[1] & 0xFF) << 10))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 8) & 0x3FFFF)) & 1))^((int64((in[1] >> 8) & 0x3FFFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 26) & 0x3FFFF)) & 1))^((int64((in[1] >> 26) & 0x3FFFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[1] >> 44) & 0x3FFFF)) & 1))^((int64((in[1] >> 44) & 0x3FFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0xFFFF) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0xFFFF) << 2))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[2] >> 16) & 0x3FFFF)) & 1))^((int64((in[2] >> 16) & 0x3FFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[2] >> 34) & 0x3FFFF)) & 1))^((int64((in[2] >> 34) & 0x3FFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[2] >> 52) | ((in[3] & 0x3F) << 12)))) & 1))^((int64(((in[2] >> 52) | ((in[3] & 0x3F) << 12))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[3] >> 6) & 0x3FFFF)) & 1))^((int64((in[3] >> 6) & 0x3FFFF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[3] >> 24) & 0x3FFFF)) & 1))^((int64((in[3] >> 24) & 0x3FFFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[3] >> 42) & 0x3FFFF)) & 1))^((int64((in[3] >> 42) & 0x3FFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x3FFF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x3FFF) << 4))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[4] >> 14) & 0x3FFFF)) & 1))^((int64((in[4] >> 14) & 0x3FFFF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[4] >> 32) & 0x3FFFF)) & 1))^((int64((in[4] >> 32) & 0x3FFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[4] >> 50) | ((in[5] & 0xF) << 14)))) & 1))^((int64(((in[4] >> 50) | ((in[5] & 0xF) << 14))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[5] >> 4) & 0x3FFFF)) & 1))^((int64((in[5] >> 4) & 0x3FFFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[5] >> 22) & 0x3FFFF)) & 1))^((int64((in[5] >> 22) & 0x3FFFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[5] >> 40) & 0x3FFFF)) & 1))^((int64((in[5] >> 40) & 0x3FFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0xFFF) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0xFFF) << 6))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[6] >> 12) & 0x3FFFF)) & 1))^((int64((in[6] >> 12) & 0x3FFFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[6] >> 30) & 0x3FFFF)) & 1))^((int64((in[6] >> 30) & 0x3FFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[6] >> 48) | ((in[7] & 0x3) << 16)))) & 1))^((int64(((in[6] >> 48) | ((in[7] & 0x3) << 16))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[7] >> 2) & 0x3FFFF)) & 1))^((int64((in[7] >> 2) & 0x3FFFF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[7] >> 20) & 0x3FFFF)) & 1))^((int64((in[7] >> 20) & 0x3FFFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[7] >> 38) & 0x3FFFF)) & 1))^((int64((in[7] >> 38) & 0x3FFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0x3FF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0x3FF) << 8))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[8] >> 10) & 0x3FFFF)) & 1))^((int64((in[8] >> 10) & 0x3FFFF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[8] >> 28) & 0x3FFFF)) & 1))^((int64((in[8] >> 28) & 0x3FFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[8] >> 46))) & 1))^((int64((in[8] >> 46)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[9] >> 0) & 0x3FFFF)) & 1))^((int64((in[9] >> 0) & 0x3FFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[9] >> 18) & 0x3FFFF)) & 1))^((int64((in[9] >> 18) & 0x3FFFF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[9] >> 36) & 0x3FFFF)) & 1))^((int64((in[9] >> 36) & 0x3FFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0xFF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0xFF) << 10))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[10] >> 8) & 0x3FFFF)) & 1))^((int64((in[10] >> 8) & 0x3FFFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[10] >> 26) & 0x3FFFF)) & 1))^((int64((in[10] >> 26) & 0x3FFFF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[10] >> 44) & 0x3FFFF)) & 1))^((int64((in[10] >> 44) & 0x3FFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[10] >> 62) | ((in[11] & 0xFFFF) << 2)))) & 1))^((int64(((in[10] >> 62) | ((in[11] & 0xFFFF) << 2))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[11] >> 16) & 0x3FFFF)) & 1))^((int64((in[11] >> 16) & 0x3FFFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[11] >> 34) & 0x3FFFF)) & 1))^((int64((in[11] >> 34) & 0x3FFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0x3F) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0x3F) << 12))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[12] >> 6) & 0x3FFFF)) & 1))^((int64((in[12] >> 6) & 0x3FFFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[12] >> 24) & 0x3FFFF)) & 1))^((int64((in[12] >> 24) & 0x3FFFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[12] >> 42) & 0x3FFFF)) & 1))^((int64((in[12] >> 42) & 0x3FFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[12] >> 60) | ((in[13] & 0x3FFF) << 4)))) & 1))^((int64(((in[12] >> 60) | ((in[13] & 0x3FFF) << 4))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[13] >> 14) & 0x3FFFF)) & 1))^((int64((in[13] >> 14) & 0x3FFFF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[13] >> 32) & 0x3FFFF)) & 1))^((int64((in[13] >> 32) & 0x3FFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[13] >> 50) | ((in[14] & 0xF) << 14)))) & 1))^((int64(((in[13] >> 50) | ((in[14] & 0xF) << 14))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[14] >> 4) & 0x3FFFF)) & 1))^((int64((in[14] >> 4) & 0x3FFFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[14] >> 22) & 0x3FFFF)) & 1))^((int64((in[14] >> 22) & 0x3FFFF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[14] >> 40) & 0x3FFFF)) & 1))^((int64((in[14] >> 40) & 0x3FFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[14] >> 58) | ((in[15] & 0xFFF) << 6)))) & 1))^((int64(((in[14] >> 58) | ((in[15] & 0xFFF) << 6))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[15] >> 12) & 0x3FFFF)) & 1))^((int64((in[15] >> 12) & 0x3FFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[15] >> 30) & 0x3FFFF)) & 1))^((int64((in[15] >> 30) & 0x3FFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0x3) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0x3) << 16))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[16] >> 2) & 0x3FFFF)) & 1))^((int64((in[16] >> 2) & 0x3FFFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[16] >> 20) & 0x3FFFF)) & 1))^((int64((in[16] >> 20) & 0x3FFFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[16] >> 38) & 0x3FFFF)) & 1))^((int64((in[16] >> 38) & 0x3FFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0x3FF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0x3FF) << 8))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[17] >> 10) & 0x3FFFF)) & 1))^((int64((in[17] >> 10) & 0x3FFFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[17] >> 28) & 0x3FFFF)) & 1))^((int64((in[17] >> 28) & 0x3FFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[17] >> 46))) & 1))^((int64((in[17] >> 46)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_19(initoffset uint64, in *[19]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 19) & 0x7FFFF)) & 1))^((int64((in[0] >> 19) & 0x7FFFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 38) & 0x7FFFF)) & 1))^((int64((in[0] >> 38) & 0x7FFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[0] >> 57) | ((in[1] & 0xFFF) << 7)))) & 1))^((int64(((in[0] >> 57) | ((in[1] & 0xFFF) << 7))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 12) & 0x7FFFF)) & 1))^((int64((in[1] >> 12) & 0x7FFFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 31) & 0x7FFFF)) & 1))^((int64((in[1] >> 31) & 0x7FFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[1] >> 50) | ((in[2] & 0x1F) << 14)))) & 1))^((int64(((in[1] >> 50) | ((in[2] & 0x1F) << 14))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[2] >> 5) & 0x7FFFF)) & 1))^((int64((in[2] >> 5) & 0x7FFFF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[2] >> 24) & 0x7FFFF)) & 1))^((int64((in[2] >> 24) & 0x7FFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[2] >> 43) & 0x7FFFF)) & 1))^((int64((in[2] >> 43) & 0x7FFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[2] >> 62) | ((in[3] & 0x1FFFF) << 2)))) & 1))^((int64(((in[2] >> 62) | ((in[3] & 0x1FFFF) << 2))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[3] >> 17) & 0x7FFFF)) & 1))^((int64((in[3] >> 17) & 0x7FFFF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[3] >> 36) & 0x7FFFF)) & 1))^((int64((in[3] >> 36) & 0x7FFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[3] >> 55) | ((in[4] & 0x3FF) << 9)))) & 1))^((int64(((in[3] >> 55) | ((in[4] & 0x3FF) << 9))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[4] >> 10) & 0x7FFFF)) & 1))^((int64((in[4] >> 10) & 0x7FFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[4] >> 29) & 0x7FFFF)) & 1))^((int64((in[4] >> 29) & 0x7FFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[4] >> 48) | ((in[5] & 0x7) << 16)))) & 1))^((int64(((in[4] >> 48) | ((in[5] & 0x7) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[5] >> 3) & 0x7FFFF)) & 1))^((int64((in[5] >> 3) & 0x7FFFF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[5] >> 22) & 0x7FFFF)) & 1))^((int64((in[5] >> 22) & 0x7FFFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[5] >> 41) & 0x7FFFF)) & 1))^((int64((in[5] >> 41) & 0x7FFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[5] >> 60) | ((in[6] & 0x7FFF) << 4)))) & 1))^((int64(((in[5] >> 60) | ((in[6] & 0x7FFF) << 4))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[6] >> 15) & 0x7FFFF)) & 1))^((int64((in[6] >> 15) & 0x7FFFF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[6] >> 34) & 0x7FFFF)) & 1))^((int64((in[6] >> 34) & 0x7FFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[6] >> 53) | ((in[7] & 0xFF) << 11)))) & 1))^((int64(((in[6] >> 53) | ((in[7] & 0xFF) << 11))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[7] >> 8) & 0x7FFFF)) & 1))^((int64((in[7] >> 8) & 0x7FFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[7] >> 27) & 0x7FFFF)) & 1))^((int64((in[7] >> 27) & 0x7FFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[7] >> 46) | ((in[8] & 0x1) << 18)))) & 1))^((int64(((in[7] >> 46) | ((in[8] & 0x1) << 18))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[8] >> 1) & 0x7FFFF)) & 1))^((int64((in[8] >> 1) & 0x7FFFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[8] >> 20) & 0x7FFFF)) & 1))^((int64((in[8] >> 20) & 0x7FFFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[8] >> 39) & 0x7FFFF)) & 1))^((int64((in[8] >> 39) & 0x7FFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[8] >> 58) | ((in[9] & 0x1FFF) << 6)))) & 1))^((int64(((in[8] >> 58) | ((in[9] & 0x1FFF) << 6))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[9] >> 13) & 0x7FFFF)) & 1))^((int64((in[9] >> 13) & 0x7FFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[9] >> 32) & 0x7FFFF)) & 1))^((int64((in[9] >> 32) & 0x7FFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[9] >> 51) | ((in[10] & 0x3F) << 13)))) & 1))^((int64(((in[9] >> 51) | ((in[10] & 0x3F) << 13))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[10] >> 6) & 0x7FFFF)) & 1))^((int64((in[10] >> 6) & 0x7FFFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[10] >> 25) & 0x7FFFF)) & 1))^((int64((in[10] >> 25) & 0x7FFFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[10] >> 44) & 0x7FFFF)) & 1))^((int64((in[10] >> 44) & 0x7FFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[10] >> 63) | ((in[11] & 0x3FFFF) << 1)))) & 1))^((int64(((in[10] >> 63) | ((in[11] & 0x3FFFF) << 1))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[11] >> 18) & 0x7FFFF)) & 1))^((int64((in[11] >> 18) & 0x7FFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[11] >> 37) & 0x7FFFF)) & 1))^((int64((in[11] >> 37) & 0x7FFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[11] >> 56) | ((in[12] & 0x7FF) << 8)))) & 1))^((int64(((in[11] >> 56) | ((in[12] & 0x7FF) << 8))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[12] >> 11) & 0x7FFFF)) & 1))^((int64((in[12] >> 11) & 0x7FFFF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[12] >> 30) & 0x7FFFF)) & 1))^((int64((in[12] >> 30) & 0x7FFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[12] >> 49) | ((in[13] & 0xF) << 15)))) & 1))^((int64(((in[12] >> 49) | ((in[13] & 0xF) << 15))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[13] >> 4) & 0x7FFFF)) & 1))^((int64((in[13] >> 4) & 0x7FFFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[13] >> 23) & 0x7FFFF)) & 1))^((int64((in[13] >> 23) & 0x7FFFF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[13] >> 42) & 0x7FFFF)) & 1))^((int64((in[13] >> 42) & 0x7FFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[13] >> 61) | ((in[14] & 0xFFFF) << 3)))) & 1))^((int64(((in[13] >> 61) | ((in[14] & 0xFFFF) << 3))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[14] >> 16) & 0x7FFFF)) & 1))^((int64((in[14] >> 16) & 0x7FFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[14] >> 35) & 0x7FFFF)) & 1))^((int64((in[14] >> 35) & 0x7FFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[14] >> 54) | ((in[15] & 0x1FF) << 10)))) & 1))^((int64(((in[14] >> 54) | ((in[15] & 0x1FF) << 10))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[15] >> 9) & 0x7FFFF)) & 1))^((int64((in[15] >> 9) & 0x7FFFF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[15] >> 28) & 0x7FFFF)) & 1))^((int64((in[15] >> 28) & 0x7FFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[15] >> 47) | ((in[16] & 0x3) << 17)))) & 1))^((int64(((in[15] >> 47) | ((in[16] & 0x3) << 17))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[16] >> 2) & 0x7FFFF)) & 1))^((int64((in[16] >> 2) & 0x7FFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[16] >> 21) & 0x7FFFF)) & 1))^((int64((in[16] >> 21) & 0x7FFFF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[16] >> 40) & 0x7FFFF)) & 1))^((int64((in[16] >> 40) & 0x7FFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[16] >> 59) | ((in[17] & 0x3FFF) << 5)))) & 1))^((int64(((in[16] >> 59) | ((in[17] & 0x3FFF) << 5))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[17] >> 14) & 0x7FFFF)) & 1))^((int64((in[17] >> 14) & 0x7FFFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[17] >> 33) & 0x7FFFF)) & 1))^((int64((in[17] >> 33) & 0x7FFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[17] >> 52) | ((in[18] & 0x7F) << 12)))) & 1))^((int64(((in[17] >> 52) | ((in[18] & 0x7F) << 12))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[18] >> 7) & 0x7FFFF)) & 1))^((int64((in[18] >> 7) & 0x7FFFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[18] >> 26) & 0x7FFFF)) & 1))^((int64((in[18] >> 26) & 0x7FFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[18] >> 45))) & 1))^((int64((in[18] >> 45)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_20(initoffset uint64, in *[20]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 20) & 0xFFFFF)) & 1))^((int64((in[0] >> 20) & 0xFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 40) & 0xFFFFF)) & 1))^((int64((in[0] >> 40) & 0xFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0xFFFF) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0xFFFF) << 4))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 16) & 0xFFFFF)) & 1))^((int64((in[1] >> 16) & 0xFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 36) & 0xFFFFF)) & 1))^((int64((in[1] >> 36) & 0xFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0xFFF) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0xFFF) << 8))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[2] >> 12) & 0xFFFFF)) & 1))^((int64((in[2] >> 12) & 0xFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[2] >> 32) & 0xFFFFF)) & 1))^((int64((in[2] >> 32) & 0xFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[2] >> 52) | ((in[3] & 0xFF) << 12)))) & 1))^((int64(((in[2] >> 52) | ((in[3] & 0xFF) << 12))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[3] >> 8) & 0xFFFFF)) & 1))^((int64((in[3] >> 8) & 0xFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[3] >> 28) & 0xFFFFF)) & 1))^((int64((in[3] >> 28) & 0xFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[3] >> 48) | ((in[4] & 0xF) << 16)))) & 1))^((int64(((in[3] >> 48) | ((in[4] & 0xF) << 16))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[4] >> 4) & 0xFFFFF)) & 1))^((int64((in[4] >> 4) & 0xFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[4] >> 24) & 0xFFFFF)) & 1))^((int64((in[4] >> 24) & 0xFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[4] >> 44))) & 1))^((int64((in[4] >> 44)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[5] >> 0) & 0xFFFFF)) & 1))^((int64((in[5] >> 0) & 0xFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[5] >> 20) & 0xFFFFF)) & 1))^((int64((in[5] >> 20) & 0xFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[5] >> 40) & 0xFFFFF)) & 1))^((int64((in[5] >> 40) & 0xFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[5] >> 60) | ((in[6] & 0xFFFF) << 4)))) & 1))^((int64(((in[5] >> 60) | ((in[6] & 0xFFFF) << 4))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[6] >> 16) & 0xFFFFF)) & 1))^((int64((in[6] >> 16) & 0xFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[6] >> 36) & 0xFFFFF)) & 1))^((int64((in[6] >> 36) & 0xFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[6] >> 56) | ((in[7] & 0xFFF) << 8)))) & 1))^((int64(((in[6] >> 56) | ((in[7] & 0xFFF) << 8))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[7] >> 12) & 0xFFFFF)) & 1))^((int64((in[7] >> 12) & 0xFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[7] >> 32) & 0xFFFFF)) & 1))^((int64((in[7] >> 32) & 0xFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[7] >> 52) | ((in[8] & 0xFF) << 12)))) & 1))^((int64(((in[7] >> 52) | ((in[8] & 0xFF) << 12))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[8] >> 8) & 0xFFFFF)) & 1))^((int64((in[8] >> 8) & 0xFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[8] >> 28) & 0xFFFFF)) & 1))^((int64((in[8] >> 28) & 0xFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[8] >> 48) | ((in[9] & 0xF) << 16)))) & 1))^((int64(((in[8] >> 48) | ((in[9] & 0xF) << 16))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[9] >> 4) & 0xFFFFF)) & 1))^((int64((in[9] >> 4) & 0xFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64((in[9] >> 24) & 0xFFFFF)) & 1))^((int64((in[9] >> 24) & 0xFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[9] >> 44))) & 1))^((int64((in[9] >> 44)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[10] >> 0) & 0xFFFFF)) & 1))^((int64((in[10] >> 0) & 0xFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[10] >> 20) & 0xFFFFF)) & 1))^((int64((in[10] >> 20) & 0xFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64((in[10] >> 40) & 0xFFFFF)) & 1))^((int64((in[10] >> 40) & 0xFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[10] >> 60) | ((in[11] & 0xFFFF) << 4)))) & 1))^((int64(((in[10] >> 60) | ((in[11] & 0xFFFF) << 4))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[11] >> 16) & 0xFFFFF)) & 1))^((int64((in[11] >> 16) & 0xFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[11] >> 36) & 0xFFFFF)) & 1))^((int64((in[11] >> 36) & 0xFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[11] >> 56) | ((in[12] & 0xFFF) << 8)))) & 1))^((int64(((in[11] >> 56) | ((in[12] & 0xFFF) << 8))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[12] >> 12) & 0xFFFFF)) & 1))^((int64((in[12] >> 12) & 0xFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[12] >> 32) & 0xFFFFF)) & 1))^((int64((in[12] >> 32) & 0xFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[12] >> 52) | ((in[13] & 0xFF) << 12)))) & 1))^((int64(((in[12] >> 52) | ((in[13] & 0xFF) << 12))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[13] >> 8) & 0xFFFFF)) & 1))^((int64((in[13] >> 8) & 0xFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[13] >> 28) & 0xFFFFF)) & 1))^((int64((in[13] >> 28) & 0xFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[13] >> 48) | ((in[14] & 0xF) << 16)))) & 1))^((int64(((in[13] >> 48) | ((in[14] & 0xF) << 16))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[14] >> 4) & 0xFFFFF)) & 1))^((int64((in[14] >> 4) & 0xFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[14] >> 24) & 0xFFFFF)) & 1))^((int64((in[14] >> 24) & 0xFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[14] >> 44))) & 1))^((int64((in[14] >> 44)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[15] >> 0) & 0xFFFFF)) & 1))^((int64((in[15] >> 0) & 0xFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[15] >> 20) & 0xFFFFF)) & 1))^((int64((in[15] >> 20) & 0xFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[15] >> 40) & 0xFFFFF)) & 1))^((int64((in[15] >> 40) & 0xFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[15] >> 60) | ((in[16] & 0xFFFF) << 4)))) & 1))^((int64(((in[15] >> 60) | ((in[16] & 0xFFFF) << 4))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[16] >> 16) & 0xFFFFF)) & 1))^((int64((in[16] >> 16) & 0xFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[16] >> 36) & 0xFFFFF)) & 1))^((int64((in[16] >> 36) & 0xFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0xFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0xFFF) << 8))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[17] >> 12) & 0xFFFFF)) & 1))^((int64((in[17] >> 12) & 0xFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[17] >> 32) & 0xFFFFF)) & 1))^((int64((in[17] >> 32) & 0xFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[17] >> 52) | ((in[18] & 0xFF) << 12)))) & 1))^((int64(((in[17] >> 52) | ((in[18] & 0xFF) << 12))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[18] >> 8) & 0xFFFFF)) & 1))^((int64((in[18] >> 8) & 0xFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[18] >> 28) & 0xFFFFF)) & 1))^((int64((in[18] >> 28) & 0xFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0xF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0xF) << 16))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[19] >> 4) & 0xFFFFF)) & 1))^((int64((in[19] >> 4) & 0xFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[19] >> 24) & 0xFFFFF)) & 1))^((int64((in[19] >> 24) & 0xFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[19] >> 44))) & 1))^((int64((in[19] >> 44)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_21(initoffset uint64, in *[21]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 21) & 0x1FFFFF)) & 1))^((int64((in[0] >> 21) & 0x1FFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64((in[0] >> 42) & 0x1FFFFF)) & 1))^((int64((in[0] >> 42) & 0x1FFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[0] >> 63) | ((in[1] & 0xFFFFF) << 1)))) & 1))^((int64(((in[0] >> 63) | ((in[1] & 0xFFFFF) << 1))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 20) & 0x1FFFFF)) & 1))^((int64((in[1] >> 20) & 0x1FFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[1] >> 41) & 0x1FFFFF)) & 1))^((int64((in[1] >> 41) & 0x1FFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0x7FFFF) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0x7FFFF) << 2))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[2] >> 19) & 0x1FFFFF)) & 1))^((int64((in[2] >> 19) & 0x1FFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[2] >> 40) & 0x1FFFFF)) & 1))^((int64((in[2] >> 40) & 0x1FFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[2] >> 61) | ((in[3] & 0x3FFFF) << 3)))) & 1))^((int64(((in[2] >> 61) | ((in[3] & 0x3FFFF) << 3))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[3] >> 18) & 0x1FFFFF)) & 1))^((int64((in[3] >> 18) & 0x1FFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[3] >> 39) & 0x1FFFFF)) & 1))^((int64((in[3] >> 39) & 0x1FFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x1FFFF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x1FFFF) << 4))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[4] >> 17) & 0x1FFFFF)) & 1))^((int64((in[4] >> 17) & 0x1FFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[4] >> 38) & 0x1FFFFF)) & 1))^((int64((in[4] >> 38) & 0x1FFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[4] >> 59) | ((in[5] & 0xFFFF) << 5)))) & 1))^((int64(((in[4] >> 59) | ((in[5] & 0xFFFF) << 5))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[5] >> 16) & 0x1FFFFF)) & 1))^((int64((in[5] >> 16) & 0x1FFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[5] >> 37) & 0x1FFFFF)) & 1))^((int64((in[5] >> 37) & 0x1FFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0x7FFF) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0x7FFF) << 6))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[6] >> 15) & 0x1FFFFF)) & 1))^((int64((in[6] >> 15) & 0x1FFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[6] >> 36) & 0x1FFFFF)) & 1))^((int64((in[6] >> 36) & 0x1FFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[6] >> 57) | ((in[7] & 0x3FFF) << 7)))) & 1))^((int64(((in[6] >> 57) | ((in[7] & 0x3FFF) << 7))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[7] >> 14) & 0x1FFFFF)) & 1))^((int64((in[7] >> 14) & 0x1FFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[7] >> 35) & 0x1FFFFF)) & 1))^((int64((in[7] >> 35) & 0x1FFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0x1FFF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0x1FFF) << 8))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[8] >> 13) & 0x1FFFFF)) & 1))^((int64((in[8] >> 13) & 0x1FFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[8] >> 34) & 0x1FFFFF)) & 1))^((int64((in[8] >> 34) & 0x1FFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[8] >> 55) | ((in[9] & 0xFFF) << 9)))) & 1))^((int64(((in[8] >> 55) | ((in[9] & 0xFFF) << 9))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[9] >> 12) & 0x1FFFFF)) & 1))^((int64((in[9] >> 12) & 0x1FFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[9] >> 33) & 0x1FFFFF)) & 1))^((int64((in[9] >> 33) & 0x1FFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0x7FF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0x7FF) << 10))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[10] >> 11) & 0x1FFFFF)) & 1))^((int64((in[10] >> 11) & 0x1FFFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[10] >> 32) & 0x1FFFFF)) & 1))^((int64((in[10] >> 32) & 0x1FFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[10] >> 53) | ((in[11] & 0x3FF) << 11)))) & 1))^((int64(((in[10] >> 53) | ((in[11] & 0x3FF) << 11))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[11] >> 10) & 0x1FFFFF)) & 1))^((int64((in[11] >> 10) & 0x1FFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[11] >> 31) & 0x1FFFFF)) & 1))^((int64((in[11] >> 31) & 0x1FFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0x1FF) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0x1FF) << 12))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[12] >> 9) & 0x1FFFFF)) & 1))^((int64((in[12] >> 9) & 0x1FFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[12] >> 30) & 0x1FFFFF)) & 1))^((int64((in[12] >> 30) & 0x1FFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[12] >> 51) | ((in[13] & 0xFF) << 13)))) & 1))^((int64(((in[12] >> 51) | ((in[13] & 0xFF) << 13))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[13] >> 8) & 0x1FFFFF)) & 1))^((int64((in[13] >> 8) & 0x1FFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[13] >> 29) & 0x1FFFFF)) & 1))^((int64((in[13] >> 29) & 0x1FFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[13] >> 50) | ((in[14] & 0x7F) << 14)))) & 1))^((int64(((in[13] >> 50) | ((in[14] & 0x7F) << 14))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[14] >> 7) & 0x1FFFFF)) & 1))^((int64((in[14] >> 7) & 0x1FFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[14] >> 28) & 0x1FFFFF)) & 1))^((int64((in[14] >> 28) & 0x1FFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[14] >> 49) | ((in[15] & 0x3F) << 15)))) & 1))^((int64(((in[14] >> 49) | ((in[15] & 0x3F) << 15))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[15] >> 6) & 0x1FFFFF)) & 1))^((int64((in[15] >> 6) & 0x1FFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[15] >> 27) & 0x1FFFFF)) & 1))^((int64((in[15] >> 27) & 0x1FFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0x1F) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0x1F) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[16] >> 5) & 0x1FFFFF)) & 1))^((int64((in[16] >> 5) & 0x1FFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[16] >> 26) & 0x1FFFFF)) & 1))^((int64((in[16] >> 26) & 0x1FFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[16] >> 47) | ((in[17] & 0xF) << 17)))) & 1))^((int64(((in[16] >> 47) | ((in[17] & 0xF) << 17))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[17] >> 4) & 0x1FFFFF)) & 1))^((int64((in[17] >> 4) & 0x1FFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[17] >> 25) & 0x1FFFFF)) & 1))^((int64((in[17] >> 25) & 0x1FFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[17] >> 46) | ((in[18] & 0x7) << 18)))) & 1))^((int64(((in[17] >> 46) | ((in[18] & 0x7) << 18))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[18] >> 3) & 0x1FFFFF)) & 1))^((int64((in[18] >> 3) & 0x1FFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[18] >> 24) & 0x1FFFFF)) & 1))^((int64((in[18] >> 24) & 0x1FFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[18] >> 45) | ((in[19] & 0x3) << 19)))) & 1))^((int64(((in[18] >> 45) | ((in[19] & 0x3) << 19))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[19] >> 2) & 0x1FFFFF)) & 1))^((int64((in[19] >> 2) & 0x1FFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[19] >> 23) & 0x1FFFFF)) & 1))^((int64((in[19] >> 23) & 0x1FFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0x1) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0x1) << 20))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[20] >> 1) & 0x1FFFFF)) & 1))^((int64((in[20] >> 1) & 0x1FFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64((in[20] >> 22) & 0x1FFFFF)) & 1))^((int64((in[20] >> 22) & 0x1FFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[20] >> 43))) & 1))^((int64((in[20] >> 43)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_22(initoffset uint64, in *[22]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 22) & 0x3FFFFF)) & 1))^((int64((in[0] >> 22) & 0x3FFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 44) | ((in[1] & 0x3) << 20)))) & 1))^((int64(((in[0] >> 44) | ((in[1] & 0x3) << 20))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 2) & 0x3FFFFF)) & 1))^((int64((in[1] >> 2) & 0x3FFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 24) & 0x3FFFFF)) & 1))^((int64((in[1] >> 24) & 0x3FFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[1] >> 46) | ((in[2] & 0xF) << 18)))) & 1))^((int64(((in[1] >> 46) | ((in[2] & 0xF) << 18))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[2] >> 4) & 0x3FFFFF)) & 1))^((int64((in[2] >> 4) & 0x3FFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[2] >> 26) & 0x3FFFFF)) & 1))^((int64((in[2] >> 26) & 0x3FFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[2] >> 48) | ((in[3] & 0x3F) << 16)))) & 1))^((int64(((in[2] >> 48) | ((in[3] & 0x3F) << 16))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[3] >> 6) & 0x3FFFFF)) & 1))^((int64((in[3] >> 6) & 0x3FFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[3] >> 28) & 0x3FFFFF)) & 1))^((int64((in[3] >> 28) & 0x3FFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[3] >> 50) | ((in[4] & 0xFF) << 14)))) & 1))^((int64(((in[3] >> 50) | ((in[4] & 0xFF) << 14))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[4] >> 8) & 0x3FFFFF)) & 1))^((int64((in[4] >> 8) & 0x3FFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[4] >> 30) & 0x3FFFFF)) & 1))^((int64((in[4] >> 30) & 0x3FFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[4] >> 52) | ((in[5] & 0x3FF) << 12)))) & 1))^((int64(((in[4] >> 52) | ((in[5] & 0x3FF) << 12))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[5] >> 10) & 0x3FFFFF)) & 1))^((int64((in[5] >> 10) & 0x3FFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[5] >> 32) & 0x3FFFFF)) & 1))^((int64((in[5] >> 32) & 0x3FFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[5] >> 54) | ((in[6] & 0xFFF) << 10)))) & 1))^((int64(((in[5] >> 54) | ((in[6] & 0xFFF) << 10))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[6] >> 12) & 0x3FFFFF)) & 1))^((int64((in[6] >> 12) & 0x3FFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[6] >> 34) & 0x3FFFFF)) & 1))^((int64((in[6] >> 34) & 0x3FFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[6] >> 56) | ((in[7] & 0x3FFF) << 8)))) & 1))^((int64(((in[6] >> 56) | ((in[7] & 0x3FFF) << 8))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[7] >> 14) & 0x3FFFFF)) & 1))^((int64((in[7] >> 14) & 0x3FFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[7] >> 36) & 0x3FFFFF)) & 1))^((int64((in[7] >> 36) & 0x3FFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[7] >> 58) | ((in[8] & 0xFFFF) << 6)))) & 1))^((int64(((in[7] >> 58) | ((in[8] & 0xFFFF) << 6))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[8] >> 16) & 0x3FFFFF)) & 1))^((int64((in[8] >> 16) & 0x3FFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[8] >> 38) & 0x3FFFFF)) & 1))^((int64((in[8] >> 38) & 0x3FFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[8] >> 60) | ((in[9] & 0x3FFFF) << 4)))) & 1))^((int64(((in[8] >> 60) | ((in[9] & 0x3FFFF) << 4))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[9] >> 18) & 0x3FFFFF)) & 1))^((int64((in[9] >> 18) & 0x3FFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[9] >> 40) & 0x3FFFFF)) & 1))^((int64((in[9] >> 40) & 0x3FFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[9] >> 62) | ((in[10] & 0xFFFFF) << 2)))) & 1))^((int64(((in[9] >> 62) | ((in[10] & 0xFFFFF) << 2))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[10] >> 20) & 0x3FFFFF)) & 1))^((int64((in[10] >> 20) & 0x3FFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[10] >> 42))) & 1))^((int64((in[10] >> 42)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[11] >> 0) & 0x3FFFFF)) & 1))^((int64((in[11] >> 0) & 0x3FFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[11] >> 22) & 0x3FFFFF)) & 1))^((int64((in[11] >> 22) & 0x3FFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[11] >> 44) | ((in[12] & 0x3) << 20)))) & 1))^((int64(((in[11] >> 44) | ((in[12] & 0x3) << 20))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[12] >> 2) & 0x3FFFFF)) & 1))^((int64((in[12] >> 2) & 0x3FFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[12] >> 24) & 0x3FFFFF)) & 1))^((int64((in[12] >> 24) & 0x3FFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[12] >> 46) | ((in[13] & 0xF) << 18)))) & 1))^((int64(((in[12] >> 46) | ((in[13] & 0xF) << 18))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[13] >> 4) & 0x3FFFFF)) & 1))^((int64((in[13] >> 4) & 0x3FFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[13] >> 26) & 0x3FFFFF)) & 1))^((int64((in[13] >> 26) & 0x3FFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[13] >> 48) | ((in[14] & 0x3F) << 16)))) & 1))^((int64(((in[13] >> 48) | ((in[14] & 0x3F) << 16))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[14] >> 6) & 0x3FFFFF)) & 1))^((int64((in[14] >> 6) & 0x3FFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[14] >> 28) & 0x3FFFFF)) & 1))^((int64((in[14] >> 28) & 0x3FFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[14] >> 50) | ((in[15] & 0xFF) << 14)))) & 1))^((int64(((in[14] >> 50) | ((in[15] & 0xFF) << 14))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[15] >> 8) & 0x3FFFFF)) & 1))^((int64((in[15] >> 8) & 0x3FFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[15] >> 30) & 0x3FFFFF)) & 1))^((int64((in[15] >> 30) & 0x3FFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[15] >> 52) | ((in[16] & 0x3FF) << 12)))) & 1))^((int64(((in[15] >> 52) | ((in[16] & 0x3FF) << 12))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[16] >> 10) & 0x3FFFFF)) & 1))^((int64((in[16] >> 10) & 0x3FFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[16] >> 32) & 0x3FFFFF)) & 1))^((int64((in[16] >> 32) & 0x3FFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[16] >> 54) | ((in[17] & 0xFFF) << 10)))) & 1))^((int64(((in[16] >> 54) | ((in[17] & 0xFFF) << 10))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[17] >> 12) & 0x3FFFFF)) & 1))^((int64((in[17] >> 12) & 0x3FFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[17] >> 34) & 0x3FFFFF)) & 1))^((int64((in[17] >> 34) & 0x3FFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[17] >> 56) | ((in[18] & 0x3FFF) << 8)))) & 1))^((int64(((in[17] >> 56) | ((in[18] & 0x3FFF) << 8))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[18] >> 14) & 0x3FFFFF)) & 1))^((int64((in[18] >> 14) & 0x3FFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[18] >> 36) & 0x3FFFFF)) & 1))^((int64((in[18] >> 36) & 0x3FFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[18] >> 58) | ((in[19] & 0xFFFF) << 6)))) & 1))^((int64(((in[18] >> 58) | ((in[19] & 0xFFFF) << 6))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[19] >> 16) & 0x3FFFFF)) & 1))^((int64((in[19] >> 16) & 0x3FFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[19] >> 38) & 0x3FFFFF)) & 1))^((int64((in[19] >> 38) & 0x3FFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[19] >> 60) | ((in[20] & 0x3FFFF) << 4)))) & 1))^((int64(((in[19] >> 60) | ((in[20] & 0x3FFFF) << 4))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[20] >> 18) & 0x3FFFFF)) & 1))^((int64((in[20] >> 18) & 0x3FFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[20] >> 40) & 0x3FFFFF)) & 1))^((int64((in[20] >> 40) & 0x3FFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[20] >> 62) | ((in[21] & 0xFFFFF) << 2)))) & 1))^((int64(((in[20] >> 62) | ((in[21] & 0xFFFFF) << 2))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[21] >> 20) & 0x3FFFFF)) & 1))^((int64((in[21] >> 20) & 0x3FFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[21] >> 42))) & 1))^((int64((in[21] >> 42)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_23(initoffset uint64, in *[23]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 23) & 0x7FFFFF)) & 1))^((int64((in[0] >> 23) & 0x7FFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 46) | ((in[1] & 0x1F) << 18)))) & 1))^((int64(((in[0] >> 46) | ((in[1] & 0x1F) << 18))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 5) & 0x7FFFFF)) & 1))^((int64((in[1] >> 5) & 0x7FFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 28) & 0x7FFFFF)) & 1))^((int64((in[1] >> 28) & 0x7FFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[1] >> 51) | ((in[2] & 0x3FF) << 13)))) & 1))^((int64(((in[1] >> 51) | ((in[2] & 0x3FF) << 13))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[2] >> 10) & 0x7FFFFF)) & 1))^((int64((in[2] >> 10) & 0x7FFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[2] >> 33) & 0x7FFFFF)) & 1))^((int64((in[2] >> 33) & 0x7FFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[2] >> 56) | ((in[3] & 0x7FFF) << 8)))) & 1))^((int64(((in[2] >> 56) | ((in[3] & 0x7FFF) << 8))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[3] >> 15) & 0x7FFFFF)) & 1))^((int64((in[3] >> 15) & 0x7FFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[3] >> 38) & 0x7FFFFF)) & 1))^((int64((in[3] >> 38) & 0x7FFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[3] >> 61) | ((in[4] & 0xFFFFF) << 3)))) & 1))^((int64(((in[3] >> 61) | ((in[4] & 0xFFFFF) << 3))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[4] >> 20) & 0x7FFFFF)) & 1))^((int64((in[4] >> 20) & 0x7FFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[4] >> 43) | ((in[5] & 0x3) << 21)))) & 1))^((int64(((in[4] >> 43) | ((in[5] & 0x3) << 21))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[5] >> 2) & 0x7FFFFF)) & 1))^((int64((in[5] >> 2) & 0x7FFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[5] >> 25) & 0x7FFFFF)) & 1))^((int64((in[5] >> 25) & 0x7FFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[5] >> 48) | ((in[6] & 0x7F) << 16)))) & 1))^((int64(((in[5] >> 48) | ((in[6] & 0x7F) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[6] >> 7) & 0x7FFFFF)) & 1))^((int64((in[6] >> 7) & 0x7FFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64((in[6] >> 30) & 0x7FFFFF)) & 1))^((int64((in[6] >> 30) & 0x7FFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[6] >> 53) | ((in[7] & 0xFFF) << 11)))) & 1))^((int64(((in[6] >> 53) | ((in[7] & 0xFFF) << 11))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[7] >> 12) & 0x7FFFFF)) & 1))^((int64((in[7] >> 12) & 0x7FFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[7] >> 35) & 0x7FFFFF)) & 1))^((int64((in[7] >> 35) & 0x7FFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[7] >> 58) | ((in[8] & 0x1FFFF) << 6)))) & 1))^((int64(((in[7] >> 58) | ((in[8] & 0x1FFFF) << 6))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[8] >> 17) & 0x7FFFFF)) & 1))^((int64((in[8] >> 17) & 0x7FFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[8] >> 40) & 0x7FFFFF)) & 1))^((int64((in[8] >> 40) & 0x7FFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[8] >> 63) | ((in[9] & 0x3FFFFF) << 1)))) & 1))^((int64(((in[8] >> 63) | ((in[9] & 0x3FFFFF) << 1))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[9] >> 22) & 0x7FFFFF)) & 1))^((int64((in[9] >> 22) & 0x7FFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[9] >> 45) | ((in[10] & 0xF) << 19)))) & 1))^((int64(((in[9] >> 45) | ((in[10] & 0xF) << 19))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[10] >> 4) & 0x7FFFFF)) & 1))^((int64((in[10] >> 4) & 0x7FFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[10] >> 27) & 0x7FFFFF)) & 1))^((int64((in[10] >> 27) & 0x7FFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[10] >> 50) | ((in[11] & 0x1FF) << 14)))) & 1))^((int64(((in[10] >> 50) | ((in[11] & 0x1FF) << 14))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[11] >> 9) & 0x7FFFFF)) & 1))^((int64((in[11] >> 9) & 0x7FFFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[11] >> 32) & 0x7FFFFF)) & 1))^((int64((in[11] >> 32) & 0x7FFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[11] >> 55) | ((in[12] & 0x3FFF) << 9)))) & 1))^((int64(((in[11] >> 55) | ((in[12] & 0x3FFF) << 9))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[12] >> 14) & 0x7FFFFF)) & 1))^((int64((in[12] >> 14) & 0x7FFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[12] >> 37) & 0x7FFFFF)) & 1))^((int64((in[12] >> 37) & 0x7FFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[12] >> 60) | ((in[13] & 0x7FFFF) << 4)))) & 1))^((int64(((in[12] >> 60) | ((in[13] & 0x7FFFF) << 4))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[13] >> 19) & 0x7FFFFF)) & 1))^((int64((in[13] >> 19) & 0x7FFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[13] >> 42) | ((in[14] & 0x1) << 22)))) & 1))^((int64(((in[13] >> 42) | ((in[14] & 0x1) << 22))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[14] >> 1) & 0x7FFFFF)) & 1))^((int64((in[14] >> 1) & 0x7FFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[14] >> 24) & 0x7FFFFF)) & 1))^((int64((in[14] >> 24) & 0x7FFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[14] >> 47) | ((in[15] & 0x3F) << 17)))) & 1))^((int64(((in[14] >> 47) | ((in[15] & 0x3F) << 17))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[15] >> 6) & 0x7FFFFF)) & 1))^((int64((in[15] >> 6) & 0x7FFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[15] >> 29) & 0x7FFFFF)) & 1))^((int64((in[15] >> 29) & 0x7FFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[15] >> 52) | ((in[16] & 0x7FF) << 12)))) & 1))^((int64(((in[15] >> 52) | ((in[16] & 0x7FF) << 12))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[16] >> 11) & 0x7FFFFF)) & 1))^((int64((in[16] >> 11) & 0x7FFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64((in[16] >> 34) & 0x7FFFFF)) & 1))^((int64((in[16] >> 34) & 0x7FFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[16] >> 57) | ((in[17] & 0xFFFF) << 7)))) & 1))^((int64(((in[16] >> 57) | ((in[17] & 0xFFFF) << 7))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[17] >> 16) & 0x7FFFFF)) & 1))^((int64((in[17] >> 16) & 0x7FFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[17] >> 39) & 0x7FFFFF)) & 1))^((int64((in[17] >> 39) & 0x7FFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[17] >> 62) | ((in[18] & 0x1FFFFF) << 2)))) & 1))^((int64(((in[17] >> 62) | ((in[18] & 0x1FFFFF) << 2))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[18] >> 21) & 0x7FFFFF)) & 1))^((int64((in[18] >> 21) & 0x7FFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[18] >> 44) | ((in[19] & 0x7) << 20)))) & 1))^((int64(((in[18] >> 44) | ((in[19] & 0x7) << 20))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[19] >> 3) & 0x7FFFFF)) & 1))^((int64((in[19] >> 3) & 0x7FFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[19] >> 26) & 0x7FFFFF)) & 1))^((int64((in[19] >> 26) & 0x7FFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[19] >> 49) | ((in[20] & 0xFF) << 15)))) & 1))^((int64(((in[19] >> 49) | ((in[20] & 0xFF) << 15))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[20] >> 8) & 0x7FFFFF)) & 1))^((int64((in[20] >> 8) & 0x7FFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[20] >> 31) & 0x7FFFFF)) & 1))^((int64((in[20] >> 31) & 0x7FFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[20] >> 54) | ((in[21] & 0x1FFF) << 10)))) & 1))^((int64(((in[20] >> 54) | ((in[21] & 0x1FFF) << 10))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[21] >> 13) & 0x7FFFFF)) & 1))^((int64((in[21] >> 13) & 0x7FFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[21] >> 36) & 0x7FFFFF)) & 1))^((int64((in[21] >> 36) & 0x7FFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[21] >> 59) | ((in[22] & 0x3FFFF) << 5)))) & 1))^((int64(((in[21] >> 59) | ((in[22] & 0x3FFFF) << 5))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[22] >> 18) & 0x7FFFFF)) & 1))^((int64((in[22] >> 18) & 0x7FFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[22] >> 41))) & 1))^((int64((in[22] >> 41)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_24(initoffset uint64, in *[24]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 24) & 0xFFFFFF)) & 1))^((int64((in[0] >> 24) & 0xFFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 48) | ((in[1] & 0xFF) << 16)))) & 1))^((int64(((in[0] >> 48) | ((in[1] & 0xFF) << 16))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 8) & 0xFFFFFF)) & 1))^((int64((in[1] >> 8) & 0xFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 32) & 0xFFFFFF)) & 1))^((int64((in[1] >> 32) & 0xFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0xFFFF) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0xFFFF) << 8))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[2] >> 16) & 0xFFFFFF)) & 1))^((int64((in[2] >> 16) & 0xFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[2] >> 40))) & 1))^((int64((in[2] >> 40)))>>1))) + out[6] + out[8] = uint64(((-((int64((in[3] >> 0) & 0xFFFFFF)) & 1))^((int64((in[3] >> 0) & 0xFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[3] >> 24) & 0xFFFFFF)) & 1))^((int64((in[3] >> 24) & 0xFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[3] >> 48) | ((in[4] & 0xFF) << 16)))) & 1))^((int64(((in[3] >> 48) | ((in[4] & 0xFF) << 16))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[4] >> 8) & 0xFFFFFF)) & 1))^((int64((in[4] >> 8) & 0xFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64((in[4] >> 32) & 0xFFFFFF)) & 1))^((int64((in[4] >> 32) & 0xFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[4] >> 56) | ((in[5] & 0xFFFF) << 8)))) & 1))^((int64(((in[4] >> 56) | ((in[5] & 0xFFFF) << 8))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[5] >> 16) & 0xFFFFFF)) & 1))^((int64((in[5] >> 16) & 0xFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[5] >> 40))) & 1))^((int64((in[5] >> 40)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[6] >> 0) & 0xFFFFFF)) & 1))^((int64((in[6] >> 0) & 0xFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[6] >> 24) & 0xFFFFFF)) & 1))^((int64((in[6] >> 24) & 0xFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[6] >> 48) | ((in[7] & 0xFF) << 16)))) & 1))^((int64(((in[6] >> 48) | ((in[7] & 0xFF) << 16))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[7] >> 8) & 0xFFFFFF)) & 1))^((int64((in[7] >> 8) & 0xFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[7] >> 32) & 0xFFFFFF)) & 1))^((int64((in[7] >> 32) & 0xFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0xFFFF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0xFFFF) << 8))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[8] >> 16) & 0xFFFFFF)) & 1))^((int64((in[8] >> 16) & 0xFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[8] >> 40))) & 1))^((int64((in[8] >> 40)))>>1))) + out[22] + out[24] = uint64(((-((int64((in[9] >> 0) & 0xFFFFFF)) & 1))^((int64((in[9] >> 0) & 0xFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[9] >> 24) & 0xFFFFFF)) & 1))^((int64((in[9] >> 24) & 0xFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[9] >> 48) | ((in[10] & 0xFF) << 16)))) & 1))^((int64(((in[9] >> 48) | ((in[10] & 0xFF) << 16))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[10] >> 8) & 0xFFFFFF)) & 1))^((int64((in[10] >> 8) & 0xFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64((in[10] >> 32) & 0xFFFFFF)) & 1))^((int64((in[10] >> 32) & 0xFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[10] >> 56) | ((in[11] & 0xFFFF) << 8)))) & 1))^((int64(((in[10] >> 56) | ((in[11] & 0xFFFF) << 8))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[11] >> 16) & 0xFFFFFF)) & 1))^((int64((in[11] >> 16) & 0xFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[11] >> 40))) & 1))^((int64((in[11] >> 40)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[12] >> 0) & 0xFFFFFF)) & 1))^((int64((in[12] >> 0) & 0xFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[12] >> 24) & 0xFFFFFF)) & 1))^((int64((in[12] >> 24) & 0xFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[12] >> 48) | ((in[13] & 0xFF) << 16)))) & 1))^((int64(((in[12] >> 48) | ((in[13] & 0xFF) << 16))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[13] >> 8) & 0xFFFFFF)) & 1))^((int64((in[13] >> 8) & 0xFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64((in[13] >> 32) & 0xFFFFFF)) & 1))^((int64((in[13] >> 32) & 0xFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[13] >> 56) | ((in[14] & 0xFFFF) << 8)))) & 1))^((int64(((in[13] >> 56) | ((in[14] & 0xFFFF) << 8))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[14] >> 16) & 0xFFFFFF)) & 1))^((int64((in[14] >> 16) & 0xFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[14] >> 40))) & 1))^((int64((in[14] >> 40)))>>1))) + out[38] + out[40] = uint64(((-((int64((in[15] >> 0) & 0xFFFFFF)) & 1))^((int64((in[15] >> 0) & 0xFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[15] >> 24) & 0xFFFFFF)) & 1))^((int64((in[15] >> 24) & 0xFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0xFF) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0xFF) << 16))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[16] >> 8) & 0xFFFFFF)) & 1))^((int64((in[16] >> 8) & 0xFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[16] >> 32) & 0xFFFFFF)) & 1))^((int64((in[16] >> 32) & 0xFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0xFFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0xFFFF) << 8))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[17] >> 16) & 0xFFFFFF)) & 1))^((int64((in[17] >> 16) & 0xFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[17] >> 40))) & 1))^((int64((in[17] >> 40)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[18] >> 0) & 0xFFFFFF)) & 1))^((int64((in[18] >> 0) & 0xFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[18] >> 24) & 0xFFFFFF)) & 1))^((int64((in[18] >> 24) & 0xFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0xFF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0xFF) << 16))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[19] >> 8) & 0xFFFFFF)) & 1))^((int64((in[19] >> 8) & 0xFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64((in[19] >> 32) & 0xFFFFFF)) & 1))^((int64((in[19] >> 32) & 0xFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[19] >> 56) | ((in[20] & 0xFFFF) << 8)))) & 1))^((int64(((in[19] >> 56) | ((in[20] & 0xFFFF) << 8))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[20] >> 16) & 0xFFFFFF)) & 1))^((int64((in[20] >> 16) & 0xFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[20] >> 40))) & 1))^((int64((in[20] >> 40)))>>1))) + out[54] + out[56] = uint64(((-((int64((in[21] >> 0) & 0xFFFFFF)) & 1))^((int64((in[21] >> 0) & 0xFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[21] >> 24) & 0xFFFFFF)) & 1))^((int64((in[21] >> 24) & 0xFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[21] >> 48) | ((in[22] & 0xFF) << 16)))) & 1))^((int64(((in[21] >> 48) | ((in[22] & 0xFF) << 16))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[22] >> 8) & 0xFFFFFF)) & 1))^((int64((in[22] >> 8) & 0xFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[22] >> 32) & 0xFFFFFF)) & 1))^((int64((in[22] >> 32) & 0xFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[22] >> 56) | ((in[23] & 0xFFFF) << 8)))) & 1))^((int64(((in[22] >> 56) | ((in[23] & 0xFFFF) << 8))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[23] >> 16) & 0xFFFFFF)) & 1))^((int64((in[23] >> 16) & 0xFFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[23] >> 40))) & 1))^((int64((in[23] >> 40)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_25(initoffset uint64, in *[25]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 25) & 0x1FFFFFF)) & 1))^((int64((in[0] >> 25) & 0x1FFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 50) | ((in[1] & 0x7FF) << 14)))) & 1))^((int64(((in[0] >> 50) | ((in[1] & 0x7FF) << 14))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 11) & 0x1FFFFFF)) & 1))^((int64((in[1] >> 11) & 0x1FFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64((in[1] >> 36) & 0x1FFFFFF)) & 1))^((int64((in[1] >> 36) & 0x1FFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[1] >> 61) | ((in[2] & 0x3FFFFF) << 3)))) & 1))^((int64(((in[1] >> 61) | ((in[2] & 0x3FFFFF) << 3))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[2] >> 22) & 0x1FFFFFF)) & 1))^((int64((in[2] >> 22) & 0x1FFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[2] >> 47) | ((in[3] & 0xFF) << 17)))) & 1))^((int64(((in[2] >> 47) | ((in[3] & 0xFF) << 17))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[3] >> 8) & 0x1FFFFFF)) & 1))^((int64((in[3] >> 8) & 0x1FFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[3] >> 33) & 0x1FFFFFF)) & 1))^((int64((in[3] >> 33) & 0x1FFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[3] >> 58) | ((in[4] & 0x7FFFF) << 6)))) & 1))^((int64(((in[3] >> 58) | ((in[4] & 0x7FFFF) << 6))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[4] >> 19) & 0x1FFFFFF)) & 1))^((int64((in[4] >> 19) & 0x1FFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[4] >> 44) | ((in[5] & 0x1F) << 20)))) & 1))^((int64(((in[4] >> 44) | ((in[5] & 0x1F) << 20))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[5] >> 5) & 0x1FFFFFF)) & 1))^((int64((in[5] >> 5) & 0x1FFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64((in[5] >> 30) & 0x1FFFFFF)) & 1))^((int64((in[5] >> 30) & 0x1FFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[5] >> 55) | ((in[6] & 0xFFFF) << 9)))) & 1))^((int64(((in[5] >> 55) | ((in[6] & 0xFFFF) << 9))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[6] >> 16) & 0x1FFFFFF)) & 1))^((int64((in[6] >> 16) & 0x1FFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[6] >> 41) | ((in[7] & 0x3) << 23)))) & 1))^((int64(((in[6] >> 41) | ((in[7] & 0x3) << 23))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[7] >> 2) & 0x1FFFFFF)) & 1))^((int64((in[7] >> 2) & 0x1FFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[7] >> 27) & 0x1FFFFFF)) & 1))^((int64((in[7] >> 27) & 0x1FFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[7] >> 52) | ((in[8] & 0x1FFF) << 12)))) & 1))^((int64(((in[7] >> 52) | ((in[8] & 0x1FFF) << 12))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[8] >> 13) & 0x1FFFFFF)) & 1))^((int64((in[8] >> 13) & 0x1FFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64((in[8] >> 38) & 0x1FFFFFF)) & 1))^((int64((in[8] >> 38) & 0x1FFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[8] >> 63) | ((in[9] & 0xFFFFFF) << 1)))) & 1))^((int64(((in[8] >> 63) | ((in[9] & 0xFFFFFF) << 1))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[9] >> 24) & 0x1FFFFFF)) & 1))^((int64((in[9] >> 24) & 0x1FFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[9] >> 49) | ((in[10] & 0x3FF) << 15)))) & 1))^((int64(((in[9] >> 49) | ((in[10] & 0x3FF) << 15))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[10] >> 10) & 0x1FFFFFF)) & 1))^((int64((in[10] >> 10) & 0x1FFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[10] >> 35) & 0x1FFFFFF)) & 1))^((int64((in[10] >> 35) & 0x1FFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[10] >> 60) | ((in[11] & 0x1FFFFF) << 4)))) & 1))^((int64(((in[10] >> 60) | ((in[11] & 0x1FFFFF) << 4))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[11] >> 21) & 0x1FFFFFF)) & 1))^((int64((in[11] >> 21) & 0x1FFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[11] >> 46) | ((in[12] & 0x7F) << 18)))) & 1))^((int64(((in[11] >> 46) | ((in[12] & 0x7F) << 18))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[12] >> 7) & 0x1FFFFFF)) & 1))^((int64((in[12] >> 7) & 0x1FFFFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[12] >> 32) & 0x1FFFFFF)) & 1))^((int64((in[12] >> 32) & 0x1FFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[12] >> 57) | ((in[13] & 0x3FFFF) << 7)))) & 1))^((int64(((in[12] >> 57) | ((in[13] & 0x3FFFF) << 7))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[13] >> 18) & 0x1FFFFFF)) & 1))^((int64((in[13] >> 18) & 0x1FFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[13] >> 43) | ((in[14] & 0xF) << 21)))) & 1))^((int64(((in[13] >> 43) | ((in[14] & 0xF) << 21))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[14] >> 4) & 0x1FFFFFF)) & 1))^((int64((in[14] >> 4) & 0x1FFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[14] >> 29) & 0x1FFFFFF)) & 1))^((int64((in[14] >> 29) & 0x1FFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[14] >> 54) | ((in[15] & 0x7FFF) << 10)))) & 1))^((int64(((in[14] >> 54) | ((in[15] & 0x7FFF) << 10))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[15] >> 15) & 0x1FFFFFF)) & 1))^((int64((in[15] >> 15) & 0x1FFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[15] >> 40) | ((in[16] & 0x1) << 24)))) & 1))^((int64(((in[15] >> 40) | ((in[16] & 0x1) << 24))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[16] >> 1) & 0x1FFFFFF)) & 1))^((int64((in[16] >> 1) & 0x1FFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64((in[16] >> 26) & 0x1FFFFFF)) & 1))^((int64((in[16] >> 26) & 0x1FFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[16] >> 51) | ((in[17] & 0xFFF) << 13)))) & 1))^((int64(((in[16] >> 51) | ((in[17] & 0xFFF) << 13))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[17] >> 12) & 0x1FFFFFF)) & 1))^((int64((in[17] >> 12) & 0x1FFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[17] >> 37) & 0x1FFFFFF)) & 1))^((int64((in[17] >> 37) & 0x1FFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[17] >> 62) | ((in[18] & 0x7FFFFF) << 2)))) & 1))^((int64(((in[17] >> 62) | ((in[18] & 0x7FFFFF) << 2))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[18] >> 23) & 0x1FFFFFF)) & 1))^((int64((in[18] >> 23) & 0x1FFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0x1FF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0x1FF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[19] >> 9) & 0x1FFFFFF)) & 1))^((int64((in[19] >> 9) & 0x1FFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64((in[19] >> 34) & 0x1FFFFFF)) & 1))^((int64((in[19] >> 34) & 0x1FFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[19] >> 59) | ((in[20] & 0xFFFFF) << 5)))) & 1))^((int64(((in[19] >> 59) | ((in[20] & 0xFFFFF) << 5))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[20] >> 20) & 0x1FFFFFF)) & 1))^((int64((in[20] >> 20) & 0x1FFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[20] >> 45) | ((in[21] & 0x3F) << 19)))) & 1))^((int64(((in[20] >> 45) | ((in[21] & 0x3F) << 19))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[21] >> 6) & 0x1FFFFFF)) & 1))^((int64((in[21] >> 6) & 0x1FFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[21] >> 31) & 0x1FFFFFF)) & 1))^((int64((in[21] >> 31) & 0x1FFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[21] >> 56) | ((in[22] & 0x1FFFF) << 8)))) & 1))^((int64(((in[21] >> 56) | ((in[22] & 0x1FFFF) << 8))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[22] >> 17) & 0x1FFFFFF)) & 1))^((int64((in[22] >> 17) & 0x1FFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[22] >> 42) | ((in[23] & 0x7) << 22)))) & 1))^((int64(((in[22] >> 42) | ((in[23] & 0x7) << 22))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[23] >> 3) & 0x1FFFFFF)) & 1))^((int64((in[23] >> 3) & 0x1FFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64((in[23] >> 28) & 0x1FFFFFF)) & 1))^((int64((in[23] >> 28) & 0x1FFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[23] >> 53) | ((in[24] & 0x3FFF) << 11)))) & 1))^((int64(((in[23] >> 53) | ((in[24] & 0x3FFF) << 11))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[24] >> 14) & 0x1FFFFFF)) & 1))^((int64((in[24] >> 14) & 0x1FFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[24] >> 39))) & 1))^((int64((in[24] >> 39)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_26(initoffset uint64, in *[26]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 26) & 0x3FFFFFF)) & 1))^((int64((in[0] >> 26) & 0x3FFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 52) | ((in[1] & 0x3FFF) << 12)))) & 1))^((int64(((in[0] >> 52) | ((in[1] & 0x3FFF) << 12))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 14) & 0x3FFFFFF)) & 1))^((int64((in[1] >> 14) & 0x3FFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[1] >> 40) | ((in[2] & 0x3) << 24)))) & 1))^((int64(((in[1] >> 40) | ((in[2] & 0x3) << 24))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[2] >> 2) & 0x3FFFFFF)) & 1))^((int64((in[2] >> 2) & 0x3FFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[2] >> 28) & 0x3FFFFFF)) & 1))^((int64((in[2] >> 28) & 0x3FFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[2] >> 54) | ((in[3] & 0xFFFF) << 10)))) & 1))^((int64(((in[2] >> 54) | ((in[3] & 0xFFFF) << 10))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[3] >> 16) & 0x3FFFFFF)) & 1))^((int64((in[3] >> 16) & 0x3FFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[3] >> 42) | ((in[4] & 0xF) << 22)))) & 1))^((int64(((in[3] >> 42) | ((in[4] & 0xF) << 22))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[4] >> 4) & 0x3FFFFFF)) & 1))^((int64((in[4] >> 4) & 0x3FFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[4] >> 30) & 0x3FFFFFF)) & 1))^((int64((in[4] >> 30) & 0x3FFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[4] >> 56) | ((in[5] & 0x3FFFF) << 8)))) & 1))^((int64(((in[4] >> 56) | ((in[5] & 0x3FFFF) << 8))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[5] >> 18) & 0x3FFFFFF)) & 1))^((int64((in[5] >> 18) & 0x3FFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[5] >> 44) | ((in[6] & 0x3F) << 20)))) & 1))^((int64(((in[5] >> 44) | ((in[6] & 0x3F) << 20))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[6] >> 6) & 0x3FFFFFF)) & 1))^((int64((in[6] >> 6) & 0x3FFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[6] >> 32) & 0x3FFFFFF)) & 1))^((int64((in[6] >> 32) & 0x3FFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[6] >> 58) | ((in[7] & 0xFFFFF) << 6)))) & 1))^((int64(((in[6] >> 58) | ((in[7] & 0xFFFFF) << 6))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[7] >> 20) & 0x3FFFFFF)) & 1))^((int64((in[7] >> 20) & 0x3FFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[7] >> 46) | ((in[8] & 0xFF) << 18)))) & 1))^((int64(((in[7] >> 46) | ((in[8] & 0xFF) << 18))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[8] >> 8) & 0x3FFFFFF)) & 1))^((int64((in[8] >> 8) & 0x3FFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[8] >> 34) & 0x3FFFFFF)) & 1))^((int64((in[8] >> 34) & 0x3FFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[8] >> 60) | ((in[9] & 0x3FFFFF) << 4)))) & 1))^((int64(((in[8] >> 60) | ((in[9] & 0x3FFFFF) << 4))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[9] >> 22) & 0x3FFFFFF)) & 1))^((int64((in[9] >> 22) & 0x3FFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[9] >> 48) | ((in[10] & 0x3FF) << 16)))) & 1))^((int64(((in[9] >> 48) | ((in[10] & 0x3FF) << 16))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[10] >> 10) & 0x3FFFFFF)) & 1))^((int64((in[10] >> 10) & 0x3FFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64((in[10] >> 36) & 0x3FFFFFF)) & 1))^((int64((in[10] >> 36) & 0x3FFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[10] >> 62) | ((in[11] & 0xFFFFFF) << 2)))) & 1))^((int64(((in[10] >> 62) | ((in[11] & 0xFFFFFF) << 2))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[11] >> 24) & 0x3FFFFFF)) & 1))^((int64((in[11] >> 24) & 0x3FFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[11] >> 50) | ((in[12] & 0xFFF) << 14)))) & 1))^((int64(((in[11] >> 50) | ((in[12] & 0xFFF) << 14))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[12] >> 12) & 0x3FFFFFF)) & 1))^((int64((in[12] >> 12) & 0x3FFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[12] >> 38))) & 1))^((int64((in[12] >> 38)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[13] >> 0) & 0x3FFFFFF)) & 1))^((int64((in[13] >> 0) & 0x3FFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[13] >> 26) & 0x3FFFFFF)) & 1))^((int64((in[13] >> 26) & 0x3FFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[13] >> 52) | ((in[14] & 0x3FFF) << 12)))) & 1))^((int64(((in[13] >> 52) | ((in[14] & 0x3FFF) << 12))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[14] >> 14) & 0x3FFFFFF)) & 1))^((int64((in[14] >> 14) & 0x3FFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[14] >> 40) | ((in[15] & 0x3) << 24)))) & 1))^((int64(((in[14] >> 40) | ((in[15] & 0x3) << 24))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[15] >> 2) & 0x3FFFFFF)) & 1))^((int64((in[15] >> 2) & 0x3FFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64((in[15] >> 28) & 0x3FFFFFF)) & 1))^((int64((in[15] >> 28) & 0x3FFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[15] >> 54) | ((in[16] & 0xFFFF) << 10)))) & 1))^((int64(((in[15] >> 54) | ((in[16] & 0xFFFF) << 10))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[16] >> 16) & 0x3FFFFFF)) & 1))^((int64((in[16] >> 16) & 0x3FFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[16] >> 42) | ((in[17] & 0xF) << 22)))) & 1))^((int64(((in[16] >> 42) | ((in[17] & 0xF) << 22))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[17] >> 4) & 0x3FFFFFF)) & 1))^((int64((in[17] >> 4) & 0x3FFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[17] >> 30) & 0x3FFFFFF)) & 1))^((int64((in[17] >> 30) & 0x3FFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[17] >> 56) | ((in[18] & 0x3FFFF) << 8)))) & 1))^((int64(((in[17] >> 56) | ((in[18] & 0x3FFFF) << 8))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[18] >> 18) & 0x3FFFFFF)) & 1))^((int64((in[18] >> 18) & 0x3FFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[18] >> 44) | ((in[19] & 0x3F) << 20)))) & 1))^((int64(((in[18] >> 44) | ((in[19] & 0x3F) << 20))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[19] >> 6) & 0x3FFFFFF)) & 1))^((int64((in[19] >> 6) & 0x3FFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[19] >> 32) & 0x3FFFFFF)) & 1))^((int64((in[19] >> 32) & 0x3FFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[19] >> 58) | ((in[20] & 0xFFFFF) << 6)))) & 1))^((int64(((in[19] >> 58) | ((in[20] & 0xFFFFF) << 6))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[20] >> 20) & 0x3FFFFFF)) & 1))^((int64((in[20] >> 20) & 0x3FFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[20] >> 46) | ((in[21] & 0xFF) << 18)))) & 1))^((int64(((in[20] >> 46) | ((in[21] & 0xFF) << 18))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[21] >> 8) & 0x3FFFFFF)) & 1))^((int64((in[21] >> 8) & 0x3FFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[21] >> 34) & 0x3FFFFFF)) & 1))^((int64((in[21] >> 34) & 0x3FFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[21] >> 60) | ((in[22] & 0x3FFFFF) << 4)))) & 1))^((int64(((in[21] >> 60) | ((in[22] & 0x3FFFFF) << 4))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[22] >> 22) & 0x3FFFFFF)) & 1))^((int64((in[22] >> 22) & 0x3FFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[22] >> 48) | ((in[23] & 0x3FF) << 16)))) & 1))^((int64(((in[22] >> 48) | ((in[23] & 0x3FF) << 16))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[23] >> 10) & 0x3FFFFFF)) & 1))^((int64((in[23] >> 10) & 0x3FFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[23] >> 36) & 0x3FFFFFF)) & 1))^((int64((in[23] >> 36) & 0x3FFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[23] >> 62) | ((in[24] & 0xFFFFFF) << 2)))) & 1))^((int64(((in[23] >> 62) | ((in[24] & 0xFFFFFF) << 2))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[24] >> 24) & 0x3FFFFFF)) & 1))^((int64((in[24] >> 24) & 0x3FFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[24] >> 50) | ((in[25] & 0xFFF) << 14)))) & 1))^((int64(((in[24] >> 50) | ((in[25] & 0xFFF) << 14))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[25] >> 12) & 0x3FFFFFF)) & 1))^((int64((in[25] >> 12) & 0x3FFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[25] >> 38))) & 1))^((int64((in[25] >> 38)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_27(initoffset uint64, in *[27]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 27) & 0x7FFFFFF)) & 1))^((int64((in[0] >> 27) & 0x7FFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 54) | ((in[1] & 0x1FFFF) << 10)))) & 1))^((int64(((in[0] >> 54) | ((in[1] & 0x1FFFF) << 10))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 17) & 0x7FFFFFF)) & 1))^((int64((in[1] >> 17) & 0x7FFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[1] >> 44) | ((in[2] & 0x7F) << 20)))) & 1))^((int64(((in[1] >> 44) | ((in[2] & 0x7F) << 20))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[2] >> 7) & 0x7FFFFFF)) & 1))^((int64((in[2] >> 7) & 0x7FFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64((in[2] >> 34) & 0x7FFFFFF)) & 1))^((int64((in[2] >> 34) & 0x7FFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[2] >> 61) | ((in[3] & 0xFFFFFF) << 3)))) & 1))^((int64(((in[2] >> 61) | ((in[3] & 0xFFFFFF) << 3))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[3] >> 24) & 0x7FFFFFF)) & 1))^((int64((in[3] >> 24) & 0x7FFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[3] >> 51) | ((in[4] & 0x3FFF) << 13)))) & 1))^((int64(((in[3] >> 51) | ((in[4] & 0x3FFF) << 13))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[4] >> 14) & 0x7FFFFFF)) & 1))^((int64((in[4] >> 14) & 0x7FFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[4] >> 41) | ((in[5] & 0xF) << 23)))) & 1))^((int64(((in[4] >> 41) | ((in[5] & 0xF) << 23))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[5] >> 4) & 0x7FFFFFF)) & 1))^((int64((in[5] >> 4) & 0x7FFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[5] >> 31) & 0x7FFFFFF)) & 1))^((int64((in[5] >> 31) & 0x7FFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0x1FFFFF) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0x1FFFFF) << 6))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[6] >> 21) & 0x7FFFFFF)) & 1))^((int64((in[6] >> 21) & 0x7FFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[6] >> 48) | ((in[7] & 0x7FF) << 16)))) & 1))^((int64(((in[6] >> 48) | ((in[7] & 0x7FF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[7] >> 11) & 0x7FFFFFF)) & 1))^((int64((in[7] >> 11) & 0x7FFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[7] >> 38) | ((in[8] & 0x1) << 26)))) & 1))^((int64(((in[7] >> 38) | ((in[8] & 0x1) << 26))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[8] >> 1) & 0x7FFFFFF)) & 1))^((int64((in[8] >> 1) & 0x7FFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64((in[8] >> 28) & 0x7FFFFFF)) & 1))^((int64((in[8] >> 28) & 0x7FFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[8] >> 55) | ((in[9] & 0x3FFFF) << 9)))) & 1))^((int64(((in[8] >> 55) | ((in[9] & 0x3FFFF) << 9))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[9] >> 18) & 0x7FFFFFF)) & 1))^((int64((in[9] >> 18) & 0x7FFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[9] >> 45) | ((in[10] & 0xFF) << 19)))) & 1))^((int64(((in[9] >> 45) | ((in[10] & 0xFF) << 19))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[10] >> 8) & 0x7FFFFFF)) & 1))^((int64((in[10] >> 8) & 0x7FFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[10] >> 35) & 0x7FFFFFF)) & 1))^((int64((in[10] >> 35) & 0x7FFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[10] >> 62) | ((in[11] & 0x1FFFFFF) << 2)))) & 1))^((int64(((in[10] >> 62) | ((in[11] & 0x1FFFFFF) << 2))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[11] >> 25) & 0x7FFFFFF)) & 1))^((int64((in[11] >> 25) & 0x7FFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0x7FFF) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0x7FFF) << 12))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[12] >> 15) & 0x7FFFFFF)) & 1))^((int64((in[12] >> 15) & 0x7FFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[12] >> 42) | ((in[13] & 0x1F) << 22)))) & 1))^((int64(((in[12] >> 42) | ((in[13] & 0x1F) << 22))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[13] >> 5) & 0x7FFFFFF)) & 1))^((int64((in[13] >> 5) & 0x7FFFFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[13] >> 32) & 0x7FFFFFF)) & 1))^((int64((in[13] >> 32) & 0x7FFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[13] >> 59) | ((in[14] & 0x3FFFFF) << 5)))) & 1))^((int64(((in[13] >> 59) | ((in[14] & 0x3FFFFF) << 5))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[14] >> 22) & 0x7FFFFFF)) & 1))^((int64((in[14] >> 22) & 0x7FFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[14] >> 49) | ((in[15] & 0xFFF) << 15)))) & 1))^((int64(((in[14] >> 49) | ((in[15] & 0xFFF) << 15))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[15] >> 12) & 0x7FFFFFF)) & 1))^((int64((in[15] >> 12) & 0x7FFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[15] >> 39) | ((in[16] & 0x3) << 25)))) & 1))^((int64(((in[15] >> 39) | ((in[16] & 0x3) << 25))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[16] >> 2) & 0x7FFFFFF)) & 1))^((int64((in[16] >> 2) & 0x7FFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[16] >> 29) & 0x7FFFFFF)) & 1))^((int64((in[16] >> 29) & 0x7FFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0x7FFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0x7FFFF) << 8))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[17] >> 19) & 0x7FFFFFF)) & 1))^((int64((in[17] >> 19) & 0x7FFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[17] >> 46) | ((in[18] & 0x1FF) << 18)))) & 1))^((int64(((in[17] >> 46) | ((in[18] & 0x1FF) << 18))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[18] >> 9) & 0x7FFFFFF)) & 1))^((int64((in[18] >> 9) & 0x7FFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64((in[18] >> 36) & 0x7FFFFFF)) & 1))^((int64((in[18] >> 36) & 0x7FFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[18] >> 63) | ((in[19] & 0x3FFFFFF) << 1)))) & 1))^((int64(((in[18] >> 63) | ((in[19] & 0x3FFFFFF) << 1))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[19] >> 26) & 0x7FFFFFF)) & 1))^((int64((in[19] >> 26) & 0x7FFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[19] >> 53) | ((in[20] & 0xFFFF) << 11)))) & 1))^((int64(((in[19] >> 53) | ((in[20] & 0xFFFF) << 11))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[20] >> 16) & 0x7FFFFFF)) & 1))^((int64((in[20] >> 16) & 0x7FFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[20] >> 43) | ((in[21] & 0x3F) << 21)))) & 1))^((int64(((in[20] >> 43) | ((in[21] & 0x3F) << 21))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[21] >> 6) & 0x7FFFFFF)) & 1))^((int64((in[21] >> 6) & 0x7FFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[21] >> 33) & 0x7FFFFFF)) & 1))^((int64((in[21] >> 33) & 0x7FFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[21] >> 60) | ((in[22] & 0x7FFFFF) << 4)))) & 1))^((int64(((in[21] >> 60) | ((in[22] & 0x7FFFFF) << 4))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[22] >> 23) & 0x7FFFFFF)) & 1))^((int64((in[22] >> 23) & 0x7FFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[22] >> 50) | ((in[23] & 0x1FFF) << 14)))) & 1))^((int64(((in[22] >> 50) | ((in[23] & 0x1FFF) << 14))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[23] >> 13) & 0x7FFFFFF)) & 1))^((int64((in[23] >> 13) & 0x7FFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[23] >> 40) | ((in[24] & 0x7) << 24)))) & 1))^((int64(((in[23] >> 40) | ((in[24] & 0x7) << 24))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[24] >> 3) & 0x7FFFFFF)) & 1))^((int64((in[24] >> 3) & 0x7FFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64((in[24] >> 30) & 0x7FFFFFF)) & 1))^((int64((in[24] >> 30) & 0x7FFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[24] >> 57) | ((in[25] & 0xFFFFF) << 7)))) & 1))^((int64(((in[24] >> 57) | ((in[25] & 0xFFFFF) << 7))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[25] >> 20) & 0x7FFFFFF)) & 1))^((int64((in[25] >> 20) & 0x7FFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[25] >> 47) | ((in[26] & 0x3FF) << 17)))) & 1))^((int64(((in[25] >> 47) | ((in[26] & 0x3FF) << 17))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[26] >> 10) & 0x7FFFFFF)) & 1))^((int64((in[26] >> 10) & 0x7FFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[26] >> 37))) & 1))^((int64((in[26] >> 37)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_28(initoffset uint64, in *[28]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 28) & 0xFFFFFFF)) & 1))^((int64((in[0] >> 28) & 0xFFFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 56) | ((in[1] & 0xFFFFF) << 8)))) & 1))^((int64(((in[0] >> 56) | ((in[1] & 0xFFFFF) << 8))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 20) & 0xFFFFFFF)) & 1))^((int64((in[1] >> 20) & 0xFFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[1] >> 48) | ((in[2] & 0xFFF) << 16)))) & 1))^((int64(((in[1] >> 48) | ((in[2] & 0xFFF) << 16))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[2] >> 12) & 0xFFFFFFF)) & 1))^((int64((in[2] >> 12) & 0xFFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[2] >> 40) | ((in[3] & 0xF) << 24)))) & 1))^((int64(((in[2] >> 40) | ((in[3] & 0xF) << 24))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[3] >> 4) & 0xFFFFFFF)) & 1))^((int64((in[3] >> 4) & 0xFFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64((in[3] >> 32) & 0xFFFFFFF)) & 1))^((int64((in[3] >> 32) & 0xFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0xFFFFFF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0xFFFFFF) << 4))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[4] >> 24) & 0xFFFFFFF)) & 1))^((int64((in[4] >> 24) & 0xFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[4] >> 52) | ((in[5] & 0xFFFF) << 12)))) & 1))^((int64(((in[4] >> 52) | ((in[5] & 0xFFFF) << 12))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[5] >> 16) & 0xFFFFFFF)) & 1))^((int64((in[5] >> 16) & 0xFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[5] >> 44) | ((in[6] & 0xFF) << 20)))) & 1))^((int64(((in[5] >> 44) | ((in[6] & 0xFF) << 20))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[6] >> 8) & 0xFFFFFFF)) & 1))^((int64((in[6] >> 8) & 0xFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[6] >> 36))) & 1))^((int64((in[6] >> 36)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[7] >> 0) & 0xFFFFFFF)) & 1))^((int64((in[7] >> 0) & 0xFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[7] >> 28) & 0xFFFFFFF)) & 1))^((int64((in[7] >> 28) & 0xFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0xFFFFF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0xFFFFF) << 8))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[8] >> 20) & 0xFFFFFFF)) & 1))^((int64((in[8] >> 20) & 0xFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[8] >> 48) | ((in[9] & 0xFFF) << 16)))) & 1))^((int64(((in[8] >> 48) | ((in[9] & 0xFFF) << 16))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[9] >> 12) & 0xFFFFFFF)) & 1))^((int64((in[9] >> 12) & 0xFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[9] >> 40) | ((in[10] & 0xF) << 24)))) & 1))^((int64(((in[9] >> 40) | ((in[10] & 0xF) << 24))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[10] >> 4) & 0xFFFFFFF)) & 1))^((int64((in[10] >> 4) & 0xFFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64((in[10] >> 32) & 0xFFFFFFF)) & 1))^((int64((in[10] >> 32) & 0xFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[10] >> 60) | ((in[11] & 0xFFFFFF) << 4)))) & 1))^((int64(((in[10] >> 60) | ((in[11] & 0xFFFFFF) << 4))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[11] >> 24) & 0xFFFFFFF)) & 1))^((int64((in[11] >> 24) & 0xFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0xFFFF) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0xFFFF) << 12))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[12] >> 16) & 0xFFFFFFF)) & 1))^((int64((in[12] >> 16) & 0xFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[12] >> 44) | ((in[13] & 0xFF) << 20)))) & 1))^((int64(((in[12] >> 44) | ((in[13] & 0xFF) << 20))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[13] >> 8) & 0xFFFFFFF)) & 1))^((int64((in[13] >> 8) & 0xFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[13] >> 36))) & 1))^((int64((in[13] >> 36)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[14] >> 0) & 0xFFFFFFF)) & 1))^((int64((in[14] >> 0) & 0xFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[14] >> 28) & 0xFFFFFFF)) & 1))^((int64((in[14] >> 28) & 0xFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[14] >> 56) | ((in[15] & 0xFFFFF) << 8)))) & 1))^((int64(((in[14] >> 56) | ((in[15] & 0xFFFFF) << 8))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[15] >> 20) & 0xFFFFFFF)) & 1))^((int64((in[15] >> 20) & 0xFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0xFFF) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0xFFF) << 16))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[16] >> 12) & 0xFFFFFFF)) & 1))^((int64((in[16] >> 12) & 0xFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[16] >> 40) | ((in[17] & 0xF) << 24)))) & 1))^((int64(((in[16] >> 40) | ((in[17] & 0xF) << 24))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[17] >> 4) & 0xFFFFFFF)) & 1))^((int64((in[17] >> 4) & 0xFFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64((in[17] >> 32) & 0xFFFFFFF)) & 1))^((int64((in[17] >> 32) & 0xFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[17] >> 60) | ((in[18] & 0xFFFFFF) << 4)))) & 1))^((int64(((in[17] >> 60) | ((in[18] & 0xFFFFFF) << 4))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[18] >> 24) & 0xFFFFFFF)) & 1))^((int64((in[18] >> 24) & 0xFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[18] >> 52) | ((in[19] & 0xFFFF) << 12)))) & 1))^((int64(((in[18] >> 52) | ((in[19] & 0xFFFF) << 12))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[19] >> 16) & 0xFFFFFFF)) & 1))^((int64((in[19] >> 16) & 0xFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0xFF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0xFF) << 20))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[20] >> 8) & 0xFFFFFFF)) & 1))^((int64((in[20] >> 8) & 0xFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[20] >> 36))) & 1))^((int64((in[20] >> 36)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[21] >> 0) & 0xFFFFFFF)) & 1))^((int64((in[21] >> 0) & 0xFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[21] >> 28) & 0xFFFFFFF)) & 1))^((int64((in[21] >> 28) & 0xFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[21] >> 56) | ((in[22] & 0xFFFFF) << 8)))) & 1))^((int64(((in[21] >> 56) | ((in[22] & 0xFFFFF) << 8))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[22] >> 20) & 0xFFFFFFF)) & 1))^((int64((in[22] >> 20) & 0xFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[22] >> 48) | ((in[23] & 0xFFF) << 16)))) & 1))^((int64(((in[22] >> 48) | ((in[23] & 0xFFF) << 16))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[23] >> 12) & 0xFFFFFFF)) & 1))^((int64((in[23] >> 12) & 0xFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[23] >> 40) | ((in[24] & 0xF) << 24)))) & 1))^((int64(((in[23] >> 40) | ((in[24] & 0xF) << 24))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[24] >> 4) & 0xFFFFFFF)) & 1))^((int64((in[24] >> 4) & 0xFFFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64((in[24] >> 32) & 0xFFFFFFF)) & 1))^((int64((in[24] >> 32) & 0xFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[24] >> 60) | ((in[25] & 0xFFFFFF) << 4)))) & 1))^((int64(((in[24] >> 60) | ((in[25] & 0xFFFFFF) << 4))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[25] >> 24) & 0xFFFFFFF)) & 1))^((int64((in[25] >> 24) & 0xFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[25] >> 52) | ((in[26] & 0xFFFF) << 12)))) & 1))^((int64(((in[25] >> 52) | ((in[26] & 0xFFFF) << 12))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[26] >> 16) & 0xFFFFFFF)) & 1))^((int64((in[26] >> 16) & 0xFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[26] >> 44) | ((in[27] & 0xFF) << 20)))) & 1))^((int64(((in[26] >> 44) | ((in[27] & 0xFF) << 20))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[27] >> 8) & 0xFFFFFFF)) & 1))^((int64((in[27] >> 8) & 0xFFFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[27] >> 36))) & 1))^((int64((in[27] >> 36)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_29(initoffset uint64, in *[29]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 29) & 0x1FFFFFFF)) & 1))^((int64((in[0] >> 29) & 0x1FFFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 58) | ((in[1] & 0x7FFFFF) << 6)))) & 1))^((int64(((in[0] >> 58) | ((in[1] & 0x7FFFFF) << 6))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 23) & 0x1FFFFFFF)) & 1))^((int64((in[1] >> 23) & 0x1FFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[1] >> 52) | ((in[2] & 0x1FFFF) << 12)))) & 1))^((int64(((in[1] >> 52) | ((in[2] & 0x1FFFF) << 12))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[2] >> 17) & 0x1FFFFFFF)) & 1))^((int64((in[2] >> 17) & 0x1FFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[2] >> 46) | ((in[3] & 0x7FF) << 18)))) & 1))^((int64(((in[2] >> 46) | ((in[3] & 0x7FF) << 18))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[3] >> 11) & 0x1FFFFFFF)) & 1))^((int64((in[3] >> 11) & 0x1FFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[3] >> 40) | ((in[4] & 0x1F) << 24)))) & 1))^((int64(((in[3] >> 40) | ((in[4] & 0x1F) << 24))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[4] >> 5) & 0x1FFFFFFF)) & 1))^((int64((in[4] >> 5) & 0x1FFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64((in[4] >> 34) & 0x1FFFFFFF)) & 1))^((int64((in[4] >> 34) & 0x1FFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[4] >> 63) | ((in[5] & 0xFFFFFFF) << 1)))) & 1))^((int64(((in[4] >> 63) | ((in[5] & 0xFFFFFFF) << 1))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[5] >> 28) & 0x1FFFFFFF)) & 1))^((int64((in[5] >> 28) & 0x1FFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[5] >> 57) | ((in[6] & 0x3FFFFF) << 7)))) & 1))^((int64(((in[5] >> 57) | ((in[6] & 0x3FFFFF) << 7))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[6] >> 22) & 0x1FFFFFFF)) & 1))^((int64((in[6] >> 22) & 0x1FFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[6] >> 51) | ((in[7] & 0xFFFF) << 13)))) & 1))^((int64(((in[6] >> 51) | ((in[7] & 0xFFFF) << 13))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[7] >> 16) & 0x1FFFFFFF)) & 1))^((int64((in[7] >> 16) & 0x1FFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[7] >> 45) | ((in[8] & 0x3FF) << 19)))) & 1))^((int64(((in[7] >> 45) | ((in[8] & 0x3FF) << 19))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[8] >> 10) & 0x1FFFFFFF)) & 1))^((int64((in[8] >> 10) & 0x1FFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[8] >> 39) | ((in[9] & 0xF) << 25)))) & 1))^((int64(((in[8] >> 39) | ((in[9] & 0xF) << 25))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[9] >> 4) & 0x1FFFFFFF)) & 1))^((int64((in[9] >> 4) & 0x1FFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[9] >> 33) & 0x1FFFFFFF)) & 1))^((int64((in[9] >> 33) & 0x1FFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[9] >> 62) | ((in[10] & 0x7FFFFFF) << 2)))) & 1))^((int64(((in[9] >> 62) | ((in[10] & 0x7FFFFFF) << 2))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[10] >> 27) & 0x1FFFFFFF)) & 1))^((int64((in[10] >> 27) & 0x1FFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[10] >> 56) | ((in[11] & 0x1FFFFF) << 8)))) & 1))^((int64(((in[10] >> 56) | ((in[11] & 0x1FFFFF) << 8))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[11] >> 21) & 0x1FFFFFFF)) & 1))^((int64((in[11] >> 21) & 0x1FFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[11] >> 50) | ((in[12] & 0x7FFF) << 14)))) & 1))^((int64(((in[11] >> 50) | ((in[12] & 0x7FFF) << 14))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[12] >> 15) & 0x1FFFFFFF)) & 1))^((int64((in[12] >> 15) & 0x1FFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[12] >> 44) | ((in[13] & 0x1FF) << 20)))) & 1))^((int64(((in[12] >> 44) | ((in[13] & 0x1FF) << 20))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[13] >> 9) & 0x1FFFFFFF)) & 1))^((int64((in[13] >> 9) & 0x1FFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[13] >> 38) | ((in[14] & 0x7) << 26)))) & 1))^((int64(((in[13] >> 38) | ((in[14] & 0x7) << 26))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[14] >> 3) & 0x1FFFFFFF)) & 1))^((int64((in[14] >> 3) & 0x1FFFFFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[14] >> 32) & 0x1FFFFFFF)) & 1))^((int64((in[14] >> 32) & 0x1FFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[14] >> 61) | ((in[15] & 0x3FFFFFF) << 3)))) & 1))^((int64(((in[14] >> 61) | ((in[15] & 0x3FFFFFF) << 3))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[15] >> 26) & 0x1FFFFFFF)) & 1))^((int64((in[15] >> 26) & 0x1FFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[15] >> 55) | ((in[16] & 0xFFFFF) << 9)))) & 1))^((int64(((in[15] >> 55) | ((in[16] & 0xFFFFF) << 9))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[16] >> 20) & 0x1FFFFFFF)) & 1))^((int64((in[16] >> 20) & 0x1FFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[16] >> 49) | ((in[17] & 0x3FFF) << 15)))) & 1))^((int64(((in[16] >> 49) | ((in[17] & 0x3FFF) << 15))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[17] >> 14) & 0x1FFFFFFF)) & 1))^((int64((in[17] >> 14) & 0x1FFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[17] >> 43) | ((in[18] & 0xFF) << 21)))) & 1))^((int64(((in[17] >> 43) | ((in[18] & 0xFF) << 21))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[18] >> 8) & 0x1FFFFFFF)) & 1))^((int64((in[18] >> 8) & 0x1FFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[18] >> 37) | ((in[19] & 0x3) << 27)))) & 1))^((int64(((in[18] >> 37) | ((in[19] & 0x3) << 27))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[19] >> 2) & 0x1FFFFFFF)) & 1))^((int64((in[19] >> 2) & 0x1FFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[19] >> 31) & 0x1FFFFFFF)) & 1))^((int64((in[19] >> 31) & 0x1FFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[19] >> 60) | ((in[20] & 0x1FFFFFF) << 4)))) & 1))^((int64(((in[19] >> 60) | ((in[20] & 0x1FFFFFF) << 4))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[20] >> 25) & 0x1FFFFFFF)) & 1))^((int64((in[20] >> 25) & 0x1FFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[20] >> 54) | ((in[21] & 0x7FFFF) << 10)))) & 1))^((int64(((in[20] >> 54) | ((in[21] & 0x7FFFF) << 10))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[21] >> 19) & 0x1FFFFFFF)) & 1))^((int64((in[21] >> 19) & 0x1FFFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[21] >> 48) | ((in[22] & 0x1FFF) << 16)))) & 1))^((int64(((in[21] >> 48) | ((in[22] & 0x1FFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[22] >> 13) & 0x1FFFFFFF)) & 1))^((int64((in[22] >> 13) & 0x1FFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[22] >> 42) | ((in[23] & 0x7F) << 22)))) & 1))^((int64(((in[22] >> 42) | ((in[23] & 0x7F) << 22))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[23] >> 7) & 0x1FFFFFFF)) & 1))^((int64((in[23] >> 7) & 0x1FFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[23] >> 36) | ((in[24] & 0x1) << 28)))) & 1))^((int64(((in[23] >> 36) | ((in[24] & 0x1) << 28))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[24] >> 1) & 0x1FFFFFFF)) & 1))^((int64((in[24] >> 1) & 0x1FFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64((in[24] >> 30) & 0x1FFFFFFF)) & 1))^((int64((in[24] >> 30) & 0x1FFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[24] >> 59) | ((in[25] & 0xFFFFFF) << 5)))) & 1))^((int64(((in[24] >> 59) | ((in[25] & 0xFFFFFF) << 5))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[25] >> 24) & 0x1FFFFFFF)) & 1))^((int64((in[25] >> 24) & 0x1FFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[25] >> 53) | ((in[26] & 0x3FFFF) << 11)))) & 1))^((int64(((in[25] >> 53) | ((in[26] & 0x3FFFF) << 11))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[26] >> 18) & 0x1FFFFFFF)) & 1))^((int64((in[26] >> 18) & 0x1FFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[26] >> 47) | ((in[27] & 0xFFF) << 17)))) & 1))^((int64(((in[26] >> 47) | ((in[27] & 0xFFF) << 17))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[27] >> 12) & 0x1FFFFFFF)) & 1))^((int64((in[27] >> 12) & 0x1FFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[27] >> 41) | ((in[28] & 0x3F) << 23)))) & 1))^((int64(((in[27] >> 41) | ((in[28] & 0x3F) << 23))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[28] >> 6) & 0x1FFFFFFF)) & 1))^((int64((in[28] >> 6) & 0x1FFFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[28] >> 35))) & 1))^((int64((in[28] >> 35)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_30(initoffset uint64, in *[30]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 30) & 0x3FFFFFFF)) & 1))^((int64((in[0] >> 30) & 0x3FFFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0x3FFFFFF) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0x3FFFFFF) << 4))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 26) & 0x3FFFFFFF)) & 1))^((int64((in[1] >> 26) & 0x3FFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0x3FFFFF) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0x3FFFFF) << 8))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[2] >> 22) & 0x3FFFFFFF)) & 1))^((int64((in[2] >> 22) & 0x3FFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[2] >> 52) | ((in[3] & 0x3FFFF) << 12)))) & 1))^((int64(((in[2] >> 52) | ((in[3] & 0x3FFFF) << 12))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[3] >> 18) & 0x3FFFFFFF)) & 1))^((int64((in[3] >> 18) & 0x3FFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[3] >> 48) | ((in[4] & 0x3FFF) << 16)))) & 1))^((int64(((in[3] >> 48) | ((in[4] & 0x3FFF) << 16))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[4] >> 14) & 0x3FFFFFFF)) & 1))^((int64((in[4] >> 14) & 0x3FFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[4] >> 44) | ((in[5] & 0x3FF) << 20)))) & 1))^((int64(((in[4] >> 44) | ((in[5] & 0x3FF) << 20))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[5] >> 10) & 0x3FFFFFFF)) & 1))^((int64((in[5] >> 10) & 0x3FFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[5] >> 40) | ((in[6] & 0x3F) << 24)))) & 1))^((int64(((in[5] >> 40) | ((in[6] & 0x3F) << 24))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[6] >> 6) & 0x3FFFFFFF)) & 1))^((int64((in[6] >> 6) & 0x3FFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[6] >> 36) | ((in[7] & 0x3) << 28)))) & 1))^((int64(((in[6] >> 36) | ((in[7] & 0x3) << 28))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[7] >> 2) & 0x3FFFFFFF)) & 1))^((int64((in[7] >> 2) & 0x3FFFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64((in[7] >> 32) & 0x3FFFFFFF)) & 1))^((int64((in[7] >> 32) & 0x3FFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[7] >> 62) | ((in[8] & 0xFFFFFFF) << 2)))) & 1))^((int64(((in[7] >> 62) | ((in[8] & 0xFFFFFFF) << 2))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[8] >> 28) & 0x3FFFFFFF)) & 1))^((int64((in[8] >> 28) & 0x3FFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[8] >> 58) | ((in[9] & 0xFFFFFF) << 6)))) & 1))^((int64(((in[8] >> 58) | ((in[9] & 0xFFFFFF) << 6))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[9] >> 24) & 0x3FFFFFFF)) & 1))^((int64((in[9] >> 24) & 0x3FFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0xFFFFF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0xFFFFF) << 10))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[10] >> 20) & 0x3FFFFFFF)) & 1))^((int64((in[10] >> 20) & 0x3FFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[10] >> 50) | ((in[11] & 0xFFFF) << 14)))) & 1))^((int64(((in[10] >> 50) | ((in[11] & 0xFFFF) << 14))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[11] >> 16) & 0x3FFFFFFF)) & 1))^((int64((in[11] >> 16) & 0x3FFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[11] >> 46) | ((in[12] & 0xFFF) << 18)))) & 1))^((int64(((in[11] >> 46) | ((in[12] & 0xFFF) << 18))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[12] >> 12) & 0x3FFFFFFF)) & 1))^((int64((in[12] >> 12) & 0x3FFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[12] >> 42) | ((in[13] & 0xFF) << 22)))) & 1))^((int64(((in[12] >> 42) | ((in[13] & 0xFF) << 22))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[13] >> 8) & 0x3FFFFFFF)) & 1))^((int64((in[13] >> 8) & 0x3FFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[13] >> 38) | ((in[14] & 0xF) << 26)))) & 1))^((int64(((in[13] >> 38) | ((in[14] & 0xF) << 26))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[14] >> 4) & 0x3FFFFFFF)) & 1))^((int64((in[14] >> 4) & 0x3FFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[14] >> 34))) & 1))^((int64((in[14] >> 34)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[15] >> 0) & 0x3FFFFFFF)) & 1))^((int64((in[15] >> 0) & 0x3FFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[15] >> 30) & 0x3FFFFFFF)) & 1))^((int64((in[15] >> 30) & 0x3FFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[15] >> 60) | ((in[16] & 0x3FFFFFF) << 4)))) & 1))^((int64(((in[15] >> 60) | ((in[16] & 0x3FFFFFF) << 4))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[16] >> 26) & 0x3FFFFFFF)) & 1))^((int64((in[16] >> 26) & 0x3FFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0x3FFFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0x3FFFFF) << 8))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[17] >> 22) & 0x3FFFFFFF)) & 1))^((int64((in[17] >> 22) & 0x3FFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[17] >> 52) | ((in[18] & 0x3FFFF) << 12)))) & 1))^((int64(((in[17] >> 52) | ((in[18] & 0x3FFFF) << 12))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[18] >> 18) & 0x3FFFFFFF)) & 1))^((int64((in[18] >> 18) & 0x3FFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0x3FFF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0x3FFF) << 16))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[19] >> 14) & 0x3FFFFFFF)) & 1))^((int64((in[19] >> 14) & 0x3FFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0x3FF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0x3FF) << 20))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[20] >> 10) & 0x3FFFFFFF)) & 1))^((int64((in[20] >> 10) & 0x3FFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[20] >> 40) | ((in[21] & 0x3F) << 24)))) & 1))^((int64(((in[20] >> 40) | ((in[21] & 0x3F) << 24))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[21] >> 6) & 0x3FFFFFFF)) & 1))^((int64((in[21] >> 6) & 0x3FFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[21] >> 36) | ((in[22] & 0x3) << 28)))) & 1))^((int64(((in[21] >> 36) | ((in[22] & 0x3) << 28))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[22] >> 2) & 0x3FFFFFFF)) & 1))^((int64((in[22] >> 2) & 0x3FFFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64((in[22] >> 32) & 0x3FFFFFFF)) & 1))^((int64((in[22] >> 32) & 0x3FFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[22] >> 62) | ((in[23] & 0xFFFFFFF) << 2)))) & 1))^((int64(((in[22] >> 62) | ((in[23] & 0xFFFFFFF) << 2))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[23] >> 28) & 0x3FFFFFFF)) & 1))^((int64((in[23] >> 28) & 0x3FFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[23] >> 58) | ((in[24] & 0xFFFFFF) << 6)))) & 1))^((int64(((in[23] >> 58) | ((in[24] & 0xFFFFFF) << 6))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[24] >> 24) & 0x3FFFFFFF)) & 1))^((int64((in[24] >> 24) & 0x3FFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[24] >> 54) | ((in[25] & 0xFFFFF) << 10)))) & 1))^((int64(((in[24] >> 54) | ((in[25] & 0xFFFFF) << 10))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[25] >> 20) & 0x3FFFFFFF)) & 1))^((int64((in[25] >> 20) & 0x3FFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[25] >> 50) | ((in[26] & 0xFFFF) << 14)))) & 1))^((int64(((in[25] >> 50) | ((in[26] & 0xFFFF) << 14))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[26] >> 16) & 0x3FFFFFFF)) & 1))^((int64((in[26] >> 16) & 0x3FFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[26] >> 46) | ((in[27] & 0xFFF) << 18)))) & 1))^((int64(((in[26] >> 46) | ((in[27] & 0xFFF) << 18))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[27] >> 12) & 0x3FFFFFFF)) & 1))^((int64((in[27] >> 12) & 0x3FFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[27] >> 42) | ((in[28] & 0xFF) << 22)))) & 1))^((int64(((in[27] >> 42) | ((in[28] & 0xFF) << 22))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[28] >> 8) & 0x3FFFFFFF)) & 1))^((int64((in[28] >> 8) & 0x3FFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[28] >> 38) | ((in[29] & 0xF) << 26)))) & 1))^((int64(((in[28] >> 38) | ((in[29] & 0xF) << 26))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[29] >> 4) & 0x3FFFFFFF)) & 1))^((int64((in[29] >> 4) & 0x3FFFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[29] >> 34))) & 1))^((int64((in[29] >> 34)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_31(initoffset uint64, in *[31]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 31) & 0x7FFFFFFF)) & 1))^((int64((in[0] >> 31) & 0x7FFFFFFF))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[0] >> 62) | ((in[1] & 0x1FFFFFFF) << 2)))) & 1))^((int64(((in[0] >> 62) | ((in[1] & 0x1FFFFFFF) << 2))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 29) & 0x7FFFFFFF)) & 1))^((int64((in[1] >> 29) & 0x7FFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[1] >> 60) | ((in[2] & 0x7FFFFFF) << 4)))) & 1))^((int64(((in[1] >> 60) | ((in[2] & 0x7FFFFFF) << 4))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[2] >> 27) & 0x7FFFFFFF)) & 1))^((int64((in[2] >> 27) & 0x7FFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[2] >> 58) | ((in[3] & 0x1FFFFFF) << 6)))) & 1))^((int64(((in[2] >> 58) | ((in[3] & 0x1FFFFFF) << 6))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[3] >> 25) & 0x7FFFFFFF)) & 1))^((int64((in[3] >> 25) & 0x7FFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[3] >> 56) | ((in[4] & 0x7FFFFF) << 8)))) & 1))^((int64(((in[3] >> 56) | ((in[4] & 0x7FFFFF) << 8))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[4] >> 23) & 0x7FFFFFFF)) & 1))^((int64((in[4] >> 23) & 0x7FFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[4] >> 54) | ((in[5] & 0x1FFFFF) << 10)))) & 1))^((int64(((in[4] >> 54) | ((in[5] & 0x1FFFFF) << 10))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[5] >> 21) & 0x7FFFFFFF)) & 1))^((int64((in[5] >> 21) & 0x7FFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[5] >> 52) | ((in[6] & 0x7FFFF) << 12)))) & 1))^((int64(((in[5] >> 52) | ((in[6] & 0x7FFFF) << 12))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[6] >> 19) & 0x7FFFFFFF)) & 1))^((int64((in[6] >> 19) & 0x7FFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[6] >> 50) | ((in[7] & 0x1FFFF) << 14)))) & 1))^((int64(((in[6] >> 50) | ((in[7] & 0x1FFFF) << 14))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[7] >> 17) & 0x7FFFFFFF)) & 1))^((int64((in[7] >> 17) & 0x7FFFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[7] >> 48) | ((in[8] & 0x7FFF) << 16)))) & 1))^((int64(((in[7] >> 48) | ((in[8] & 0x7FFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[8] >> 15) & 0x7FFFFFFF)) & 1))^((int64((in[8] >> 15) & 0x7FFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[8] >> 46) | ((in[9] & 0x1FFF) << 18)))) & 1))^((int64(((in[8] >> 46) | ((in[9] & 0x1FFF) << 18))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[9] >> 13) & 0x7FFFFFFF)) & 1))^((int64((in[9] >> 13) & 0x7FFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[9] >> 44) | ((in[10] & 0x7FF) << 20)))) & 1))^((int64(((in[9] >> 44) | ((in[10] & 0x7FF) << 20))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[10] >> 11) & 0x7FFFFFFF)) & 1))^((int64((in[10] >> 11) & 0x7FFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[10] >> 42) | ((in[11] & 0x1FF) << 22)))) & 1))^((int64(((in[10] >> 42) | ((in[11] & 0x1FF) << 22))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[11] >> 9) & 0x7FFFFFFF)) & 1))^((int64((in[11] >> 9) & 0x7FFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[11] >> 40) | ((in[12] & 0x7F) << 24)))) & 1))^((int64(((in[11] >> 40) | ((in[12] & 0x7F) << 24))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[12] >> 7) & 0x7FFFFFFF)) & 1))^((int64((in[12] >> 7) & 0x7FFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[12] >> 38) | ((in[13] & 0x1F) << 26)))) & 1))^((int64(((in[12] >> 38) | ((in[13] & 0x1F) << 26))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[13] >> 5) & 0x7FFFFFFF)) & 1))^((int64((in[13] >> 5) & 0x7FFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[13] >> 36) | ((in[14] & 0x7) << 28)))) & 1))^((int64(((in[13] >> 36) | ((in[14] & 0x7) << 28))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[14] >> 3) & 0x7FFFFFFF)) & 1))^((int64((in[14] >> 3) & 0x7FFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[14] >> 34) | ((in[15] & 0x1) << 30)))) & 1))^((int64(((in[14] >> 34) | ((in[15] & 0x1) << 30))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[15] >> 1) & 0x7FFFFFFF)) & 1))^((int64((in[15] >> 1) & 0x7FFFFFFF))>>1))) + out[30] + out[32] = uint64(((-((int64((in[15] >> 32) & 0x7FFFFFFF)) & 1))^((int64((in[15] >> 32) & 0x7FFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[15] >> 63) | ((in[16] & 0x3FFFFFFF) << 1)))) & 1))^((int64(((in[15] >> 63) | ((in[16] & 0x3FFFFFFF) << 1))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[16] >> 30) & 0x7FFFFFFF)) & 1))^((int64((in[16] >> 30) & 0x7FFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[16] >> 61) | ((in[17] & 0xFFFFFFF) << 3)))) & 1))^((int64(((in[16] >> 61) | ((in[17] & 0xFFFFFFF) << 3))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[17] >> 28) & 0x7FFFFFFF)) & 1))^((int64((in[17] >> 28) & 0x7FFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[17] >> 59) | ((in[18] & 0x3FFFFFF) << 5)))) & 1))^((int64(((in[17] >> 59) | ((in[18] & 0x3FFFFFF) << 5))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[18] >> 26) & 0x7FFFFFFF)) & 1))^((int64((in[18] >> 26) & 0x7FFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[18] >> 57) | ((in[19] & 0xFFFFFF) << 7)))) & 1))^((int64(((in[18] >> 57) | ((in[19] & 0xFFFFFF) << 7))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[19] >> 24) & 0x7FFFFFFF)) & 1))^((int64((in[19] >> 24) & 0x7FFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[19] >> 55) | ((in[20] & 0x3FFFFF) << 9)))) & 1))^((int64(((in[19] >> 55) | ((in[20] & 0x3FFFFF) << 9))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[20] >> 22) & 0x7FFFFFFF)) & 1))^((int64((in[20] >> 22) & 0x7FFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[20] >> 53) | ((in[21] & 0xFFFFF) << 11)))) & 1))^((int64(((in[20] >> 53) | ((in[21] & 0xFFFFF) << 11))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[21] >> 20) & 0x7FFFFFFF)) & 1))^((int64((in[21] >> 20) & 0x7FFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[21] >> 51) | ((in[22] & 0x3FFFF) << 13)))) & 1))^((int64(((in[21] >> 51) | ((in[22] & 0x3FFFF) << 13))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[22] >> 18) & 0x7FFFFFFF)) & 1))^((int64((in[22] >> 18) & 0x7FFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[22] >> 49) | ((in[23] & 0xFFFF) << 15)))) & 1))^((int64(((in[22] >> 49) | ((in[23] & 0xFFFF) << 15))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[23] >> 16) & 0x7FFFFFFF)) & 1))^((int64((in[23] >> 16) & 0x7FFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[23] >> 47) | ((in[24] & 0x3FFF) << 17)))) & 1))^((int64(((in[23] >> 47) | ((in[24] & 0x3FFF) << 17))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[24] >> 14) & 0x7FFFFFFF)) & 1))^((int64((in[24] >> 14) & 0x7FFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[24] >> 45) | ((in[25] & 0xFFF) << 19)))) & 1))^((int64(((in[24] >> 45) | ((in[25] & 0xFFF) << 19))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[25] >> 12) & 0x7FFFFFFF)) & 1))^((int64((in[25] >> 12) & 0x7FFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[25] >> 43) | ((in[26] & 0x3FF) << 21)))) & 1))^((int64(((in[25] >> 43) | ((in[26] & 0x3FF) << 21))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[26] >> 10) & 0x7FFFFFFF)) & 1))^((int64((in[26] >> 10) & 0x7FFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[26] >> 41) | ((in[27] & 0xFF) << 23)))) & 1))^((int64(((in[26] >> 41) | ((in[27] & 0xFF) << 23))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[27] >> 8) & 0x7FFFFFFF)) & 1))^((int64((in[27] >> 8) & 0x7FFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[27] >> 39) | ((in[28] & 0x3F) << 25)))) & 1))^((int64(((in[27] >> 39) | ((in[28] & 0x3F) << 25))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[28] >> 6) & 0x7FFFFFFF)) & 1))^((int64((in[28] >> 6) & 0x7FFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[28] >> 37) | ((in[29] & 0xF) << 27)))) & 1))^((int64(((in[28] >> 37) | ((in[29] & 0xF) << 27))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[29] >> 4) & 0x7FFFFFFF)) & 1))^((int64((in[29] >> 4) & 0x7FFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[29] >> 35) | ((in[30] & 0x3) << 29)))) & 1))^((int64(((in[29] >> 35) | ((in[30] & 0x3) << 29))))>>1))) + out[60] + out[62] = uint64(((-((int64((in[30] >> 2) & 0x7FFFFFFF)) & 1))^((int64((in[30] >> 2) & 0x7FFFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[30] >> 33))) & 1))^((int64((in[30] >> 33)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_32(initoffset uint64, in *[32]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64((in[0] >> 32))) & 1))^((int64((in[0] >> 32)))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[1] >> 0) & 0xFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64((in[1] >> 32))) & 1))^((int64((in[1] >> 32)))>>1))) + out[2] + out[4] = uint64(((-((int64((in[2] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[2] >> 0) & 0xFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64((in[2] >> 32))) & 1))^((int64((in[2] >> 32)))>>1))) + out[4] + out[6] = uint64(((-((int64((in[3] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[3] >> 0) & 0xFFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64((in[3] >> 32))) & 1))^((int64((in[3] >> 32)))>>1))) + out[6] + out[8] = uint64(((-((int64((in[4] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[4] >> 0) & 0xFFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64((in[4] >> 32))) & 1))^((int64((in[4] >> 32)))>>1))) + out[8] + out[10] = uint64(((-((int64((in[5] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[5] >> 0) & 0xFFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64((in[5] >> 32))) & 1))^((int64((in[5] >> 32)))>>1))) + out[10] + out[12] = uint64(((-((int64((in[6] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[6] >> 0) & 0xFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64((in[6] >> 32))) & 1))^((int64((in[6] >> 32)))>>1))) + out[12] + out[14] = uint64(((-((int64((in[7] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[7] >> 0) & 0xFFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64((in[7] >> 32))) & 1))^((int64((in[7] >> 32)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[8] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[8] >> 0) & 0xFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64((in[8] >> 32))) & 1))^((int64((in[8] >> 32)))>>1))) + out[16] + out[18] = uint64(((-((int64((in[9] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[9] >> 0) & 0xFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64((in[9] >> 32))) & 1))^((int64((in[9] >> 32)))>>1))) + out[18] + out[20] = uint64(((-((int64((in[10] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[10] >> 0) & 0xFFFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64((in[10] >> 32))) & 1))^((int64((in[10] >> 32)))>>1))) + out[20] + out[22] = uint64(((-((int64((in[11] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[11] >> 0) & 0xFFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64((in[11] >> 32))) & 1))^((int64((in[11] >> 32)))>>1))) + out[22] + out[24] = uint64(((-((int64((in[12] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[12] >> 0) & 0xFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64((in[12] >> 32))) & 1))^((int64((in[12] >> 32)))>>1))) + out[24] + out[26] = uint64(((-((int64((in[13] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[13] >> 0) & 0xFFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64((in[13] >> 32))) & 1))^((int64((in[13] >> 32)))>>1))) + out[26] + out[28] = uint64(((-((int64((in[14] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[14] >> 0) & 0xFFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64((in[14] >> 32))) & 1))^((int64((in[14] >> 32)))>>1))) + out[28] + out[30] = uint64(((-((int64((in[15] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[15] >> 0) & 0xFFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64((in[15] >> 32))) & 1))^((int64((in[15] >> 32)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[16] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[16] >> 0) & 0xFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64((in[16] >> 32))) & 1))^((int64((in[16] >> 32)))>>1))) + out[32] + out[34] = uint64(((-((int64((in[17] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[17] >> 0) & 0xFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64((in[17] >> 32))) & 1))^((int64((in[17] >> 32)))>>1))) + out[34] + out[36] = uint64(((-((int64((in[18] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[18] >> 0) & 0xFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64((in[18] >> 32))) & 1))^((int64((in[18] >> 32)))>>1))) + out[36] + out[38] = uint64(((-((int64((in[19] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[19] >> 0) & 0xFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64((in[19] >> 32))) & 1))^((int64((in[19] >> 32)))>>1))) + out[38] + out[40] = uint64(((-((int64((in[20] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[20] >> 0) & 0xFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64((in[20] >> 32))) & 1))^((int64((in[20] >> 32)))>>1))) + out[40] + out[42] = uint64(((-((int64((in[21] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[21] >> 0) & 0xFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64((in[21] >> 32))) & 1))^((int64((in[21] >> 32)))>>1))) + out[42] + out[44] = uint64(((-((int64((in[22] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[22] >> 0) & 0xFFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64((in[22] >> 32))) & 1))^((int64((in[22] >> 32)))>>1))) + out[44] + out[46] = uint64(((-((int64((in[23] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[23] >> 0) & 0xFFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64((in[23] >> 32))) & 1))^((int64((in[23] >> 32)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[24] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[24] >> 0) & 0xFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64((in[24] >> 32))) & 1))^((int64((in[24] >> 32)))>>1))) + out[48] + out[50] = uint64(((-((int64((in[25] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[25] >> 0) & 0xFFFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64((in[25] >> 32))) & 1))^((int64((in[25] >> 32)))>>1))) + out[50] + out[52] = uint64(((-((int64((in[26] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[26] >> 0) & 0xFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64((in[26] >> 32))) & 1))^((int64((in[26] >> 32)))>>1))) + out[52] + out[54] = uint64(((-((int64((in[27] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[27] >> 0) & 0xFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64((in[27] >> 32))) & 1))^((int64((in[27] >> 32)))>>1))) + out[54] + out[56] = uint64(((-((int64((in[28] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[28] >> 0) & 0xFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64((in[28] >> 32))) & 1))^((int64((in[28] >> 32)))>>1))) + out[56] + out[58] = uint64(((-((int64((in[29] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[29] >> 0) & 0xFFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64((in[29] >> 32))) & 1))^((int64((in[29] >> 32)))>>1))) + out[58] + out[60] = uint64(((-((int64((in[30] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[30] >> 0) & 0xFFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64((in[30] >> 32))) & 1))^((int64((in[30] >> 32)))>>1))) + out[60] + out[62] = uint64(((-((int64((in[31] >> 0) & 0xFFFFFFFF)) & 1))^((int64((in[31] >> 0) & 0xFFFFFFFF))>>1))) + out[61] + out[63] = uint64(((-((int64((in[31] >> 32))) & 1))^((int64((in[31] >> 32)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_33(initoffset uint64, in *[33]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 33) | ((in[1] & 0x3) << 31)))) & 1))^((int64(((in[0] >> 33) | ((in[1] & 0x3) << 31))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 2) & 0x1FFFFFFFF)) & 1))^((int64((in[1] >> 2) & 0x1FFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 35) | ((in[2] & 0xF) << 29)))) & 1))^((int64(((in[1] >> 35) | ((in[2] & 0xF) << 29))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[2] >> 4) & 0x1FFFFFFFF)) & 1))^((int64((in[2] >> 4) & 0x1FFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[2] >> 37) | ((in[3] & 0x3F) << 27)))) & 1))^((int64(((in[2] >> 37) | ((in[3] & 0x3F) << 27))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[3] >> 6) & 0x1FFFFFFFF)) & 1))^((int64((in[3] >> 6) & 0x1FFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[3] >> 39) | ((in[4] & 0xFF) << 25)))) & 1))^((int64(((in[3] >> 39) | ((in[4] & 0xFF) << 25))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[4] >> 8) & 0x1FFFFFFFF)) & 1))^((int64((in[4] >> 8) & 0x1FFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[4] >> 41) | ((in[5] & 0x3FF) << 23)))) & 1))^((int64(((in[4] >> 41) | ((in[5] & 0x3FF) << 23))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[5] >> 10) & 0x1FFFFFFFF)) & 1))^((int64((in[5] >> 10) & 0x1FFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[5] >> 43) | ((in[6] & 0xFFF) << 21)))) & 1))^((int64(((in[5] >> 43) | ((in[6] & 0xFFF) << 21))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[6] >> 12) & 0x1FFFFFFFF)) & 1))^((int64((in[6] >> 12) & 0x1FFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[6] >> 45) | ((in[7] & 0x3FFF) << 19)))) & 1))^((int64(((in[6] >> 45) | ((in[7] & 0x3FFF) << 19))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[7] >> 14) & 0x1FFFFFFFF)) & 1))^((int64((in[7] >> 14) & 0x1FFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[7] >> 47) | ((in[8] & 0xFFFF) << 17)))) & 1))^((int64(((in[7] >> 47) | ((in[8] & 0xFFFF) << 17))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[8] >> 16) & 0x1FFFFFFFF)) & 1))^((int64((in[8] >> 16) & 0x1FFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[8] >> 49) | ((in[9] & 0x3FFFF) << 15)))) & 1))^((int64(((in[8] >> 49) | ((in[9] & 0x3FFFF) << 15))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[9] >> 18) & 0x1FFFFFFFF)) & 1))^((int64((in[9] >> 18) & 0x1FFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[9] >> 51) | ((in[10] & 0xFFFFF) << 13)))) & 1))^((int64(((in[9] >> 51) | ((in[10] & 0xFFFFF) << 13))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[10] >> 20) & 0x1FFFFFFFF)) & 1))^((int64((in[10] >> 20) & 0x1FFFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[10] >> 53) | ((in[11] & 0x3FFFFF) << 11)))) & 1))^((int64(((in[10] >> 53) | ((in[11] & 0x3FFFFF) << 11))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[11] >> 22) & 0x1FFFFFFFF)) & 1))^((int64((in[11] >> 22) & 0x1FFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[11] >> 55) | ((in[12] & 0xFFFFFF) << 9)))) & 1))^((int64(((in[11] >> 55) | ((in[12] & 0xFFFFFF) << 9))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[12] >> 24) & 0x1FFFFFFFF)) & 1))^((int64((in[12] >> 24) & 0x1FFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[12] >> 57) | ((in[13] & 0x3FFFFFF) << 7)))) & 1))^((int64(((in[12] >> 57) | ((in[13] & 0x3FFFFFF) << 7))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[13] >> 26) & 0x1FFFFFFFF)) & 1))^((int64((in[13] >> 26) & 0x1FFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[13] >> 59) | ((in[14] & 0xFFFFFFF) << 5)))) & 1))^((int64(((in[13] >> 59) | ((in[14] & 0xFFFFFFF) << 5))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[14] >> 28) & 0x1FFFFFFFF)) & 1))^((int64((in[14] >> 28) & 0x1FFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[14] >> 61) | ((in[15] & 0x3FFFFFFF) << 3)))) & 1))^((int64(((in[14] >> 61) | ((in[15] & 0x3FFFFFFF) << 3))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[15] >> 30) & 0x1FFFFFFFF)) & 1))^((int64((in[15] >> 30) & 0x1FFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[15] >> 63) | ((in[16] & 0xFFFFFFFF) << 1)))) & 1))^((int64(((in[15] >> 63) | ((in[16] & 0xFFFFFFFF) << 1))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[16] >> 32) | ((in[17] & 0x1) << 32)))) & 1))^((int64(((in[16] >> 32) | ((in[17] & 0x1) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[17] >> 1) & 0x1FFFFFFFF)) & 1))^((int64((in[17] >> 1) & 0x1FFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[17] >> 34) | ((in[18] & 0x7) << 30)))) & 1))^((int64(((in[17] >> 34) | ((in[18] & 0x7) << 30))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[18] >> 3) & 0x1FFFFFFFF)) & 1))^((int64((in[18] >> 3) & 0x1FFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[18] >> 36) | ((in[19] & 0x1F) << 28)))) & 1))^((int64(((in[18] >> 36) | ((in[19] & 0x1F) << 28))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[19] >> 5) & 0x1FFFFFFFF)) & 1))^((int64((in[19] >> 5) & 0x1FFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[19] >> 38) | ((in[20] & 0x7F) << 26)))) & 1))^((int64(((in[19] >> 38) | ((in[20] & 0x7F) << 26))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[20] >> 7) & 0x1FFFFFFFF)) & 1))^((int64((in[20] >> 7) & 0x1FFFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[20] >> 40) | ((in[21] & 0x1FF) << 24)))) & 1))^((int64(((in[20] >> 40) | ((in[21] & 0x1FF) << 24))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[21] >> 9) & 0x1FFFFFFFF)) & 1))^((int64((in[21] >> 9) & 0x1FFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[21] >> 42) | ((in[22] & 0x7FF) << 22)))) & 1))^((int64(((in[21] >> 42) | ((in[22] & 0x7FF) << 22))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[22] >> 11) & 0x1FFFFFFFF)) & 1))^((int64((in[22] >> 11) & 0x1FFFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[22] >> 44) | ((in[23] & 0x1FFF) << 20)))) & 1))^((int64(((in[22] >> 44) | ((in[23] & 0x1FFF) << 20))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[23] >> 13) & 0x1FFFFFFFF)) & 1))^((int64((in[23] >> 13) & 0x1FFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[23] >> 46) | ((in[24] & 0x7FFF) << 18)))) & 1))^((int64(((in[23] >> 46) | ((in[24] & 0x7FFF) << 18))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[24] >> 15) & 0x1FFFFFFFF)) & 1))^((int64((in[24] >> 15) & 0x1FFFFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[24] >> 48) | ((in[25] & 0x1FFFF) << 16)))) & 1))^((int64(((in[24] >> 48) | ((in[25] & 0x1FFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[25] >> 17) & 0x1FFFFFFFF)) & 1))^((int64((in[25] >> 17) & 0x1FFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[25] >> 50) | ((in[26] & 0x7FFFF) << 14)))) & 1))^((int64(((in[25] >> 50) | ((in[26] & 0x7FFFF) << 14))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[26] >> 19) & 0x1FFFFFFFF)) & 1))^((int64((in[26] >> 19) & 0x1FFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[26] >> 52) | ((in[27] & 0x1FFFFF) << 12)))) & 1))^((int64(((in[26] >> 52) | ((in[27] & 0x1FFFFF) << 12))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[27] >> 21) & 0x1FFFFFFFF)) & 1))^((int64((in[27] >> 21) & 0x1FFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[27] >> 54) | ((in[28] & 0x7FFFFF) << 10)))) & 1))^((int64(((in[27] >> 54) | ((in[28] & 0x7FFFFF) << 10))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[28] >> 23) & 0x1FFFFFFFF)) & 1))^((int64((in[28] >> 23) & 0x1FFFFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[28] >> 56) | ((in[29] & 0x1FFFFFF) << 8)))) & 1))^((int64(((in[28] >> 56) | ((in[29] & 0x1FFFFFF) << 8))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[29] >> 25) & 0x1FFFFFFFF)) & 1))^((int64((in[29] >> 25) & 0x1FFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[29] >> 58) | ((in[30] & 0x7FFFFFF) << 6)))) & 1))^((int64(((in[29] >> 58) | ((in[30] & 0x7FFFFFF) << 6))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[30] >> 27) & 0x1FFFFFFFF)) & 1))^((int64((in[30] >> 27) & 0x1FFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[30] >> 60) | ((in[31] & 0x1FFFFFFF) << 4)))) & 1))^((int64(((in[30] >> 60) | ((in[31] & 0x1FFFFFFF) << 4))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[31] >> 29) & 0x1FFFFFFFF)) & 1))^((int64((in[31] >> 29) & 0x1FFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[31] >> 62) | ((in[32] & 0x7FFFFFFF) << 2)))) & 1))^((int64(((in[31] >> 62) | ((in[32] & 0x7FFFFFFF) << 2))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[32] >> 31))) & 1))^((int64((in[32] >> 31)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_34(initoffset uint64, in *[34]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 34) | ((in[1] & 0xF) << 30)))) & 1))^((int64(((in[0] >> 34) | ((in[1] & 0xF) << 30))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 4) & 0x3FFFFFFFF)) & 1))^((int64((in[1] >> 4) & 0x3FFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 38) | ((in[2] & 0xFF) << 26)))) & 1))^((int64(((in[1] >> 38) | ((in[2] & 0xFF) << 26))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[2] >> 8) & 0x3FFFFFFFF)) & 1))^((int64((in[2] >> 8) & 0x3FFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[2] >> 42) | ((in[3] & 0xFFF) << 22)))) & 1))^((int64(((in[2] >> 42) | ((in[3] & 0xFFF) << 22))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[3] >> 12) & 0x3FFFFFFFF)) & 1))^((int64((in[3] >> 12) & 0x3FFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[3] >> 46) | ((in[4] & 0xFFFF) << 18)))) & 1))^((int64(((in[3] >> 46) | ((in[4] & 0xFFFF) << 18))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[4] >> 16) & 0x3FFFFFFFF)) & 1))^((int64((in[4] >> 16) & 0x3FFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[4] >> 50) | ((in[5] & 0xFFFFF) << 14)))) & 1))^((int64(((in[4] >> 50) | ((in[5] & 0xFFFFF) << 14))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[5] >> 20) & 0x3FFFFFFFF)) & 1))^((int64((in[5] >> 20) & 0x3FFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[5] >> 54) | ((in[6] & 0xFFFFFF) << 10)))) & 1))^((int64(((in[5] >> 54) | ((in[6] & 0xFFFFFF) << 10))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[6] >> 24) & 0x3FFFFFFFF)) & 1))^((int64((in[6] >> 24) & 0x3FFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[6] >> 58) | ((in[7] & 0xFFFFFFF) << 6)))) & 1))^((int64(((in[6] >> 58) | ((in[7] & 0xFFFFFFF) << 6))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[7] >> 28) & 0x3FFFFFFFF)) & 1))^((int64((in[7] >> 28) & 0x3FFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[7] >> 62) | ((in[8] & 0xFFFFFFFF) << 2)))) & 1))^((int64(((in[7] >> 62) | ((in[8] & 0xFFFFFFFF) << 2))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[8] >> 32) | ((in[9] & 0x3) << 32)))) & 1))^((int64(((in[8] >> 32) | ((in[9] & 0x3) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[9] >> 2) & 0x3FFFFFFFF)) & 1))^((int64((in[9] >> 2) & 0x3FFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[9] >> 36) | ((in[10] & 0x3F) << 28)))) & 1))^((int64(((in[9] >> 36) | ((in[10] & 0x3F) << 28))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[10] >> 6) & 0x3FFFFFFFF)) & 1))^((int64((in[10] >> 6) & 0x3FFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[10] >> 40) | ((in[11] & 0x3FF) << 24)))) & 1))^((int64(((in[10] >> 40) | ((in[11] & 0x3FF) << 24))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[11] >> 10) & 0x3FFFFFFFF)) & 1))^((int64((in[11] >> 10) & 0x3FFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[11] >> 44) | ((in[12] & 0x3FFF) << 20)))) & 1))^((int64(((in[11] >> 44) | ((in[12] & 0x3FFF) << 20))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[12] >> 14) & 0x3FFFFFFFF)) & 1))^((int64((in[12] >> 14) & 0x3FFFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[12] >> 48) | ((in[13] & 0x3FFFF) << 16)))) & 1))^((int64(((in[12] >> 48) | ((in[13] & 0x3FFFF) << 16))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[13] >> 18) & 0x3FFFFFFFF)) & 1))^((int64((in[13] >> 18) & 0x3FFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[13] >> 52) | ((in[14] & 0x3FFFFF) << 12)))) & 1))^((int64(((in[13] >> 52) | ((in[14] & 0x3FFFFF) << 12))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[14] >> 22) & 0x3FFFFFFFF)) & 1))^((int64((in[14] >> 22) & 0x3FFFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[14] >> 56) | ((in[15] & 0x3FFFFFF) << 8)))) & 1))^((int64(((in[14] >> 56) | ((in[15] & 0x3FFFFFF) << 8))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[15] >> 26) & 0x3FFFFFFFF)) & 1))^((int64((in[15] >> 26) & 0x3FFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[15] >> 60) | ((in[16] & 0x3FFFFFFF) << 4)))) & 1))^((int64(((in[15] >> 60) | ((in[16] & 0x3FFFFFFF) << 4))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[16] >> 30))) & 1))^((int64((in[16] >> 30)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[17] >> 0) & 0x3FFFFFFFF)) & 1))^((int64((in[17] >> 0) & 0x3FFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[17] >> 34) | ((in[18] & 0xF) << 30)))) & 1))^((int64(((in[17] >> 34) | ((in[18] & 0xF) << 30))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[18] >> 4) & 0x3FFFFFFFF)) & 1))^((int64((in[18] >> 4) & 0x3FFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[18] >> 38) | ((in[19] & 0xFF) << 26)))) & 1))^((int64(((in[18] >> 38) | ((in[19] & 0xFF) << 26))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[19] >> 8) & 0x3FFFFFFFF)) & 1))^((int64((in[19] >> 8) & 0x3FFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[19] >> 42) | ((in[20] & 0xFFF) << 22)))) & 1))^((int64(((in[19] >> 42) | ((in[20] & 0xFFF) << 22))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[20] >> 12) & 0x3FFFFFFFF)) & 1))^((int64((in[20] >> 12) & 0x3FFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[20] >> 46) | ((in[21] & 0xFFFF) << 18)))) & 1))^((int64(((in[20] >> 46) | ((in[21] & 0xFFFF) << 18))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[21] >> 16) & 0x3FFFFFFFF)) & 1))^((int64((in[21] >> 16) & 0x3FFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[21] >> 50) | ((in[22] & 0xFFFFF) << 14)))) & 1))^((int64(((in[21] >> 50) | ((in[22] & 0xFFFFF) << 14))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[22] >> 20) & 0x3FFFFFFFF)) & 1))^((int64((in[22] >> 20) & 0x3FFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[22] >> 54) | ((in[23] & 0xFFFFFF) << 10)))) & 1))^((int64(((in[22] >> 54) | ((in[23] & 0xFFFFFF) << 10))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[23] >> 24) & 0x3FFFFFFFF)) & 1))^((int64((in[23] >> 24) & 0x3FFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[23] >> 58) | ((in[24] & 0xFFFFFFF) << 6)))) & 1))^((int64(((in[23] >> 58) | ((in[24] & 0xFFFFFFF) << 6))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[24] >> 28) & 0x3FFFFFFFF)) & 1))^((int64((in[24] >> 28) & 0x3FFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[24] >> 62) | ((in[25] & 0xFFFFFFFF) << 2)))) & 1))^((int64(((in[24] >> 62) | ((in[25] & 0xFFFFFFFF) << 2))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[25] >> 32) | ((in[26] & 0x3) << 32)))) & 1))^((int64(((in[25] >> 32) | ((in[26] & 0x3) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[26] >> 2) & 0x3FFFFFFFF)) & 1))^((int64((in[26] >> 2) & 0x3FFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[26] >> 36) | ((in[27] & 0x3F) << 28)))) & 1))^((int64(((in[26] >> 36) | ((in[27] & 0x3F) << 28))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[27] >> 6) & 0x3FFFFFFFF)) & 1))^((int64((in[27] >> 6) & 0x3FFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[27] >> 40) | ((in[28] & 0x3FF) << 24)))) & 1))^((int64(((in[27] >> 40) | ((in[28] & 0x3FF) << 24))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[28] >> 10) & 0x3FFFFFFFF)) & 1))^((int64((in[28] >> 10) & 0x3FFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[28] >> 44) | ((in[29] & 0x3FFF) << 20)))) & 1))^((int64(((in[28] >> 44) | ((in[29] & 0x3FFF) << 20))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[29] >> 14) & 0x3FFFFFFFF)) & 1))^((int64((in[29] >> 14) & 0x3FFFFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[29] >> 48) | ((in[30] & 0x3FFFF) << 16)))) & 1))^((int64(((in[29] >> 48) | ((in[30] & 0x3FFFF) << 16))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[30] >> 18) & 0x3FFFFFFFF)) & 1))^((int64((in[30] >> 18) & 0x3FFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[30] >> 52) | ((in[31] & 0x3FFFFF) << 12)))) & 1))^((int64(((in[30] >> 52) | ((in[31] & 0x3FFFFF) << 12))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[31] >> 22) & 0x3FFFFFFFF)) & 1))^((int64((in[31] >> 22) & 0x3FFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[31] >> 56) | ((in[32] & 0x3FFFFFF) << 8)))) & 1))^((int64(((in[31] >> 56) | ((in[32] & 0x3FFFFFF) << 8))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[32] >> 26) & 0x3FFFFFFFF)) & 1))^((int64((in[32] >> 26) & 0x3FFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[32] >> 60) | ((in[33] & 0x3FFFFFFF) << 4)))) & 1))^((int64(((in[32] >> 60) | ((in[33] & 0x3FFFFFFF) << 4))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[33] >> 30))) & 1))^((int64((in[33] >> 30)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_35(initoffset uint64, in *[35]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 35) | ((in[1] & 0x3F) << 29)))) & 1))^((int64(((in[0] >> 35) | ((in[1] & 0x3F) << 29))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 6) & 0x7FFFFFFFF)) & 1))^((int64((in[1] >> 6) & 0x7FFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 41) | ((in[2] & 0xFFF) << 23)))) & 1))^((int64(((in[1] >> 41) | ((in[2] & 0xFFF) << 23))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[2] >> 12) & 0x7FFFFFFFF)) & 1))^((int64((in[2] >> 12) & 0x7FFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[2] >> 47) | ((in[3] & 0x3FFFF) << 17)))) & 1))^((int64(((in[2] >> 47) | ((in[3] & 0x3FFFF) << 17))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[3] >> 18) & 0x7FFFFFFFF)) & 1))^((int64((in[3] >> 18) & 0x7FFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[3] >> 53) | ((in[4] & 0xFFFFFF) << 11)))) & 1))^((int64(((in[3] >> 53) | ((in[4] & 0xFFFFFF) << 11))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[4] >> 24) & 0x7FFFFFFFF)) & 1))^((int64((in[4] >> 24) & 0x7FFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[4] >> 59) | ((in[5] & 0x3FFFFFFF) << 5)))) & 1))^((int64(((in[4] >> 59) | ((in[5] & 0x3FFFFFFF) << 5))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[5] >> 30) | ((in[6] & 0x1) << 34)))) & 1))^((int64(((in[5] >> 30) | ((in[6] & 0x1) << 34))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[6] >> 1) & 0x7FFFFFFFF)) & 1))^((int64((in[6] >> 1) & 0x7FFFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[6] >> 36) | ((in[7] & 0x7F) << 28)))) & 1))^((int64(((in[6] >> 36) | ((in[7] & 0x7F) << 28))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[7] >> 7) & 0x7FFFFFFFF)) & 1))^((int64((in[7] >> 7) & 0x7FFFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[7] >> 42) | ((in[8] & 0x1FFF) << 22)))) & 1))^((int64(((in[7] >> 42) | ((in[8] & 0x1FFF) << 22))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[8] >> 13) & 0x7FFFFFFFF)) & 1))^((int64((in[8] >> 13) & 0x7FFFFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[8] >> 48) | ((in[9] & 0x7FFFF) << 16)))) & 1))^((int64(((in[8] >> 48) | ((in[9] & 0x7FFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[9] >> 19) & 0x7FFFFFFFF)) & 1))^((int64((in[9] >> 19) & 0x7FFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0x1FFFFFF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0x1FFFFFF) << 10))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[10] >> 25) & 0x7FFFFFFFF)) & 1))^((int64((in[10] >> 25) & 0x7FFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[10] >> 60) | ((in[11] & 0x7FFFFFFF) << 4)))) & 1))^((int64(((in[10] >> 60) | ((in[11] & 0x7FFFFFFF) << 4))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[11] >> 31) | ((in[12] & 0x3) << 33)))) & 1))^((int64(((in[11] >> 31) | ((in[12] & 0x3) << 33))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[12] >> 2) & 0x7FFFFFFFF)) & 1))^((int64((in[12] >> 2) & 0x7FFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[12] >> 37) | ((in[13] & 0xFF) << 27)))) & 1))^((int64(((in[12] >> 37) | ((in[13] & 0xFF) << 27))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[13] >> 8) & 0x7FFFFFFFF)) & 1))^((int64((in[13] >> 8) & 0x7FFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[13] >> 43) | ((in[14] & 0x3FFF) << 21)))) & 1))^((int64(((in[13] >> 43) | ((in[14] & 0x3FFF) << 21))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[14] >> 14) & 0x7FFFFFFFF)) & 1))^((int64((in[14] >> 14) & 0x7FFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[14] >> 49) | ((in[15] & 0xFFFFF) << 15)))) & 1))^((int64(((in[14] >> 49) | ((in[15] & 0xFFFFF) << 15))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[15] >> 20) & 0x7FFFFFFFF)) & 1))^((int64((in[15] >> 20) & 0x7FFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[15] >> 55) | ((in[16] & 0x3FFFFFF) << 9)))) & 1))^((int64(((in[15] >> 55) | ((in[16] & 0x3FFFFFF) << 9))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[16] >> 26) & 0x7FFFFFFFF)) & 1))^((int64((in[16] >> 26) & 0x7FFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[16] >> 61) | ((in[17] & 0xFFFFFFFF) << 3)))) & 1))^((int64(((in[16] >> 61) | ((in[17] & 0xFFFFFFFF) << 3))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[17] >> 32) | ((in[18] & 0x7) << 32)))) & 1))^((int64(((in[17] >> 32) | ((in[18] & 0x7) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[18] >> 3) & 0x7FFFFFFFF)) & 1))^((int64((in[18] >> 3) & 0x7FFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[18] >> 38) | ((in[19] & 0x1FF) << 26)))) & 1))^((int64(((in[18] >> 38) | ((in[19] & 0x1FF) << 26))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[19] >> 9) & 0x7FFFFFFFF)) & 1))^((int64((in[19] >> 9) & 0x7FFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0x7FFF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0x7FFF) << 20))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[20] >> 15) & 0x7FFFFFFFF)) & 1))^((int64((in[20] >> 15) & 0x7FFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[20] >> 50) | ((in[21] & 0x1FFFFF) << 14)))) & 1))^((int64(((in[20] >> 50) | ((in[21] & 0x1FFFFF) << 14))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[21] >> 21) & 0x7FFFFFFFF)) & 1))^((int64((in[21] >> 21) & 0x7FFFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[21] >> 56) | ((in[22] & 0x7FFFFFF) << 8)))) & 1))^((int64(((in[21] >> 56) | ((in[22] & 0x7FFFFFF) << 8))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[22] >> 27) & 0x7FFFFFFFF)) & 1))^((int64((in[22] >> 27) & 0x7FFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[22] >> 62) | ((in[23] & 0x1FFFFFFFF) << 2)))) & 1))^((int64(((in[22] >> 62) | ((in[23] & 0x1FFFFFFFF) << 2))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[23] >> 33) | ((in[24] & 0xF) << 31)))) & 1))^((int64(((in[23] >> 33) | ((in[24] & 0xF) << 31))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[24] >> 4) & 0x7FFFFFFFF)) & 1))^((int64((in[24] >> 4) & 0x7FFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[24] >> 39) | ((in[25] & 0x3FF) << 25)))) & 1))^((int64(((in[24] >> 39) | ((in[25] & 0x3FF) << 25))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[25] >> 10) & 0x7FFFFFFFF)) & 1))^((int64((in[25] >> 10) & 0x7FFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[25] >> 45) | ((in[26] & 0xFFFF) << 19)))) & 1))^((int64(((in[25] >> 45) | ((in[26] & 0xFFFF) << 19))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[26] >> 16) & 0x7FFFFFFFF)) & 1))^((int64((in[26] >> 16) & 0x7FFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[26] >> 51) | ((in[27] & 0x3FFFFF) << 13)))) & 1))^((int64(((in[26] >> 51) | ((in[27] & 0x3FFFFF) << 13))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[27] >> 22) & 0x7FFFFFFFF)) & 1))^((int64((in[27] >> 22) & 0x7FFFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[27] >> 57) | ((in[28] & 0xFFFFFFF) << 7)))) & 1))^((int64(((in[27] >> 57) | ((in[28] & 0xFFFFFFF) << 7))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[28] >> 28) & 0x7FFFFFFFF)) & 1))^((int64((in[28] >> 28) & 0x7FFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[28] >> 63) | ((in[29] & 0x3FFFFFFFF) << 1)))) & 1))^((int64(((in[28] >> 63) | ((in[29] & 0x3FFFFFFFF) << 1))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[29] >> 34) | ((in[30] & 0x1F) << 30)))) & 1))^((int64(((in[29] >> 34) | ((in[30] & 0x1F) << 30))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[30] >> 5) & 0x7FFFFFFFF)) & 1))^((int64((in[30] >> 5) & 0x7FFFFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[30] >> 40) | ((in[31] & 0x7FF) << 24)))) & 1))^((int64(((in[30] >> 40) | ((in[31] & 0x7FF) << 24))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[31] >> 11) & 0x7FFFFFFFF)) & 1))^((int64((in[31] >> 11) & 0x7FFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[31] >> 46) | ((in[32] & 0x1FFFF) << 18)))) & 1))^((int64(((in[31] >> 46) | ((in[32] & 0x1FFFF) << 18))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[32] >> 17) & 0x7FFFFFFFF)) & 1))^((int64((in[32] >> 17) & 0x7FFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[32] >> 52) | ((in[33] & 0x7FFFFF) << 12)))) & 1))^((int64(((in[32] >> 52) | ((in[33] & 0x7FFFFF) << 12))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[33] >> 23) & 0x7FFFFFFFF)) & 1))^((int64((in[33] >> 23) & 0x7FFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[33] >> 58) | ((in[34] & 0x1FFFFFFF) << 6)))) & 1))^((int64(((in[33] >> 58) | ((in[34] & 0x1FFFFFFF) << 6))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[34] >> 29))) & 1))^((int64((in[34] >> 29)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_36(initoffset uint64, in *[36]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 36) | ((in[1] & 0xFF) << 28)))) & 1))^((int64(((in[0] >> 36) | ((in[1] & 0xFF) << 28))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 8) & 0xFFFFFFFFF)) & 1))^((int64((in[1] >> 8) & 0xFFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 44) | ((in[2] & 0xFFFF) << 20)))) & 1))^((int64(((in[1] >> 44) | ((in[2] & 0xFFFF) << 20))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[2] >> 16) & 0xFFFFFFFFF)) & 1))^((int64((in[2] >> 16) & 0xFFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[2] >> 52) | ((in[3] & 0xFFFFFF) << 12)))) & 1))^((int64(((in[2] >> 52) | ((in[3] & 0xFFFFFF) << 12))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[3] >> 24) & 0xFFFFFFFFF)) & 1))^((int64((in[3] >> 24) & 0xFFFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0xFFFFFFFF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0xFFFFFFFF) << 4))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[4] >> 32) | ((in[5] & 0xF) << 32)))) & 1))^((int64(((in[4] >> 32) | ((in[5] & 0xF) << 32))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[5] >> 4) & 0xFFFFFFFFF)) & 1))^((int64((in[5] >> 4) & 0xFFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[5] >> 40) | ((in[6] & 0xFFF) << 24)))) & 1))^((int64(((in[5] >> 40) | ((in[6] & 0xFFF) << 24))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[6] >> 12) & 0xFFFFFFFFF)) & 1))^((int64((in[6] >> 12) & 0xFFFFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[6] >> 48) | ((in[7] & 0xFFFFF) << 16)))) & 1))^((int64(((in[6] >> 48) | ((in[7] & 0xFFFFF) << 16))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[7] >> 20) & 0xFFFFFFFFF)) & 1))^((int64((in[7] >> 20) & 0xFFFFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0xFFFFFFF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0xFFFFFFF) << 8))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[8] >> 28))) & 1))^((int64((in[8] >> 28)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[9] >> 0) & 0xFFFFFFFFF)) & 1))^((int64((in[9] >> 0) & 0xFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[9] >> 36) | ((in[10] & 0xFF) << 28)))) & 1))^((int64(((in[9] >> 36) | ((in[10] & 0xFF) << 28))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[10] >> 8) & 0xFFFFFFFFF)) & 1))^((int64((in[10] >> 8) & 0xFFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[10] >> 44) | ((in[11] & 0xFFFF) << 20)))) & 1))^((int64(((in[10] >> 44) | ((in[11] & 0xFFFF) << 20))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[11] >> 16) & 0xFFFFFFFFF)) & 1))^((int64((in[11] >> 16) & 0xFFFFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0xFFFFFF) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0xFFFFFF) << 12))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[12] >> 24) & 0xFFFFFFFFF)) & 1))^((int64((in[12] >> 24) & 0xFFFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[12] >> 60) | ((in[13] & 0xFFFFFFFF) << 4)))) & 1))^((int64(((in[12] >> 60) | ((in[13] & 0xFFFFFFFF) << 4))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[13] >> 32) | ((in[14] & 0xF) << 32)))) & 1))^((int64(((in[13] >> 32) | ((in[14] & 0xF) << 32))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[14] >> 4) & 0xFFFFFFFFF)) & 1))^((int64((in[14] >> 4) & 0xFFFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[14] >> 40) | ((in[15] & 0xFFF) << 24)))) & 1))^((int64(((in[14] >> 40) | ((in[15] & 0xFFF) << 24))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[15] >> 12) & 0xFFFFFFFFF)) & 1))^((int64((in[15] >> 12) & 0xFFFFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0xFFFFF) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0xFFFFF) << 16))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[16] >> 20) & 0xFFFFFFFFF)) & 1))^((int64((in[16] >> 20) & 0xFFFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFF) << 8))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[17] >> 28))) & 1))^((int64((in[17] >> 28)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[18] >> 0) & 0xFFFFFFFFF)) & 1))^((int64((in[18] >> 0) & 0xFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[18] >> 36) | ((in[19] & 0xFF) << 28)))) & 1))^((int64(((in[18] >> 36) | ((in[19] & 0xFF) << 28))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[19] >> 8) & 0xFFFFFFFFF)) & 1))^((int64((in[19] >> 8) & 0xFFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0xFFFF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0xFFFF) << 20))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[20] >> 16) & 0xFFFFFFFFF)) & 1))^((int64((in[20] >> 16) & 0xFFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[20] >> 52) | ((in[21] & 0xFFFFFF) << 12)))) & 1))^((int64(((in[20] >> 52) | ((in[21] & 0xFFFFFF) << 12))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[21] >> 24) & 0xFFFFFFFFF)) & 1))^((int64((in[21] >> 24) & 0xFFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[21] >> 60) | ((in[22] & 0xFFFFFFFF) << 4)))) & 1))^((int64(((in[21] >> 60) | ((in[22] & 0xFFFFFFFF) << 4))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[22] >> 32) | ((in[23] & 0xF) << 32)))) & 1))^((int64(((in[22] >> 32) | ((in[23] & 0xF) << 32))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[23] >> 4) & 0xFFFFFFFFF)) & 1))^((int64((in[23] >> 4) & 0xFFFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[23] >> 40) | ((in[24] & 0xFFF) << 24)))) & 1))^((int64(((in[23] >> 40) | ((in[24] & 0xFFF) << 24))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[24] >> 12) & 0xFFFFFFFFF)) & 1))^((int64((in[24] >> 12) & 0xFFFFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[24] >> 48) | ((in[25] & 0xFFFFF) << 16)))) & 1))^((int64(((in[24] >> 48) | ((in[25] & 0xFFFFF) << 16))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[25] >> 20) & 0xFFFFFFFFF)) & 1))^((int64((in[25] >> 20) & 0xFFFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[25] >> 56) | ((in[26] & 0xFFFFFFF) << 8)))) & 1))^((int64(((in[25] >> 56) | ((in[26] & 0xFFFFFFF) << 8))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[26] >> 28))) & 1))^((int64((in[26] >> 28)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[27] >> 0) & 0xFFFFFFFFF)) & 1))^((int64((in[27] >> 0) & 0xFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[27] >> 36) | ((in[28] & 0xFF) << 28)))) & 1))^((int64(((in[27] >> 36) | ((in[28] & 0xFF) << 28))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[28] >> 8) & 0xFFFFFFFFF)) & 1))^((int64((in[28] >> 8) & 0xFFFFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[28] >> 44) | ((in[29] & 0xFFFF) << 20)))) & 1))^((int64(((in[28] >> 44) | ((in[29] & 0xFFFF) << 20))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[29] >> 16) & 0xFFFFFFFFF)) & 1))^((int64((in[29] >> 16) & 0xFFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[29] >> 52) | ((in[30] & 0xFFFFFF) << 12)))) & 1))^((int64(((in[29] >> 52) | ((in[30] & 0xFFFFFF) << 12))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[30] >> 24) & 0xFFFFFFFFF)) & 1))^((int64((in[30] >> 24) & 0xFFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFF) << 4)))) & 1))^((int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFF) << 4))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[31] >> 32) | ((in[32] & 0xF) << 32)))) & 1))^((int64(((in[31] >> 32) | ((in[32] & 0xF) << 32))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[32] >> 4) & 0xFFFFFFFFF)) & 1))^((int64((in[32] >> 4) & 0xFFFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[32] >> 40) | ((in[33] & 0xFFF) << 24)))) & 1))^((int64(((in[32] >> 40) | ((in[33] & 0xFFF) << 24))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[33] >> 12) & 0xFFFFFFFFF)) & 1))^((int64((in[33] >> 12) & 0xFFFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[33] >> 48) | ((in[34] & 0xFFFFF) << 16)))) & 1))^((int64(((in[33] >> 48) | ((in[34] & 0xFFFFF) << 16))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[34] >> 20) & 0xFFFFFFFFF)) & 1))^((int64((in[34] >> 20) & 0xFFFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[34] >> 56) | ((in[35] & 0xFFFFFFF) << 8)))) & 1))^((int64(((in[34] >> 56) | ((in[35] & 0xFFFFFFF) << 8))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[35] >> 28))) & 1))^((int64((in[35] >> 28)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_37(initoffset uint64, in *[37]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 37) | ((in[1] & 0x3FF) << 27)))) & 1))^((int64(((in[0] >> 37) | ((in[1] & 0x3FF) << 27))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 10) & 0x1FFFFFFFFF)) & 1))^((int64((in[1] >> 10) & 0x1FFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 47) | ((in[2] & 0xFFFFF) << 17)))) & 1))^((int64(((in[1] >> 47) | ((in[2] & 0xFFFFF) << 17))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[2] >> 20) & 0x1FFFFFFFFF)) & 1))^((int64((in[2] >> 20) & 0x1FFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[2] >> 57) | ((in[3] & 0x3FFFFFFF) << 7)))) & 1))^((int64(((in[2] >> 57) | ((in[3] & 0x3FFFFFFF) << 7))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[3] >> 30) | ((in[4] & 0x7) << 34)))) & 1))^((int64(((in[3] >> 30) | ((in[4] & 0x7) << 34))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[4] >> 3) & 0x1FFFFFFFFF)) & 1))^((int64((in[4] >> 3) & 0x1FFFFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[4] >> 40) | ((in[5] & 0x1FFF) << 24)))) & 1))^((int64(((in[4] >> 40) | ((in[5] & 0x1FFF) << 24))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[5] >> 13) & 0x1FFFFFFFFF)) & 1))^((int64((in[5] >> 13) & 0x1FFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[5] >> 50) | ((in[6] & 0x7FFFFF) << 14)))) & 1))^((int64(((in[5] >> 50) | ((in[6] & 0x7FFFFF) << 14))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[6] >> 23) & 0x1FFFFFFFFF)) & 1))^((int64((in[6] >> 23) & 0x1FFFFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[6] >> 60) | ((in[7] & 0x1FFFFFFFF) << 4)))) & 1))^((int64(((in[6] >> 60) | ((in[7] & 0x1FFFFFFFF) << 4))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[7] >> 33) | ((in[8] & 0x3F) << 31)))) & 1))^((int64(((in[7] >> 33) | ((in[8] & 0x3F) << 31))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[8] >> 6) & 0x1FFFFFFFFF)) & 1))^((int64((in[8] >> 6) & 0x1FFFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[8] >> 43) | ((in[9] & 0xFFFF) << 21)))) & 1))^((int64(((in[8] >> 43) | ((in[9] & 0xFFFF) << 21))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[9] >> 16) & 0x1FFFFFFFFF)) & 1))^((int64((in[9] >> 16) & 0x1FFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[9] >> 53) | ((in[10] & 0x3FFFFFF) << 11)))) & 1))^((int64(((in[9] >> 53) | ((in[10] & 0x3FFFFFF) << 11))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[10] >> 26) & 0x1FFFFFFFFF)) & 1))^((int64((in[10] >> 26) & 0x1FFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[10] >> 63) | ((in[11] & 0xFFFFFFFFF) << 1)))) & 1))^((int64(((in[10] >> 63) | ((in[11] & 0xFFFFFFFFF) << 1))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[11] >> 36) | ((in[12] & 0x1FF) << 28)))) & 1))^((int64(((in[11] >> 36) | ((in[12] & 0x1FF) << 28))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[12] >> 9) & 0x1FFFFFFFFF)) & 1))^((int64((in[12] >> 9) & 0x1FFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[12] >> 46) | ((in[13] & 0x7FFFF) << 18)))) & 1))^((int64(((in[12] >> 46) | ((in[13] & 0x7FFFF) << 18))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[13] >> 19) & 0x1FFFFFFFFF)) & 1))^((int64((in[13] >> 19) & 0x1FFFFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[13] >> 56) | ((in[14] & 0x1FFFFFFF) << 8)))) & 1))^((int64(((in[13] >> 56) | ((in[14] & 0x1FFFFFFF) << 8))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[14] >> 29) | ((in[15] & 0x3) << 35)))) & 1))^((int64(((in[14] >> 29) | ((in[15] & 0x3) << 35))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[15] >> 2) & 0x1FFFFFFFFF)) & 1))^((int64((in[15] >> 2) & 0x1FFFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[15] >> 39) | ((in[16] & 0xFFF) << 25)))) & 1))^((int64(((in[15] >> 39) | ((in[16] & 0xFFF) << 25))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[16] >> 12) & 0x1FFFFFFFFF)) & 1))^((int64((in[16] >> 12) & 0x1FFFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[16] >> 49) | ((in[17] & 0x3FFFFF) << 15)))) & 1))^((int64(((in[16] >> 49) | ((in[17] & 0x3FFFFF) << 15))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[17] >> 22) & 0x1FFFFFFFFF)) & 1))^((int64((in[17] >> 22) & 0x1FFFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[17] >> 59) | ((in[18] & 0xFFFFFFFF) << 5)))) & 1))^((int64(((in[17] >> 59) | ((in[18] & 0xFFFFFFFF) << 5))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[18] >> 32) | ((in[19] & 0x1F) << 32)))) & 1))^((int64(((in[18] >> 32) | ((in[19] & 0x1F) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[19] >> 5) & 0x1FFFFFFFFF)) & 1))^((int64((in[19] >> 5) & 0x1FFFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[19] >> 42) | ((in[20] & 0x7FFF) << 22)))) & 1))^((int64(((in[19] >> 42) | ((in[20] & 0x7FFF) << 22))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[20] >> 15) & 0x1FFFFFFFFF)) & 1))^((int64((in[20] >> 15) & 0x1FFFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[20] >> 52) | ((in[21] & 0x1FFFFFF) << 12)))) & 1))^((int64(((in[20] >> 52) | ((in[21] & 0x1FFFFFF) << 12))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[21] >> 25) & 0x1FFFFFFFFF)) & 1))^((int64((in[21] >> 25) & 0x1FFFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[21] >> 62) | ((in[22] & 0x7FFFFFFFF) << 2)))) & 1))^((int64(((in[21] >> 62) | ((in[22] & 0x7FFFFFFFF) << 2))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[22] >> 35) | ((in[23] & 0xFF) << 29)))) & 1))^((int64(((in[22] >> 35) | ((in[23] & 0xFF) << 29))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[23] >> 8) & 0x1FFFFFFFFF)) & 1))^((int64((in[23] >> 8) & 0x1FFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[23] >> 45) | ((in[24] & 0x3FFFF) << 19)))) & 1))^((int64(((in[23] >> 45) | ((in[24] & 0x3FFFF) << 19))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[24] >> 18) & 0x1FFFFFFFFF)) & 1))^((int64((in[24] >> 18) & 0x1FFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[24] >> 55) | ((in[25] & 0xFFFFFFF) << 9)))) & 1))^((int64(((in[24] >> 55) | ((in[25] & 0xFFFFFFF) << 9))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[25] >> 28) | ((in[26] & 0x1) << 36)))) & 1))^((int64(((in[25] >> 28) | ((in[26] & 0x1) << 36))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[26] >> 1) & 0x1FFFFFFFFF)) & 1))^((int64((in[26] >> 1) & 0x1FFFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[26] >> 38) | ((in[27] & 0x7FF) << 26)))) & 1))^((int64(((in[26] >> 38) | ((in[27] & 0x7FF) << 26))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[27] >> 11) & 0x1FFFFFFFFF)) & 1))^((int64((in[27] >> 11) & 0x1FFFFFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[27] >> 48) | ((in[28] & 0x1FFFFF) << 16)))) & 1))^((int64(((in[27] >> 48) | ((in[28] & 0x1FFFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[28] >> 21) & 0x1FFFFFFFFF)) & 1))^((int64((in[28] >> 21) & 0x1FFFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[28] >> 58) | ((in[29] & 0x7FFFFFFF) << 6)))) & 1))^((int64(((in[28] >> 58) | ((in[29] & 0x7FFFFFFF) << 6))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[29] >> 31) | ((in[30] & 0xF) << 33)))) & 1))^((int64(((in[29] >> 31) | ((in[30] & 0xF) << 33))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[30] >> 4) & 0x1FFFFFFFFF)) & 1))^((int64((in[30] >> 4) & 0x1FFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[30] >> 41) | ((in[31] & 0x3FFF) << 23)))) & 1))^((int64(((in[30] >> 41) | ((in[31] & 0x3FFF) << 23))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[31] >> 14) & 0x1FFFFFFFFF)) & 1))^((int64((in[31] >> 14) & 0x1FFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[31] >> 51) | ((in[32] & 0xFFFFFF) << 13)))) & 1))^((int64(((in[31] >> 51) | ((in[32] & 0xFFFFFF) << 13))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[32] >> 24) & 0x1FFFFFFFFF)) & 1))^((int64((in[32] >> 24) & 0x1FFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[32] >> 61) | ((in[33] & 0x3FFFFFFFF) << 3)))) & 1))^((int64(((in[32] >> 61) | ((in[33] & 0x3FFFFFFFF) << 3))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[33] >> 34) | ((in[34] & 0x7F) << 30)))) & 1))^((int64(((in[33] >> 34) | ((in[34] & 0x7F) << 30))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[34] >> 7) & 0x1FFFFFFFFF)) & 1))^((int64((in[34] >> 7) & 0x1FFFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[34] >> 44) | ((in[35] & 0x1FFFF) << 20)))) & 1))^((int64(((in[34] >> 44) | ((in[35] & 0x1FFFF) << 20))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[35] >> 17) & 0x1FFFFFFFFF)) & 1))^((int64((in[35] >> 17) & 0x1FFFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[35] >> 54) | ((in[36] & 0x7FFFFFF) << 10)))) & 1))^((int64(((in[35] >> 54) | ((in[36] & 0x7FFFFFF) << 10))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[36] >> 27))) & 1))^((int64((in[36] >> 27)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_38(initoffset uint64, in *[38]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 38) | ((in[1] & 0xFFF) << 26)))) & 1))^((int64(((in[0] >> 38) | ((in[1] & 0xFFF) << 26))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 12) & 0x3FFFFFFFFF)) & 1))^((int64((in[1] >> 12) & 0x3FFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 50) | ((in[2] & 0xFFFFFF) << 14)))) & 1))^((int64(((in[1] >> 50) | ((in[2] & 0xFFFFFF) << 14))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[2] >> 24) & 0x3FFFFFFFFF)) & 1))^((int64((in[2] >> 24) & 0x3FFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[2] >> 62) | ((in[3] & 0xFFFFFFFFF) << 2)))) & 1))^((int64(((in[2] >> 62) | ((in[3] & 0xFFFFFFFFF) << 2))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[3] >> 36) | ((in[4] & 0x3FF) << 28)))) & 1))^((int64(((in[3] >> 36) | ((in[4] & 0x3FF) << 28))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[4] >> 10) & 0x3FFFFFFFFF)) & 1))^((int64((in[4] >> 10) & 0x3FFFFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[4] >> 48) | ((in[5] & 0x3FFFFF) << 16)))) & 1))^((int64(((in[4] >> 48) | ((in[5] & 0x3FFFFF) << 16))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[5] >> 22) & 0x3FFFFFFFFF)) & 1))^((int64((in[5] >> 22) & 0x3FFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[5] >> 60) | ((in[6] & 0x3FFFFFFFF) << 4)))) & 1))^((int64(((in[5] >> 60) | ((in[6] & 0x3FFFFFFFF) << 4))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[6] >> 34) | ((in[7] & 0xFF) << 30)))) & 1))^((int64(((in[6] >> 34) | ((in[7] & 0xFF) << 30))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[7] >> 8) & 0x3FFFFFFFFF)) & 1))^((int64((in[7] >> 8) & 0x3FFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[7] >> 46) | ((in[8] & 0xFFFFF) << 18)))) & 1))^((int64(((in[7] >> 46) | ((in[8] & 0xFFFFF) << 18))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[8] >> 20) & 0x3FFFFFFFFF)) & 1))^((int64((in[8] >> 20) & 0x3FFFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[8] >> 58) | ((in[9] & 0xFFFFFFFF) << 6)))) & 1))^((int64(((in[8] >> 58) | ((in[9] & 0xFFFFFFFF) << 6))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[9] >> 32) | ((in[10] & 0x3F) << 32)))) & 1))^((int64(((in[9] >> 32) | ((in[10] & 0x3F) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[10] >> 6) & 0x3FFFFFFFFF)) & 1))^((int64((in[10] >> 6) & 0x3FFFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[10] >> 44) | ((in[11] & 0x3FFFF) << 20)))) & 1))^((int64(((in[10] >> 44) | ((in[11] & 0x3FFFF) << 20))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[11] >> 18) & 0x3FFFFFFFFF)) & 1))^((int64((in[11] >> 18) & 0x3FFFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[11] >> 56) | ((in[12] & 0x3FFFFFFF) << 8)))) & 1))^((int64(((in[11] >> 56) | ((in[12] & 0x3FFFFFFF) << 8))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[12] >> 30) | ((in[13] & 0xF) << 34)))) & 1))^((int64(((in[12] >> 30) | ((in[13] & 0xF) << 34))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[13] >> 4) & 0x3FFFFFFFFF)) & 1))^((int64((in[13] >> 4) & 0x3FFFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[13] >> 42) | ((in[14] & 0xFFFF) << 22)))) & 1))^((int64(((in[13] >> 42) | ((in[14] & 0xFFFF) << 22))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[14] >> 16) & 0x3FFFFFFFFF)) & 1))^((int64((in[14] >> 16) & 0x3FFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[14] >> 54) | ((in[15] & 0xFFFFFFF) << 10)))) & 1))^((int64(((in[14] >> 54) | ((in[15] & 0xFFFFFFF) << 10))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[15] >> 28) | ((in[16] & 0x3) << 36)))) & 1))^((int64(((in[15] >> 28) | ((in[16] & 0x3) << 36))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[16] >> 2) & 0x3FFFFFFFFF)) & 1))^((int64((in[16] >> 2) & 0x3FFFFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[16] >> 40) | ((in[17] & 0x3FFF) << 24)))) & 1))^((int64(((in[16] >> 40) | ((in[17] & 0x3FFF) << 24))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[17] >> 14) & 0x3FFFFFFFFF)) & 1))^((int64((in[17] >> 14) & 0x3FFFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[17] >> 52) | ((in[18] & 0x3FFFFFF) << 12)))) & 1))^((int64(((in[17] >> 52) | ((in[18] & 0x3FFFFFF) << 12))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[18] >> 26))) & 1))^((int64((in[18] >> 26)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[19] >> 0) & 0x3FFFFFFFFF)) & 1))^((int64((in[19] >> 0) & 0x3FFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[19] >> 38) | ((in[20] & 0xFFF) << 26)))) & 1))^((int64(((in[19] >> 38) | ((in[20] & 0xFFF) << 26))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[20] >> 12) & 0x3FFFFFFFFF)) & 1))^((int64((in[20] >> 12) & 0x3FFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[20] >> 50) | ((in[21] & 0xFFFFFF) << 14)))) & 1))^((int64(((in[20] >> 50) | ((in[21] & 0xFFFFFF) << 14))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[21] >> 24) & 0x3FFFFFFFFF)) & 1))^((int64((in[21] >> 24) & 0x3FFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[21] >> 62) | ((in[22] & 0xFFFFFFFFF) << 2)))) & 1))^((int64(((in[21] >> 62) | ((in[22] & 0xFFFFFFFFF) << 2))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[22] >> 36) | ((in[23] & 0x3FF) << 28)))) & 1))^((int64(((in[22] >> 36) | ((in[23] & 0x3FF) << 28))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[23] >> 10) & 0x3FFFFFFFFF)) & 1))^((int64((in[23] >> 10) & 0x3FFFFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[23] >> 48) | ((in[24] & 0x3FFFFF) << 16)))) & 1))^((int64(((in[23] >> 48) | ((in[24] & 0x3FFFFF) << 16))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[24] >> 22) & 0x3FFFFFFFFF)) & 1))^((int64((in[24] >> 22) & 0x3FFFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[24] >> 60) | ((in[25] & 0x3FFFFFFFF) << 4)))) & 1))^((int64(((in[24] >> 60) | ((in[25] & 0x3FFFFFFFF) << 4))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[25] >> 34) | ((in[26] & 0xFF) << 30)))) & 1))^((int64(((in[25] >> 34) | ((in[26] & 0xFF) << 30))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[26] >> 8) & 0x3FFFFFFFFF)) & 1))^((int64((in[26] >> 8) & 0x3FFFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[26] >> 46) | ((in[27] & 0xFFFFF) << 18)))) & 1))^((int64(((in[26] >> 46) | ((in[27] & 0xFFFFF) << 18))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[27] >> 20) & 0x3FFFFFFFFF)) & 1))^((int64((in[27] >> 20) & 0x3FFFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[27] >> 58) | ((in[28] & 0xFFFFFFFF) << 6)))) & 1))^((int64(((in[27] >> 58) | ((in[28] & 0xFFFFFFFF) << 6))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[28] >> 32) | ((in[29] & 0x3F) << 32)))) & 1))^((int64(((in[28] >> 32) | ((in[29] & 0x3F) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[29] >> 6) & 0x3FFFFFFFFF)) & 1))^((int64((in[29] >> 6) & 0x3FFFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[29] >> 44) | ((in[30] & 0x3FFFF) << 20)))) & 1))^((int64(((in[29] >> 44) | ((in[30] & 0x3FFFF) << 20))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[30] >> 18) & 0x3FFFFFFFFF)) & 1))^((int64((in[30] >> 18) & 0x3FFFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[30] >> 56) | ((in[31] & 0x3FFFFFFF) << 8)))) & 1))^((int64(((in[30] >> 56) | ((in[31] & 0x3FFFFFFF) << 8))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[31] >> 30) | ((in[32] & 0xF) << 34)))) & 1))^((int64(((in[31] >> 30) | ((in[32] & 0xF) << 34))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[32] >> 4) & 0x3FFFFFFFFF)) & 1))^((int64((in[32] >> 4) & 0x3FFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[32] >> 42) | ((in[33] & 0xFFFF) << 22)))) & 1))^((int64(((in[32] >> 42) | ((in[33] & 0xFFFF) << 22))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[33] >> 16) & 0x3FFFFFFFFF)) & 1))^((int64((in[33] >> 16) & 0x3FFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[33] >> 54) | ((in[34] & 0xFFFFFFF) << 10)))) & 1))^((int64(((in[33] >> 54) | ((in[34] & 0xFFFFFFF) << 10))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[34] >> 28) | ((in[35] & 0x3) << 36)))) & 1))^((int64(((in[34] >> 28) | ((in[35] & 0x3) << 36))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[35] >> 2) & 0x3FFFFFFFFF)) & 1))^((int64((in[35] >> 2) & 0x3FFFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[35] >> 40) | ((in[36] & 0x3FFF) << 24)))) & 1))^((int64(((in[35] >> 40) | ((in[36] & 0x3FFF) << 24))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[36] >> 14) & 0x3FFFFFFFFF)) & 1))^((int64((in[36] >> 14) & 0x3FFFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[36] >> 52) | ((in[37] & 0x3FFFFFF) << 12)))) & 1))^((int64(((in[36] >> 52) | ((in[37] & 0x3FFFFFF) << 12))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[37] >> 26))) & 1))^((int64((in[37] >> 26)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_39(initoffset uint64, in *[39]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 39) | ((in[1] & 0x3FFF) << 25)))) & 1))^((int64(((in[0] >> 39) | ((in[1] & 0x3FFF) << 25))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 14) & 0x7FFFFFFFFF)) & 1))^((int64((in[1] >> 14) & 0x7FFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 53) | ((in[2] & 0xFFFFFFF) << 11)))) & 1))^((int64(((in[1] >> 53) | ((in[2] & 0xFFFFFFF) << 11))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 28) | ((in[3] & 0x7) << 36)))) & 1))^((int64(((in[2] >> 28) | ((in[3] & 0x7) << 36))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[3] >> 3) & 0x7FFFFFFFFF)) & 1))^((int64((in[3] >> 3) & 0x7FFFFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[3] >> 42) | ((in[4] & 0x1FFFF) << 22)))) & 1))^((int64(((in[3] >> 42) | ((in[4] & 0x1FFFF) << 22))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[4] >> 17) & 0x7FFFFFFFFF)) & 1))^((int64((in[4] >> 17) & 0x7FFFFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[4] >> 56) | ((in[5] & 0x7FFFFFFF) << 8)))) & 1))^((int64(((in[4] >> 56) | ((in[5] & 0x7FFFFFFF) << 8))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[5] >> 31) | ((in[6] & 0x3F) << 33)))) & 1))^((int64(((in[5] >> 31) | ((in[6] & 0x3F) << 33))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[6] >> 6) & 0x7FFFFFFFFF)) & 1))^((int64((in[6] >> 6) & 0x7FFFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[6] >> 45) | ((in[7] & 0xFFFFF) << 19)))) & 1))^((int64(((in[6] >> 45) | ((in[7] & 0xFFFFF) << 19))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[7] >> 20) & 0x7FFFFFFFFF)) & 1))^((int64((in[7] >> 20) & 0x7FFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[7] >> 59) | ((in[8] & 0x3FFFFFFFF) << 5)))) & 1))^((int64(((in[7] >> 59) | ((in[8] & 0x3FFFFFFFF) << 5))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[8] >> 34) | ((in[9] & 0x1FF) << 30)))) & 1))^((int64(((in[8] >> 34) | ((in[9] & 0x1FF) << 30))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[9] >> 9) & 0x7FFFFFFFFF)) & 1))^((int64((in[9] >> 9) & 0x7FFFFFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[9] >> 48) | ((in[10] & 0x7FFFFF) << 16)))) & 1))^((int64(((in[9] >> 48) | ((in[10] & 0x7FFFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[10] >> 23) & 0x7FFFFFFFFF)) & 1))^((int64((in[10] >> 23) & 0x7FFFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[10] >> 62) | ((in[11] & 0x1FFFFFFFFF) << 2)))) & 1))^((int64(((in[10] >> 62) | ((in[11] & 0x1FFFFFFFFF) << 2))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[11] >> 37) | ((in[12] & 0xFFF) << 27)))) & 1))^((int64(((in[11] >> 37) | ((in[12] & 0xFFF) << 27))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[12] >> 12) & 0x7FFFFFFFFF)) & 1))^((int64((in[12] >> 12) & 0x7FFFFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[12] >> 51) | ((in[13] & 0x3FFFFFF) << 13)))) & 1))^((int64(((in[12] >> 51) | ((in[13] & 0x3FFFFFF) << 13))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[13] >> 26) | ((in[14] & 0x1) << 38)))) & 1))^((int64(((in[13] >> 26) | ((in[14] & 0x1) << 38))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[14] >> 1) & 0x7FFFFFFFFF)) & 1))^((int64((in[14] >> 1) & 0x7FFFFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[14] >> 40) | ((in[15] & 0x7FFF) << 24)))) & 1))^((int64(((in[14] >> 40) | ((in[15] & 0x7FFF) << 24))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[15] >> 15) & 0x7FFFFFFFFF)) & 1))^((int64((in[15] >> 15) & 0x7FFFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[15] >> 54) | ((in[16] & 0x1FFFFFFF) << 10)))) & 1))^((int64(((in[15] >> 54) | ((in[16] & 0x1FFFFFFF) << 10))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[16] >> 29) | ((in[17] & 0xF) << 35)))) & 1))^((int64(((in[16] >> 29) | ((in[17] & 0xF) << 35))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[17] >> 4) & 0x7FFFFFFFFF)) & 1))^((int64((in[17] >> 4) & 0x7FFFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[17] >> 43) | ((in[18] & 0x3FFFF) << 21)))) & 1))^((int64(((in[17] >> 43) | ((in[18] & 0x3FFFF) << 21))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[18] >> 18) & 0x7FFFFFFFFF)) & 1))^((int64((in[18] >> 18) & 0x7FFFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[18] >> 57) | ((in[19] & 0xFFFFFFFF) << 7)))) & 1))^((int64(((in[18] >> 57) | ((in[19] & 0xFFFFFFFF) << 7))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[19] >> 32) | ((in[20] & 0x7F) << 32)))) & 1))^((int64(((in[19] >> 32) | ((in[20] & 0x7F) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[20] >> 7) & 0x7FFFFFFFFF)) & 1))^((int64((in[20] >> 7) & 0x7FFFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[20] >> 46) | ((in[21] & 0x1FFFFF) << 18)))) & 1))^((int64(((in[20] >> 46) | ((in[21] & 0x1FFFFF) << 18))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[21] >> 21) & 0x7FFFFFFFFF)) & 1))^((int64((in[21] >> 21) & 0x7FFFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[21] >> 60) | ((in[22] & 0x7FFFFFFFF) << 4)))) & 1))^((int64(((in[21] >> 60) | ((in[22] & 0x7FFFFFFFF) << 4))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[22] >> 35) | ((in[23] & 0x3FF) << 29)))) & 1))^((int64(((in[22] >> 35) | ((in[23] & 0x3FF) << 29))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[23] >> 10) & 0x7FFFFFFFFF)) & 1))^((int64((in[23] >> 10) & 0x7FFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[23] >> 49) | ((in[24] & 0xFFFFFF) << 15)))) & 1))^((int64(((in[23] >> 49) | ((in[24] & 0xFFFFFF) << 15))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[24] >> 24) & 0x7FFFFFFFFF)) & 1))^((int64((in[24] >> 24) & 0x7FFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[24] >> 63) | ((in[25] & 0x3FFFFFFFFF) << 1)))) & 1))^((int64(((in[24] >> 63) | ((in[25] & 0x3FFFFFFFFF) << 1))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[25] >> 38) | ((in[26] & 0x1FFF) << 26)))) & 1))^((int64(((in[25] >> 38) | ((in[26] & 0x1FFF) << 26))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[26] >> 13) & 0x7FFFFFFFFF)) & 1))^((int64((in[26] >> 13) & 0x7FFFFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[26] >> 52) | ((in[27] & 0x7FFFFFF) << 12)))) & 1))^((int64(((in[26] >> 52) | ((in[27] & 0x7FFFFFF) << 12))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[27] >> 27) | ((in[28] & 0x3) << 37)))) & 1))^((int64(((in[27] >> 27) | ((in[28] & 0x3) << 37))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[28] >> 2) & 0x7FFFFFFFFF)) & 1))^((int64((in[28] >> 2) & 0x7FFFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[28] >> 41) | ((in[29] & 0xFFFF) << 23)))) & 1))^((int64(((in[28] >> 41) | ((in[29] & 0xFFFF) << 23))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[29] >> 16) & 0x7FFFFFFFFF)) & 1))^((int64((in[29] >> 16) & 0x7FFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[29] >> 55) | ((in[30] & 0x3FFFFFFF) << 9)))) & 1))^((int64(((in[29] >> 55) | ((in[30] & 0x3FFFFFFF) << 9))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[30] >> 30) | ((in[31] & 0x1F) << 34)))) & 1))^((int64(((in[30] >> 30) | ((in[31] & 0x1F) << 34))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[31] >> 5) & 0x7FFFFFFFFF)) & 1))^((int64((in[31] >> 5) & 0x7FFFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[31] >> 44) | ((in[32] & 0x7FFFF) << 20)))) & 1))^((int64(((in[31] >> 44) | ((in[32] & 0x7FFFF) << 20))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[32] >> 19) & 0x7FFFFFFFFF)) & 1))^((int64((in[32] >> 19) & 0x7FFFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[32] >> 58) | ((in[33] & 0x1FFFFFFFF) << 6)))) & 1))^((int64(((in[32] >> 58) | ((in[33] & 0x1FFFFFFFF) << 6))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[33] >> 33) | ((in[34] & 0xFF) << 31)))) & 1))^((int64(((in[33] >> 33) | ((in[34] & 0xFF) << 31))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[34] >> 8) & 0x7FFFFFFFFF)) & 1))^((int64((in[34] >> 8) & 0x7FFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[34] >> 47) | ((in[35] & 0x3FFFFF) << 17)))) & 1))^((int64(((in[34] >> 47) | ((in[35] & 0x3FFFFF) << 17))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[35] >> 22) & 0x7FFFFFFFFF)) & 1))^((int64((in[35] >> 22) & 0x7FFFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[35] >> 61) | ((in[36] & 0xFFFFFFFFF) << 3)))) & 1))^((int64(((in[35] >> 61) | ((in[36] & 0xFFFFFFFFF) << 3))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[36] >> 36) | ((in[37] & 0x7FF) << 28)))) & 1))^((int64(((in[36] >> 36) | ((in[37] & 0x7FF) << 28))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[37] >> 11) & 0x7FFFFFFFFF)) & 1))^((int64((in[37] >> 11) & 0x7FFFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[37] >> 50) | ((in[38] & 0x1FFFFFF) << 14)))) & 1))^((int64(((in[37] >> 50) | ((in[38] & 0x1FFFFFF) << 14))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[38] >> 25))) & 1))^((int64((in[38] >> 25)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_40(initoffset uint64, in *[40]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 40) | ((in[1] & 0xFFFF) << 24)))) & 1))^((int64(((in[0] >> 40) | ((in[1] & 0xFFFF) << 24))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[1] >> 16) & 0xFFFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0xFFFFFFFF) << 8))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 32) | ((in[3] & 0xFF) << 32)))) & 1))^((int64(((in[2] >> 32) | ((in[3] & 0xFF) << 32))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[3] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[3] >> 8) & 0xFFFFFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[3] >> 48) | ((in[4] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[3] >> 48) | ((in[4] & 0xFFFFFF) << 16))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[4] >> 24))) & 1))^((int64((in[4] >> 24)))>>1))) + out[6] + out[8] = uint64(((-((int64((in[5] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[5] >> 0) & 0xFFFFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[5] >> 40) | ((in[6] & 0xFFFF) << 24)))) & 1))^((int64(((in[5] >> 40) | ((in[6] & 0xFFFF) << 24))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[6] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[6] >> 16) & 0xFFFFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[6] >> 56) | ((in[7] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[6] >> 56) | ((in[7] & 0xFFFFFFFF) << 8))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[7] >> 32) | ((in[8] & 0xFF) << 32)))) & 1))^((int64(((in[7] >> 32) | ((in[8] & 0xFF) << 32))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[8] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[8] >> 8) & 0xFFFFFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[8] >> 48) | ((in[9] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[8] >> 48) | ((in[9] & 0xFFFFFF) << 16))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[9] >> 24))) & 1))^((int64((in[9] >> 24)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[10] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[10] >> 0) & 0xFFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[10] >> 40) | ((in[11] & 0xFFFF) << 24)))) & 1))^((int64(((in[10] >> 40) | ((in[11] & 0xFFFF) << 24))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[11] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[11] >> 16) & 0xFFFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[11] >> 56) | ((in[12] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[11] >> 56) | ((in[12] & 0xFFFFFFFF) << 8))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[12] >> 32) | ((in[13] & 0xFF) << 32)))) & 1))^((int64(((in[12] >> 32) | ((in[13] & 0xFF) << 32))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[13] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[13] >> 8) & 0xFFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[13] >> 48) | ((in[14] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[13] >> 48) | ((in[14] & 0xFFFFFF) << 16))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[14] >> 24))) & 1))^((int64((in[14] >> 24)))>>1))) + out[22] + out[24] = uint64(((-((int64((in[15] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[15] >> 0) & 0xFFFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[15] >> 40) | ((in[16] & 0xFFFF) << 24)))) & 1))^((int64(((in[15] >> 40) | ((in[16] & 0xFFFF) << 24))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[16] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[16] >> 16) & 0xFFFFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFFF) << 8))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[17] >> 32) | ((in[18] & 0xFF) << 32)))) & 1))^((int64(((in[17] >> 32) | ((in[18] & 0xFF) << 32))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[18] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[18] >> 8) & 0xFFFFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0xFFFFFF) << 16))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[19] >> 24))) & 1))^((int64((in[19] >> 24)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[20] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[20] >> 0) & 0xFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[20] >> 40) | ((in[21] & 0xFFFF) << 24)))) & 1))^((int64(((in[20] >> 40) | ((in[21] & 0xFFFF) << 24))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[21] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[21] >> 16) & 0xFFFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[21] >> 56) | ((in[22] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[21] >> 56) | ((in[22] & 0xFFFFFFFF) << 8))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[22] >> 32) | ((in[23] & 0xFF) << 32)))) & 1))^((int64(((in[22] >> 32) | ((in[23] & 0xFF) << 32))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[23] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[23] >> 8) & 0xFFFFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[23] >> 48) | ((in[24] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[23] >> 48) | ((in[24] & 0xFFFFFF) << 16))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[24] >> 24))) & 1))^((int64((in[24] >> 24)))>>1))) + out[38] + out[40] = uint64(((-((int64((in[25] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[25] >> 0) & 0xFFFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[25] >> 40) | ((in[26] & 0xFFFF) << 24)))) & 1))^((int64(((in[25] >> 40) | ((in[26] & 0xFFFF) << 24))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[26] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[26] >> 16) & 0xFFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[26] >> 56) | ((in[27] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[26] >> 56) | ((in[27] & 0xFFFFFFFF) << 8))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[27] >> 32) | ((in[28] & 0xFF) << 32)))) & 1))^((int64(((in[27] >> 32) | ((in[28] & 0xFF) << 32))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[28] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[28] >> 8) & 0xFFFFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[28] >> 48) | ((in[29] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[28] >> 48) | ((in[29] & 0xFFFFFF) << 16))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[29] >> 24))) & 1))^((int64((in[29] >> 24)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[30] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[30] >> 0) & 0xFFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[30] >> 40) | ((in[31] & 0xFFFF) << 24)))) & 1))^((int64(((in[30] >> 40) | ((in[31] & 0xFFFF) << 24))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[31] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[31] >> 16) & 0xFFFFFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[31] >> 56) | ((in[32] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[31] >> 56) | ((in[32] & 0xFFFFFFFF) << 8))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[32] >> 32) | ((in[33] & 0xFF) << 32)))) & 1))^((int64(((in[32] >> 32) | ((in[33] & 0xFF) << 32))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[33] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[33] >> 8) & 0xFFFFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[33] >> 48) | ((in[34] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[33] >> 48) | ((in[34] & 0xFFFFFF) << 16))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[34] >> 24))) & 1))^((int64((in[34] >> 24)))>>1))) + out[54] + out[56] = uint64(((-((int64((in[35] >> 0) & 0xFFFFFFFFFF)) & 1))^((int64((in[35] >> 0) & 0xFFFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[35] >> 40) | ((in[36] & 0xFFFF) << 24)))) & 1))^((int64(((in[35] >> 40) | ((in[36] & 0xFFFF) << 24))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[36] >> 16) & 0xFFFFFFFFFF)) & 1))^((int64((in[36] >> 16) & 0xFFFFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[36] >> 56) | ((in[37] & 0xFFFFFFFF) << 8)))) & 1))^((int64(((in[36] >> 56) | ((in[37] & 0xFFFFFFFF) << 8))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[37] >> 32) | ((in[38] & 0xFF) << 32)))) & 1))^((int64(((in[37] >> 32) | ((in[38] & 0xFF) << 32))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[38] >> 8) & 0xFFFFFFFFFF)) & 1))^((int64((in[38] >> 8) & 0xFFFFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[38] >> 48) | ((in[39] & 0xFFFFFF) << 16)))) & 1))^((int64(((in[38] >> 48) | ((in[39] & 0xFFFFFF) << 16))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[39] >> 24))) & 1))^((int64((in[39] >> 24)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_41(initoffset uint64, in *[41]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 41) | ((in[1] & 0x3FFFF) << 23)))) & 1))^((int64(((in[0] >> 41) | ((in[1] & 0x3FFFF) << 23))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 18) & 0x1FFFFFFFFFF)) & 1))^((int64((in[1] >> 18) & 0x1FFFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 59) | ((in[2] & 0xFFFFFFFFF) << 5)))) & 1))^((int64(((in[1] >> 59) | ((in[2] & 0xFFFFFFFFF) << 5))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 36) | ((in[3] & 0x1FFF) << 28)))) & 1))^((int64(((in[2] >> 36) | ((in[3] & 0x1FFF) << 28))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[3] >> 13) & 0x1FFFFFFFFFF)) & 1))^((int64((in[3] >> 13) & 0x1FFFFFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[3] >> 54) | ((in[4] & 0x7FFFFFFF) << 10)))) & 1))^((int64(((in[3] >> 54) | ((in[4] & 0x7FFFFFFF) << 10))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[4] >> 31) | ((in[5] & 0xFF) << 33)))) & 1))^((int64(((in[4] >> 31) | ((in[5] & 0xFF) << 33))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[5] >> 8) & 0x1FFFFFFFFFF)) & 1))^((int64((in[5] >> 8) & 0x1FFFFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[5] >> 49) | ((in[6] & 0x3FFFFFF) << 15)))) & 1))^((int64(((in[5] >> 49) | ((in[6] & 0x3FFFFFF) << 15))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[6] >> 26) | ((in[7] & 0x7) << 38)))) & 1))^((int64(((in[6] >> 26) | ((in[7] & 0x7) << 38))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[7] >> 3) & 0x1FFFFFFFFFF)) & 1))^((int64((in[7] >> 3) & 0x1FFFFFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[7] >> 44) | ((in[8] & 0x1FFFFF) << 20)))) & 1))^((int64(((in[7] >> 44) | ((in[8] & 0x1FFFFF) << 20))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[8] >> 21) & 0x1FFFFFFFFFF)) & 1))^((int64((in[8] >> 21) & 0x1FFFFFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[8] >> 62) | ((in[9] & 0x7FFFFFFFFF) << 2)))) & 1))^((int64(((in[8] >> 62) | ((in[9] & 0x7FFFFFFFFF) << 2))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[9] >> 39) | ((in[10] & 0xFFFF) << 25)))) & 1))^((int64(((in[9] >> 39) | ((in[10] & 0xFFFF) << 25))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[10] >> 16) & 0x1FFFFFFFFFF)) & 1))^((int64((in[10] >> 16) & 0x1FFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[10] >> 57) | ((in[11] & 0x3FFFFFFFF) << 7)))) & 1))^((int64(((in[10] >> 57) | ((in[11] & 0x3FFFFFFFF) << 7))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[11] >> 34) | ((in[12] & 0x7FF) << 30)))) & 1))^((int64(((in[11] >> 34) | ((in[12] & 0x7FF) << 30))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[12] >> 11) & 0x1FFFFFFFFFF)) & 1))^((int64((in[12] >> 11) & 0x1FFFFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[12] >> 52) | ((in[13] & 0x1FFFFFFF) << 12)))) & 1))^((int64(((in[12] >> 52) | ((in[13] & 0x1FFFFFFF) << 12))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[13] >> 29) | ((in[14] & 0x3F) << 35)))) & 1))^((int64(((in[13] >> 29) | ((in[14] & 0x3F) << 35))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[14] >> 6) & 0x1FFFFFFFFFF)) & 1))^((int64((in[14] >> 6) & 0x1FFFFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[14] >> 47) | ((in[15] & 0xFFFFFF) << 17)))) & 1))^((int64(((in[14] >> 47) | ((in[15] & 0xFFFFFF) << 17))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[15] >> 24) | ((in[16] & 0x1) << 40)))) & 1))^((int64(((in[15] >> 24) | ((in[16] & 0x1) << 40))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[16] >> 1) & 0x1FFFFFFFFFF)) & 1))^((int64((in[16] >> 1) & 0x1FFFFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[16] >> 42) | ((in[17] & 0x7FFFF) << 22)))) & 1))^((int64(((in[16] >> 42) | ((in[17] & 0x7FFFF) << 22))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[17] >> 19) & 0x1FFFFFFFFFF)) & 1))^((int64((in[17] >> 19) & 0x1FFFFFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[17] >> 60) | ((in[18] & 0x1FFFFFFFFF) << 4)))) & 1))^((int64(((in[17] >> 60) | ((in[18] & 0x1FFFFFFFFF) << 4))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[18] >> 37) | ((in[19] & 0x3FFF) << 27)))) & 1))^((int64(((in[18] >> 37) | ((in[19] & 0x3FFF) << 27))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[19] >> 14) & 0x1FFFFFFFFFF)) & 1))^((int64((in[19] >> 14) & 0x1FFFFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[19] >> 55) | ((in[20] & 0xFFFFFFFF) << 9)))) & 1))^((int64(((in[19] >> 55) | ((in[20] & 0xFFFFFFFF) << 9))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[20] >> 32) | ((in[21] & 0x1FF) << 32)))) & 1))^((int64(((in[20] >> 32) | ((in[21] & 0x1FF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[21] >> 9) & 0x1FFFFFFFFFF)) & 1))^((int64((in[21] >> 9) & 0x1FFFFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[21] >> 50) | ((in[22] & 0x7FFFFFF) << 14)))) & 1))^((int64(((in[21] >> 50) | ((in[22] & 0x7FFFFFF) << 14))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[22] >> 27) | ((in[23] & 0xF) << 37)))) & 1))^((int64(((in[22] >> 27) | ((in[23] & 0xF) << 37))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[23] >> 4) & 0x1FFFFFFFFFF)) & 1))^((int64((in[23] >> 4) & 0x1FFFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[23] >> 45) | ((in[24] & 0x3FFFFF) << 19)))) & 1))^((int64(((in[23] >> 45) | ((in[24] & 0x3FFFFF) << 19))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[24] >> 22) & 0x1FFFFFFFFFF)) & 1))^((int64((in[24] >> 22) & 0x1FFFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[24] >> 63) | ((in[25] & 0xFFFFFFFFFF) << 1)))) & 1))^((int64(((in[24] >> 63) | ((in[25] & 0xFFFFFFFFFF) << 1))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[25] >> 40) | ((in[26] & 0x1FFFF) << 24)))) & 1))^((int64(((in[25] >> 40) | ((in[26] & 0x1FFFF) << 24))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[26] >> 17) & 0x1FFFFFFFFFF)) & 1))^((int64((in[26] >> 17) & 0x1FFFFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[26] >> 58) | ((in[27] & 0x7FFFFFFFF) << 6)))) & 1))^((int64(((in[26] >> 58) | ((in[27] & 0x7FFFFFFFF) << 6))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[27] >> 35) | ((in[28] & 0xFFF) << 29)))) & 1))^((int64(((in[27] >> 35) | ((in[28] & 0xFFF) << 29))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[28] >> 12) & 0x1FFFFFFFFFF)) & 1))^((int64((in[28] >> 12) & 0x1FFFFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[28] >> 53) | ((in[29] & 0x3FFFFFFF) << 11)))) & 1))^((int64(((in[28] >> 53) | ((in[29] & 0x3FFFFFFF) << 11))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[29] >> 30) | ((in[30] & 0x7F) << 34)))) & 1))^((int64(((in[29] >> 30) | ((in[30] & 0x7F) << 34))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[30] >> 7) & 0x1FFFFFFFFFF)) & 1))^((int64((in[30] >> 7) & 0x1FFFFFFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[30] >> 48) | ((in[31] & 0x1FFFFFF) << 16)))) & 1))^((int64(((in[30] >> 48) | ((in[31] & 0x1FFFFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[31] >> 25) | ((in[32] & 0x3) << 39)))) & 1))^((int64(((in[31] >> 25) | ((in[32] & 0x3) << 39))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[32] >> 2) & 0x1FFFFFFFFFF)) & 1))^((int64((in[32] >> 2) & 0x1FFFFFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[32] >> 43) | ((in[33] & 0xFFFFF) << 21)))) & 1))^((int64(((in[32] >> 43) | ((in[33] & 0xFFFFF) << 21))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[33] >> 20) & 0x1FFFFFFFFFF)) & 1))^((int64((in[33] >> 20) & 0x1FFFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFF) << 3)))) & 1))^((int64(((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFF) << 3))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[34] >> 38) | ((in[35] & 0x7FFF) << 26)))) & 1))^((int64(((in[34] >> 38) | ((in[35] & 0x7FFF) << 26))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[35] >> 15) & 0x1FFFFFFFFFF)) & 1))^((int64((in[35] >> 15) & 0x1FFFFFFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[35] >> 56) | ((in[36] & 0x1FFFFFFFF) << 8)))) & 1))^((int64(((in[35] >> 56) | ((in[36] & 0x1FFFFFFFF) << 8))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[36] >> 33) | ((in[37] & 0x3FF) << 31)))) & 1))^((int64(((in[36] >> 33) | ((in[37] & 0x3FF) << 31))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[37] >> 10) & 0x1FFFFFFFFFF)) & 1))^((int64((in[37] >> 10) & 0x1FFFFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[37] >> 51) | ((in[38] & 0xFFFFFFF) << 13)))) & 1))^((int64(((in[37] >> 51) | ((in[38] & 0xFFFFFFF) << 13))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[38] >> 28) | ((in[39] & 0x1F) << 36)))) & 1))^((int64(((in[38] >> 28) | ((in[39] & 0x1F) << 36))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[39] >> 5) & 0x1FFFFFFFFFF)) & 1))^((int64((in[39] >> 5) & 0x1FFFFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[39] >> 46) | ((in[40] & 0x7FFFFF) << 18)))) & 1))^((int64(((in[39] >> 46) | ((in[40] & 0x7FFFFF) << 18))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[40] >> 23))) & 1))^((int64((in[40] >> 23)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_42(initoffset uint64, in *[42]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 42) | ((in[1] & 0xFFFFF) << 22)))) & 1))^((int64(((in[0] >> 42) | ((in[1] & 0xFFFFF) << 22))))>>1))) + out[0] + out[2] = uint64(((-((int64((in[1] >> 20) & 0x3FFFFFFFFFF)) & 1))^((int64((in[1] >> 20) & 0x3FFFFFFFFFF))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0xFFFFFFFFFF) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0xFFFFFFFFFF) << 2))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 40) | ((in[3] & 0x3FFFF) << 24)))) & 1))^((int64(((in[2] >> 40) | ((in[3] & 0x3FFFF) << 24))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[3] >> 18) & 0x3FFFFFFFFFF)) & 1))^((int64((in[3] >> 18) & 0x3FFFFFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x3FFFFFFFFF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x3FFFFFFFFF) << 4))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[4] >> 38) | ((in[5] & 0xFFFF) << 26)))) & 1))^((int64(((in[4] >> 38) | ((in[5] & 0xFFFF) << 26))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[5] >> 16) & 0x3FFFFFFFFFF)) & 1))^((int64((in[5] >> 16) & 0x3FFFFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0xFFFFFFFFF) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0xFFFFFFFFF) << 6))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[6] >> 36) | ((in[7] & 0x3FFF) << 28)))) & 1))^((int64(((in[6] >> 36) | ((in[7] & 0x3FFF) << 28))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[7] >> 14) & 0x3FFFFFFFFFF)) & 1))^((int64((in[7] >> 14) & 0x3FFFFFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0x3FFFFFFFF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0x3FFFFFFFF) << 8))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[8] >> 34) | ((in[9] & 0xFFF) << 30)))) & 1))^((int64(((in[8] >> 34) | ((in[9] & 0xFFF) << 30))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[9] >> 12) & 0x3FFFFFFFFFF)) & 1))^((int64((in[9] >> 12) & 0x3FFFFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0xFFFFFFFF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0xFFFFFFFF) << 10))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[10] >> 32) | ((in[11] & 0x3FF) << 32)))) & 1))^((int64(((in[10] >> 32) | ((in[11] & 0x3FF) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[11] >> 10) & 0x3FFFFFFFFFF)) & 1))^((int64((in[11] >> 10) & 0x3FFFFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0x3FFFFFFF) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0x3FFFFFFF) << 12))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[12] >> 30) | ((in[13] & 0xFF) << 34)))) & 1))^((int64(((in[12] >> 30) | ((in[13] & 0xFF) << 34))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[13] >> 8) & 0x3FFFFFFFFFF)) & 1))^((int64((in[13] >> 8) & 0x3FFFFFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[13] >> 50) | ((in[14] & 0xFFFFFFF) << 14)))) & 1))^((int64(((in[13] >> 50) | ((in[14] & 0xFFFFFFF) << 14))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[14] >> 28) | ((in[15] & 0x3F) << 36)))) & 1))^((int64(((in[14] >> 28) | ((in[15] & 0x3F) << 36))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[15] >> 6) & 0x3FFFFFFFFFF)) & 1))^((int64((in[15] >> 6) & 0x3FFFFFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0x3FFFFFF) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0x3FFFFFF) << 16))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[16] >> 26) | ((in[17] & 0xF) << 38)))) & 1))^((int64(((in[16] >> 26) | ((in[17] & 0xF) << 38))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[17] >> 4) & 0x3FFFFFFFFFF)) & 1))^((int64((in[17] >> 4) & 0x3FFFFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[17] >> 46) | ((in[18] & 0xFFFFFF) << 18)))) & 1))^((int64(((in[17] >> 46) | ((in[18] & 0xFFFFFF) << 18))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[18] >> 24) | ((in[19] & 0x3) << 40)))) & 1))^((int64(((in[18] >> 24) | ((in[19] & 0x3) << 40))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[19] >> 2) & 0x3FFFFFFFFFF)) & 1))^((int64((in[19] >> 2) & 0x3FFFFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0x3FFFFF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0x3FFFFF) << 20))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[20] >> 22))) & 1))^((int64((in[20] >> 22)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[21] >> 0) & 0x3FFFFFFFFFF)) & 1))^((int64((in[21] >> 0) & 0x3FFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[21] >> 42) | ((in[22] & 0xFFFFF) << 22)))) & 1))^((int64(((in[21] >> 42) | ((in[22] & 0xFFFFF) << 22))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[22] >> 20) & 0x3FFFFFFFFFF)) & 1))^((int64((in[22] >> 20) & 0x3FFFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[22] >> 62) | ((in[23] & 0xFFFFFFFFFF) << 2)))) & 1))^((int64(((in[22] >> 62) | ((in[23] & 0xFFFFFFFFFF) << 2))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[23] >> 40) | ((in[24] & 0x3FFFF) << 24)))) & 1))^((int64(((in[23] >> 40) | ((in[24] & 0x3FFFF) << 24))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[24] >> 18) & 0x3FFFFFFFFFF)) & 1))^((int64((in[24] >> 18) & 0x3FFFFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[24] >> 60) | ((in[25] & 0x3FFFFFFFFF) << 4)))) & 1))^((int64(((in[24] >> 60) | ((in[25] & 0x3FFFFFFFFF) << 4))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[25] >> 38) | ((in[26] & 0xFFFF) << 26)))) & 1))^((int64(((in[25] >> 38) | ((in[26] & 0xFFFF) << 26))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[26] >> 16) & 0x3FFFFFFFFFF)) & 1))^((int64((in[26] >> 16) & 0x3FFFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[26] >> 58) | ((in[27] & 0xFFFFFFFFF) << 6)))) & 1))^((int64(((in[26] >> 58) | ((in[27] & 0xFFFFFFFFF) << 6))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[27] >> 36) | ((in[28] & 0x3FFF) << 28)))) & 1))^((int64(((in[27] >> 36) | ((in[28] & 0x3FFF) << 28))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[28] >> 14) & 0x3FFFFFFFFFF)) & 1))^((int64((in[28] >> 14) & 0x3FFFFFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[28] >> 56) | ((in[29] & 0x3FFFFFFFF) << 8)))) & 1))^((int64(((in[28] >> 56) | ((in[29] & 0x3FFFFFFFF) << 8))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[29] >> 34) | ((in[30] & 0xFFF) << 30)))) & 1))^((int64(((in[29] >> 34) | ((in[30] & 0xFFF) << 30))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[30] >> 12) & 0x3FFFFFFFFFF)) & 1))^((int64((in[30] >> 12) & 0x3FFFFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[30] >> 54) | ((in[31] & 0xFFFFFFFF) << 10)))) & 1))^((int64(((in[30] >> 54) | ((in[31] & 0xFFFFFFFF) << 10))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[31] >> 32) | ((in[32] & 0x3FF) << 32)))) & 1))^((int64(((in[31] >> 32) | ((in[32] & 0x3FF) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[32] >> 10) & 0x3FFFFFFFFFF)) & 1))^((int64((in[32] >> 10) & 0x3FFFFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[32] >> 52) | ((in[33] & 0x3FFFFFFF) << 12)))) & 1))^((int64(((in[32] >> 52) | ((in[33] & 0x3FFFFFFF) << 12))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[33] >> 30) | ((in[34] & 0xFF) << 34)))) & 1))^((int64(((in[33] >> 30) | ((in[34] & 0xFF) << 34))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[34] >> 8) & 0x3FFFFFFFFFF)) & 1))^((int64((in[34] >> 8) & 0x3FFFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[34] >> 50) | ((in[35] & 0xFFFFFFF) << 14)))) & 1))^((int64(((in[34] >> 50) | ((in[35] & 0xFFFFFFF) << 14))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[35] >> 28) | ((in[36] & 0x3F) << 36)))) & 1))^((int64(((in[35] >> 28) | ((in[36] & 0x3F) << 36))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[36] >> 6) & 0x3FFFFFFFFFF)) & 1))^((int64((in[36] >> 6) & 0x3FFFFFFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[36] >> 48) | ((in[37] & 0x3FFFFFF) << 16)))) & 1))^((int64(((in[36] >> 48) | ((in[37] & 0x3FFFFFF) << 16))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[37] >> 26) | ((in[38] & 0xF) << 38)))) & 1))^((int64(((in[37] >> 26) | ((in[38] & 0xF) << 38))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[38] >> 4) & 0x3FFFFFFFFFF)) & 1))^((int64((in[38] >> 4) & 0x3FFFFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[38] >> 46) | ((in[39] & 0xFFFFFF) << 18)))) & 1))^((int64(((in[38] >> 46) | ((in[39] & 0xFFFFFF) << 18))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[39] >> 24) | ((in[40] & 0x3) << 40)))) & 1))^((int64(((in[39] >> 24) | ((in[40] & 0x3) << 40))))>>1))) + out[59] + out[61] = uint64(((-((int64((in[40] >> 2) & 0x3FFFFFFFFFF)) & 1))^((int64((in[40] >> 2) & 0x3FFFFFFFFFF))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[40] >> 44) | ((in[41] & 0x3FFFFF) << 20)))) & 1))^((int64(((in[40] >> 44) | ((in[41] & 0x3FFFFF) << 20))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[41] >> 22))) & 1))^((int64((in[41] >> 22)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_43(initoffset uint64, in *[43]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 43) | ((in[1] & 0x3FFFFF) << 21)))) & 1))^((int64(((in[0] >> 43) | ((in[1] & 0x3FFFFF) << 21))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 22) | ((in[2] & 0x1) << 42)))) & 1))^((int64(((in[1] >> 22) | ((in[2] & 0x1) << 42))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[2] >> 1) & 0x7FFFFFFFFFF)) & 1))^((int64((in[2] >> 1) & 0x7FFFFFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 44) | ((in[3] & 0x7FFFFF) << 20)))) & 1))^((int64(((in[2] >> 44) | ((in[3] & 0x7FFFFF) << 20))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 23) | ((in[4] & 0x3) << 41)))) & 1))^((int64(((in[3] >> 23) | ((in[4] & 0x3) << 41))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[4] >> 2) & 0x7FFFFFFFFFF)) & 1))^((int64((in[4] >> 2) & 0x7FFFFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[4] >> 45) | ((in[5] & 0xFFFFFF) << 19)))) & 1))^((int64(((in[4] >> 45) | ((in[5] & 0xFFFFFF) << 19))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[5] >> 24) | ((in[6] & 0x7) << 40)))) & 1))^((int64(((in[5] >> 24) | ((in[6] & 0x7) << 40))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[6] >> 3) & 0x7FFFFFFFFFF)) & 1))^((int64((in[6] >> 3) & 0x7FFFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[6] >> 46) | ((in[7] & 0x1FFFFFF) << 18)))) & 1))^((int64(((in[6] >> 46) | ((in[7] & 0x1FFFFFF) << 18))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[7] >> 25) | ((in[8] & 0xF) << 39)))) & 1))^((int64(((in[7] >> 25) | ((in[8] & 0xF) << 39))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[8] >> 4) & 0x7FFFFFFFFFF)) & 1))^((int64((in[8] >> 4) & 0x7FFFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[8] >> 47) | ((in[9] & 0x3FFFFFF) << 17)))) & 1))^((int64(((in[8] >> 47) | ((in[9] & 0x3FFFFFF) << 17))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[9] >> 26) | ((in[10] & 0x1F) << 38)))) & 1))^((int64(((in[9] >> 26) | ((in[10] & 0x1F) << 38))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[10] >> 5) & 0x7FFFFFFFFFF)) & 1))^((int64((in[10] >> 5) & 0x7FFFFFFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[10] >> 48) | ((in[11] & 0x7FFFFFF) << 16)))) & 1))^((int64(((in[10] >> 48) | ((in[11] & 0x7FFFFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[11] >> 27) | ((in[12] & 0x3F) << 37)))) & 1))^((int64(((in[11] >> 27) | ((in[12] & 0x3F) << 37))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[12] >> 6) & 0x7FFFFFFFFFF)) & 1))^((int64((in[12] >> 6) & 0x7FFFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[12] >> 49) | ((in[13] & 0xFFFFFFF) << 15)))) & 1))^((int64(((in[12] >> 49) | ((in[13] & 0xFFFFFFF) << 15))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[13] >> 28) | ((in[14] & 0x7F) << 36)))) & 1))^((int64(((in[13] >> 28) | ((in[14] & 0x7F) << 36))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[14] >> 7) & 0x7FFFFFFFFFF)) & 1))^((int64((in[14] >> 7) & 0x7FFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[14] >> 50) | ((in[15] & 0x1FFFFFFF) << 14)))) & 1))^((int64(((in[14] >> 50) | ((in[15] & 0x1FFFFFFF) << 14))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[15] >> 29) | ((in[16] & 0xFF) << 35)))) & 1))^((int64(((in[15] >> 29) | ((in[16] & 0xFF) << 35))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[16] >> 8) & 0x7FFFFFFFFFF)) & 1))^((int64((in[16] >> 8) & 0x7FFFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[16] >> 51) | ((in[17] & 0x3FFFFFFF) << 13)))) & 1))^((int64(((in[16] >> 51) | ((in[17] & 0x3FFFFFFF) << 13))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[17] >> 30) | ((in[18] & 0x1FF) << 34)))) & 1))^((int64(((in[17] >> 30) | ((in[18] & 0x1FF) << 34))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[18] >> 9) & 0x7FFFFFFFFFF)) & 1))^((int64((in[18] >> 9) & 0x7FFFFFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[18] >> 52) | ((in[19] & 0x7FFFFFFF) << 12)))) & 1))^((int64(((in[18] >> 52) | ((in[19] & 0x7FFFFFFF) << 12))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[19] >> 31) | ((in[20] & 0x3FF) << 33)))) & 1))^((int64(((in[19] >> 31) | ((in[20] & 0x3FF) << 33))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[20] >> 10) & 0x7FFFFFFFFFF)) & 1))^((int64((in[20] >> 10) & 0x7FFFFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[20] >> 53) | ((in[21] & 0xFFFFFFFF) << 11)))) & 1))^((int64(((in[20] >> 53) | ((in[21] & 0xFFFFFFFF) << 11))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[21] >> 32) | ((in[22] & 0x7FF) << 32)))) & 1))^((int64(((in[21] >> 32) | ((in[22] & 0x7FF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[22] >> 11) & 0x7FFFFFFFFFF)) & 1))^((int64((in[22] >> 11) & 0x7FFFFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[22] >> 54) | ((in[23] & 0x1FFFFFFFF) << 10)))) & 1))^((int64(((in[22] >> 54) | ((in[23] & 0x1FFFFFFFF) << 10))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[23] >> 33) | ((in[24] & 0xFFF) << 31)))) & 1))^((int64(((in[23] >> 33) | ((in[24] & 0xFFF) << 31))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[24] >> 12) & 0x7FFFFFFFFFF)) & 1))^((int64((in[24] >> 12) & 0x7FFFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[24] >> 55) | ((in[25] & 0x3FFFFFFFF) << 9)))) & 1))^((int64(((in[24] >> 55) | ((in[25] & 0x3FFFFFFFF) << 9))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[25] >> 34) | ((in[26] & 0x1FFF) << 30)))) & 1))^((int64(((in[25] >> 34) | ((in[26] & 0x1FFF) << 30))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[26] >> 13) & 0x7FFFFFFFFFF)) & 1))^((int64((in[26] >> 13) & 0x7FFFFFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[26] >> 56) | ((in[27] & 0x7FFFFFFFF) << 8)))) & 1))^((int64(((in[26] >> 56) | ((in[27] & 0x7FFFFFFFF) << 8))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[27] >> 35) | ((in[28] & 0x3FFF) << 29)))) & 1))^((int64(((in[27] >> 35) | ((in[28] & 0x3FFF) << 29))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[28] >> 14) & 0x7FFFFFFFFFF)) & 1))^((int64((in[28] >> 14) & 0x7FFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[28] >> 57) | ((in[29] & 0xFFFFFFFFF) << 7)))) & 1))^((int64(((in[28] >> 57) | ((in[29] & 0xFFFFFFFFF) << 7))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[29] >> 36) | ((in[30] & 0x7FFF) << 28)))) & 1))^((int64(((in[29] >> 36) | ((in[30] & 0x7FFF) << 28))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[30] >> 15) & 0x7FFFFFFFFFF)) & 1))^((int64((in[30] >> 15) & 0x7FFFFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[30] >> 58) | ((in[31] & 0x1FFFFFFFFF) << 6)))) & 1))^((int64(((in[30] >> 58) | ((in[31] & 0x1FFFFFFFFF) << 6))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[31] >> 37) | ((in[32] & 0xFFFF) << 27)))) & 1))^((int64(((in[31] >> 37) | ((in[32] & 0xFFFF) << 27))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[32] >> 16) & 0x7FFFFFFFFFF)) & 1))^((int64((in[32] >> 16) & 0x7FFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[32] >> 59) | ((in[33] & 0x3FFFFFFFFF) << 5)))) & 1))^((int64(((in[32] >> 59) | ((in[33] & 0x3FFFFFFFFF) << 5))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[33] >> 38) | ((in[34] & 0x1FFFF) << 26)))) & 1))^((int64(((in[33] >> 38) | ((in[34] & 0x1FFFF) << 26))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[34] >> 17) & 0x7FFFFFFFFFF)) & 1))^((int64((in[34] >> 17) & 0x7FFFFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[34] >> 60) | ((in[35] & 0x7FFFFFFFFF) << 4)))) & 1))^((int64(((in[34] >> 60) | ((in[35] & 0x7FFFFFFFFF) << 4))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[35] >> 39) | ((in[36] & 0x3FFFF) << 25)))) & 1))^((int64(((in[35] >> 39) | ((in[36] & 0x3FFFF) << 25))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[36] >> 18) & 0x7FFFFFFFFFF)) & 1))^((int64((in[36] >> 18) & 0x7FFFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFF) << 3)))) & 1))^((int64(((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFF) << 3))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[37] >> 40) | ((in[38] & 0x7FFFF) << 24)))) & 1))^((int64(((in[37] >> 40) | ((in[38] & 0x7FFFF) << 24))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[38] >> 19) & 0x7FFFFFFFFFF)) & 1))^((int64((in[38] >> 19) & 0x7FFFFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[38] >> 62) | ((in[39] & 0x1FFFFFFFFFF) << 2)))) & 1))^((int64(((in[38] >> 62) | ((in[39] & 0x1FFFFFFFFFF) << 2))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[39] >> 41) | ((in[40] & 0xFFFFF) << 23)))) & 1))^((int64(((in[39] >> 41) | ((in[40] & 0xFFFFF) << 23))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[40] >> 20) & 0x7FFFFFFFFFF)) & 1))^((int64((in[40] >> 20) & 0x7FFFFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[40] >> 63) | ((in[41] & 0x3FFFFFFFFFF) << 1)))) & 1))^((int64(((in[40] >> 63) | ((in[41] & 0x3FFFFFFFFFF) << 1))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[41] >> 42) | ((in[42] & 0x1FFFFF) << 22)))) & 1))^((int64(((in[41] >> 42) | ((in[42] & 0x1FFFFF) << 22))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[42] >> 21))) & 1))^((int64((in[42] >> 21)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_44(initoffset uint64, in *[44]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 44) | ((in[1] & 0xFFFFFF) << 20)))) & 1))^((int64(((in[0] >> 44) | ((in[1] & 0xFFFFFF) << 20))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 24) | ((in[2] & 0xF) << 40)))) & 1))^((int64(((in[1] >> 24) | ((in[2] & 0xF) << 40))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[2] >> 4) & 0xFFFFFFFFFFF)) & 1))^((int64((in[2] >> 4) & 0xFFFFFFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 48) | ((in[3] & 0xFFFFFFF) << 16)))) & 1))^((int64(((in[2] >> 48) | ((in[3] & 0xFFFFFFF) << 16))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 28) | ((in[4] & 0xFF) << 36)))) & 1))^((int64(((in[3] >> 28) | ((in[4] & 0xFF) << 36))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[4] >> 8) & 0xFFFFFFFFFFF)) & 1))^((int64((in[4] >> 8) & 0xFFFFFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[4] >> 52) | ((in[5] & 0xFFFFFFFF) << 12)))) & 1))^((int64(((in[4] >> 52) | ((in[5] & 0xFFFFFFFF) << 12))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[5] >> 32) | ((in[6] & 0xFFF) << 32)))) & 1))^((int64(((in[5] >> 32) | ((in[6] & 0xFFF) << 32))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[6] >> 12) & 0xFFFFFFFFFFF)) & 1))^((int64((in[6] >> 12) & 0xFFFFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[6] >> 56) | ((in[7] & 0xFFFFFFFFF) << 8)))) & 1))^((int64(((in[6] >> 56) | ((in[7] & 0xFFFFFFFFF) << 8))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[7] >> 36) | ((in[8] & 0xFFFF) << 28)))) & 1))^((int64(((in[7] >> 36) | ((in[8] & 0xFFFF) << 28))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[8] >> 16) & 0xFFFFFFFFFFF)) & 1))^((int64((in[8] >> 16) & 0xFFFFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFF) << 4)))) & 1))^((int64(((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFF) << 4))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[9] >> 40) | ((in[10] & 0xFFFFF) << 24)))) & 1))^((int64(((in[9] >> 40) | ((in[10] & 0xFFFFF) << 24))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[10] >> 20))) & 1))^((int64((in[10] >> 20)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[11] >> 0) & 0xFFFFFFFFFFF)) & 1))^((int64((in[11] >> 0) & 0xFFFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[11] >> 44) | ((in[12] & 0xFFFFFF) << 20)))) & 1))^((int64(((in[11] >> 44) | ((in[12] & 0xFFFFFF) << 20))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[12] >> 24) | ((in[13] & 0xF) << 40)))) & 1))^((int64(((in[12] >> 24) | ((in[13] & 0xF) << 40))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[13] >> 4) & 0xFFFFFFFFFFF)) & 1))^((int64((in[13] >> 4) & 0xFFFFFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[13] >> 48) | ((in[14] & 0xFFFFFFF) << 16)))) & 1))^((int64(((in[13] >> 48) | ((in[14] & 0xFFFFFFF) << 16))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[14] >> 28) | ((in[15] & 0xFF) << 36)))) & 1))^((int64(((in[14] >> 28) | ((in[15] & 0xFF) << 36))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[15] >> 8) & 0xFFFFFFFFFFF)) & 1))^((int64((in[15] >> 8) & 0xFFFFFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[15] >> 52) | ((in[16] & 0xFFFFFFFF) << 12)))) & 1))^((int64(((in[15] >> 52) | ((in[16] & 0xFFFFFFFF) << 12))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[16] >> 32) | ((in[17] & 0xFFF) << 32)))) & 1))^((int64(((in[16] >> 32) | ((in[17] & 0xFFF) << 32))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[17] >> 12) & 0xFFFFFFFFFFF)) & 1))^((int64((in[17] >> 12) & 0xFFFFFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[17] >> 56) | ((in[18] & 0xFFFFFFFFF) << 8)))) & 1))^((int64(((in[17] >> 56) | ((in[18] & 0xFFFFFFFFF) << 8))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[18] >> 36) | ((in[19] & 0xFFFF) << 28)))) & 1))^((int64(((in[18] >> 36) | ((in[19] & 0xFFFF) << 28))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[19] >> 16) & 0xFFFFFFFFFFF)) & 1))^((int64((in[19] >> 16) & 0xFFFFFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[19] >> 60) | ((in[20] & 0xFFFFFFFFFF) << 4)))) & 1))^((int64(((in[19] >> 60) | ((in[20] & 0xFFFFFFFFFF) << 4))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[20] >> 40) | ((in[21] & 0xFFFFF) << 24)))) & 1))^((int64(((in[20] >> 40) | ((in[21] & 0xFFFFF) << 24))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[21] >> 20))) & 1))^((int64((in[21] >> 20)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[22] >> 0) & 0xFFFFFFFFFFF)) & 1))^((int64((in[22] >> 0) & 0xFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[22] >> 44) | ((in[23] & 0xFFFFFF) << 20)))) & 1))^((int64(((in[22] >> 44) | ((in[23] & 0xFFFFFF) << 20))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[23] >> 24) | ((in[24] & 0xF) << 40)))) & 1))^((int64(((in[23] >> 24) | ((in[24] & 0xF) << 40))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[24] >> 4) & 0xFFFFFFFFFFF)) & 1))^((int64((in[24] >> 4) & 0xFFFFFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[24] >> 48) | ((in[25] & 0xFFFFFFF) << 16)))) & 1))^((int64(((in[24] >> 48) | ((in[25] & 0xFFFFFFF) << 16))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[25] >> 28) | ((in[26] & 0xFF) << 36)))) & 1))^((int64(((in[25] >> 28) | ((in[26] & 0xFF) << 36))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[26] >> 8) & 0xFFFFFFFFFFF)) & 1))^((int64((in[26] >> 8) & 0xFFFFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[26] >> 52) | ((in[27] & 0xFFFFFFFF) << 12)))) & 1))^((int64(((in[26] >> 52) | ((in[27] & 0xFFFFFFFF) << 12))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[27] >> 32) | ((in[28] & 0xFFF) << 32)))) & 1))^((int64(((in[27] >> 32) | ((in[28] & 0xFFF) << 32))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[28] >> 12) & 0xFFFFFFFFFFF)) & 1))^((int64((in[28] >> 12) & 0xFFFFFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[28] >> 56) | ((in[29] & 0xFFFFFFFFF) << 8)))) & 1))^((int64(((in[28] >> 56) | ((in[29] & 0xFFFFFFFFF) << 8))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[29] >> 36) | ((in[30] & 0xFFFF) << 28)))) & 1))^((int64(((in[29] >> 36) | ((in[30] & 0xFFFF) << 28))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[30] >> 16) & 0xFFFFFFFFFFF)) & 1))^((int64((in[30] >> 16) & 0xFFFFFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFF) << 4)))) & 1))^((int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFF) << 4))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[31] >> 40) | ((in[32] & 0xFFFFF) << 24)))) & 1))^((int64(((in[31] >> 40) | ((in[32] & 0xFFFFF) << 24))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[32] >> 20))) & 1))^((int64((in[32] >> 20)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[33] >> 0) & 0xFFFFFFFFFFF)) & 1))^((int64((in[33] >> 0) & 0xFFFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[33] >> 44) | ((in[34] & 0xFFFFFF) << 20)))) & 1))^((int64(((in[33] >> 44) | ((in[34] & 0xFFFFFF) << 20))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[34] >> 24) | ((in[35] & 0xF) << 40)))) & 1))^((int64(((in[34] >> 24) | ((in[35] & 0xF) << 40))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[35] >> 4) & 0xFFFFFFFFFFF)) & 1))^((int64((in[35] >> 4) & 0xFFFFFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[35] >> 48) | ((in[36] & 0xFFFFFFF) << 16)))) & 1))^((int64(((in[35] >> 48) | ((in[36] & 0xFFFFFFF) << 16))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[36] >> 28) | ((in[37] & 0xFF) << 36)))) & 1))^((int64(((in[36] >> 28) | ((in[37] & 0xFF) << 36))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[37] >> 8) & 0xFFFFFFFFFFF)) & 1))^((int64((in[37] >> 8) & 0xFFFFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[37] >> 52) | ((in[38] & 0xFFFFFFFF) << 12)))) & 1))^((int64(((in[37] >> 52) | ((in[38] & 0xFFFFFFFF) << 12))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[38] >> 32) | ((in[39] & 0xFFF) << 32)))) & 1))^((int64(((in[38] >> 32) | ((in[39] & 0xFFF) << 32))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[39] >> 12) & 0xFFFFFFFFFFF)) & 1))^((int64((in[39] >> 12) & 0xFFFFFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[39] >> 56) | ((in[40] & 0xFFFFFFFFF) << 8)))) & 1))^((int64(((in[39] >> 56) | ((in[40] & 0xFFFFFFFFF) << 8))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[40] >> 36) | ((in[41] & 0xFFFF) << 28)))) & 1))^((int64(((in[40] >> 36) | ((in[41] & 0xFFFF) << 28))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[41] >> 16) & 0xFFFFFFFFFFF)) & 1))^((int64((in[41] >> 16) & 0xFFFFFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[41] >> 60) | ((in[42] & 0xFFFFFFFFFF) << 4)))) & 1))^((int64(((in[41] >> 60) | ((in[42] & 0xFFFFFFFFFF) << 4))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[42] >> 40) | ((in[43] & 0xFFFFF) << 24)))) & 1))^((int64(((in[42] >> 40) | ((in[43] & 0xFFFFF) << 24))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[43] >> 20))) & 1))^((int64((in[43] >> 20)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_45(initoffset uint64, in *[45]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 45) | ((in[1] & 0x3FFFFFF) << 19)))) & 1))^((int64(((in[0] >> 45) | ((in[1] & 0x3FFFFFF) << 19))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 26) | ((in[2] & 0x7F) << 38)))) & 1))^((int64(((in[1] >> 26) | ((in[2] & 0x7F) << 38))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[2] >> 7) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[2] >> 7) & 0x1FFFFFFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 52) | ((in[3] & 0x1FFFFFFFF) << 12)))) & 1))^((int64(((in[2] >> 52) | ((in[3] & 0x1FFFFFFFF) << 12))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 33) | ((in[4] & 0x3FFF) << 31)))) & 1))^((int64(((in[3] >> 33) | ((in[4] & 0x3FFF) << 31))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[4] >> 14) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[4] >> 14) & 0x1FFFFFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[4] >> 59) | ((in[5] & 0xFFFFFFFFFF) << 5)))) & 1))^((int64(((in[4] >> 59) | ((in[5] & 0xFFFFFFFFFF) << 5))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[5] >> 40) | ((in[6] & 0x1FFFFF) << 24)))) & 1))^((int64(((in[5] >> 40) | ((in[6] & 0x1FFFFF) << 24))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[6] >> 21) | ((in[7] & 0x3) << 43)))) & 1))^((int64(((in[6] >> 21) | ((in[7] & 0x3) << 43))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[7] >> 2) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[7] >> 2) & 0x1FFFFFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[7] >> 47) | ((in[8] & 0xFFFFFFF) << 17)))) & 1))^((int64(((in[7] >> 47) | ((in[8] & 0xFFFFFFF) << 17))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[8] >> 28) | ((in[9] & 0x1FF) << 36)))) & 1))^((int64(((in[8] >> 28) | ((in[9] & 0x1FF) << 36))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[9] >> 9) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[9] >> 9) & 0x1FFFFFFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0x7FFFFFFFF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0x7FFFFFFFF) << 10))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[10] >> 35) | ((in[11] & 0xFFFF) << 29)))) & 1))^((int64(((in[10] >> 35) | ((in[11] & 0xFFFF) << 29))))>>1))) + out[14] + out[16] = uint64(((-((int64((in[11] >> 16) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[11] >> 16) & 0x1FFFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[11] >> 61) | ((in[12] & 0x3FFFFFFFFFF) << 3)))) & 1))^((int64(((in[11] >> 61) | ((in[12] & 0x3FFFFFFFFFF) << 3))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[12] >> 42) | ((in[13] & 0x7FFFFF) << 22)))) & 1))^((int64(((in[12] >> 42) | ((in[13] & 0x7FFFFF) << 22))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[13] >> 23) | ((in[14] & 0xF) << 41)))) & 1))^((int64(((in[13] >> 23) | ((in[14] & 0xF) << 41))))>>1))) + out[18] + out[20] = uint64(((-((int64((in[14] >> 4) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[14] >> 4) & 0x1FFFFFFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[14] >> 49) | ((in[15] & 0x3FFFFFFF) << 15)))) & 1))^((int64(((in[14] >> 49) | ((in[15] & 0x3FFFFFFF) << 15))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[15] >> 30) | ((in[16] & 0x7FF) << 34)))) & 1))^((int64(((in[15] >> 30) | ((in[16] & 0x7FF) << 34))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[16] >> 11) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[16] >> 11) & 0x1FFFFFFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0x1FFFFFFFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0x1FFFFFFFFF) << 8))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[17] >> 37) | ((in[18] & 0x3FFFF) << 27)))) & 1))^((int64(((in[17] >> 37) | ((in[18] & 0x3FFFF) << 27))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[18] >> 18) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[18] >> 18) & 0x1FFFFFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[18] >> 63) | ((in[19] & 0xFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[18] >> 63) | ((in[19] & 0xFFFFFFFFFFF) << 1))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0x1FFFFFF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0x1FFFFFF) << 20))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[20] >> 25) | ((in[21] & 0x3F) << 39)))) & 1))^((int64(((in[20] >> 25) | ((in[21] & 0x3F) << 39))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[21] >> 6) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[21] >> 6) & 0x1FFFFFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[21] >> 51) | ((in[22] & 0xFFFFFFFF) << 13)))) & 1))^((int64(((in[21] >> 51) | ((in[22] & 0xFFFFFFFF) << 13))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[22] >> 32) | ((in[23] & 0x1FFF) << 32)))) & 1))^((int64(((in[22] >> 32) | ((in[23] & 0x1FFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[23] >> 13) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[23] >> 13) & 0x1FFFFFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[23] >> 58) | ((in[24] & 0x7FFFFFFFFF) << 6)))) & 1))^((int64(((in[23] >> 58) | ((in[24] & 0x7FFFFFFFFF) << 6))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[24] >> 39) | ((in[25] & 0xFFFFF) << 25)))) & 1))^((int64(((in[24] >> 39) | ((in[25] & 0xFFFFF) << 25))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[25] >> 20) | ((in[26] & 0x1) << 44)))) & 1))^((int64(((in[25] >> 20) | ((in[26] & 0x1) << 44))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[26] >> 1) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[26] >> 1) & 0x1FFFFFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[26] >> 46) | ((in[27] & 0x7FFFFFF) << 18)))) & 1))^((int64(((in[26] >> 46) | ((in[27] & 0x7FFFFFF) << 18))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[27] >> 27) | ((in[28] & 0xFF) << 37)))) & 1))^((int64(((in[27] >> 27) | ((in[28] & 0xFF) << 37))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[28] >> 8) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[28] >> 8) & 0x1FFFFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[28] >> 53) | ((in[29] & 0x3FFFFFFFF) << 11)))) & 1))^((int64(((in[28] >> 53) | ((in[29] & 0x3FFFFFFFF) << 11))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[29] >> 34) | ((in[30] & 0x7FFF) << 30)))) & 1))^((int64(((in[29] >> 34) | ((in[30] & 0x7FFF) << 30))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[30] >> 15) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[30] >> 15) & 0x1FFFFFFFFFFF))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[30] >> 60) | ((in[31] & 0x1FFFFFFFFFF) << 4)))) & 1))^((int64(((in[30] >> 60) | ((in[31] & 0x1FFFFFFFFFF) << 4))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[31] >> 41) | ((in[32] & 0x3FFFFF) << 23)))) & 1))^((int64(((in[31] >> 41) | ((in[32] & 0x3FFFFF) << 23))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[32] >> 22) | ((in[33] & 0x7) << 42)))) & 1))^((int64(((in[32] >> 22) | ((in[33] & 0x7) << 42))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[33] >> 3) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[33] >> 3) & 0x1FFFFFFFFFFF))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[33] >> 48) | ((in[34] & 0x1FFFFFFF) << 16)))) & 1))^((int64(((in[33] >> 48) | ((in[34] & 0x1FFFFFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[34] >> 29) | ((in[35] & 0x3FF) << 35)))) & 1))^((int64(((in[34] >> 29) | ((in[35] & 0x3FF) << 35))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[35] >> 10) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[35] >> 10) & 0x1FFFFFFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[35] >> 55) | ((in[36] & 0xFFFFFFFFF) << 9)))) & 1))^((int64(((in[35] >> 55) | ((in[36] & 0xFFFFFFFFF) << 9))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[36] >> 36) | ((in[37] & 0x1FFFF) << 28)))) & 1))^((int64(((in[36] >> 36) | ((in[37] & 0x1FFFF) << 28))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[37] >> 17) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[37] >> 17) & 0x1FFFFFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[37] >> 62) | ((in[38] & 0x7FFFFFFFFFF) << 2)))) & 1))^((int64(((in[37] >> 62) | ((in[38] & 0x7FFFFFFFFFF) << 2))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[38] >> 43) | ((in[39] & 0xFFFFFF) << 21)))) & 1))^((int64(((in[38] >> 43) | ((in[39] & 0xFFFFFF) << 21))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[39] >> 24) | ((in[40] & 0x1F) << 40)))) & 1))^((int64(((in[39] >> 24) | ((in[40] & 0x1F) << 40))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[40] >> 5) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[40] >> 5) & 0x1FFFFFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[40] >> 50) | ((in[41] & 0x7FFFFFFF) << 14)))) & 1))^((int64(((in[40] >> 50) | ((in[41] & 0x7FFFFFFF) << 14))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[41] >> 31) | ((in[42] & 0xFFF) << 33)))) & 1))^((int64(((in[41] >> 31) | ((in[42] & 0xFFF) << 33))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[42] >> 12) & 0x1FFFFFFFFFFF)) & 1))^((int64((in[42] >> 12) & 0x1FFFFFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFF) << 7)))) & 1))^((int64(((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFF) << 7))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[43] >> 38) | ((in[44] & 0x7FFFF) << 26)))) & 1))^((int64(((in[43] >> 38) | ((in[44] & 0x7FFFF) << 26))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[44] >> 19))) & 1))^((int64((in[44] >> 19)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_46(initoffset uint64, in *[46]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 46) | ((in[1] & 0xFFFFFFF) << 18)))) & 1))^((int64(((in[0] >> 46) | ((in[1] & 0xFFFFFFF) << 18))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 28) | ((in[2] & 0x3FF) << 36)))) & 1))^((int64(((in[1] >> 28) | ((in[2] & 0x3FF) << 36))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[2] >> 10) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[2] >> 10) & 0x3FFFFFFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 56) | ((in[3] & 0x3FFFFFFFFF) << 8)))) & 1))^((int64(((in[2] >> 56) | ((in[3] & 0x3FFFFFFFFF) << 8))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 38) | ((in[4] & 0xFFFFF) << 26)))) & 1))^((int64(((in[3] >> 38) | ((in[4] & 0xFFFFF) << 26))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 20) | ((in[5] & 0x3) << 44)))) & 1))^((int64(((in[4] >> 20) | ((in[5] & 0x3) << 44))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[5] >> 2) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[5] >> 2) & 0x3FFFFFFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[5] >> 48) | ((in[6] & 0x3FFFFFFF) << 16)))) & 1))^((int64(((in[5] >> 48) | ((in[6] & 0x3FFFFFFF) << 16))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[6] >> 30) | ((in[7] & 0xFFF) << 34)))) & 1))^((int64(((in[6] >> 30) | ((in[7] & 0xFFF) << 34))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[7] >> 12) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[7] >> 12) & 0x3FFFFFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[7] >> 58) | ((in[8] & 0xFFFFFFFFFF) << 6)))) & 1))^((int64(((in[7] >> 58) | ((in[8] & 0xFFFFFFFFFF) << 6))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[8] >> 40) | ((in[9] & 0x3FFFFF) << 24)))) & 1))^((int64(((in[8] >> 40) | ((in[9] & 0x3FFFFF) << 24))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[9] >> 22) | ((in[10] & 0xF) << 42)))) & 1))^((int64(((in[9] >> 22) | ((in[10] & 0xF) << 42))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[10] >> 4) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[10] >> 4) & 0x3FFFFFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[10] >> 50) | ((in[11] & 0xFFFFFFFF) << 14)))) & 1))^((int64(((in[10] >> 50) | ((in[11] & 0xFFFFFFFF) << 14))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[11] >> 32) | ((in[12] & 0x3FFF) << 32)))) & 1))^((int64(((in[11] >> 32) | ((in[12] & 0x3FFF) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[12] >> 14) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[12] >> 14) & 0x3FFFFFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[12] >> 60) | ((in[13] & 0x3FFFFFFFFFF) << 4)))) & 1))^((int64(((in[12] >> 60) | ((in[13] & 0x3FFFFFFFFFF) << 4))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[13] >> 42) | ((in[14] & 0xFFFFFF) << 22)))) & 1))^((int64(((in[13] >> 42) | ((in[14] & 0xFFFFFF) << 22))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[14] >> 24) | ((in[15] & 0x3F) << 40)))) & 1))^((int64(((in[14] >> 24) | ((in[15] & 0x3F) << 40))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[15] >> 6) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[15] >> 6) & 0x3FFFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[15] >> 52) | ((in[16] & 0x3FFFFFFFF) << 12)))) & 1))^((int64(((in[15] >> 52) | ((in[16] & 0x3FFFFFFFF) << 12))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[16] >> 34) | ((in[17] & 0xFFFF) << 30)))) & 1))^((int64(((in[16] >> 34) | ((in[17] & 0xFFFF) << 30))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[17] >> 16) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[17] >> 16) & 0x3FFFFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFF) << 2))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[18] >> 44) | ((in[19] & 0x3FFFFFF) << 20)))) & 1))^((int64(((in[18] >> 44) | ((in[19] & 0x3FFFFFF) << 20))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[19] >> 26) | ((in[20] & 0xFF) << 38)))) & 1))^((int64(((in[19] >> 26) | ((in[20] & 0xFF) << 38))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[20] >> 8) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[20] >> 8) & 0x3FFFFFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[20] >> 54) | ((in[21] & 0xFFFFFFFFF) << 10)))) & 1))^((int64(((in[20] >> 54) | ((in[21] & 0xFFFFFFFFF) << 10))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[21] >> 36) | ((in[22] & 0x3FFFF) << 28)))) & 1))^((int64(((in[21] >> 36) | ((in[22] & 0x3FFFF) << 28))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[22] >> 18))) & 1))^((int64((in[22] >> 18)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[23] >> 0) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[23] >> 0) & 0x3FFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[23] >> 46) | ((in[24] & 0xFFFFFFF) << 18)))) & 1))^((int64(((in[23] >> 46) | ((in[24] & 0xFFFFFFF) << 18))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[24] >> 28) | ((in[25] & 0x3FF) << 36)))) & 1))^((int64(((in[24] >> 28) | ((in[25] & 0x3FF) << 36))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[25] >> 10) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[25] >> 10) & 0x3FFFFFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[25] >> 56) | ((in[26] & 0x3FFFFFFFFF) << 8)))) & 1))^((int64(((in[25] >> 56) | ((in[26] & 0x3FFFFFFFFF) << 8))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[26] >> 38) | ((in[27] & 0xFFFFF) << 26)))) & 1))^((int64(((in[26] >> 38) | ((in[27] & 0xFFFFF) << 26))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[27] >> 20) | ((in[28] & 0x3) << 44)))) & 1))^((int64(((in[27] >> 20) | ((in[28] & 0x3) << 44))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[28] >> 2) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[28] >> 2) & 0x3FFFFFFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[28] >> 48) | ((in[29] & 0x3FFFFFFF) << 16)))) & 1))^((int64(((in[28] >> 48) | ((in[29] & 0x3FFFFFFF) << 16))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[29] >> 30) | ((in[30] & 0xFFF) << 34)))) & 1))^((int64(((in[29] >> 30) | ((in[30] & 0xFFF) << 34))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[30] >> 12) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[30] >> 12) & 0x3FFFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[30] >> 58) | ((in[31] & 0xFFFFFFFFFF) << 6)))) & 1))^((int64(((in[30] >> 58) | ((in[31] & 0xFFFFFFFFFF) << 6))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[31] >> 40) | ((in[32] & 0x3FFFFF) << 24)))) & 1))^((int64(((in[31] >> 40) | ((in[32] & 0x3FFFFF) << 24))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[32] >> 22) | ((in[33] & 0xF) << 42)))) & 1))^((int64(((in[32] >> 22) | ((in[33] & 0xF) << 42))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[33] >> 4) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[33] >> 4) & 0x3FFFFFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[33] >> 50) | ((in[34] & 0xFFFFFFFF) << 14)))) & 1))^((int64(((in[33] >> 50) | ((in[34] & 0xFFFFFFFF) << 14))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[34] >> 32) | ((in[35] & 0x3FFF) << 32)))) & 1))^((int64(((in[34] >> 32) | ((in[35] & 0x3FFF) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[35] >> 14) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[35] >> 14) & 0x3FFFFFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFF) << 4)))) & 1))^((int64(((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFF) << 4))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[36] >> 42) | ((in[37] & 0xFFFFFF) << 22)))) & 1))^((int64(((in[36] >> 42) | ((in[37] & 0xFFFFFF) << 22))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[37] >> 24) | ((in[38] & 0x3F) << 40)))) & 1))^((int64(((in[37] >> 24) | ((in[38] & 0x3F) << 40))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[38] >> 6) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[38] >> 6) & 0x3FFFFFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[38] >> 52) | ((in[39] & 0x3FFFFFFFF) << 12)))) & 1))^((int64(((in[38] >> 52) | ((in[39] & 0x3FFFFFFFF) << 12))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[39] >> 34) | ((in[40] & 0xFFFF) << 30)))) & 1))^((int64(((in[39] >> 34) | ((in[40] & 0xFFFF) << 30))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[40] >> 16) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[40] >> 16) & 0x3FFFFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[40] >> 62) | ((in[41] & 0xFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[40] >> 62) | ((in[41] & 0xFFFFFFFFFFF) << 2))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[41] >> 44) | ((in[42] & 0x3FFFFFF) << 20)))) & 1))^((int64(((in[41] >> 44) | ((in[42] & 0x3FFFFFF) << 20))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[42] >> 26) | ((in[43] & 0xFF) << 38)))) & 1))^((int64(((in[42] >> 26) | ((in[43] & 0xFF) << 38))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[43] >> 8) & 0x3FFFFFFFFFFF)) & 1))^((int64((in[43] >> 8) & 0x3FFFFFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[43] >> 54) | ((in[44] & 0xFFFFFFFFF) << 10)))) & 1))^((int64(((in[43] >> 54) | ((in[44] & 0xFFFFFFFFF) << 10))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[44] >> 36) | ((in[45] & 0x3FFFF) << 28)))) & 1))^((int64(((in[44] >> 36) | ((in[45] & 0x3FFFF) << 28))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[45] >> 18))) & 1))^((int64((in[45] >> 18)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_47(initoffset uint64, in *[47]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 47) | ((in[1] & 0x3FFFFFFF) << 17)))) & 1))^((int64(((in[0] >> 47) | ((in[1] & 0x3FFFFFFF) << 17))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 30) | ((in[2] & 0x1FFF) << 34)))) & 1))^((int64(((in[1] >> 30) | ((in[2] & 0x1FFF) << 34))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[2] >> 13) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[2] >> 13) & 0x7FFFFFFFFFFF))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[2] >> 60) | ((in[3] & 0x7FFFFFFFFFF) << 4)))) & 1))^((int64(((in[2] >> 60) | ((in[3] & 0x7FFFFFFFFFF) << 4))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 43) | ((in[4] & 0x3FFFFFF) << 21)))) & 1))^((int64(((in[3] >> 43) | ((in[4] & 0x3FFFFFF) << 21))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 26) | ((in[5] & 0x1FF) << 38)))) & 1))^((int64(((in[4] >> 26) | ((in[5] & 0x1FF) << 38))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[5] >> 9) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[5] >> 9) & 0x7FFFFFFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[5] >> 56) | ((in[6] & 0x7FFFFFFFFF) << 8)))) & 1))^((int64(((in[5] >> 56) | ((in[6] & 0x7FFFFFFFFF) << 8))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[6] >> 39) | ((in[7] & 0x3FFFFF) << 25)))) & 1))^((int64(((in[6] >> 39) | ((in[7] & 0x3FFFFF) << 25))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[7] >> 22) | ((in[8] & 0x1F) << 42)))) & 1))^((int64(((in[7] >> 22) | ((in[8] & 0x1F) << 42))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[8] >> 5) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[8] >> 5) & 0x7FFFFFFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[8] >> 52) | ((in[9] & 0x7FFFFFFFF) << 12)))) & 1))^((int64(((in[8] >> 52) | ((in[9] & 0x7FFFFFFFF) << 12))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[9] >> 35) | ((in[10] & 0x3FFFF) << 29)))) & 1))^((int64(((in[9] >> 35) | ((in[10] & 0x3FFFF) << 29))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[10] >> 18) | ((in[11] & 0x1) << 46)))) & 1))^((int64(((in[10] >> 18) | ((in[11] & 0x1) << 46))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[11] >> 1) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[11] >> 1) & 0x7FFFFFFFFFFF))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[11] >> 48) | ((in[12] & 0x7FFFFFFF) << 16)))) & 1))^((int64(((in[11] >> 48) | ((in[12] & 0x7FFFFFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[12] >> 31) | ((in[13] & 0x3FFF) << 33)))) & 1))^((int64(((in[12] >> 31) | ((in[13] & 0x3FFF) << 33))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[13] >> 14) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[13] >> 14) & 0x7FFFFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[13] >> 61) | ((in[14] & 0xFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[13] >> 61) | ((in[14] & 0xFFFFFFFFFFF) << 3))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[14] >> 44) | ((in[15] & 0x7FFFFFF) << 20)))) & 1))^((int64(((in[14] >> 44) | ((in[15] & 0x7FFFFFF) << 20))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[15] >> 27) | ((in[16] & 0x3FF) << 37)))) & 1))^((int64(((in[15] >> 27) | ((in[16] & 0x3FF) << 37))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[16] >> 10) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[16] >> 10) & 0x7FFFFFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[16] >> 57) | ((in[17] & 0xFFFFFFFFFF) << 7)))) & 1))^((int64(((in[16] >> 57) | ((in[17] & 0xFFFFFFFFFF) << 7))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[17] >> 40) | ((in[18] & 0x7FFFFF) << 24)))) & 1))^((int64(((in[17] >> 40) | ((in[18] & 0x7FFFFF) << 24))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[18] >> 23) | ((in[19] & 0x3F) << 41)))) & 1))^((int64(((in[18] >> 23) | ((in[19] & 0x3F) << 41))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[19] >> 6) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[19] >> 6) & 0x7FFFFFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[19] >> 53) | ((in[20] & 0xFFFFFFFFF) << 11)))) & 1))^((int64(((in[19] >> 53) | ((in[20] & 0xFFFFFFFFF) << 11))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[20] >> 36) | ((in[21] & 0x7FFFF) << 28)))) & 1))^((int64(((in[20] >> 36) | ((in[21] & 0x7FFFF) << 28))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[21] >> 19) | ((in[22] & 0x3) << 45)))) & 1))^((int64(((in[21] >> 19) | ((in[22] & 0x3) << 45))))>>1))) + out[28] + out[30] = uint64(((-((int64((in[22] >> 2) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[22] >> 2) & 0x7FFFFFFFFFFF))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[22] >> 49) | ((in[23] & 0xFFFFFFFF) << 15)))) & 1))^((int64(((in[22] >> 49) | ((in[23] & 0xFFFFFFFF) << 15))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[23] >> 32) | ((in[24] & 0x7FFF) << 32)))) & 1))^((int64(((in[23] >> 32) | ((in[24] & 0x7FFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64((in[24] >> 15) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[24] >> 15) & 0x7FFFFFFFFFFF))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[24] >> 62) | ((in[25] & 0x1FFFFFFFFFFF) << 2)))) & 1))^((int64(((in[24] >> 62) | ((in[25] & 0x1FFFFFFFFFFF) << 2))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[25] >> 45) | ((in[26] & 0xFFFFFFF) << 19)))) & 1))^((int64(((in[25] >> 45) | ((in[26] & 0xFFFFFFF) << 19))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[26] >> 28) | ((in[27] & 0x7FF) << 36)))) & 1))^((int64(((in[26] >> 28) | ((in[27] & 0x7FF) << 36))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[27] >> 11) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[27] >> 11) & 0x7FFFFFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[27] >> 58) | ((in[28] & 0x1FFFFFFFFFF) << 6)))) & 1))^((int64(((in[27] >> 58) | ((in[28] & 0x1FFFFFFFFFF) << 6))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[28] >> 41) | ((in[29] & 0xFFFFFF) << 23)))) & 1))^((int64(((in[28] >> 41) | ((in[29] & 0xFFFFFF) << 23))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[29] >> 24) | ((in[30] & 0x7F) << 40)))) & 1))^((int64(((in[29] >> 24) | ((in[30] & 0x7F) << 40))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[30] >> 7) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[30] >> 7) & 0x7FFFFFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[30] >> 54) | ((in[31] & 0x1FFFFFFFFF) << 10)))) & 1))^((int64(((in[30] >> 54) | ((in[31] & 0x1FFFFFFFFF) << 10))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[31] >> 37) | ((in[32] & 0xFFFFF) << 27)))) & 1))^((int64(((in[31] >> 37) | ((in[32] & 0xFFFFF) << 27))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[32] >> 20) | ((in[33] & 0x7) << 44)))) & 1))^((int64(((in[32] >> 20) | ((in[33] & 0x7) << 44))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[33] >> 3) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[33] >> 3) & 0x7FFFFFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[33] >> 50) | ((in[34] & 0x1FFFFFFFF) << 14)))) & 1))^((int64(((in[33] >> 50) | ((in[34] & 0x1FFFFFFFF) << 14))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[34] >> 33) | ((in[35] & 0xFFFF) << 31)))) & 1))^((int64(((in[34] >> 33) | ((in[35] & 0xFFFF) << 31))))>>1))) + out[46] + out[48] = uint64(((-((int64((in[35] >> 16) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[35] >> 16) & 0x7FFFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[35] >> 63) | ((in[36] & 0x3FFFFFFFFFFF) << 1)))) & 1))^((int64(((in[35] >> 63) | ((in[36] & 0x3FFFFFFFFFFF) << 1))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[36] >> 46) | ((in[37] & 0x1FFFFFFF) << 18)))) & 1))^((int64(((in[36] >> 46) | ((in[37] & 0x1FFFFFFF) << 18))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[37] >> 29) | ((in[38] & 0xFFF) << 35)))) & 1))^((int64(((in[37] >> 29) | ((in[38] & 0xFFF) << 35))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[38] >> 12) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[38] >> 12) & 0x7FFFFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[38] >> 59) | ((in[39] & 0x3FFFFFFFFFF) << 5)))) & 1))^((int64(((in[38] >> 59) | ((in[39] & 0x3FFFFFFFFFF) << 5))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[39] >> 42) | ((in[40] & 0x1FFFFFF) << 22)))) & 1))^((int64(((in[39] >> 42) | ((in[40] & 0x1FFFFFF) << 22))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[40] >> 25) | ((in[41] & 0xFF) << 39)))) & 1))^((int64(((in[40] >> 25) | ((in[41] & 0xFF) << 39))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[41] >> 8) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[41] >> 8) & 0x7FFFFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[41] >> 55) | ((in[42] & 0x3FFFFFFFFF) << 9)))) & 1))^((int64(((in[41] >> 55) | ((in[42] & 0x3FFFFFFFFF) << 9))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[42] >> 38) | ((in[43] & 0x1FFFFF) << 26)))) & 1))^((int64(((in[42] >> 38) | ((in[43] & 0x1FFFFF) << 26))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[43] >> 21) | ((in[44] & 0xF) << 43)))) & 1))^((int64(((in[43] >> 21) | ((in[44] & 0xF) << 43))))>>1))) + out[58] + out[60] = uint64(((-((int64((in[44] >> 4) & 0x7FFFFFFFFFFF)) & 1))^((int64((in[44] >> 4) & 0x7FFFFFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[44] >> 51) | ((in[45] & 0x3FFFFFFFF) << 13)))) & 1))^((int64(((in[44] >> 51) | ((in[45] & 0x3FFFFFFFF) << 13))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[45] >> 34) | ((in[46] & 0x1FFFF) << 30)))) & 1))^((int64(((in[45] >> 34) | ((in[46] & 0x1FFFF) << 30))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[46] >> 17))) & 1))^((int64((in[46] >> 17)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_48(initoffset uint64, in *[48]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 48) | ((in[1] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[0] >> 48) | ((in[1] & 0xFFFFFFFF) << 16))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 32) | ((in[2] & 0xFFFF) << 32)))) & 1))^((int64(((in[1] >> 32) | ((in[2] & 0xFFFF) << 32))))>>1))) + out[1] + out[3] = uint64(((-((int64((in[2] >> 16))) & 1))^((int64((in[2] >> 16)))>>1))) + out[2] + out[4] = uint64(((-((int64((in[3] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[3] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 48) | ((in[4] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[3] >> 48) | ((in[4] & 0xFFFFFFFF) << 16))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 32) | ((in[5] & 0xFFFF) << 32)))) & 1))^((int64(((in[4] >> 32) | ((in[5] & 0xFFFF) << 32))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[5] >> 16))) & 1))^((int64((in[5] >> 16)))>>1))) + out[6] + out[8] = uint64(((-((int64((in[6] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[6] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[6] >> 48) | ((in[7] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[6] >> 48) | ((in[7] & 0xFFFFFFFF) << 16))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[7] >> 32) | ((in[8] & 0xFFFF) << 32)))) & 1))^((int64(((in[7] >> 32) | ((in[8] & 0xFFFF) << 32))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[8] >> 16))) & 1))^((int64((in[8] >> 16)))>>1))) + out[10] + out[12] = uint64(((-((int64((in[9] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[9] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[9] >> 48) | ((in[10] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[9] >> 48) | ((in[10] & 0xFFFFFFFF) << 16))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[10] >> 32) | ((in[11] & 0xFFFF) << 32)))) & 1))^((int64(((in[10] >> 32) | ((in[11] & 0xFFFF) << 32))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[11] >> 16))) & 1))^((int64((in[11] >> 16)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[12] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[12] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[12] >> 48) | ((in[13] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[12] >> 48) | ((in[13] & 0xFFFFFFFF) << 16))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[13] >> 32) | ((in[14] & 0xFFFF) << 32)))) & 1))^((int64(((in[13] >> 32) | ((in[14] & 0xFFFF) << 32))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[14] >> 16))) & 1))^((int64((in[14] >> 16)))>>1))) + out[18] + out[20] = uint64(((-((int64((in[15] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[15] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0xFFFFFFFF) << 16))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[16] >> 32) | ((in[17] & 0xFFFF) << 32)))) & 1))^((int64(((in[16] >> 32) | ((in[17] & 0xFFFF) << 32))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[17] >> 16))) & 1))^((int64((in[17] >> 16)))>>1))) + out[22] + out[24] = uint64(((-((int64((in[18] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[18] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0xFFFFFFFF) << 16))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[19] >> 32) | ((in[20] & 0xFFFF) << 32)))) & 1))^((int64(((in[19] >> 32) | ((in[20] & 0xFFFF) << 32))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[20] >> 16))) & 1))^((int64((in[20] >> 16)))>>1))) + out[26] + out[28] = uint64(((-((int64((in[21] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[21] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[21] >> 48) | ((in[22] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[21] >> 48) | ((in[22] & 0xFFFFFFFF) << 16))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[22] >> 32) | ((in[23] & 0xFFFF) << 32)))) & 1))^((int64(((in[22] >> 32) | ((in[23] & 0xFFFF) << 32))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[23] >> 16))) & 1))^((int64((in[23] >> 16)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[24] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[24] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[24] >> 48) | ((in[25] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[24] >> 48) | ((in[25] & 0xFFFFFFFF) << 16))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[25] >> 32) | ((in[26] & 0xFFFF) << 32)))) & 1))^((int64(((in[25] >> 32) | ((in[26] & 0xFFFF) << 32))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[26] >> 16))) & 1))^((int64((in[26] >> 16)))>>1))) + out[34] + out[36] = uint64(((-((int64((in[27] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[27] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[27] >> 48) | ((in[28] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[27] >> 48) | ((in[28] & 0xFFFFFFFF) << 16))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[28] >> 32) | ((in[29] & 0xFFFF) << 32)))) & 1))^((int64(((in[28] >> 32) | ((in[29] & 0xFFFF) << 32))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[29] >> 16))) & 1))^((int64((in[29] >> 16)))>>1))) + out[38] + out[40] = uint64(((-((int64((in[30] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[30] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[30] >> 48) | ((in[31] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[30] >> 48) | ((in[31] & 0xFFFFFFFF) << 16))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[31] >> 32) | ((in[32] & 0xFFFF) << 32)))) & 1))^((int64(((in[31] >> 32) | ((in[32] & 0xFFFF) << 32))))>>1))) + out[41] + out[43] = uint64(((-((int64((in[32] >> 16))) & 1))^((int64((in[32] >> 16)))>>1))) + out[42] + out[44] = uint64(((-((int64((in[33] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[33] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[33] >> 48) | ((in[34] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[33] >> 48) | ((in[34] & 0xFFFFFFFF) << 16))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[34] >> 32) | ((in[35] & 0xFFFF) << 32)))) & 1))^((int64(((in[34] >> 32) | ((in[35] & 0xFFFF) << 32))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[35] >> 16))) & 1))^((int64((in[35] >> 16)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[36] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[36] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[36] >> 48) | ((in[37] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[36] >> 48) | ((in[37] & 0xFFFFFFFF) << 16))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[37] >> 32) | ((in[38] & 0xFFFF) << 32)))) & 1))^((int64(((in[37] >> 32) | ((in[38] & 0xFFFF) << 32))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[38] >> 16))) & 1))^((int64((in[38] >> 16)))>>1))) + out[50] + out[52] = uint64(((-((int64((in[39] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[39] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[39] >> 48) | ((in[40] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[39] >> 48) | ((in[40] & 0xFFFFFFFF) << 16))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[40] >> 32) | ((in[41] & 0xFFFF) << 32)))) & 1))^((int64(((in[40] >> 32) | ((in[41] & 0xFFFF) << 32))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[41] >> 16))) & 1))^((int64((in[41] >> 16)))>>1))) + out[54] + out[56] = uint64(((-((int64((in[42] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[42] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[42] >> 48) | ((in[43] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[42] >> 48) | ((in[43] & 0xFFFFFFFF) << 16))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[43] >> 32) | ((in[44] & 0xFFFF) << 32)))) & 1))^((int64(((in[43] >> 32) | ((in[44] & 0xFFFF) << 32))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[44] >> 16))) & 1))^((int64((in[44] >> 16)))>>1))) + out[58] + out[60] = uint64(((-((int64((in[45] >> 0) & 0xFFFFFFFFFFFF)) & 1))^((int64((in[45] >> 0) & 0xFFFFFFFFFFFF))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[45] >> 48) | ((in[46] & 0xFFFFFFFF) << 16)))) & 1))^((int64(((in[45] >> 48) | ((in[46] & 0xFFFFFFFF) << 16))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[46] >> 32) | ((in[47] & 0xFFFF) << 32)))) & 1))^((int64(((in[46] >> 32) | ((in[47] & 0xFFFF) << 32))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[47] >> 16))) & 1))^((int64((in[47] >> 16)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_49(initoffset uint64, in *[49]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 49) | ((in[1] & 0x3FFFFFFFF) << 15)))) & 1))^((int64(((in[0] >> 49) | ((in[1] & 0x3FFFFFFFF) << 15))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 34) | ((in[2] & 0x7FFFF) << 30)))) & 1))^((int64(((in[1] >> 34) | ((in[2] & 0x7FFFF) << 30))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 19) | ((in[3] & 0xF) << 45)))) & 1))^((int64(((in[2] >> 19) | ((in[3] & 0xF) << 45))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[3] >> 4) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[3] >> 4) & 0x1FFFFFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 53) | ((in[4] & 0x3FFFFFFFFF) << 11)))) & 1))^((int64(((in[3] >> 53) | ((in[4] & 0x3FFFFFFFFF) << 11))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 38) | ((in[5] & 0x7FFFFF) << 26)))) & 1))^((int64(((in[4] >> 38) | ((in[5] & 0x7FFFFF) << 26))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[5] >> 23) | ((in[6] & 0xFF) << 41)))) & 1))^((int64(((in[5] >> 23) | ((in[6] & 0xFF) << 41))))>>1))) + out[6] + out[8] = uint64(((-((int64((in[6] >> 8) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[6] >> 8) & 0x1FFFFFFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[6] >> 57) | ((in[7] & 0x3FFFFFFFFFF) << 7)))) & 1))^((int64(((in[6] >> 57) | ((in[7] & 0x3FFFFFFFFFF) << 7))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[7] >> 42) | ((in[8] & 0x7FFFFFF) << 22)))) & 1))^((int64(((in[7] >> 42) | ((in[8] & 0x7FFFFFF) << 22))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[8] >> 27) | ((in[9] & 0xFFF) << 37)))) & 1))^((int64(((in[8] >> 27) | ((in[9] & 0xFFF) << 37))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[9] >> 12) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[9] >> 12) & 0x1FFFFFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[9] >> 61) | ((in[10] & 0x3FFFFFFFFFFF) << 3)))) & 1))^((int64(((in[9] >> 61) | ((in[10] & 0x3FFFFFFFFFFF) << 3))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[10] >> 46) | ((in[11] & 0x7FFFFFFF) << 18)))) & 1))^((int64(((in[10] >> 46) | ((in[11] & 0x7FFFFFFF) << 18))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[11] >> 31) | ((in[12] & 0xFFFF) << 33)))) & 1))^((int64(((in[11] >> 31) | ((in[12] & 0xFFFF) << 33))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[12] >> 16) | ((in[13] & 0x1) << 48)))) & 1))^((int64(((in[12] >> 16) | ((in[13] & 0x1) << 48))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[13] >> 1) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[13] >> 1) & 0x1FFFFFFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[13] >> 50) | ((in[14] & 0x7FFFFFFFF) << 14)))) & 1))^((int64(((in[13] >> 50) | ((in[14] & 0x7FFFFFFFF) << 14))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[14] >> 35) | ((in[15] & 0xFFFFF) << 29)))) & 1))^((int64(((in[14] >> 35) | ((in[15] & 0xFFFFF) << 29))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[15] >> 20) | ((in[16] & 0x1F) << 44)))) & 1))^((int64(((in[15] >> 20) | ((in[16] & 0x1F) << 44))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[16] >> 5) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[16] >> 5) & 0x1FFFFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[16] >> 54) | ((in[17] & 0x7FFFFFFFFF) << 10)))) & 1))^((int64(((in[16] >> 54) | ((in[17] & 0x7FFFFFFFFF) << 10))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[17] >> 39) | ((in[18] & 0xFFFFFF) << 25)))) & 1))^((int64(((in[17] >> 39) | ((in[18] & 0xFFFFFF) << 25))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[18] >> 24) | ((in[19] & 0x1FF) << 40)))) & 1))^((int64(((in[18] >> 24) | ((in[19] & 0x1FF) << 40))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[19] >> 9) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[19] >> 9) & 0x1FFFFFFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[19] >> 58) | ((in[20] & 0x7FFFFFFFFFF) << 6)))) & 1))^((int64(((in[19] >> 58) | ((in[20] & 0x7FFFFFFFFFF) << 6))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[20] >> 43) | ((in[21] & 0xFFFFFFF) << 21)))) & 1))^((int64(((in[20] >> 43) | ((in[21] & 0xFFFFFFF) << 21))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[21] >> 28) | ((in[22] & 0x1FFF) << 36)))) & 1))^((int64(((in[21] >> 28) | ((in[22] & 0x1FFF) << 36))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[22] >> 13) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[22] >> 13) & 0x1FFFFFFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[22] >> 62) | ((in[23] & 0x7FFFFFFFFFFF) << 2)))) & 1))^((int64(((in[22] >> 62) | ((in[23] & 0x7FFFFFFFFFFF) << 2))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[23] >> 47) | ((in[24] & 0xFFFFFFFF) << 17)))) & 1))^((int64(((in[23] >> 47) | ((in[24] & 0xFFFFFFFF) << 17))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[24] >> 32) | ((in[25] & 0x1FFFF) << 32)))) & 1))^((int64(((in[24] >> 32) | ((in[25] & 0x1FFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[25] >> 17) | ((in[26] & 0x3) << 47)))) & 1))^((int64(((in[25] >> 17) | ((in[26] & 0x3) << 47))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[26] >> 2) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[26] >> 2) & 0x1FFFFFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[26] >> 51) | ((in[27] & 0xFFFFFFFFF) << 13)))) & 1))^((int64(((in[26] >> 51) | ((in[27] & 0xFFFFFFFFF) << 13))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[27] >> 36) | ((in[28] & 0x1FFFFF) << 28)))) & 1))^((int64(((in[27] >> 36) | ((in[28] & 0x1FFFFF) << 28))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[28] >> 21) | ((in[29] & 0x3F) << 43)))) & 1))^((int64(((in[28] >> 21) | ((in[29] & 0x3F) << 43))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[29] >> 6) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[29] >> 6) & 0x1FFFFFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[29] >> 55) | ((in[30] & 0xFFFFFFFFFF) << 9)))) & 1))^((int64(((in[29] >> 55) | ((in[30] & 0xFFFFFFFFFF) << 9))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[30] >> 40) | ((in[31] & 0x1FFFFFF) << 24)))) & 1))^((int64(((in[30] >> 40) | ((in[31] & 0x1FFFFFF) << 24))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[31] >> 25) | ((in[32] & 0x3FF) << 39)))) & 1))^((int64(((in[31] >> 25) | ((in[32] & 0x3FF) << 39))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[32] >> 10) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[32] >> 10) & 0x1FFFFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[32] >> 59) | ((in[33] & 0xFFFFFFFFFFF) << 5)))) & 1))^((int64(((in[32] >> 59) | ((in[33] & 0xFFFFFFFFFFF) << 5))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[33] >> 44) | ((in[34] & 0x1FFFFFFF) << 20)))) & 1))^((int64(((in[33] >> 44) | ((in[34] & 0x1FFFFFFF) << 20))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[34] >> 29) | ((in[35] & 0x3FFF) << 35)))) & 1))^((int64(((in[34] >> 29) | ((in[35] & 0x3FFF) << 35))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[35] >> 14) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[35] >> 14) & 0x1FFFFFFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[35] >> 63) | ((in[36] & 0xFFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[35] >> 63) | ((in[36] & 0xFFFFFFFFFFFF) << 1))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[36] >> 48) | ((in[37] & 0x1FFFFFFFF) << 16)))) & 1))^((int64(((in[36] >> 48) | ((in[37] & 0x1FFFFFFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[37] >> 33) | ((in[38] & 0x3FFFF) << 31)))) & 1))^((int64(((in[37] >> 33) | ((in[38] & 0x3FFFF) << 31))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[38] >> 18) | ((in[39] & 0x7) << 46)))) & 1))^((int64(((in[38] >> 18) | ((in[39] & 0x7) << 46))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[39] >> 3) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[39] >> 3) & 0x1FFFFFFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[39] >> 52) | ((in[40] & 0x1FFFFFFFFF) << 12)))) & 1))^((int64(((in[39] >> 52) | ((in[40] & 0x1FFFFFFFFF) << 12))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[40] >> 37) | ((in[41] & 0x3FFFFF) << 27)))) & 1))^((int64(((in[40] >> 37) | ((in[41] & 0x3FFFFF) << 27))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[41] >> 22) | ((in[42] & 0x7F) << 42)))) & 1))^((int64(((in[41] >> 22) | ((in[42] & 0x7F) << 42))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[42] >> 7) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[42] >> 7) & 0x1FFFFFFFFFFFF))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[42] >> 56) | ((in[43] & 0x1FFFFFFFFFF) << 8)))) & 1))^((int64(((in[42] >> 56) | ((in[43] & 0x1FFFFFFFFFF) << 8))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[43] >> 41) | ((in[44] & 0x3FFFFFF) << 23)))) & 1))^((int64(((in[43] >> 41) | ((in[44] & 0x3FFFFFF) << 23))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[44] >> 26) | ((in[45] & 0x7FF) << 38)))) & 1))^((int64(((in[44] >> 26) | ((in[45] & 0x7FF) << 38))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[45] >> 11) & 0x1FFFFFFFFFFFF)) & 1))^((int64((in[45] >> 11) & 0x1FFFFFFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[45] >> 60) | ((in[46] & 0x1FFFFFFFFFFF) << 4)))) & 1))^((int64(((in[45] >> 60) | ((in[46] & 0x1FFFFFFFFFFF) << 4))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[46] >> 45) | ((in[47] & 0x3FFFFFFF) << 19)))) & 1))^((int64(((in[46] >> 45) | ((in[47] & 0x3FFFFFFF) << 19))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[47] >> 30) | ((in[48] & 0x7FFF) << 34)))) & 1))^((int64(((in[47] >> 30) | ((in[48] & 0x7FFF) << 34))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[48] >> 15))) & 1))^((int64((in[48] >> 15)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_50(initoffset uint64, in *[50]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 50) | ((in[1] & 0xFFFFFFFFF) << 14)))) & 1))^((int64(((in[0] >> 50) | ((in[1] & 0xFFFFFFFFF) << 14))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 36) | ((in[2] & 0x3FFFFF) << 28)))) & 1))^((int64(((in[1] >> 36) | ((in[2] & 0x3FFFFF) << 28))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 22) | ((in[3] & 0xFF) << 42)))) & 1))^((int64(((in[2] >> 22) | ((in[3] & 0xFF) << 42))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[3] >> 8) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[3] >> 8) & 0x3FFFFFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 58) | ((in[4] & 0xFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[3] >> 58) | ((in[4] & 0xFFFFFFFFFFF) << 6))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 44) | ((in[5] & 0x3FFFFFFF) << 20)))) & 1))^((int64(((in[4] >> 44) | ((in[5] & 0x3FFFFFFF) << 20))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[5] >> 30) | ((in[6] & 0xFFFF) << 34)))) & 1))^((int64(((in[5] >> 30) | ((in[6] & 0xFFFF) << 34))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[6] >> 16) | ((in[7] & 0x3) << 48)))) & 1))^((int64(((in[6] >> 16) | ((in[7] & 0x3) << 48))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[7] >> 2) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[7] >> 2) & 0x3FFFFFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[7] >> 52) | ((in[8] & 0x3FFFFFFFFF) << 12)))) & 1))^((int64(((in[7] >> 52) | ((in[8] & 0x3FFFFFFFFF) << 12))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[8] >> 38) | ((in[9] & 0xFFFFFF) << 26)))) & 1))^((int64(((in[8] >> 38) | ((in[9] & 0xFFFFFF) << 26))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[9] >> 24) | ((in[10] & 0x3FF) << 40)))) & 1))^((int64(((in[9] >> 24) | ((in[10] & 0x3FF) << 40))))>>1))) + out[11] + out[13] = uint64(((-((int64((in[10] >> 10) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[10] >> 10) & 0x3FFFFFFFFFFFF))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[10] >> 60) | ((in[11] & 0x3FFFFFFFFFFF) << 4)))) & 1))^((int64(((in[10] >> 60) | ((in[11] & 0x3FFFFFFFFFFF) << 4))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[11] >> 46) | ((in[12] & 0xFFFFFFFF) << 18)))) & 1))^((int64(((in[11] >> 46) | ((in[12] & 0xFFFFFFFF) << 18))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[12] >> 32) | ((in[13] & 0x3FFFF) << 32)))) & 1))^((int64(((in[12] >> 32) | ((in[13] & 0x3FFFF) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[13] >> 18) | ((in[14] & 0xF) << 46)))) & 1))^((int64(((in[13] >> 18) | ((in[14] & 0xF) << 46))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[14] >> 4) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[14] >> 4) & 0x3FFFFFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[14] >> 54) | ((in[15] & 0xFFFFFFFFFF) << 10)))) & 1))^((int64(((in[14] >> 54) | ((in[15] & 0xFFFFFFFFFF) << 10))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[15] >> 40) | ((in[16] & 0x3FFFFFF) << 24)))) & 1))^((int64(((in[15] >> 40) | ((in[16] & 0x3FFFFFF) << 24))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[16] >> 26) | ((in[17] & 0xFFF) << 38)))) & 1))^((int64(((in[16] >> 26) | ((in[17] & 0xFFF) << 38))))>>1))) + out[20] + out[22] = uint64(((-((int64((in[17] >> 12) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[17] >> 12) & 0x3FFFFFFFFFFFF))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[17] >> 62) | ((in[18] & 0xFFFFFFFFFFFF) << 2))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0x3FFFFFFFF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0x3FFFFFFFF) << 16))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[19] >> 34) | ((in[20] & 0xFFFFF) << 30)))) & 1))^((int64(((in[19] >> 34) | ((in[20] & 0xFFFFF) << 30))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[20] >> 20) | ((in[21] & 0x3F) << 44)))) & 1))^((int64(((in[20] >> 20) | ((in[21] & 0x3F) << 44))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[21] >> 6) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[21] >> 6) & 0x3FFFFFFFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[21] >> 56) | ((in[22] & 0x3FFFFFFFFFF) << 8)))) & 1))^((int64(((in[21] >> 56) | ((in[22] & 0x3FFFFFFFFFF) << 8))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[22] >> 42) | ((in[23] & 0xFFFFFFF) << 22)))) & 1))^((int64(((in[22] >> 42) | ((in[23] & 0xFFFFFFF) << 22))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[23] >> 28) | ((in[24] & 0x3FFF) << 36)))) & 1))^((int64(((in[23] >> 28) | ((in[24] & 0x3FFF) << 36))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[24] >> 14))) & 1))^((int64((in[24] >> 14)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[25] >> 0) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[25] >> 0) & 0x3FFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[25] >> 50) | ((in[26] & 0xFFFFFFFFF) << 14)))) & 1))^((int64(((in[25] >> 50) | ((in[26] & 0xFFFFFFFFF) << 14))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[26] >> 36) | ((in[27] & 0x3FFFFF) << 28)))) & 1))^((int64(((in[26] >> 36) | ((in[27] & 0x3FFFFF) << 28))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[27] >> 22) | ((in[28] & 0xFF) << 42)))) & 1))^((int64(((in[27] >> 22) | ((in[28] & 0xFF) << 42))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[28] >> 8) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[28] >> 8) & 0x3FFFFFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[28] >> 58) | ((in[29] & 0xFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[28] >> 58) | ((in[29] & 0xFFFFFFFFFFF) << 6))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[29] >> 44) | ((in[30] & 0x3FFFFFFF) << 20)))) & 1))^((int64(((in[29] >> 44) | ((in[30] & 0x3FFFFFFF) << 20))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[30] >> 30) | ((in[31] & 0xFFFF) << 34)))) & 1))^((int64(((in[30] >> 30) | ((in[31] & 0xFFFF) << 34))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[31] >> 16) | ((in[32] & 0x3) << 48)))) & 1))^((int64(((in[31] >> 16) | ((in[32] & 0x3) << 48))))>>1))) + out[39] + out[41] = uint64(((-((int64((in[32] >> 2) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[32] >> 2) & 0x3FFFFFFFFFFFF))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[32] >> 52) | ((in[33] & 0x3FFFFFFFFF) << 12)))) & 1))^((int64(((in[32] >> 52) | ((in[33] & 0x3FFFFFFFFF) << 12))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[33] >> 38) | ((in[34] & 0xFFFFFF) << 26)))) & 1))^((int64(((in[33] >> 38) | ((in[34] & 0xFFFFFF) << 26))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[34] >> 24) | ((in[35] & 0x3FF) << 40)))) & 1))^((int64(((in[34] >> 24) | ((in[35] & 0x3FF) << 40))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[35] >> 10) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[35] >> 10) & 0x3FFFFFFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFFF) << 4)))) & 1))^((int64(((in[35] >> 60) | ((in[36] & 0x3FFFFFFFFFFF) << 4))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[36] >> 46) | ((in[37] & 0xFFFFFFFF) << 18)))) & 1))^((int64(((in[36] >> 46) | ((in[37] & 0xFFFFFFFF) << 18))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[37] >> 32) | ((in[38] & 0x3FFFF) << 32)))) & 1))^((int64(((in[37] >> 32) | ((in[38] & 0x3FFFF) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[38] >> 18) | ((in[39] & 0xF) << 46)))) & 1))^((int64(((in[38] >> 18) | ((in[39] & 0xF) << 46))))>>1))) + out[48] + out[50] = uint64(((-((int64((in[39] >> 4) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[39] >> 4) & 0x3FFFFFFFFFFFF))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[39] >> 54) | ((in[40] & 0xFFFFFFFFFF) << 10)))) & 1))^((int64(((in[39] >> 54) | ((in[40] & 0xFFFFFFFFFF) << 10))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[40] >> 40) | ((in[41] & 0x3FFFFFF) << 24)))) & 1))^((int64(((in[40] >> 40) | ((in[41] & 0x3FFFFFF) << 24))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[41] >> 26) | ((in[42] & 0xFFF) << 38)))) & 1))^((int64(((in[41] >> 26) | ((in[42] & 0xFFF) << 38))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[42] >> 12) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[42] >> 12) & 0x3FFFFFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[42] >> 62) | ((in[43] & 0xFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[42] >> 62) | ((in[43] & 0xFFFFFFFFFFFF) << 2))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[43] >> 48) | ((in[44] & 0x3FFFFFFFF) << 16)))) & 1))^((int64(((in[43] >> 48) | ((in[44] & 0x3FFFFFFFF) << 16))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[44] >> 34) | ((in[45] & 0xFFFFF) << 30)))) & 1))^((int64(((in[44] >> 34) | ((in[45] & 0xFFFFF) << 30))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[45] >> 20) | ((in[46] & 0x3F) << 44)))) & 1))^((int64(((in[45] >> 20) | ((in[46] & 0x3F) << 44))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[46] >> 6) & 0x3FFFFFFFFFFFF)) & 1))^((int64((in[46] >> 6) & 0x3FFFFFFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[46] >> 56) | ((in[47] & 0x3FFFFFFFFFF) << 8)))) & 1))^((int64(((in[46] >> 56) | ((in[47] & 0x3FFFFFFFFFF) << 8))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[47] >> 42) | ((in[48] & 0xFFFFFFF) << 22)))) & 1))^((int64(((in[47] >> 42) | ((in[48] & 0xFFFFFFF) << 22))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[48] >> 28) | ((in[49] & 0x3FFF) << 36)))) & 1))^((int64(((in[48] >> 28) | ((in[49] & 0x3FFF) << 36))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[49] >> 14))) & 1))^((int64((in[49] >> 14)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_51(initoffset uint64, in *[51]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 51) | ((in[1] & 0x3FFFFFFFFF) << 13)))) & 1))^((int64(((in[0] >> 51) | ((in[1] & 0x3FFFFFFFFF) << 13))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 38) | ((in[2] & 0x1FFFFFF) << 26)))) & 1))^((int64(((in[1] >> 38) | ((in[2] & 0x1FFFFFF) << 26))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 25) | ((in[3] & 0xFFF) << 39)))) & 1))^((int64(((in[2] >> 25) | ((in[3] & 0xFFF) << 39))))>>1))) + out[2] + out[4] = uint64(((-((int64((in[3] >> 12) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[3] >> 12) & 0x7FFFFFFFFFFFF))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[3] >> 63) | ((in[4] & 0x3FFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[3] >> 63) | ((in[4] & 0x3FFFFFFFFFFFF) << 1))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 50) | ((in[5] & 0x1FFFFFFFFF) << 14)))) & 1))^((int64(((in[4] >> 50) | ((in[5] & 0x1FFFFFFFFF) << 14))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[5] >> 37) | ((in[6] & 0xFFFFFF) << 27)))) & 1))^((int64(((in[5] >> 37) | ((in[6] & 0xFFFFFF) << 27))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[6] >> 24) | ((in[7] & 0x7FF) << 40)))) & 1))^((int64(((in[6] >> 24) | ((in[7] & 0x7FF) << 40))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[7] >> 11) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[7] >> 11) & 0x7FFFFFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[7] >> 62) | ((in[8] & 0x1FFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[7] >> 62) | ((in[8] & 0x1FFFFFFFFFFFF) << 2))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[8] >> 49) | ((in[9] & 0xFFFFFFFFF) << 15)))) & 1))^((int64(((in[8] >> 49) | ((in[9] & 0xFFFFFFFFF) << 15))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[9] >> 36) | ((in[10] & 0x7FFFFF) << 28)))) & 1))^((int64(((in[9] >> 36) | ((in[10] & 0x7FFFFF) << 28))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[10] >> 23) | ((in[11] & 0x3FF) << 41)))) & 1))^((int64(((in[10] >> 23) | ((in[11] & 0x3FF) << 41))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[11] >> 10) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[11] >> 10) & 0x7FFFFFFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[11] >> 61) | ((in[12] & 0xFFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[11] >> 61) | ((in[12] & 0xFFFFFFFFFFFF) << 3))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[12] >> 48) | ((in[13] & 0x7FFFFFFFF) << 16)))) & 1))^((int64(((in[12] >> 48) | ((in[13] & 0x7FFFFFFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[13] >> 35) | ((in[14] & 0x3FFFFF) << 29)))) & 1))^((int64(((in[13] >> 35) | ((in[14] & 0x3FFFFF) << 29))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[14] >> 22) | ((in[15] & 0x1FF) << 42)))) & 1))^((int64(((in[14] >> 22) | ((in[15] & 0x1FF) << 42))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[15] >> 9) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[15] >> 9) & 0x7FFFFFFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[15] >> 60) | ((in[16] & 0x7FFFFFFFFFFF) << 4)))) & 1))^((int64(((in[15] >> 60) | ((in[16] & 0x7FFFFFFFFFFF) << 4))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[16] >> 47) | ((in[17] & 0x3FFFFFFFF) << 17)))) & 1))^((int64(((in[16] >> 47) | ((in[17] & 0x3FFFFFFFF) << 17))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[17] >> 34) | ((in[18] & 0x1FFFFF) << 30)))) & 1))^((int64(((in[17] >> 34) | ((in[18] & 0x1FFFFF) << 30))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[18] >> 21) | ((in[19] & 0xFF) << 43)))) & 1))^((int64(((in[18] >> 21) | ((in[19] & 0xFF) << 43))))>>1))) + out[22] + out[24] = uint64(((-((int64((in[19] >> 8) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[19] >> 8) & 0x7FFFFFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[19] >> 59) | ((in[20] & 0x3FFFFFFFFFFF) << 5)))) & 1))^((int64(((in[19] >> 59) | ((in[20] & 0x3FFFFFFFFFFF) << 5))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[20] >> 46) | ((in[21] & 0x1FFFFFFFF) << 18)))) & 1))^((int64(((in[20] >> 46) | ((in[21] & 0x1FFFFFFFF) << 18))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[21] >> 33) | ((in[22] & 0xFFFFF) << 31)))) & 1))^((int64(((in[21] >> 33) | ((in[22] & 0xFFFFF) << 31))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[22] >> 20) | ((in[23] & 0x7F) << 44)))) & 1))^((int64(((in[22] >> 20) | ((in[23] & 0x7F) << 44))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[23] >> 7) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[23] >> 7) & 0x7FFFFFFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[23] >> 58) | ((in[24] & 0x1FFFFFFFFFFF) << 6)))) & 1))^((int64(((in[23] >> 58) | ((in[24] & 0x1FFFFFFFFFFF) << 6))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[24] >> 45) | ((in[25] & 0xFFFFFFFF) << 19)))) & 1))^((int64(((in[24] >> 45) | ((in[25] & 0xFFFFFFFF) << 19))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[25] >> 32) | ((in[26] & 0x7FFFF) << 32)))) & 1))^((int64(((in[25] >> 32) | ((in[26] & 0x7FFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[26] >> 19) | ((in[27] & 0x3F) << 45)))) & 1))^((int64(((in[26] >> 19) | ((in[27] & 0x3F) << 45))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[27] >> 6) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[27] >> 6) & 0x7FFFFFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[27] >> 57) | ((in[28] & 0xFFFFFFFFFFF) << 7)))) & 1))^((int64(((in[27] >> 57) | ((in[28] & 0xFFFFFFFFFFF) << 7))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[28] >> 44) | ((in[29] & 0x7FFFFFFF) << 20)))) & 1))^((int64(((in[28] >> 44) | ((in[29] & 0x7FFFFFFF) << 20))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[29] >> 31) | ((in[30] & 0x3FFFF) << 33)))) & 1))^((int64(((in[29] >> 31) | ((in[30] & 0x3FFFF) << 33))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[30] >> 18) | ((in[31] & 0x1F) << 46)))) & 1))^((int64(((in[30] >> 18) | ((in[31] & 0x1F) << 46))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[31] >> 5) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[31] >> 5) & 0x7FFFFFFFFFFFF))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[31] >> 56) | ((in[32] & 0x7FFFFFFFFFF) << 8)))) & 1))^((int64(((in[31] >> 56) | ((in[32] & 0x7FFFFFFFFFF) << 8))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[32] >> 43) | ((in[33] & 0x3FFFFFFF) << 21)))) & 1))^((int64(((in[32] >> 43) | ((in[33] & 0x3FFFFFFF) << 21))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[33] >> 30) | ((in[34] & 0x1FFFF) << 34)))) & 1))^((int64(((in[33] >> 30) | ((in[34] & 0x1FFFF) << 34))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[34] >> 17) | ((in[35] & 0xF) << 47)))) & 1))^((int64(((in[34] >> 17) | ((in[35] & 0xF) << 47))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[35] >> 4) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[35] >> 4) & 0x7FFFFFFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[35] >> 55) | ((in[36] & 0x3FFFFFFFFFF) << 9)))) & 1))^((int64(((in[35] >> 55) | ((in[36] & 0x3FFFFFFFFFF) << 9))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[36] >> 42) | ((in[37] & 0x1FFFFFFF) << 22)))) & 1))^((int64(((in[36] >> 42) | ((in[37] & 0x1FFFFFFF) << 22))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[37] >> 29) | ((in[38] & 0xFFFF) << 35)))) & 1))^((int64(((in[37] >> 29) | ((in[38] & 0xFFFF) << 35))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[38] >> 16) | ((in[39] & 0x7) << 48)))) & 1))^((int64(((in[38] >> 16) | ((in[39] & 0x7) << 48))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[39] >> 3) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[39] >> 3) & 0x7FFFFFFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[39] >> 54) | ((in[40] & 0x1FFFFFFFFFF) << 10)))) & 1))^((int64(((in[39] >> 54) | ((in[40] & 0x1FFFFFFFFFF) << 10))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[40] >> 41) | ((in[41] & 0xFFFFFFF) << 23)))) & 1))^((int64(((in[40] >> 41) | ((in[41] & 0xFFFFFFF) << 23))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[41] >> 28) | ((in[42] & 0x7FFF) << 36)))) & 1))^((int64(((in[41] >> 28) | ((in[42] & 0x7FFF) << 36))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[42] >> 15) | ((in[43] & 0x3) << 49)))) & 1))^((int64(((in[42] >> 15) | ((in[43] & 0x3) << 49))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[43] >> 2) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[43] >> 2) & 0x7FFFFFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFF) << 11)))) & 1))^((int64(((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFF) << 11))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[44] >> 40) | ((in[45] & 0x7FFFFFF) << 24)))) & 1))^((int64(((in[44] >> 40) | ((in[45] & 0x7FFFFFF) << 24))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[45] >> 27) | ((in[46] & 0x3FFF) << 37)))) & 1))^((int64(((in[45] >> 27) | ((in[46] & 0x3FFF) << 37))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[46] >> 14) | ((in[47] & 0x1) << 50)))) & 1))^((int64(((in[46] >> 14) | ((in[47] & 0x1) << 50))))>>1))) + out[57] + out[59] = uint64(((-((int64((in[47] >> 1) & 0x7FFFFFFFFFFFF)) & 1))^((int64((in[47] >> 1) & 0x7FFFFFFFFFFFF))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[47] >> 52) | ((in[48] & 0x7FFFFFFFFF) << 12)))) & 1))^((int64(((in[47] >> 52) | ((in[48] & 0x7FFFFFFFFF) << 12))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[48] >> 39) | ((in[49] & 0x3FFFFFF) << 25)))) & 1))^((int64(((in[48] >> 39) | ((in[49] & 0x3FFFFFF) << 25))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[49] >> 26) | ((in[50] & 0x1FFF) << 38)))) & 1))^((int64(((in[49] >> 26) | ((in[50] & 0x1FFF) << 38))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[50] >> 13))) & 1))^((int64((in[50] >> 13)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_52(initoffset uint64, in *[52]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 52) | ((in[1] & 0xFFFFFFFFFF) << 12)))) & 1))^((int64(((in[0] >> 52) | ((in[1] & 0xFFFFFFFFFF) << 12))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 40) | ((in[2] & 0xFFFFFFF) << 24)))) & 1))^((int64(((in[1] >> 40) | ((in[2] & 0xFFFFFFF) << 24))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 28) | ((in[3] & 0xFFFF) << 36)))) & 1))^((int64(((in[2] >> 28) | ((in[3] & 0xFFFF) << 36))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 16) | ((in[4] & 0xF) << 48)))) & 1))^((int64(((in[3] >> 16) | ((in[4] & 0xF) << 48))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[4] >> 4) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[4] >> 4) & 0xFFFFFFFFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 56) | ((in[5] & 0xFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[4] >> 56) | ((in[5] & 0xFFFFFFFFFFF) << 8))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[5] >> 44) | ((in[6] & 0xFFFFFFFF) << 20)))) & 1))^((int64(((in[5] >> 44) | ((in[6] & 0xFFFFFFFF) << 20))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[6] >> 32) | ((in[7] & 0xFFFFF) << 32)))) & 1))^((int64(((in[6] >> 32) | ((in[7] & 0xFFFFF) << 32))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[7] >> 20) | ((in[8] & 0xFF) << 44)))) & 1))^((int64(((in[7] >> 20) | ((in[8] & 0xFF) << 44))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[8] >> 8) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[8] >> 8) & 0xFFFFFFFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[8] >> 60) | ((in[9] & 0xFFFFFFFFFFFF) << 4))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[9] >> 48) | ((in[10] & 0xFFFFFFFFF) << 16)))) & 1))^((int64(((in[9] >> 48) | ((in[10] & 0xFFFFFFFFF) << 16))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[10] >> 36) | ((in[11] & 0xFFFFFF) << 28)))) & 1))^((int64(((in[10] >> 36) | ((in[11] & 0xFFFFFF) << 28))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[11] >> 24) | ((in[12] & 0xFFF) << 40)))) & 1))^((int64(((in[11] >> 24) | ((in[12] & 0xFFF) << 40))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[12] >> 12))) & 1))^((int64((in[12] >> 12)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[13] >> 0) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[13] >> 0) & 0xFFFFFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[13] >> 52) | ((in[14] & 0xFFFFFFFFFF) << 12)))) & 1))^((int64(((in[13] >> 52) | ((in[14] & 0xFFFFFFFFFF) << 12))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[14] >> 40) | ((in[15] & 0xFFFFFFF) << 24)))) & 1))^((int64(((in[14] >> 40) | ((in[15] & 0xFFFFFFF) << 24))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[15] >> 28) | ((in[16] & 0xFFFF) << 36)))) & 1))^((int64(((in[15] >> 28) | ((in[16] & 0xFFFF) << 36))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[16] >> 16) | ((in[17] & 0xF) << 48)))) & 1))^((int64(((in[16] >> 16) | ((in[17] & 0xF) << 48))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[17] >> 4) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[17] >> 4) & 0xFFFFFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[17] >> 56) | ((in[18] & 0xFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[17] >> 56) | ((in[18] & 0xFFFFFFFFFFF) << 8))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[18] >> 44) | ((in[19] & 0xFFFFFFFF) << 20)))) & 1))^((int64(((in[18] >> 44) | ((in[19] & 0xFFFFFFFF) << 20))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[19] >> 32) | ((in[20] & 0xFFFFF) << 32)))) & 1))^((int64(((in[19] >> 32) | ((in[20] & 0xFFFFF) << 32))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[20] >> 20) | ((in[21] & 0xFF) << 44)))) & 1))^((int64(((in[20] >> 20) | ((in[21] & 0xFF) << 44))))>>1))) + out[24] + out[26] = uint64(((-((int64((in[21] >> 8) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[21] >> 8) & 0xFFFFFFFFFFFFF))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[21] >> 60) | ((in[22] & 0xFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[21] >> 60) | ((in[22] & 0xFFFFFFFFFFFF) << 4))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[22] >> 48) | ((in[23] & 0xFFFFFFFFF) << 16)))) & 1))^((int64(((in[22] >> 48) | ((in[23] & 0xFFFFFFFFF) << 16))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[23] >> 36) | ((in[24] & 0xFFFFFF) << 28)))) & 1))^((int64(((in[23] >> 36) | ((in[24] & 0xFFFFFF) << 28))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[24] >> 24) | ((in[25] & 0xFFF) << 40)))) & 1))^((int64(((in[24] >> 24) | ((in[25] & 0xFFF) << 40))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[25] >> 12))) & 1))^((int64((in[25] >> 12)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[26] >> 0) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[26] >> 0) & 0xFFFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[26] >> 52) | ((in[27] & 0xFFFFFFFFFF) << 12)))) & 1))^((int64(((in[26] >> 52) | ((in[27] & 0xFFFFFFFFFF) << 12))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[27] >> 40) | ((in[28] & 0xFFFFFFF) << 24)))) & 1))^((int64(((in[27] >> 40) | ((in[28] & 0xFFFFFFF) << 24))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[28] >> 28) | ((in[29] & 0xFFFF) << 36)))) & 1))^((int64(((in[28] >> 28) | ((in[29] & 0xFFFF) << 36))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[29] >> 16) | ((in[30] & 0xF) << 48)))) & 1))^((int64(((in[29] >> 16) | ((in[30] & 0xF) << 48))))>>1))) + out[35] + out[37] = uint64(((-((int64((in[30] >> 4) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[30] >> 4) & 0xFFFFFFFFFFFFF))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[30] >> 56) | ((in[31] & 0xFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[30] >> 56) | ((in[31] & 0xFFFFFFFFFFF) << 8))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[31] >> 44) | ((in[32] & 0xFFFFFFFF) << 20)))) & 1))^((int64(((in[31] >> 44) | ((in[32] & 0xFFFFFFFF) << 20))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[32] >> 32) | ((in[33] & 0xFFFFF) << 32)))) & 1))^((int64(((in[32] >> 32) | ((in[33] & 0xFFFFF) << 32))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[33] >> 20) | ((in[34] & 0xFF) << 44)))) & 1))^((int64(((in[33] >> 20) | ((in[34] & 0xFF) << 44))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[34] >> 8) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[34] >> 8) & 0xFFFFFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[34] >> 60) | ((in[35] & 0xFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[34] >> 60) | ((in[35] & 0xFFFFFFFFFFFF) << 4))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[35] >> 48) | ((in[36] & 0xFFFFFFFFF) << 16)))) & 1))^((int64(((in[35] >> 48) | ((in[36] & 0xFFFFFFFFF) << 16))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[36] >> 36) | ((in[37] & 0xFFFFFF) << 28)))) & 1))^((int64(((in[36] >> 36) | ((in[37] & 0xFFFFFF) << 28))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[37] >> 24) | ((in[38] & 0xFFF) << 40)))) & 1))^((int64(((in[37] >> 24) | ((in[38] & 0xFFF) << 40))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[38] >> 12))) & 1))^((int64((in[38] >> 12)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[39] >> 0) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[39] >> 0) & 0xFFFFFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[39] >> 52) | ((in[40] & 0xFFFFFFFFFF) << 12)))) & 1))^((int64(((in[39] >> 52) | ((in[40] & 0xFFFFFFFFFF) << 12))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[40] >> 40) | ((in[41] & 0xFFFFFFF) << 24)))) & 1))^((int64(((in[40] >> 40) | ((in[41] & 0xFFFFFFF) << 24))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[41] >> 28) | ((in[42] & 0xFFFF) << 36)))) & 1))^((int64(((in[41] >> 28) | ((in[42] & 0xFFFF) << 36))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[42] >> 16) | ((in[43] & 0xF) << 48)))) & 1))^((int64(((in[42] >> 16) | ((in[43] & 0xF) << 48))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[43] >> 4) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[43] >> 4) & 0xFFFFFFFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[43] >> 56) | ((in[44] & 0xFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[43] >> 56) | ((in[44] & 0xFFFFFFFFFFF) << 8))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[44] >> 44) | ((in[45] & 0xFFFFFFFF) << 20)))) & 1))^((int64(((in[44] >> 44) | ((in[45] & 0xFFFFFFFF) << 20))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[45] >> 32) | ((in[46] & 0xFFFFF) << 32)))) & 1))^((int64(((in[45] >> 32) | ((in[46] & 0xFFFFF) << 32))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[46] >> 20) | ((in[47] & 0xFF) << 44)))) & 1))^((int64(((in[46] >> 20) | ((in[47] & 0xFF) << 44))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[47] >> 8) & 0xFFFFFFFFFFFFF)) & 1))^((int64((in[47] >> 8) & 0xFFFFFFFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[47] >> 60) | ((in[48] & 0xFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[47] >> 60) | ((in[48] & 0xFFFFFFFFFFFF) << 4))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[48] >> 48) | ((in[49] & 0xFFFFFFFFF) << 16)))) & 1))^((int64(((in[48] >> 48) | ((in[49] & 0xFFFFFFFFF) << 16))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[49] >> 36) | ((in[50] & 0xFFFFFF) << 28)))) & 1))^((int64(((in[49] >> 36) | ((in[50] & 0xFFFFFF) << 28))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[50] >> 24) | ((in[51] & 0xFFF) << 40)))) & 1))^((int64(((in[50] >> 24) | ((in[51] & 0xFFF) << 40))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[51] >> 12))) & 1))^((int64((in[51] >> 12)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_53(initoffset uint64, in *[53]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 53) | ((in[1] & 0x3FFFFFFFFFF) << 11)))) & 1))^((int64(((in[0] >> 53) | ((in[1] & 0x3FFFFFFFFFF) << 11))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 42) | ((in[2] & 0x7FFFFFFF) << 22)))) & 1))^((int64(((in[1] >> 42) | ((in[2] & 0x7FFFFFFF) << 22))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 31) | ((in[3] & 0xFFFFF) << 33)))) & 1))^((int64(((in[2] >> 31) | ((in[3] & 0xFFFFF) << 33))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 20) | ((in[4] & 0x1FF) << 44)))) & 1))^((int64(((in[3] >> 20) | ((in[4] & 0x1FF) << 44))))>>1))) + out[3] + out[5] = uint64(((-((int64((in[4] >> 9) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[4] >> 9) & 0x1FFFFFFFFFFFFF))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[4] >> 62) | ((in[5] & 0x7FFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[4] >> 62) | ((in[5] & 0x7FFFFFFFFFFFF) << 2))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[5] >> 51) | ((in[6] & 0xFFFFFFFFFF) << 13)))) & 1))^((int64(((in[5] >> 51) | ((in[6] & 0xFFFFFFFFFF) << 13))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[6] >> 40) | ((in[7] & 0x1FFFFFFF) << 24)))) & 1))^((int64(((in[6] >> 40) | ((in[7] & 0x1FFFFFFF) << 24))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[7] >> 29) | ((in[8] & 0x3FFFF) << 35)))) & 1))^((int64(((in[7] >> 29) | ((in[8] & 0x3FFFF) << 35))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[8] >> 18) | ((in[9] & 0x7F) << 46)))) & 1))^((int64(((in[8] >> 18) | ((in[9] & 0x7F) << 46))))>>1))) + out[9] + out[11] = uint64(((-((int64((in[9] >> 7) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[9] >> 7) & 0x1FFFFFFFFFFFFF))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[9] >> 60) | ((in[10] & 0x1FFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[9] >> 60) | ((in[10] & 0x1FFFFFFFFFFFF) << 4))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[10] >> 49) | ((in[11] & 0x3FFFFFFFFF) << 15)))) & 1))^((int64(((in[10] >> 49) | ((in[11] & 0x3FFFFFFFFF) << 15))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[11] >> 38) | ((in[12] & 0x7FFFFFF) << 26)))) & 1))^((int64(((in[11] >> 38) | ((in[12] & 0x7FFFFFF) << 26))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[12] >> 27) | ((in[13] & 0xFFFF) << 37)))) & 1))^((int64(((in[12] >> 27) | ((in[13] & 0xFFFF) << 37))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[13] >> 16) | ((in[14] & 0x1F) << 48)))) & 1))^((int64(((in[13] >> 16) | ((in[14] & 0x1F) << 48))))>>1))) + out[15] + out[17] = uint64(((-((int64((in[14] >> 5) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[14] >> 5) & 0x1FFFFFFFFFFFFF))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[14] >> 58) | ((in[15] & 0x7FFFFFFFFFFF) << 6)))) & 1))^((int64(((in[14] >> 58) | ((in[15] & 0x7FFFFFFFFFFF) << 6))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[15] >> 47) | ((in[16] & 0xFFFFFFFFF) << 17)))) & 1))^((int64(((in[15] >> 47) | ((in[16] & 0xFFFFFFFFF) << 17))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[16] >> 36) | ((in[17] & 0x1FFFFFF) << 28)))) & 1))^((int64(((in[16] >> 36) | ((in[17] & 0x1FFFFFF) << 28))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[17] >> 25) | ((in[18] & 0x3FFF) << 39)))) & 1))^((int64(((in[17] >> 25) | ((in[18] & 0x3FFF) << 39))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[18] >> 14) | ((in[19] & 0x7) << 50)))) & 1))^((int64(((in[18] >> 14) | ((in[19] & 0x7) << 50))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[19] >> 3) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[19] >> 3) & 0x1FFFFFFFFFFFFF))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[19] >> 56) | ((in[20] & 0x1FFFFFFFFFFF) << 8)))) & 1))^((int64(((in[19] >> 56) | ((in[20] & 0x1FFFFFFFFFFF) << 8))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[20] >> 45) | ((in[21] & 0x3FFFFFFFF) << 19)))) & 1))^((int64(((in[20] >> 45) | ((in[21] & 0x3FFFFFFFF) << 19))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[21] >> 34) | ((in[22] & 0x7FFFFF) << 30)))) & 1))^((int64(((in[21] >> 34) | ((in[22] & 0x7FFFFF) << 30))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[22] >> 23) | ((in[23] & 0xFFF) << 41)))) & 1))^((int64(((in[22] >> 23) | ((in[23] & 0xFFF) << 41))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[23] >> 12) | ((in[24] & 0x1) << 52)))) & 1))^((int64(((in[23] >> 12) | ((in[24] & 0x1) << 52))))>>1))) + out[27] + out[29] = uint64(((-((int64((in[24] >> 1) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[24] >> 1) & 0x1FFFFFFFFFFFFF))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[24] >> 54) | ((in[25] & 0x7FFFFFFFFFF) << 10)))) & 1))^((int64(((in[24] >> 54) | ((in[25] & 0x7FFFFFFFFFF) << 10))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[25] >> 43) | ((in[26] & 0xFFFFFFFF) << 21)))) & 1))^((int64(((in[25] >> 43) | ((in[26] & 0xFFFFFFFF) << 21))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[26] >> 32) | ((in[27] & 0x1FFFFF) << 32)))) & 1))^((int64(((in[26] >> 32) | ((in[27] & 0x1FFFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[27] >> 21) | ((in[28] & 0x3FF) << 43)))) & 1))^((int64(((in[27] >> 21) | ((in[28] & 0x3FF) << 43))))>>1))) + out[32] + out[34] = uint64(((-((int64((in[28] >> 10) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[28] >> 10) & 0x1FFFFFFFFFFFFF))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[28] >> 63) | ((in[29] & 0xFFFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[28] >> 63) | ((in[29] & 0xFFFFFFFFFFFFF) << 1))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[29] >> 52) | ((in[30] & 0x1FFFFFFFFFF) << 12)))) & 1))^((int64(((in[29] >> 52) | ((in[30] & 0x1FFFFFFFFFF) << 12))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[30] >> 41) | ((in[31] & 0x3FFFFFFF) << 23)))) & 1))^((int64(((in[30] >> 41) | ((in[31] & 0x3FFFFFFF) << 23))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[31] >> 30) | ((in[32] & 0x7FFFF) << 34)))) & 1))^((int64(((in[31] >> 30) | ((in[32] & 0x7FFFF) << 34))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[32] >> 19) | ((in[33] & 0xFF) << 45)))) & 1))^((int64(((in[32] >> 19) | ((in[33] & 0xFF) << 45))))>>1))) + out[38] + out[40] = uint64(((-((int64((in[33] >> 8) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[33] >> 8) & 0x1FFFFFFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[33] >> 61) | ((in[34] & 0x3FFFFFFFFFFFF) << 3))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[34] >> 50) | ((in[35] & 0x7FFFFFFFFF) << 14)))) & 1))^((int64(((in[34] >> 50) | ((in[35] & 0x7FFFFFFFFF) << 14))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[35] >> 39) | ((in[36] & 0xFFFFFFF) << 25)))) & 1))^((int64(((in[35] >> 39) | ((in[36] & 0xFFFFFFF) << 25))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[36] >> 28) | ((in[37] & 0x1FFFF) << 36)))) & 1))^((int64(((in[36] >> 28) | ((in[37] & 0x1FFFF) << 36))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[37] >> 17) | ((in[38] & 0x3F) << 47)))) & 1))^((int64(((in[37] >> 17) | ((in[38] & 0x3F) << 47))))>>1))) + out[44] + out[46] = uint64(((-((int64((in[38] >> 6) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[38] >> 6) & 0x1FFFFFFFFFFFFF))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[38] >> 59) | ((in[39] & 0xFFFFFFFFFFFF) << 5)))) & 1))^((int64(((in[38] >> 59) | ((in[39] & 0xFFFFFFFFFFFF) << 5))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[39] >> 48) | ((in[40] & 0x1FFFFFFFFF) << 16)))) & 1))^((int64(((in[39] >> 48) | ((in[40] & 0x1FFFFFFFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[40] >> 37) | ((in[41] & 0x3FFFFFF) << 27)))) & 1))^((int64(((in[40] >> 37) | ((in[41] & 0x3FFFFFF) << 27))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[41] >> 26) | ((in[42] & 0x7FFF) << 38)))) & 1))^((int64(((in[41] >> 26) | ((in[42] & 0x7FFF) << 38))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[42] >> 15) | ((in[43] & 0xF) << 49)))) & 1))^((int64(((in[42] >> 15) | ((in[43] & 0xF) << 49))))>>1))) + out[50] + out[52] = uint64(((-((int64((in[43] >> 4) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[43] >> 4) & 0x1FFFFFFFFFFFFF))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[43] >> 57) | ((in[44] & 0x3FFFFFFFFFFF) << 7)))) & 1))^((int64(((in[43] >> 57) | ((in[44] & 0x3FFFFFFFFFFF) << 7))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[44] >> 46) | ((in[45] & 0x7FFFFFFFF) << 18)))) & 1))^((int64(((in[44] >> 46) | ((in[45] & 0x7FFFFFFFF) << 18))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[45] >> 35) | ((in[46] & 0xFFFFFF) << 29)))) & 1))^((int64(((in[45] >> 35) | ((in[46] & 0xFFFFFF) << 29))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[46] >> 24) | ((in[47] & 0x1FFF) << 40)))) & 1))^((int64(((in[46] >> 24) | ((in[47] & 0x1FFF) << 40))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[47] >> 13) | ((in[48] & 0x3) << 51)))) & 1))^((int64(((in[47] >> 13) | ((in[48] & 0x3) << 51))))>>1))) + out[56] + out[58] = uint64(((-((int64((in[48] >> 2) & 0x1FFFFFFFFFFFFF)) & 1))^((int64((in[48] >> 2) & 0x1FFFFFFFFFFFFF))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[48] >> 55) | ((in[49] & 0xFFFFFFFFFFF) << 9)))) & 1))^((int64(((in[48] >> 55) | ((in[49] & 0xFFFFFFFFFFF) << 9))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[49] >> 44) | ((in[50] & 0x1FFFFFFFF) << 20)))) & 1))^((int64(((in[49] >> 44) | ((in[50] & 0x1FFFFFFFF) << 20))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[50] >> 33) | ((in[51] & 0x3FFFFF) << 31)))) & 1))^((int64(((in[50] >> 33) | ((in[51] & 0x3FFFFF) << 31))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[51] >> 22) | ((in[52] & 0x7FF) << 42)))) & 1))^((int64(((in[51] >> 22) | ((in[52] & 0x7FF) << 42))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[52] >> 11))) & 1))^((int64((in[52] >> 11)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_54(initoffset uint64, in *[54]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 54) | ((in[1] & 0xFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[0] >> 54) | ((in[1] & 0xFFFFFFFFFFF) << 10))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 44) | ((in[2] & 0x3FFFFFFFF) << 20)))) & 1))^((int64(((in[1] >> 44) | ((in[2] & 0x3FFFFFFFF) << 20))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 34) | ((in[3] & 0xFFFFFF) << 30)))) & 1))^((int64(((in[2] >> 34) | ((in[3] & 0xFFFFFF) << 30))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 24) | ((in[4] & 0x3FFF) << 40)))) & 1))^((int64(((in[3] >> 24) | ((in[4] & 0x3FFF) << 40))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 14) | ((in[5] & 0xF) << 50)))) & 1))^((int64(((in[4] >> 14) | ((in[5] & 0xF) << 50))))>>1))) + out[4] + out[6] = uint64(((-((int64((in[5] >> 4) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[5] >> 4) & 0x3FFFFFFFFFFFFF))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0xFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0xFFFFFFFFFFFF) << 6))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[6] >> 48) | ((in[7] & 0x3FFFFFFFFF) << 16)))) & 1))^((int64(((in[6] >> 48) | ((in[7] & 0x3FFFFFFFFF) << 16))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[7] >> 38) | ((in[8] & 0xFFFFFFF) << 26)))) & 1))^((int64(((in[7] >> 38) | ((in[8] & 0xFFFFFFF) << 26))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[8] >> 28) | ((in[9] & 0x3FFFF) << 36)))) & 1))^((int64(((in[8] >> 28) | ((in[9] & 0x3FFFF) << 36))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[9] >> 18) | ((in[10] & 0xFF) << 46)))) & 1))^((int64(((in[9] >> 18) | ((in[10] & 0xFF) << 46))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[10] >> 8) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[10] >> 8) & 0x3FFFFFFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[10] >> 62) | ((in[11] & 0xFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[10] >> 62) | ((in[11] & 0xFFFFFFFFFFFFF) << 2))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0x3FFFFFFFFFF) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0x3FFFFFFFFFF) << 12))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[12] >> 42) | ((in[13] & 0xFFFFFFFF) << 22)))) & 1))^((int64(((in[12] >> 42) | ((in[13] & 0xFFFFFFFF) << 22))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[13] >> 32) | ((in[14] & 0x3FFFFF) << 32)))) & 1))^((int64(((in[13] >> 32) | ((in[14] & 0x3FFFFF) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[14] >> 22) | ((in[15] & 0xFFF) << 42)))) & 1))^((int64(((in[14] >> 22) | ((in[15] & 0xFFF) << 42))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[15] >> 12) | ((in[16] & 0x3) << 52)))) & 1))^((int64(((in[15] >> 12) | ((in[16] & 0x3) << 52))))>>1))) + out[17] + out[19] = uint64(((-((int64((in[16] >> 2) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[16] >> 2) & 0x3FFFFFFFFFFFFF))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0x3FFFFFFFFFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0x3FFFFFFFFFFF) << 8))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[17] >> 46) | ((in[18] & 0xFFFFFFFFF) << 18)))) & 1))^((int64(((in[17] >> 46) | ((in[18] & 0xFFFFFFFFF) << 18))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[18] >> 36) | ((in[19] & 0x3FFFFFF) << 28)))) & 1))^((int64(((in[18] >> 36) | ((in[19] & 0x3FFFFFF) << 28))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[19] >> 26) | ((in[20] & 0xFFFF) << 38)))) & 1))^((int64(((in[19] >> 26) | ((in[20] & 0xFFFF) << 38))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[20] >> 16) | ((in[21] & 0x3F) << 48)))) & 1))^((int64(((in[20] >> 16) | ((in[21] & 0x3F) << 48))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[21] >> 6) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[21] >> 6) & 0x3FFFFFFFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[21] >> 60) | ((in[22] & 0x3FFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[21] >> 60) | ((in[22] & 0x3FFFFFFFFFFFF) << 4))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[22] >> 50) | ((in[23] & 0xFFFFFFFFFF) << 14)))) & 1))^((int64(((in[22] >> 50) | ((in[23] & 0xFFFFFFFFFF) << 14))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[23] >> 40) | ((in[24] & 0x3FFFFFFF) << 24)))) & 1))^((int64(((in[23] >> 40) | ((in[24] & 0x3FFFFFFF) << 24))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[24] >> 30) | ((in[25] & 0xFFFFF) << 34)))) & 1))^((int64(((in[24] >> 30) | ((in[25] & 0xFFFFF) << 34))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[25] >> 20) | ((in[26] & 0x3FF) << 44)))) & 1))^((int64(((in[25] >> 20) | ((in[26] & 0x3FF) << 44))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[26] >> 10))) & 1))^((int64((in[26] >> 10)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[27] >> 0) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[27] >> 0) & 0x3FFFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[27] >> 54) | ((in[28] & 0xFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[27] >> 54) | ((in[28] & 0xFFFFFFFFFFF) << 10))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[28] >> 44) | ((in[29] & 0x3FFFFFFFF) << 20)))) & 1))^((int64(((in[28] >> 44) | ((in[29] & 0x3FFFFFFFF) << 20))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[29] >> 34) | ((in[30] & 0xFFFFFF) << 30)))) & 1))^((int64(((in[29] >> 34) | ((in[30] & 0xFFFFFF) << 30))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[30] >> 24) | ((in[31] & 0x3FFF) << 40)))) & 1))^((int64(((in[30] >> 24) | ((in[31] & 0x3FFF) << 40))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[31] >> 14) | ((in[32] & 0xF) << 50)))) & 1))^((int64(((in[31] >> 14) | ((in[32] & 0xF) << 50))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[32] >> 4) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[32] >> 4) & 0x3FFFFFFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[32] >> 58) | ((in[33] & 0xFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[32] >> 58) | ((in[33] & 0xFFFFFFFFFFFF) << 6))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[33] >> 48) | ((in[34] & 0x3FFFFFFFFF) << 16)))) & 1))^((int64(((in[33] >> 48) | ((in[34] & 0x3FFFFFFFFF) << 16))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[34] >> 38) | ((in[35] & 0xFFFFFFF) << 26)))) & 1))^((int64(((in[34] >> 38) | ((in[35] & 0xFFFFFFF) << 26))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[35] >> 28) | ((in[36] & 0x3FFFF) << 36)))) & 1))^((int64(((in[35] >> 28) | ((in[36] & 0x3FFFF) << 36))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[36] >> 18) | ((in[37] & 0xFF) << 46)))) & 1))^((int64(((in[36] >> 18) | ((in[37] & 0xFF) << 46))))>>1))) + out[42] + out[44] = uint64(((-((int64((in[37] >> 8) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[37] >> 8) & 0x3FFFFFFFFFFFFF))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[37] >> 62) | ((in[38] & 0xFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[37] >> 62) | ((in[38] & 0xFFFFFFFFFFFFF) << 2))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[38] >> 52) | ((in[39] & 0x3FFFFFFFFFF) << 12)))) & 1))^((int64(((in[38] >> 52) | ((in[39] & 0x3FFFFFFFFFF) << 12))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[39] >> 42) | ((in[40] & 0xFFFFFFFF) << 22)))) & 1))^((int64(((in[39] >> 42) | ((in[40] & 0xFFFFFFFF) << 22))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[40] >> 32) | ((in[41] & 0x3FFFFF) << 32)))) & 1))^((int64(((in[40] >> 32) | ((in[41] & 0x3FFFFF) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[41] >> 22) | ((in[42] & 0xFFF) << 42)))) & 1))^((int64(((in[41] >> 22) | ((in[42] & 0xFFF) << 42))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[42] >> 12) | ((in[43] & 0x3) << 52)))) & 1))^((int64(((in[42] >> 12) | ((in[43] & 0x3) << 52))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[43] >> 2) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[43] >> 2) & 0x3FFFFFFFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[43] >> 56) | ((in[44] & 0x3FFFFFFFFFFF) << 8)))) & 1))^((int64(((in[43] >> 56) | ((in[44] & 0x3FFFFFFFFFFF) << 8))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[44] >> 46) | ((in[45] & 0xFFFFFFFFF) << 18)))) & 1))^((int64(((in[44] >> 46) | ((in[45] & 0xFFFFFFFFF) << 18))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[45] >> 36) | ((in[46] & 0x3FFFFFF) << 28)))) & 1))^((int64(((in[45] >> 36) | ((in[46] & 0x3FFFFFF) << 28))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[46] >> 26) | ((in[47] & 0xFFFF) << 38)))) & 1))^((int64(((in[46] >> 26) | ((in[47] & 0xFFFF) << 38))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[47] >> 16) | ((in[48] & 0x3F) << 48)))) & 1))^((int64(((in[47] >> 16) | ((in[48] & 0x3F) << 48))))>>1))) + out[55] + out[57] = uint64(((-((int64((in[48] >> 6) & 0x3FFFFFFFFFFFFF)) & 1))^((int64((in[48] >> 6) & 0x3FFFFFFFFFFFFF))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFF) << 4))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[49] >> 50) | ((in[50] & 0xFFFFFFFFFF) << 14)))) & 1))^((int64(((in[49] >> 50) | ((in[50] & 0xFFFFFFFFFF) << 14))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[50] >> 40) | ((in[51] & 0x3FFFFFFF) << 24)))) & 1))^((int64(((in[50] >> 40) | ((in[51] & 0x3FFFFFFF) << 24))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[51] >> 30) | ((in[52] & 0xFFFFF) << 34)))) & 1))^((int64(((in[51] >> 30) | ((in[52] & 0xFFFFF) << 34))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[52] >> 20) | ((in[53] & 0x3FF) << 44)))) & 1))^((int64(((in[52] >> 20) | ((in[53] & 0x3FF) << 44))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[53] >> 10))) & 1))^((int64((in[53] >> 10)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_55(initoffset uint64, in *[55]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 55) | ((in[1] & 0x3FFFFFFFFFFF) << 9)))) & 1))^((int64(((in[0] >> 55) | ((in[1] & 0x3FFFFFFFFFFF) << 9))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 46) | ((in[2] & 0x1FFFFFFFFF) << 18)))) & 1))^((int64(((in[1] >> 46) | ((in[2] & 0x1FFFFFFFFF) << 18))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 37) | ((in[3] & 0xFFFFFFF) << 27)))) & 1))^((int64(((in[2] >> 37) | ((in[3] & 0xFFFFFFF) << 27))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 28) | ((in[4] & 0x7FFFF) << 36)))) & 1))^((int64(((in[3] >> 28) | ((in[4] & 0x7FFFF) << 36))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 19) | ((in[5] & 0x3FF) << 45)))) & 1))^((int64(((in[4] >> 19) | ((in[5] & 0x3FF) << 45))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 10) | ((in[6] & 0x1) << 54)))) & 1))^((int64(((in[5] >> 10) | ((in[6] & 0x1) << 54))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[6] >> 1) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[6] >> 1) & 0x7FFFFFFFFFFFFF))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[6] >> 56) | ((in[7] & 0x7FFFFFFFFFFF) << 8)))) & 1))^((int64(((in[6] >> 56) | ((in[7] & 0x7FFFFFFFFFFF) << 8))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[7] >> 47) | ((in[8] & 0x3FFFFFFFFF) << 17)))) & 1))^((int64(((in[7] >> 47) | ((in[8] & 0x3FFFFFFFFF) << 17))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[8] >> 38) | ((in[9] & 0x1FFFFFFF) << 26)))) & 1))^((int64(((in[8] >> 38) | ((in[9] & 0x1FFFFFFF) << 26))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[9] >> 29) | ((in[10] & 0xFFFFF) << 35)))) & 1))^((int64(((in[9] >> 29) | ((in[10] & 0xFFFFF) << 35))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[10] >> 20) | ((in[11] & 0x7FF) << 44)))) & 1))^((int64(((in[10] >> 20) | ((in[11] & 0x7FF) << 44))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[11] >> 11) | ((in[12] & 0x3) << 53)))) & 1))^((int64(((in[11] >> 11) | ((in[12] & 0x3) << 53))))>>1))) + out[12] + out[14] = uint64(((-((int64((in[12] >> 2) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[12] >> 2) & 0x7FFFFFFFFFFFFF))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[12] >> 57) | ((in[13] & 0xFFFFFFFFFFFF) << 7)))) & 1))^((int64(((in[12] >> 57) | ((in[13] & 0xFFFFFFFFFFFF) << 7))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[13] >> 48) | ((in[14] & 0x7FFFFFFFFF) << 16)))) & 1))^((int64(((in[13] >> 48) | ((in[14] & 0x7FFFFFFFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[14] >> 39) | ((in[15] & 0x3FFFFFFF) << 25)))) & 1))^((int64(((in[14] >> 39) | ((in[15] & 0x3FFFFFFF) << 25))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[15] >> 30) | ((in[16] & 0x1FFFFF) << 34)))) & 1))^((int64(((in[15] >> 30) | ((in[16] & 0x1FFFFF) << 34))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[16] >> 21) | ((in[17] & 0xFFF) << 43)))) & 1))^((int64(((in[16] >> 21) | ((in[17] & 0xFFF) << 43))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[17] >> 12) | ((in[18] & 0x7) << 52)))) & 1))^((int64(((in[17] >> 12) | ((in[18] & 0x7) << 52))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[18] >> 3) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[18] >> 3) & 0x7FFFFFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[18] >> 58) | ((in[19] & 0x1FFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[18] >> 58) | ((in[19] & 0x1FFFFFFFFFFFF) << 6))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[19] >> 49) | ((in[20] & 0xFFFFFFFFFF) << 15)))) & 1))^((int64(((in[19] >> 49) | ((in[20] & 0xFFFFFFFFFF) << 15))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[20] >> 40) | ((in[21] & 0x7FFFFFFF) << 24)))) & 1))^((int64(((in[20] >> 40) | ((in[21] & 0x7FFFFFFF) << 24))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[21] >> 31) | ((in[22] & 0x3FFFFF) << 33)))) & 1))^((int64(((in[21] >> 31) | ((in[22] & 0x3FFFFF) << 33))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[22] >> 22) | ((in[23] & 0x1FFF) << 42)))) & 1))^((int64(((in[22] >> 22) | ((in[23] & 0x1FFF) << 42))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[23] >> 13) | ((in[24] & 0xF) << 51)))) & 1))^((int64(((in[23] >> 13) | ((in[24] & 0xF) << 51))))>>1))) + out[26] + out[28] = uint64(((-((int64((in[24] >> 4) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[24] >> 4) & 0x7FFFFFFFFFFFFF))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[24] >> 59) | ((in[25] & 0x3FFFFFFFFFFFF) << 5)))) & 1))^((int64(((in[24] >> 59) | ((in[25] & 0x3FFFFFFFFFFFF) << 5))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[25] >> 50) | ((in[26] & 0x1FFFFFFFFFF) << 14)))) & 1))^((int64(((in[25] >> 50) | ((in[26] & 0x1FFFFFFFFFF) << 14))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[26] >> 41) | ((in[27] & 0xFFFFFFFF) << 23)))) & 1))^((int64(((in[26] >> 41) | ((in[27] & 0xFFFFFFFF) << 23))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[27] >> 32) | ((in[28] & 0x7FFFFF) << 32)))) & 1))^((int64(((in[27] >> 32) | ((in[28] & 0x7FFFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[28] >> 23) | ((in[29] & 0x3FFF) << 41)))) & 1))^((int64(((in[28] >> 23) | ((in[29] & 0x3FFF) << 41))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[29] >> 14) | ((in[30] & 0x1F) << 50)))) & 1))^((int64(((in[29] >> 14) | ((in[30] & 0x1F) << 50))))>>1))) + out[33] + out[35] = uint64(((-((int64((in[30] >> 5) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[30] >> 5) & 0x7FFFFFFFFFFFFF))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[30] >> 60) | ((in[31] & 0x7FFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[30] >> 60) | ((in[31] & 0x7FFFFFFFFFFFF) << 4))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[31] >> 51) | ((in[32] & 0x3FFFFFFFFFF) << 13)))) & 1))^((int64(((in[31] >> 51) | ((in[32] & 0x3FFFFFFFFFF) << 13))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[32] >> 42) | ((in[33] & 0x1FFFFFFFF) << 22)))) & 1))^((int64(((in[32] >> 42) | ((in[33] & 0x1FFFFFFFF) << 22))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[33] >> 33) | ((in[34] & 0xFFFFFF) << 31)))) & 1))^((int64(((in[33] >> 33) | ((in[34] & 0xFFFFFF) << 31))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[34] >> 24) | ((in[35] & 0x7FFF) << 40)))) & 1))^((int64(((in[34] >> 24) | ((in[35] & 0x7FFF) << 40))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[35] >> 15) | ((in[36] & 0x3F) << 49)))) & 1))^((int64(((in[35] >> 15) | ((in[36] & 0x3F) << 49))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[36] >> 6) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[36] >> 6) & 0x7FFFFFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[36] >> 61) | ((in[37] & 0xFFFFFFFFFFFFF) << 3))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[37] >> 52) | ((in[38] & 0x7FFFFFFFFFF) << 12)))) & 1))^((int64(((in[37] >> 52) | ((in[38] & 0x7FFFFFFFFFF) << 12))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[38] >> 43) | ((in[39] & 0x3FFFFFFFF) << 21)))) & 1))^((int64(((in[38] >> 43) | ((in[39] & 0x3FFFFFFFF) << 21))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[39] >> 34) | ((in[40] & 0x1FFFFFF) << 30)))) & 1))^((int64(((in[39] >> 34) | ((in[40] & 0x1FFFFFF) << 30))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[40] >> 25) | ((in[41] & 0xFFFF) << 39)))) & 1))^((int64(((in[40] >> 25) | ((in[41] & 0xFFFF) << 39))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[41] >> 16) | ((in[42] & 0x7F) << 48)))) & 1))^((int64(((in[41] >> 16) | ((in[42] & 0x7F) << 48))))>>1))) + out[47] + out[49] = uint64(((-((int64((in[42] >> 7) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[42] >> 7) & 0x7FFFFFFFFFFFFF))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[42] >> 62) | ((in[43] & 0x1FFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[42] >> 62) | ((in[43] & 0x1FFFFFFFFFFFFF) << 2))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFFF) << 11)))) & 1))^((int64(((in[43] >> 53) | ((in[44] & 0xFFFFFFFFFFF) << 11))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[44] >> 44) | ((in[45] & 0x7FFFFFFFF) << 20)))) & 1))^((int64(((in[44] >> 44) | ((in[45] & 0x7FFFFFFFF) << 20))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[45] >> 35) | ((in[46] & 0x3FFFFFF) << 29)))) & 1))^((int64(((in[45] >> 35) | ((in[46] & 0x3FFFFFF) << 29))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[46] >> 26) | ((in[47] & 0x1FFFF) << 38)))) & 1))^((int64(((in[46] >> 26) | ((in[47] & 0x1FFFF) << 38))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[47] >> 17) | ((in[48] & 0xFF) << 47)))) & 1))^((int64(((in[47] >> 17) | ((in[48] & 0xFF) << 47))))>>1))) + out[54] + out[56] = uint64(((-((int64((in[48] >> 8) & 0x7FFFFFFFFFFFFF)) & 1))^((int64((in[48] >> 8) & 0x7FFFFFFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[48] >> 63) | ((in[49] & 0x3FFFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[48] >> 63) | ((in[49] & 0x3FFFFFFFFFFFFF) << 1))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[49] >> 54) | ((in[50] & 0x1FFFFFFFFFFF) << 10)))) & 1))^((int64(((in[49] >> 54) | ((in[50] & 0x1FFFFFFFFFFF) << 10))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[50] >> 45) | ((in[51] & 0xFFFFFFFFF) << 19)))) & 1))^((int64(((in[50] >> 45) | ((in[51] & 0xFFFFFFFFF) << 19))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[51] >> 36) | ((in[52] & 0x7FFFFFF) << 28)))) & 1))^((int64(((in[51] >> 36) | ((in[52] & 0x7FFFFFF) << 28))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[52] >> 27) | ((in[53] & 0x3FFFF) << 37)))) & 1))^((int64(((in[52] >> 27) | ((in[53] & 0x3FFFF) << 37))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[53] >> 18) | ((in[54] & 0x1FF) << 46)))) & 1))^((int64(((in[53] >> 18) | ((in[54] & 0x1FF) << 46))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[54] >> 9))) & 1))^((int64((in[54] >> 9)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_56(initoffset uint64, in *[56]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 56) | ((in[1] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[0] >> 56) | ((in[1] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 48) | ((in[2] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[1] >> 48) | ((in[2] & 0xFFFFFFFFFF) << 16))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 40) | ((in[3] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[2] >> 40) | ((in[3] & 0xFFFFFFFF) << 24))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 32) | ((in[4] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[3] >> 32) | ((in[4] & 0xFFFFFF) << 32))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 24) | ((in[5] & 0xFFFF) << 40)))) & 1))^((int64(((in[4] >> 24) | ((in[5] & 0xFFFF) << 40))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 16) | ((in[6] & 0xFF) << 48)))) & 1))^((int64(((in[5] >> 16) | ((in[6] & 0xFF) << 48))))>>1))) + out[5] + out[7] = uint64(((-((int64((in[6] >> 8))) & 1))^((int64((in[6] >> 8)))>>1))) + out[6] + out[8] = uint64(((-((int64((in[7] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[7] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[8] >> 48) | ((in[9] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[8] >> 48) | ((in[9] & 0xFFFFFFFFFF) << 16))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[9] >> 40) | ((in[10] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[9] >> 40) | ((in[10] & 0xFFFFFFFF) << 24))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[10] >> 32) | ((in[11] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[10] >> 32) | ((in[11] & 0xFFFFFF) << 32))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[11] >> 24) | ((in[12] & 0xFFFF) << 40)))) & 1))^((int64(((in[11] >> 24) | ((in[12] & 0xFFFF) << 40))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[12] >> 16) | ((in[13] & 0xFF) << 48)))) & 1))^((int64(((in[12] >> 16) | ((in[13] & 0xFF) << 48))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[13] >> 8))) & 1))^((int64((in[13] >> 8)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[14] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[14] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[14] >> 56) | ((in[15] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[14] >> 56) | ((in[15] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0xFFFFFFFFFF) << 16))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[16] >> 40) | ((in[17] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[16] >> 40) | ((in[17] & 0xFFFFFFFF) << 24))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[17] >> 32) | ((in[18] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[17] >> 32) | ((in[18] & 0xFFFFFF) << 32))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[18] >> 24) | ((in[19] & 0xFFFF) << 40)))) & 1))^((int64(((in[18] >> 24) | ((in[19] & 0xFFFF) << 40))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[19] >> 16) | ((in[20] & 0xFF) << 48)))) & 1))^((int64(((in[19] >> 16) | ((in[20] & 0xFF) << 48))))>>1))) + out[21] + out[23] = uint64(((-((int64((in[20] >> 8))) & 1))^((int64((in[20] >> 8)))>>1))) + out[22] + out[24] = uint64(((-((int64((in[21] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[21] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[21] >> 56) | ((in[22] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[21] >> 56) | ((in[22] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[22] >> 48) | ((in[23] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[22] >> 48) | ((in[23] & 0xFFFFFFFFFF) << 16))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[23] >> 40) | ((in[24] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[23] >> 40) | ((in[24] & 0xFFFFFFFF) << 24))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[24] >> 32) | ((in[25] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[24] >> 32) | ((in[25] & 0xFFFFFF) << 32))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[25] >> 24) | ((in[26] & 0xFFFF) << 40)))) & 1))^((int64(((in[25] >> 24) | ((in[26] & 0xFFFF) << 40))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[26] >> 16) | ((in[27] & 0xFF) << 48)))) & 1))^((int64(((in[26] >> 16) | ((in[27] & 0xFF) << 48))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[27] >> 8))) & 1))^((int64((in[27] >> 8)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[28] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[28] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[28] >> 56) | ((in[29] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[28] >> 56) | ((in[29] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[29] >> 48) | ((in[30] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[29] >> 48) | ((in[30] & 0xFFFFFFFFFF) << 16))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[30] >> 40) | ((in[31] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[30] >> 40) | ((in[31] & 0xFFFFFFFF) << 24))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[31] >> 32) | ((in[32] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[31] >> 32) | ((in[32] & 0xFFFFFF) << 32))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[32] >> 24) | ((in[33] & 0xFFFF) << 40)))) & 1))^((int64(((in[32] >> 24) | ((in[33] & 0xFFFF) << 40))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[33] >> 16) | ((in[34] & 0xFF) << 48)))) & 1))^((int64(((in[33] >> 16) | ((in[34] & 0xFF) << 48))))>>1))) + out[37] + out[39] = uint64(((-((int64((in[34] >> 8))) & 1))^((int64((in[34] >> 8)))>>1))) + out[38] + out[40] = uint64(((-((int64((in[35] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[35] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[35] >> 56) | ((in[36] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[35] >> 56) | ((in[36] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[36] >> 48) | ((in[37] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[36] >> 48) | ((in[37] & 0xFFFFFFFFFF) << 16))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[37] >> 40) | ((in[38] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[37] >> 40) | ((in[38] & 0xFFFFFFFF) << 24))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[38] >> 32) | ((in[39] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[38] >> 32) | ((in[39] & 0xFFFFFF) << 32))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[39] >> 24) | ((in[40] & 0xFFFF) << 40)))) & 1))^((int64(((in[39] >> 24) | ((in[40] & 0xFFFF) << 40))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[40] >> 16) | ((in[41] & 0xFF) << 48)))) & 1))^((int64(((in[40] >> 16) | ((in[41] & 0xFF) << 48))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[41] >> 8))) & 1))^((int64((in[41] >> 8)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[42] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[42] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[42] >> 56) | ((in[43] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[42] >> 56) | ((in[43] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[43] >> 48) | ((in[44] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[43] >> 48) | ((in[44] & 0xFFFFFFFFFF) << 16))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[44] >> 40) | ((in[45] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[44] >> 40) | ((in[45] & 0xFFFFFFFF) << 24))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[45] >> 32) | ((in[46] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[45] >> 32) | ((in[46] & 0xFFFFFF) << 32))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[46] >> 24) | ((in[47] & 0xFFFF) << 40)))) & 1))^((int64(((in[46] >> 24) | ((in[47] & 0xFFFF) << 40))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[47] >> 16) | ((in[48] & 0xFF) << 48)))) & 1))^((int64(((in[47] >> 16) | ((in[48] & 0xFF) << 48))))>>1))) + out[53] + out[55] = uint64(((-((int64((in[48] >> 8))) & 1))^((int64((in[48] >> 8)))>>1))) + out[54] + out[56] = uint64(((-((int64((in[49] >> 0) & 0xFFFFFFFFFFFFFF)) & 1))^((int64((in[49] >> 0) & 0xFFFFFFFFFFFFFF))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[49] >> 56) | ((in[50] & 0xFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[49] >> 56) | ((in[50] & 0xFFFFFFFFFFFF) << 8))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[50] >> 48) | ((in[51] & 0xFFFFFFFFFF) << 16)))) & 1))^((int64(((in[50] >> 48) | ((in[51] & 0xFFFFFFFFFF) << 16))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[51] >> 40) | ((in[52] & 0xFFFFFFFF) << 24)))) & 1))^((int64(((in[51] >> 40) | ((in[52] & 0xFFFFFFFF) << 24))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[52] >> 32) | ((in[53] & 0xFFFFFF) << 32)))) & 1))^((int64(((in[52] >> 32) | ((in[53] & 0xFFFFFF) << 32))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[53] >> 24) | ((in[54] & 0xFFFF) << 40)))) & 1))^((int64(((in[53] >> 24) | ((in[54] & 0xFFFF) << 40))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[54] >> 16) | ((in[55] & 0xFF) << 48)))) & 1))^((int64(((in[54] >> 16) | ((in[55] & 0xFF) << 48))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[55] >> 8))) & 1))^((int64((in[55] >> 8)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_57(initoffset uint64, in *[57]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 57) | ((in[1] & 0x3FFFFFFFFFFFF) << 7)))) & 1))^((int64(((in[0] >> 57) | ((in[1] & 0x3FFFFFFFFFFFF) << 7))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 50) | ((in[2] & 0x7FFFFFFFFFF) << 14)))) & 1))^((int64(((in[1] >> 50) | ((in[2] & 0x7FFFFFFFFFF) << 14))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 43) | ((in[3] & 0xFFFFFFFFF) << 21)))) & 1))^((int64(((in[2] >> 43) | ((in[3] & 0xFFFFFFFFF) << 21))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 36) | ((in[4] & 0x1FFFFFFF) << 28)))) & 1))^((int64(((in[3] >> 36) | ((in[4] & 0x1FFFFFFF) << 28))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 29) | ((in[5] & 0x3FFFFF) << 35)))) & 1))^((int64(((in[4] >> 29) | ((in[5] & 0x3FFFFF) << 35))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 22) | ((in[6] & 0x7FFF) << 42)))) & 1))^((int64(((in[5] >> 22) | ((in[6] & 0x7FFF) << 42))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[6] >> 15) | ((in[7] & 0xFF) << 49)))) & 1))^((int64(((in[6] >> 15) | ((in[7] & 0xFF) << 49))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[7] >> 8) | ((in[8] & 0x1) << 56)))) & 1))^((int64(((in[7] >> 8) | ((in[8] & 0x1) << 56))))>>1))) + out[7] + out[9] = uint64(((-((int64((in[8] >> 1) & 0x1FFFFFFFFFFFFFF)) & 1))^((int64((in[8] >> 1) & 0x1FFFFFFFFFFFFFF))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[8] >> 58) | ((in[9] & 0x7FFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[8] >> 58) | ((in[9] & 0x7FFFFFFFFFFFF) << 6))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[9] >> 51) | ((in[10] & 0xFFFFFFFFFFF) << 13)))) & 1))^((int64(((in[9] >> 51) | ((in[10] & 0xFFFFFFFFFFF) << 13))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[10] >> 44) | ((in[11] & 0x1FFFFFFFFF) << 20)))) & 1))^((int64(((in[10] >> 44) | ((in[11] & 0x1FFFFFFFFF) << 20))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[11] >> 37) | ((in[12] & 0x3FFFFFFF) << 27)))) & 1))^((int64(((in[11] >> 37) | ((in[12] & 0x3FFFFFFF) << 27))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[12] >> 30) | ((in[13] & 0x7FFFFF) << 34)))) & 1))^((int64(((in[12] >> 30) | ((in[13] & 0x7FFFFF) << 34))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[13] >> 23) | ((in[14] & 0xFFFF) << 41)))) & 1))^((int64(((in[13] >> 23) | ((in[14] & 0xFFFF) << 41))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[14] >> 16) | ((in[15] & 0x1FF) << 48)))) & 1))^((int64(((in[14] >> 16) | ((in[15] & 0x1FF) << 48))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[15] >> 9) | ((in[16] & 0x3) << 55)))) & 1))^((int64(((in[15] >> 9) | ((in[16] & 0x3) << 55))))>>1))) + out[16] + out[18] = uint64(((-((int64((in[16] >> 2) & 0x1FFFFFFFFFFFFFF)) & 1))^((int64((in[16] >> 2) & 0x1FFFFFFFFFFFFFF))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[16] >> 59) | ((in[17] & 0xFFFFFFFFFFFFF) << 5)))) & 1))^((int64(((in[16] >> 59) | ((in[17] & 0xFFFFFFFFFFFFF) << 5))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[17] >> 52) | ((in[18] & 0x1FFFFFFFFFFF) << 12)))) & 1))^((int64(((in[17] >> 52) | ((in[18] & 0x1FFFFFFFFFFF) << 12))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[18] >> 45) | ((in[19] & 0x3FFFFFFFFF) << 19)))) & 1))^((int64(((in[18] >> 45) | ((in[19] & 0x3FFFFFFFFF) << 19))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[19] >> 38) | ((in[20] & 0x7FFFFFFF) << 26)))) & 1))^((int64(((in[19] >> 38) | ((in[20] & 0x7FFFFFFF) << 26))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[20] >> 31) | ((in[21] & 0xFFFFFF) << 33)))) & 1))^((int64(((in[20] >> 31) | ((in[21] & 0xFFFFFF) << 33))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[21] >> 24) | ((in[22] & 0x1FFFF) << 40)))) & 1))^((int64(((in[21] >> 24) | ((in[22] & 0x1FFFF) << 40))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[22] >> 17) | ((in[23] & 0x3FF) << 47)))) & 1))^((int64(((in[22] >> 17) | ((in[23] & 0x3FF) << 47))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[23] >> 10) | ((in[24] & 0x7) << 54)))) & 1))^((int64(((in[23] >> 10) | ((in[24] & 0x7) << 54))))>>1))) + out[25] + out[27] = uint64(((-((int64((in[24] >> 3) & 0x1FFFFFFFFFFFFFF)) & 1))^((int64((in[24] >> 3) & 0x1FFFFFFFFFFFFFF))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[24] >> 60) | ((in[25] & 0x1FFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[24] >> 60) | ((in[25] & 0x1FFFFFFFFFFFFF) << 4))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[25] >> 53) | ((in[26] & 0x3FFFFFFFFFFF) << 11)))) & 1))^((int64(((in[25] >> 53) | ((in[26] & 0x3FFFFFFFFFFF) << 11))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[26] >> 46) | ((in[27] & 0x7FFFFFFFFF) << 18)))) & 1))^((int64(((in[26] >> 46) | ((in[27] & 0x7FFFFFFFFF) << 18))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[27] >> 39) | ((in[28] & 0xFFFFFFFF) << 25)))) & 1))^((int64(((in[27] >> 39) | ((in[28] & 0xFFFFFFFF) << 25))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[28] >> 32) | ((in[29] & 0x1FFFFFF) << 32)))) & 1))^((int64(((in[28] >> 32) | ((in[29] & 0x1FFFFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[29] >> 25) | ((in[30] & 0x3FFFF) << 39)))) & 1))^((int64(((in[29] >> 25) | ((in[30] & 0x3FFFF) << 39))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[30] >> 18) | ((in[31] & 0x7FF) << 46)))) & 1))^((int64(((in[30] >> 18) | ((in[31] & 0x7FF) << 46))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[31] >> 11) | ((in[32] & 0xF) << 53)))) & 1))^((int64(((in[31] >> 11) | ((in[32] & 0xF) << 53))))>>1))) + out[34] + out[36] = uint64(((-((int64((in[32] >> 4) & 0x1FFFFFFFFFFFFFF)) & 1))^((int64((in[32] >> 4) & 0x1FFFFFFFFFFFFFF))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[32] >> 61) | ((in[33] & 0x3FFFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[32] >> 61) | ((in[33] & 0x3FFFFFFFFFFFFF) << 3))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[33] >> 54) | ((in[34] & 0x7FFFFFFFFFFF) << 10)))) & 1))^((int64(((in[33] >> 54) | ((in[34] & 0x7FFFFFFFFFFF) << 10))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[34] >> 47) | ((in[35] & 0xFFFFFFFFFF) << 17)))) & 1))^((int64(((in[34] >> 47) | ((in[35] & 0xFFFFFFFFFF) << 17))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[35] >> 40) | ((in[36] & 0x1FFFFFFFF) << 24)))) & 1))^((int64(((in[35] >> 40) | ((in[36] & 0x1FFFFFFFF) << 24))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[36] >> 33) | ((in[37] & 0x3FFFFFF) << 31)))) & 1))^((int64(((in[36] >> 33) | ((in[37] & 0x3FFFFFF) << 31))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[37] >> 26) | ((in[38] & 0x7FFFF) << 38)))) & 1))^((int64(((in[37] >> 26) | ((in[38] & 0x7FFFF) << 38))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[38] >> 19) | ((in[39] & 0xFFF) << 45)))) & 1))^((int64(((in[38] >> 19) | ((in[39] & 0xFFF) << 45))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[39] >> 12) | ((in[40] & 0x1F) << 52)))) & 1))^((int64(((in[39] >> 12) | ((in[40] & 0x1F) << 52))))>>1))) + out[43] + out[45] = uint64(((-((int64((in[40] >> 5) & 0x1FFFFFFFFFFFFFF)) & 1))^((int64((in[40] >> 5) & 0x1FFFFFFFFFFFFFF))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[40] >> 62) | ((in[41] & 0x7FFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[40] >> 62) | ((in[41] & 0x7FFFFFFFFFFFFF) << 2))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[41] >> 55) | ((in[42] & 0xFFFFFFFFFFFF) << 9)))) & 1))^((int64(((in[41] >> 55) | ((in[42] & 0xFFFFFFFFFFFF) << 9))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[42] >> 48) | ((in[43] & 0x1FFFFFFFFFF) << 16)))) & 1))^((int64(((in[42] >> 48) | ((in[43] & 0x1FFFFFFFFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[43] >> 41) | ((in[44] & 0x3FFFFFFFF) << 23)))) & 1))^((int64(((in[43] >> 41) | ((in[44] & 0x3FFFFFFFF) << 23))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[44] >> 34) | ((in[45] & 0x7FFFFFF) << 30)))) & 1))^((int64(((in[44] >> 34) | ((in[45] & 0x7FFFFFF) << 30))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[45] >> 27) | ((in[46] & 0xFFFFF) << 37)))) & 1))^((int64(((in[45] >> 27) | ((in[46] & 0xFFFFF) << 37))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[46] >> 20) | ((in[47] & 0x1FFF) << 44)))) & 1))^((int64(((in[46] >> 20) | ((in[47] & 0x1FFF) << 44))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[47] >> 13) | ((in[48] & 0x3F) << 51)))) & 1))^((int64(((in[47] >> 13) | ((in[48] & 0x3F) << 51))))>>1))) + out[52] + out[54] = uint64(((-((int64((in[48] >> 6) & 0x1FFFFFFFFFFFFFF)) & 1))^((int64((in[48] >> 6) & 0x1FFFFFFFFFFFFFF))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[48] >> 63) | ((in[49] & 0xFFFFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[48] >> 63) | ((in[49] & 0xFFFFFFFFFFFFFF) << 1))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[49] >> 56) | ((in[50] & 0x1FFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[49] >> 56) | ((in[50] & 0x1FFFFFFFFFFFF) << 8))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[50] >> 49) | ((in[51] & 0x3FFFFFFFFFF) << 15)))) & 1))^((int64(((in[50] >> 49) | ((in[51] & 0x3FFFFFFFFFF) << 15))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[51] >> 42) | ((in[52] & 0x7FFFFFFFF) << 22)))) & 1))^((int64(((in[51] >> 42) | ((in[52] & 0x7FFFFFFFF) << 22))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[52] >> 35) | ((in[53] & 0xFFFFFFF) << 29)))) & 1))^((int64(((in[52] >> 35) | ((in[53] & 0xFFFFFFF) << 29))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[53] >> 28) | ((in[54] & 0x1FFFFF) << 36)))) & 1))^((int64(((in[53] >> 28) | ((in[54] & 0x1FFFFF) << 36))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[54] >> 21) | ((in[55] & 0x3FFF) << 43)))) & 1))^((int64(((in[54] >> 21) | ((in[55] & 0x3FFF) << 43))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[55] >> 14) | ((in[56] & 0x7F) << 50)))) & 1))^((int64(((in[55] >> 14) | ((in[56] & 0x7F) << 50))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[56] >> 7))) & 1))^((int64((in[56] >> 7)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_58(initoffset uint64, in *[58]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 58) | ((in[1] & 0xFFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[0] >> 58) | ((in[1] & 0xFFFFFFFFFFFFF) << 6))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 52) | ((in[2] & 0x3FFFFFFFFFFF) << 12)))) & 1))^((int64(((in[1] >> 52) | ((in[2] & 0x3FFFFFFFFFFF) << 12))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 46) | ((in[3] & 0xFFFFFFFFFF) << 18)))) & 1))^((int64(((in[2] >> 46) | ((in[3] & 0xFFFFFFFFFF) << 18))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 40) | ((in[4] & 0x3FFFFFFFF) << 24)))) & 1))^((int64(((in[3] >> 40) | ((in[4] & 0x3FFFFFFFF) << 24))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 34) | ((in[5] & 0xFFFFFFF) << 30)))) & 1))^((int64(((in[4] >> 34) | ((in[5] & 0xFFFFFFF) << 30))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 28) | ((in[6] & 0x3FFFFF) << 36)))) & 1))^((int64(((in[5] >> 28) | ((in[6] & 0x3FFFFF) << 36))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[6] >> 22) | ((in[7] & 0xFFFF) << 42)))) & 1))^((int64(((in[6] >> 22) | ((in[7] & 0xFFFF) << 42))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[7] >> 16) | ((in[8] & 0x3FF) << 48)))) & 1))^((int64(((in[7] >> 16) | ((in[8] & 0x3FF) << 48))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[8] >> 10) | ((in[9] & 0xF) << 54)))) & 1))^((int64(((in[8] >> 10) | ((in[9] & 0xF) << 54))))>>1))) + out[8] + out[10] = uint64(((-((int64((in[9] >> 4) & 0x3FFFFFFFFFFFFFF)) & 1))^((int64((in[9] >> 4) & 0x3FFFFFFFFFFFFFF))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[9] >> 62) | ((in[10] & 0xFFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[9] >> 62) | ((in[10] & 0xFFFFFFFFFFFFFF) << 2))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[10] >> 56) | ((in[11] & 0x3FFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[10] >> 56) | ((in[11] & 0x3FFFFFFFFFFFF) << 8))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[11] >> 50) | ((in[12] & 0xFFFFFFFFFFF) << 14)))) & 1))^((int64(((in[11] >> 50) | ((in[12] & 0xFFFFFFFFFFF) << 14))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[12] >> 44) | ((in[13] & 0x3FFFFFFFFF) << 20)))) & 1))^((int64(((in[12] >> 44) | ((in[13] & 0x3FFFFFFFFF) << 20))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[13] >> 38) | ((in[14] & 0xFFFFFFFF) << 26)))) & 1))^((int64(((in[13] >> 38) | ((in[14] & 0xFFFFFFFF) << 26))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[14] >> 32) | ((in[15] & 0x3FFFFFF) << 32)))) & 1))^((int64(((in[14] >> 32) | ((in[15] & 0x3FFFFFF) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[15] >> 26) | ((in[16] & 0xFFFFF) << 38)))) & 1))^((int64(((in[15] >> 26) | ((in[16] & 0xFFFFF) << 38))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[16] >> 20) | ((in[17] & 0x3FFF) << 44)))) & 1))^((int64(((in[16] >> 20) | ((in[17] & 0x3FFF) << 44))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[17] >> 14) | ((in[18] & 0xFF) << 50)))) & 1))^((int64(((in[17] >> 14) | ((in[18] & 0xFF) << 50))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[18] >> 8) | ((in[19] & 0x3) << 56)))) & 1))^((int64(((in[18] >> 8) | ((in[19] & 0x3) << 56))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[19] >> 2) & 0x3FFFFFFFFFFFFFF)) & 1))^((int64((in[19] >> 2) & 0x3FFFFFFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[19] >> 60) | ((in[20] & 0x3FFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[19] >> 60) | ((in[20] & 0x3FFFFFFFFFFFFF) << 4))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[20] >> 54) | ((in[21] & 0xFFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[20] >> 54) | ((in[21] & 0xFFFFFFFFFFFF) << 10))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[21] >> 48) | ((in[22] & 0x3FFFFFFFFFF) << 16)))) & 1))^((int64(((in[21] >> 48) | ((in[22] & 0x3FFFFFFFFFF) << 16))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[22] >> 42) | ((in[23] & 0xFFFFFFFFF) << 22)))) & 1))^((int64(((in[22] >> 42) | ((in[23] & 0xFFFFFFFFF) << 22))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[23] >> 36) | ((in[24] & 0x3FFFFFFF) << 28)))) & 1))^((int64(((in[23] >> 36) | ((in[24] & 0x3FFFFFFF) << 28))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[24] >> 30) | ((in[25] & 0xFFFFFF) << 34)))) & 1))^((int64(((in[24] >> 30) | ((in[25] & 0xFFFFFF) << 34))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[25] >> 24) | ((in[26] & 0x3FFFF) << 40)))) & 1))^((int64(((in[25] >> 24) | ((in[26] & 0x3FFFF) << 40))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[26] >> 18) | ((in[27] & 0xFFF) << 46)))) & 1))^((int64(((in[26] >> 18) | ((in[27] & 0xFFF) << 46))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[27] >> 12) | ((in[28] & 0x3F) << 52)))) & 1))^((int64(((in[27] >> 12) | ((in[28] & 0x3F) << 52))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[28] >> 6))) & 1))^((int64((in[28] >> 6)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[29] >> 0) & 0x3FFFFFFFFFFFFFF)) & 1))^((int64((in[29] >> 0) & 0x3FFFFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[29] >> 58) | ((in[30] & 0xFFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[29] >> 58) | ((in[30] & 0xFFFFFFFFFFFFF) << 6))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[30] >> 52) | ((in[31] & 0x3FFFFFFFFFFF) << 12)))) & 1))^((int64(((in[30] >> 52) | ((in[31] & 0x3FFFFFFFFFFF) << 12))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[31] >> 46) | ((in[32] & 0xFFFFFFFFFF) << 18)))) & 1))^((int64(((in[31] >> 46) | ((in[32] & 0xFFFFFFFFFF) << 18))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[32] >> 40) | ((in[33] & 0x3FFFFFFFF) << 24)))) & 1))^((int64(((in[32] >> 40) | ((in[33] & 0x3FFFFFFFF) << 24))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[33] >> 34) | ((in[34] & 0xFFFFFFF) << 30)))) & 1))^((int64(((in[33] >> 34) | ((in[34] & 0xFFFFFFF) << 30))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[34] >> 28) | ((in[35] & 0x3FFFFF) << 36)))) & 1))^((int64(((in[34] >> 28) | ((in[35] & 0x3FFFFF) << 36))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[35] >> 22) | ((in[36] & 0xFFFF) << 42)))) & 1))^((int64(((in[35] >> 22) | ((in[36] & 0xFFFF) << 42))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[36] >> 16) | ((in[37] & 0x3FF) << 48)))) & 1))^((int64(((in[36] >> 16) | ((in[37] & 0x3FF) << 48))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[37] >> 10) | ((in[38] & 0xF) << 54)))) & 1))^((int64(((in[37] >> 10) | ((in[38] & 0xF) << 54))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[38] >> 4) & 0x3FFFFFFFFFFFFFF)) & 1))^((int64((in[38] >> 4) & 0x3FFFFFFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[38] >> 62) | ((in[39] & 0xFFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[38] >> 62) | ((in[39] & 0xFFFFFFFFFFFFFF) << 2))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[39] >> 56) | ((in[40] & 0x3FFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[39] >> 56) | ((in[40] & 0x3FFFFFFFFFFFF) << 8))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[40] >> 50) | ((in[41] & 0xFFFFFFFFFFF) << 14)))) & 1))^((int64(((in[40] >> 50) | ((in[41] & 0xFFFFFFFFFFF) << 14))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[41] >> 44) | ((in[42] & 0x3FFFFFFFFF) << 20)))) & 1))^((int64(((in[41] >> 44) | ((in[42] & 0x3FFFFFFFFF) << 20))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[42] >> 38) | ((in[43] & 0xFFFFFFFF) << 26)))) & 1))^((int64(((in[42] >> 38) | ((in[43] & 0xFFFFFFFF) << 26))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[43] >> 32) | ((in[44] & 0x3FFFFFF) << 32)))) & 1))^((int64(((in[43] >> 32) | ((in[44] & 0x3FFFFFF) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[44] >> 26) | ((in[45] & 0xFFFFF) << 38)))) & 1))^((int64(((in[44] >> 26) | ((in[45] & 0xFFFFF) << 38))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[45] >> 20) | ((in[46] & 0x3FFF) << 44)))) & 1))^((int64(((in[45] >> 20) | ((in[46] & 0x3FFF) << 44))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[46] >> 14) | ((in[47] & 0xFF) << 50)))) & 1))^((int64(((in[46] >> 14) | ((in[47] & 0xFF) << 50))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[47] >> 8) | ((in[48] & 0x3) << 56)))) & 1))^((int64(((in[47] >> 8) | ((in[48] & 0x3) << 56))))>>1))) + out[51] + out[53] = uint64(((-((int64((in[48] >> 2) & 0x3FFFFFFFFFFFFFF)) & 1))^((int64((in[48] >> 2) & 0x3FFFFFFFFFFFFFF))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[48] >> 60) | ((in[49] & 0x3FFFFFFFFFFFFF) << 4))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[49] >> 54) | ((in[50] & 0xFFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[49] >> 54) | ((in[50] & 0xFFFFFFFFFFFF) << 10))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[50] >> 48) | ((in[51] & 0x3FFFFFFFFFF) << 16)))) & 1))^((int64(((in[50] >> 48) | ((in[51] & 0x3FFFFFFFFFF) << 16))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[51] >> 42) | ((in[52] & 0xFFFFFFFFF) << 22)))) & 1))^((int64(((in[51] >> 42) | ((in[52] & 0xFFFFFFFFF) << 22))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[52] >> 36) | ((in[53] & 0x3FFFFFFF) << 28)))) & 1))^((int64(((in[52] >> 36) | ((in[53] & 0x3FFFFFFF) << 28))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[53] >> 30) | ((in[54] & 0xFFFFFF) << 34)))) & 1))^((int64(((in[53] >> 30) | ((in[54] & 0xFFFFFF) << 34))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[54] >> 24) | ((in[55] & 0x3FFFF) << 40)))) & 1))^((int64(((in[54] >> 24) | ((in[55] & 0x3FFFF) << 40))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[55] >> 18) | ((in[56] & 0xFFF) << 46)))) & 1))^((int64(((in[55] >> 18) | ((in[56] & 0xFFF) << 46))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[56] >> 12) | ((in[57] & 0x3F) << 52)))) & 1))^((int64(((in[56] >> 12) | ((in[57] & 0x3F) << 52))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[57] >> 6))) & 1))^((int64((in[57] >> 6)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_59(initoffset uint64, in *[59]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 59) | ((in[1] & 0x3FFFFFFFFFFFFF) << 5)))) & 1))^((int64(((in[0] >> 59) | ((in[1] & 0x3FFFFFFFFFFFFF) << 5))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 54) | ((in[2] & 0x1FFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[1] >> 54) | ((in[2] & 0x1FFFFFFFFFFFF) << 10))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 49) | ((in[3] & 0xFFFFFFFFFFF) << 15)))) & 1))^((int64(((in[2] >> 49) | ((in[3] & 0xFFFFFFFFFFF) << 15))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 44) | ((in[4] & 0x7FFFFFFFFF) << 20)))) & 1))^((int64(((in[3] >> 44) | ((in[4] & 0x7FFFFFFFFF) << 20))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 39) | ((in[5] & 0x3FFFFFFFF) << 25)))) & 1))^((int64(((in[4] >> 39) | ((in[5] & 0x3FFFFFFFF) << 25))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 34) | ((in[6] & 0x1FFFFFFF) << 30)))) & 1))^((int64(((in[5] >> 34) | ((in[6] & 0x1FFFFFFF) << 30))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[6] >> 29) | ((in[7] & 0xFFFFFF) << 35)))) & 1))^((int64(((in[6] >> 29) | ((in[7] & 0xFFFFFF) << 35))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[7] >> 24) | ((in[8] & 0x7FFFF) << 40)))) & 1))^((int64(((in[7] >> 24) | ((in[8] & 0x7FFFF) << 40))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[8] >> 19) | ((in[9] & 0x3FFF) << 45)))) & 1))^((int64(((in[8] >> 19) | ((in[9] & 0x3FFF) << 45))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[9] >> 14) | ((in[10] & 0x1FF) << 50)))) & 1))^((int64(((in[9] >> 14) | ((in[10] & 0x1FF) << 50))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[10] >> 9) | ((in[11] & 0xF) << 55)))) & 1))^((int64(((in[10] >> 9) | ((in[11] & 0xF) << 55))))>>1))) + out[10] + out[12] = uint64(((-((int64((in[11] >> 4) & 0x7FFFFFFFFFFFFFF)) & 1))^((int64((in[11] >> 4) & 0x7FFFFFFFFFFFFFF))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[11] >> 63) | ((in[12] & 0x3FFFFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[11] >> 63) | ((in[12] & 0x3FFFFFFFFFFFFFF) << 1))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[12] >> 58) | ((in[13] & 0x1FFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[12] >> 58) | ((in[13] & 0x1FFFFFFFFFFFFF) << 6))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[13] >> 53) | ((in[14] & 0xFFFFFFFFFFFF) << 11)))) & 1))^((int64(((in[13] >> 53) | ((in[14] & 0xFFFFFFFFFFFF) << 11))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[14] >> 48) | ((in[15] & 0x7FFFFFFFFFF) << 16)))) & 1))^((int64(((in[14] >> 48) | ((in[15] & 0x7FFFFFFFFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[15] >> 43) | ((in[16] & 0x3FFFFFFFFF) << 21)))) & 1))^((int64(((in[15] >> 43) | ((in[16] & 0x3FFFFFFFFF) << 21))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[16] >> 38) | ((in[17] & 0x1FFFFFFFF) << 26)))) & 1))^((int64(((in[16] >> 38) | ((in[17] & 0x1FFFFFFFF) << 26))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[17] >> 33) | ((in[18] & 0xFFFFFFF) << 31)))) & 1))^((int64(((in[17] >> 33) | ((in[18] & 0xFFFFFFF) << 31))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[18] >> 28) | ((in[19] & 0x7FFFFF) << 36)))) & 1))^((int64(((in[18] >> 28) | ((in[19] & 0x7FFFFF) << 36))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[19] >> 23) | ((in[20] & 0x3FFFF) << 41)))) & 1))^((int64(((in[19] >> 23) | ((in[20] & 0x3FFFF) << 41))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[20] >> 18) | ((in[21] & 0x1FFF) << 46)))) & 1))^((int64(((in[20] >> 18) | ((in[21] & 0x1FFF) << 46))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[21] >> 13) | ((in[22] & 0xFF) << 51)))) & 1))^((int64(((in[21] >> 13) | ((in[22] & 0xFF) << 51))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[22] >> 8) | ((in[23] & 0x7) << 56)))) & 1))^((int64(((in[22] >> 8) | ((in[23] & 0x7) << 56))))>>1))) + out[23] + out[25] = uint64(((-((int64((in[23] >> 3) & 0x7FFFFFFFFFFFFFF)) & 1))^((int64((in[23] >> 3) & 0x7FFFFFFFFFFFFFF))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[23] >> 62) | ((in[24] & 0x1FFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[23] >> 62) | ((in[24] & 0x1FFFFFFFFFFFFFF) << 2))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[24] >> 57) | ((in[25] & 0xFFFFFFFFFFFFF) << 7)))) & 1))^((int64(((in[24] >> 57) | ((in[25] & 0xFFFFFFFFFFFFF) << 7))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[25] >> 52) | ((in[26] & 0x7FFFFFFFFFFF) << 12)))) & 1))^((int64(((in[25] >> 52) | ((in[26] & 0x7FFFFFFFFFFF) << 12))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[26] >> 47) | ((in[27] & 0x3FFFFFFFFFF) << 17)))) & 1))^((int64(((in[26] >> 47) | ((in[27] & 0x3FFFFFFFFFF) << 17))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[27] >> 42) | ((in[28] & 0x1FFFFFFFFF) << 22)))) & 1))^((int64(((in[27] >> 42) | ((in[28] & 0x1FFFFFFFFF) << 22))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[28] >> 37) | ((in[29] & 0xFFFFFFFF) << 27)))) & 1))^((int64(((in[28] >> 37) | ((in[29] & 0xFFFFFFFF) << 27))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[29] >> 32) | ((in[30] & 0x7FFFFFF) << 32)))) & 1))^((int64(((in[29] >> 32) | ((in[30] & 0x7FFFFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[30] >> 27) | ((in[31] & 0x3FFFFF) << 37)))) & 1))^((int64(((in[30] >> 27) | ((in[31] & 0x3FFFFF) << 37))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[31] >> 22) | ((in[32] & 0x1FFFF) << 42)))) & 1))^((int64(((in[31] >> 22) | ((in[32] & 0x1FFFF) << 42))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[32] >> 17) | ((in[33] & 0xFFF) << 47)))) & 1))^((int64(((in[32] >> 17) | ((in[33] & 0xFFF) << 47))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[33] >> 12) | ((in[34] & 0x7F) << 52)))) & 1))^((int64(((in[33] >> 12) | ((in[34] & 0x7F) << 52))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[34] >> 7) | ((in[35] & 0x3) << 57)))) & 1))^((int64(((in[34] >> 7) | ((in[35] & 0x3) << 57))))>>1))) + out[36] + out[38] = uint64(((-((int64((in[35] >> 2) & 0x7FFFFFFFFFFFFFF)) & 1))^((int64((in[35] >> 2) & 0x7FFFFFFFFFFFFFF))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[35] >> 61) | ((in[36] & 0xFFFFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[35] >> 61) | ((in[36] & 0xFFFFFFFFFFFFFF) << 3))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[36] >> 56) | ((in[37] & 0x7FFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[36] >> 56) | ((in[37] & 0x7FFFFFFFFFFFF) << 8))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[37] >> 51) | ((in[38] & 0x3FFFFFFFFFFF) << 13)))) & 1))^((int64(((in[37] >> 51) | ((in[38] & 0x3FFFFFFFFFFF) << 13))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[38] >> 46) | ((in[39] & 0x1FFFFFFFFFF) << 18)))) & 1))^((int64(((in[38] >> 46) | ((in[39] & 0x1FFFFFFFFFF) << 18))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[39] >> 41) | ((in[40] & 0xFFFFFFFFF) << 23)))) & 1))^((int64(((in[39] >> 41) | ((in[40] & 0xFFFFFFFFF) << 23))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[40] >> 36) | ((in[41] & 0x7FFFFFFF) << 28)))) & 1))^((int64(((in[40] >> 36) | ((in[41] & 0x7FFFFFFF) << 28))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[41] >> 31) | ((in[42] & 0x3FFFFFF) << 33)))) & 1))^((int64(((in[41] >> 31) | ((in[42] & 0x3FFFFFF) << 33))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[42] >> 26) | ((in[43] & 0x1FFFFF) << 38)))) & 1))^((int64(((in[42] >> 26) | ((in[43] & 0x1FFFFF) << 38))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[43] >> 21) | ((in[44] & 0xFFFF) << 43)))) & 1))^((int64(((in[43] >> 21) | ((in[44] & 0xFFFF) << 43))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[44] >> 16) | ((in[45] & 0x7FF) << 48)))) & 1))^((int64(((in[44] >> 16) | ((in[45] & 0x7FF) << 48))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[45] >> 11) | ((in[46] & 0x3F) << 53)))) & 1))^((int64(((in[45] >> 11) | ((in[46] & 0x3F) << 53))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[46] >> 6) | ((in[47] & 0x1) << 58)))) & 1))^((int64(((in[46] >> 6) | ((in[47] & 0x1) << 58))))>>1))) + out[49] + out[51] = uint64(((-((int64((in[47] >> 1) & 0x7FFFFFFFFFFFFFF)) & 1))^((int64((in[47] >> 1) & 0x7FFFFFFFFFFFFFF))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[47] >> 60) | ((in[48] & 0x7FFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[47] >> 60) | ((in[48] & 0x7FFFFFFFFFFFFF) << 4))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[48] >> 55) | ((in[49] & 0x3FFFFFFFFFFFF) << 9)))) & 1))^((int64(((in[48] >> 55) | ((in[49] & 0x3FFFFFFFFFFFF) << 9))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[49] >> 50) | ((in[50] & 0x1FFFFFFFFFFF) << 14)))) & 1))^((int64(((in[49] >> 50) | ((in[50] & 0x1FFFFFFFFFFF) << 14))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[50] >> 45) | ((in[51] & 0xFFFFFFFFFF) << 19)))) & 1))^((int64(((in[50] >> 45) | ((in[51] & 0xFFFFFFFFFF) << 19))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[51] >> 40) | ((in[52] & 0x7FFFFFFFF) << 24)))) & 1))^((int64(((in[51] >> 40) | ((in[52] & 0x7FFFFFFFF) << 24))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[52] >> 35) | ((in[53] & 0x3FFFFFFF) << 29)))) & 1))^((int64(((in[52] >> 35) | ((in[53] & 0x3FFFFFFF) << 29))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[53] >> 30) | ((in[54] & 0x1FFFFFF) << 34)))) & 1))^((int64(((in[53] >> 30) | ((in[54] & 0x1FFFFFF) << 34))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[54] >> 25) | ((in[55] & 0xFFFFF) << 39)))) & 1))^((int64(((in[54] >> 25) | ((in[55] & 0xFFFFF) << 39))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[55] >> 20) | ((in[56] & 0x7FFF) << 44)))) & 1))^((int64(((in[55] >> 20) | ((in[56] & 0x7FFF) << 44))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[56] >> 15) | ((in[57] & 0x3FF) << 49)))) & 1))^((int64(((in[56] >> 15) | ((in[57] & 0x3FF) << 49))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[57] >> 10) | ((in[58] & 0x1F) << 54)))) & 1))^((int64(((in[57] >> 10) | ((in[58] & 0x1F) << 54))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[58] >> 5))) & 1))^((int64((in[58] >> 5)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_60(initoffset uint64, in *[60]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0xFFFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0xFFFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 60) | ((in[1] & 0xFFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[0] >> 60) | ((in[1] & 0xFFFFFFFFFFFFFF) << 4))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 56) | ((in[2] & 0xFFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[1] >> 56) | ((in[2] & 0xFFFFFFFFFFFFF) << 8))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 52) | ((in[3] & 0xFFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[2] >> 52) | ((in[3] & 0xFFFFFFFFFFFF) << 12))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 48) | ((in[4] & 0xFFFFFFFFFFF) << 16)))) & 1))^((int64(((in[3] >> 48) | ((in[4] & 0xFFFFFFFFFFF) << 16))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 44) | ((in[5] & 0xFFFFFFFFFF) << 20)))) & 1))^((int64(((in[4] >> 44) | ((in[5] & 0xFFFFFFFFFF) << 20))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 40) | ((in[6] & 0xFFFFFFFFF) << 24)))) & 1))^((int64(((in[5] >> 40) | ((in[6] & 0xFFFFFFFFF) << 24))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[6] >> 36) | ((in[7] & 0xFFFFFFFF) << 28)))) & 1))^((int64(((in[6] >> 36) | ((in[7] & 0xFFFFFFFF) << 28))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[7] >> 32) | ((in[8] & 0xFFFFFFF) << 32)))) & 1))^((int64(((in[7] >> 32) | ((in[8] & 0xFFFFFFF) << 32))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[8] >> 28) | ((in[9] & 0xFFFFFF) << 36)))) & 1))^((int64(((in[8] >> 28) | ((in[9] & 0xFFFFFF) << 36))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[9] >> 24) | ((in[10] & 0xFFFFF) << 40)))) & 1))^((int64(((in[9] >> 24) | ((in[10] & 0xFFFFF) << 40))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[10] >> 20) | ((in[11] & 0xFFFF) << 44)))) & 1))^((int64(((in[10] >> 20) | ((in[11] & 0xFFFF) << 44))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[11] >> 16) | ((in[12] & 0xFFF) << 48)))) & 1))^((int64(((in[11] >> 16) | ((in[12] & 0xFFF) << 48))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[12] >> 12) | ((in[13] & 0xFF) << 52)))) & 1))^((int64(((in[12] >> 12) | ((in[13] & 0xFF) << 52))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[13] >> 8) | ((in[14] & 0xF) << 56)))) & 1))^((int64(((in[13] >> 8) | ((in[14] & 0xF) << 56))))>>1))) + out[13] + out[15] = uint64(((-((int64((in[14] >> 4))) & 1))^((int64((in[14] >> 4)))>>1))) + out[14] + out[16] = uint64(((-((int64((in[15] >> 0) & 0xFFFFFFFFFFFFFFF)) & 1))^((int64((in[15] >> 0) & 0xFFFFFFFFFFFFFFF))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[15] >> 60) | ((in[16] & 0xFFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[15] >> 60) | ((in[16] & 0xFFFFFFFFFFFFFF) << 4))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[16] >> 56) | ((in[17] & 0xFFFFFFFFFFFFF) << 8))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[17] >> 52) | ((in[18] & 0xFFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[17] >> 52) | ((in[18] & 0xFFFFFFFFFFFF) << 12))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[18] >> 48) | ((in[19] & 0xFFFFFFFFFFF) << 16)))) & 1))^((int64(((in[18] >> 48) | ((in[19] & 0xFFFFFFFFFFF) << 16))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0xFFFFFFFFFF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0xFFFFFFFFFF) << 20))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[20] >> 40) | ((in[21] & 0xFFFFFFFFF) << 24)))) & 1))^((int64(((in[20] >> 40) | ((in[21] & 0xFFFFFFFFF) << 24))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[21] >> 36) | ((in[22] & 0xFFFFFFFF) << 28)))) & 1))^((int64(((in[21] >> 36) | ((in[22] & 0xFFFFFFFF) << 28))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[22] >> 32) | ((in[23] & 0xFFFFFFF) << 32)))) & 1))^((int64(((in[22] >> 32) | ((in[23] & 0xFFFFFFF) << 32))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[23] >> 28) | ((in[24] & 0xFFFFFF) << 36)))) & 1))^((int64(((in[23] >> 28) | ((in[24] & 0xFFFFFF) << 36))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[24] >> 24) | ((in[25] & 0xFFFFF) << 40)))) & 1))^((int64(((in[24] >> 24) | ((in[25] & 0xFFFFF) << 40))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[25] >> 20) | ((in[26] & 0xFFFF) << 44)))) & 1))^((int64(((in[25] >> 20) | ((in[26] & 0xFFFF) << 44))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[26] >> 16) | ((in[27] & 0xFFF) << 48)))) & 1))^((int64(((in[26] >> 16) | ((in[27] & 0xFFF) << 48))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[27] >> 12) | ((in[28] & 0xFF) << 52)))) & 1))^((int64(((in[27] >> 12) | ((in[28] & 0xFF) << 52))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[28] >> 8) | ((in[29] & 0xF) << 56)))) & 1))^((int64(((in[28] >> 8) | ((in[29] & 0xF) << 56))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[29] >> 4))) & 1))^((int64((in[29] >> 4)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[30] >> 0) & 0xFFFFFFFFFFFFFFF)) & 1))^((int64((in[30] >> 0) & 0xFFFFFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[30] >> 60) | ((in[31] & 0xFFFFFFFFFFFFFF) << 4))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[31] >> 56) | ((in[32] & 0xFFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[31] >> 56) | ((in[32] & 0xFFFFFFFFFFFFF) << 8))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[32] >> 52) | ((in[33] & 0xFFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[32] >> 52) | ((in[33] & 0xFFFFFFFFFFFF) << 12))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[33] >> 48) | ((in[34] & 0xFFFFFFFFFFF) << 16)))) & 1))^((int64(((in[33] >> 48) | ((in[34] & 0xFFFFFFFFFFF) << 16))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[34] >> 44) | ((in[35] & 0xFFFFFFFFFF) << 20)))) & 1))^((int64(((in[34] >> 44) | ((in[35] & 0xFFFFFFFFFF) << 20))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[35] >> 40) | ((in[36] & 0xFFFFFFFFF) << 24)))) & 1))^((int64(((in[35] >> 40) | ((in[36] & 0xFFFFFFFFF) << 24))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[36] >> 36) | ((in[37] & 0xFFFFFFFF) << 28)))) & 1))^((int64(((in[36] >> 36) | ((in[37] & 0xFFFFFFFF) << 28))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[37] >> 32) | ((in[38] & 0xFFFFFFF) << 32)))) & 1))^((int64(((in[37] >> 32) | ((in[38] & 0xFFFFFFF) << 32))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[38] >> 28) | ((in[39] & 0xFFFFFF) << 36)))) & 1))^((int64(((in[38] >> 28) | ((in[39] & 0xFFFFFF) << 36))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[39] >> 24) | ((in[40] & 0xFFFFF) << 40)))) & 1))^((int64(((in[39] >> 24) | ((in[40] & 0xFFFFF) << 40))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[40] >> 20) | ((in[41] & 0xFFFF) << 44)))) & 1))^((int64(((in[40] >> 20) | ((in[41] & 0xFFFF) << 44))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[41] >> 16) | ((in[42] & 0xFFF) << 48)))) & 1))^((int64(((in[41] >> 16) | ((in[42] & 0xFFF) << 48))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[42] >> 12) | ((in[43] & 0xFF) << 52)))) & 1))^((int64(((in[42] >> 12) | ((in[43] & 0xFF) << 52))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[43] >> 8) | ((in[44] & 0xF) << 56)))) & 1))^((int64(((in[43] >> 8) | ((in[44] & 0xF) << 56))))>>1))) + out[45] + out[47] = uint64(((-((int64((in[44] >> 4))) & 1))^((int64((in[44] >> 4)))>>1))) + out[46] + out[48] = uint64(((-((int64((in[45] >> 0) & 0xFFFFFFFFFFFFFFF)) & 1))^((int64((in[45] >> 0) & 0xFFFFFFFFFFFFFFF))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[45] >> 60) | ((in[46] & 0xFFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[45] >> 60) | ((in[46] & 0xFFFFFFFFFFFFFF) << 4))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[46] >> 56) | ((in[47] & 0xFFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[46] >> 56) | ((in[47] & 0xFFFFFFFFFFFFF) << 8))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[47] >> 52) | ((in[48] & 0xFFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[47] >> 52) | ((in[48] & 0xFFFFFFFFFFFF) << 12))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[48] >> 48) | ((in[49] & 0xFFFFFFFFFFF) << 16)))) & 1))^((int64(((in[48] >> 48) | ((in[49] & 0xFFFFFFFFFFF) << 16))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[49] >> 44) | ((in[50] & 0xFFFFFFFFFF) << 20)))) & 1))^((int64(((in[49] >> 44) | ((in[50] & 0xFFFFFFFFFF) << 20))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[50] >> 40) | ((in[51] & 0xFFFFFFFFF) << 24)))) & 1))^((int64(((in[50] >> 40) | ((in[51] & 0xFFFFFFFFF) << 24))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[51] >> 36) | ((in[52] & 0xFFFFFFFF) << 28)))) & 1))^((int64(((in[51] >> 36) | ((in[52] & 0xFFFFFFFF) << 28))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[52] >> 32) | ((in[53] & 0xFFFFFFF) << 32)))) & 1))^((int64(((in[52] >> 32) | ((in[53] & 0xFFFFFFF) << 32))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[53] >> 28) | ((in[54] & 0xFFFFFF) << 36)))) & 1))^((int64(((in[53] >> 28) | ((in[54] & 0xFFFFFF) << 36))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[54] >> 24) | ((in[55] & 0xFFFFF) << 40)))) & 1))^((int64(((in[54] >> 24) | ((in[55] & 0xFFFFF) << 40))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[55] >> 20) | ((in[56] & 0xFFFF) << 44)))) & 1))^((int64(((in[55] >> 20) | ((in[56] & 0xFFFF) << 44))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[56] >> 16) | ((in[57] & 0xFFF) << 48)))) & 1))^((int64(((in[56] >> 16) | ((in[57] & 0xFFF) << 48))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[57] >> 12) | ((in[58] & 0xFF) << 52)))) & 1))^((int64(((in[57] >> 12) | ((in[58] & 0xFF) << 52))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[58] >> 8) | ((in[59] & 0xF) << 56)))) & 1))^((int64(((in[58] >> 8) | ((in[59] & 0xF) << 56))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[59] >> 4))) & 1))^((int64((in[59] >> 4)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_61(initoffset uint64, in *[61]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x1FFFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x1FFFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 61) | ((in[1] & 0x3FFFFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[0] >> 61) | ((in[1] & 0x3FFFFFFFFFFFFFF) << 3))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 58) | ((in[2] & 0x7FFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[1] >> 58) | ((in[2] & 0x7FFFFFFFFFFFFF) << 6))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 55) | ((in[3] & 0xFFFFFFFFFFFFF) << 9)))) & 1))^((int64(((in[2] >> 55) | ((in[3] & 0xFFFFFFFFFFFFF) << 9))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 52) | ((in[4] & 0x1FFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[3] >> 52) | ((in[4] & 0x1FFFFFFFFFFFF) << 12))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 49) | ((in[5] & 0x3FFFFFFFFFFF) << 15)))) & 1))^((int64(((in[4] >> 49) | ((in[5] & 0x3FFFFFFFFFFF) << 15))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 46) | ((in[6] & 0x7FFFFFFFFFF) << 18)))) & 1))^((int64(((in[5] >> 46) | ((in[6] & 0x7FFFFFFFFFF) << 18))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[6] >> 43) | ((in[7] & 0xFFFFFFFFFF) << 21)))) & 1))^((int64(((in[6] >> 43) | ((in[7] & 0xFFFFFFFFFF) << 21))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[7] >> 40) | ((in[8] & 0x1FFFFFFFFF) << 24)))) & 1))^((int64(((in[7] >> 40) | ((in[8] & 0x1FFFFFFFFF) << 24))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[8] >> 37) | ((in[9] & 0x3FFFFFFFF) << 27)))) & 1))^((int64(((in[8] >> 37) | ((in[9] & 0x3FFFFFFFF) << 27))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[9] >> 34) | ((in[10] & 0x7FFFFFFF) << 30)))) & 1))^((int64(((in[9] >> 34) | ((in[10] & 0x7FFFFFFF) << 30))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[10] >> 31) | ((in[11] & 0xFFFFFFF) << 33)))) & 1))^((int64(((in[10] >> 31) | ((in[11] & 0xFFFFFFF) << 33))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[11] >> 28) | ((in[12] & 0x1FFFFFF) << 36)))) & 1))^((int64(((in[11] >> 28) | ((in[12] & 0x1FFFFFF) << 36))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[12] >> 25) | ((in[13] & 0x3FFFFF) << 39)))) & 1))^((int64(((in[12] >> 25) | ((in[13] & 0x3FFFFF) << 39))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[13] >> 22) | ((in[14] & 0x7FFFF) << 42)))) & 1))^((int64(((in[13] >> 22) | ((in[14] & 0x7FFFF) << 42))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[14] >> 19) | ((in[15] & 0xFFFF) << 45)))) & 1))^((int64(((in[14] >> 19) | ((in[15] & 0xFFFF) << 45))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[15] >> 16) | ((in[16] & 0x1FFF) << 48)))) & 1))^((int64(((in[15] >> 16) | ((in[16] & 0x1FFF) << 48))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[16] >> 13) | ((in[17] & 0x3FF) << 51)))) & 1))^((int64(((in[16] >> 13) | ((in[17] & 0x3FF) << 51))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[17] >> 10) | ((in[18] & 0x7F) << 54)))) & 1))^((int64(((in[17] >> 10) | ((in[18] & 0x7F) << 54))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[18] >> 7) | ((in[19] & 0xF) << 57)))) & 1))^((int64(((in[18] >> 7) | ((in[19] & 0xF) << 57))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[19] >> 4) | ((in[20] & 0x1) << 60)))) & 1))^((int64(((in[19] >> 4) | ((in[20] & 0x1) << 60))))>>1))) + out[19] + out[21] = uint64(((-((int64((in[20] >> 1) & 0x1FFFFFFFFFFFFFFF)) & 1))^((int64((in[20] >> 1) & 0x1FFFFFFFFFFFFFFF))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[20] >> 62) | ((in[21] & 0x7FFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[20] >> 62) | ((in[21] & 0x7FFFFFFFFFFFFFF) << 2))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[21] >> 59) | ((in[22] & 0xFFFFFFFFFFFFFF) << 5)))) & 1))^((int64(((in[21] >> 59) | ((in[22] & 0xFFFFFFFFFFFFFF) << 5))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[22] >> 56) | ((in[23] & 0x1FFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[22] >> 56) | ((in[23] & 0x1FFFFFFFFFFFFF) << 8))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[23] >> 53) | ((in[24] & 0x3FFFFFFFFFFFF) << 11)))) & 1))^((int64(((in[23] >> 53) | ((in[24] & 0x3FFFFFFFFFFFF) << 11))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[24] >> 50) | ((in[25] & 0x7FFFFFFFFFFF) << 14)))) & 1))^((int64(((in[24] >> 50) | ((in[25] & 0x7FFFFFFFFFFF) << 14))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[25] >> 47) | ((in[26] & 0xFFFFFFFFFFF) << 17)))) & 1))^((int64(((in[25] >> 47) | ((in[26] & 0xFFFFFFFFFFF) << 17))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[26] >> 44) | ((in[27] & 0x1FFFFFFFFFF) << 20)))) & 1))^((int64(((in[26] >> 44) | ((in[27] & 0x1FFFFFFFFFF) << 20))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[27] >> 41) | ((in[28] & 0x3FFFFFFFFF) << 23)))) & 1))^((int64(((in[27] >> 41) | ((in[28] & 0x3FFFFFFFFF) << 23))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[28] >> 38) | ((in[29] & 0x7FFFFFFFF) << 26)))) & 1))^((int64(((in[28] >> 38) | ((in[29] & 0x7FFFFFFFF) << 26))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[29] >> 35) | ((in[30] & 0xFFFFFFFF) << 29)))) & 1))^((int64(((in[29] >> 35) | ((in[30] & 0xFFFFFFFF) << 29))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[30] >> 32) | ((in[31] & 0x1FFFFFFF) << 32)))) & 1))^((int64(((in[30] >> 32) | ((in[31] & 0x1FFFFFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[31] >> 29) | ((in[32] & 0x3FFFFFF) << 35)))) & 1))^((int64(((in[31] >> 29) | ((in[32] & 0x3FFFFFF) << 35))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[32] >> 26) | ((in[33] & 0x7FFFFF) << 38)))) & 1))^((int64(((in[32] >> 26) | ((in[33] & 0x7FFFFF) << 38))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[33] >> 23) | ((in[34] & 0xFFFFF) << 41)))) & 1))^((int64(((in[33] >> 23) | ((in[34] & 0xFFFFF) << 41))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[34] >> 20) | ((in[35] & 0x1FFFF) << 44)))) & 1))^((int64(((in[34] >> 20) | ((in[35] & 0x1FFFF) << 44))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[35] >> 17) | ((in[36] & 0x3FFF) << 47)))) & 1))^((int64(((in[35] >> 17) | ((in[36] & 0x3FFF) << 47))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[36] >> 14) | ((in[37] & 0x7FF) << 50)))) & 1))^((int64(((in[36] >> 14) | ((in[37] & 0x7FF) << 50))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[37] >> 11) | ((in[38] & 0xFF) << 53)))) & 1))^((int64(((in[37] >> 11) | ((in[38] & 0xFF) << 53))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[38] >> 8) | ((in[39] & 0x1F) << 56)))) & 1))^((int64(((in[38] >> 8) | ((in[39] & 0x1F) << 56))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[39] >> 5) | ((in[40] & 0x3) << 59)))) & 1))^((int64(((in[39] >> 5) | ((in[40] & 0x3) << 59))))>>1))) + out[40] + out[42] = uint64(((-((int64((in[40] >> 2) & 0x1FFFFFFFFFFFFFFF)) & 1))^((int64((in[40] >> 2) & 0x1FFFFFFFFFFFFFFF))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[40] >> 63) | ((in[41] & 0xFFFFFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[40] >> 63) | ((in[41] & 0xFFFFFFFFFFFFFFF) << 1))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[41] >> 60) | ((in[42] & 0x1FFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[41] >> 60) | ((in[42] & 0x1FFFFFFFFFFFFFF) << 4))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFFFFFF) << 7)))) & 1))^((int64(((in[42] >> 57) | ((in[43] & 0x3FFFFFFFFFFFFF) << 7))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[43] >> 54) | ((in[44] & 0x7FFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[43] >> 54) | ((in[44] & 0x7FFFFFFFFFFFF) << 10))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[44] >> 51) | ((in[45] & 0xFFFFFFFFFFFF) << 13)))) & 1))^((int64(((in[44] >> 51) | ((in[45] & 0xFFFFFFFFFFFF) << 13))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[45] >> 48) | ((in[46] & 0x1FFFFFFFFFFF) << 16)))) & 1))^((int64(((in[45] >> 48) | ((in[46] & 0x1FFFFFFFFFFF) << 16))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[46] >> 45) | ((in[47] & 0x3FFFFFFFFFF) << 19)))) & 1))^((int64(((in[46] >> 45) | ((in[47] & 0x3FFFFFFFFFF) << 19))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[47] >> 42) | ((in[48] & 0x7FFFFFFFFF) << 22)))) & 1))^((int64(((in[47] >> 42) | ((in[48] & 0x7FFFFFFFFF) << 22))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[48] >> 39) | ((in[49] & 0xFFFFFFFFF) << 25)))) & 1))^((int64(((in[48] >> 39) | ((in[49] & 0xFFFFFFFFF) << 25))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[49] >> 36) | ((in[50] & 0x1FFFFFFFF) << 28)))) & 1))^((int64(((in[49] >> 36) | ((in[50] & 0x1FFFFFFFF) << 28))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[50] >> 33) | ((in[51] & 0x3FFFFFFF) << 31)))) & 1))^((int64(((in[50] >> 33) | ((in[51] & 0x3FFFFFFF) << 31))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[51] >> 30) | ((in[52] & 0x7FFFFFF) << 34)))) & 1))^((int64(((in[51] >> 30) | ((in[52] & 0x7FFFFFF) << 34))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[52] >> 27) | ((in[53] & 0xFFFFFF) << 37)))) & 1))^((int64(((in[52] >> 27) | ((in[53] & 0xFFFFFF) << 37))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[53] >> 24) | ((in[54] & 0x1FFFFF) << 40)))) & 1))^((int64(((in[53] >> 24) | ((in[54] & 0x1FFFFF) << 40))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[54] >> 21) | ((in[55] & 0x3FFFF) << 43)))) & 1))^((int64(((in[54] >> 21) | ((in[55] & 0x3FFFF) << 43))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[55] >> 18) | ((in[56] & 0x7FFF) << 46)))) & 1))^((int64(((in[55] >> 18) | ((in[56] & 0x7FFF) << 46))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[56] >> 15) | ((in[57] & 0xFFF) << 49)))) & 1))^((int64(((in[56] >> 15) | ((in[57] & 0xFFF) << 49))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[57] >> 12) | ((in[58] & 0x1FF) << 52)))) & 1))^((int64(((in[57] >> 12) | ((in[58] & 0x1FF) << 52))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[58] >> 9) | ((in[59] & 0x3F) << 55)))) & 1))^((int64(((in[58] >> 9) | ((in[59] & 0x3F) << 55))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[59] >> 6) | ((in[60] & 0x7) << 58)))) & 1))^((int64(((in[59] >> 6) | ((in[60] & 0x7) << 58))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[60] >> 3))) & 1))^((int64((in[60] >> 3)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_62(initoffset uint64, in *[62]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x3FFFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x3FFFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 62) | ((in[1] & 0xFFFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[0] >> 62) | ((in[1] & 0xFFFFFFFFFFFFFFF) << 2))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 60) | ((in[2] & 0x3FFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[1] >> 60) | ((in[2] & 0x3FFFFFFFFFFFFFF) << 4))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 58) | ((in[3] & 0xFFFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[2] >> 58) | ((in[3] & 0xFFFFFFFFFFFFFF) << 6))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 56) | ((in[4] & 0x3FFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[3] >> 56) | ((in[4] & 0x3FFFFFFFFFFFFF) << 8))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 54) | ((in[5] & 0xFFFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[4] >> 54) | ((in[5] & 0xFFFFFFFFFFFFF) << 10))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 52) | ((in[6] & 0x3FFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[5] >> 52) | ((in[6] & 0x3FFFFFFFFFFFF) << 12))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[6] >> 50) | ((in[7] & 0xFFFFFFFFFFFF) << 14)))) & 1))^((int64(((in[6] >> 50) | ((in[7] & 0xFFFFFFFFFFFF) << 14))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[7] >> 48) | ((in[8] & 0x3FFFFFFFFFFF) << 16)))) & 1))^((int64(((in[7] >> 48) | ((in[8] & 0x3FFFFFFFFFFF) << 16))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[8] >> 46) | ((in[9] & 0xFFFFFFFFFFF) << 18)))) & 1))^((int64(((in[8] >> 46) | ((in[9] & 0xFFFFFFFFFFF) << 18))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[9] >> 44) | ((in[10] & 0x3FFFFFFFFFF) << 20)))) & 1))^((int64(((in[9] >> 44) | ((in[10] & 0x3FFFFFFFFFF) << 20))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[10] >> 42) | ((in[11] & 0xFFFFFFFFFF) << 22)))) & 1))^((int64(((in[10] >> 42) | ((in[11] & 0xFFFFFFFFFF) << 22))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[11] >> 40) | ((in[12] & 0x3FFFFFFFFF) << 24)))) & 1))^((int64(((in[11] >> 40) | ((in[12] & 0x3FFFFFFFFF) << 24))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[12] >> 38) | ((in[13] & 0xFFFFFFFFF) << 26)))) & 1))^((int64(((in[12] >> 38) | ((in[13] & 0xFFFFFFFFF) << 26))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[13] >> 36) | ((in[14] & 0x3FFFFFFFF) << 28)))) & 1))^((int64(((in[13] >> 36) | ((in[14] & 0x3FFFFFFFF) << 28))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[14] >> 34) | ((in[15] & 0xFFFFFFFF) << 30)))) & 1))^((int64(((in[14] >> 34) | ((in[15] & 0xFFFFFFFF) << 30))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[15] >> 32) | ((in[16] & 0x3FFFFFFF) << 32)))) & 1))^((int64(((in[15] >> 32) | ((in[16] & 0x3FFFFFFF) << 32))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[16] >> 30) | ((in[17] & 0xFFFFFFF) << 34)))) & 1))^((int64(((in[16] >> 30) | ((in[17] & 0xFFFFFFF) << 34))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[17] >> 28) | ((in[18] & 0x3FFFFFF) << 36)))) & 1))^((int64(((in[17] >> 28) | ((in[18] & 0x3FFFFFF) << 36))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[18] >> 26) | ((in[19] & 0xFFFFFF) << 38)))) & 1))^((int64(((in[18] >> 26) | ((in[19] & 0xFFFFFF) << 38))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[19] >> 24) | ((in[20] & 0x3FFFFF) << 40)))) & 1))^((int64(((in[19] >> 24) | ((in[20] & 0x3FFFFF) << 40))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[20] >> 22) | ((in[21] & 0xFFFFF) << 42)))) & 1))^((int64(((in[20] >> 22) | ((in[21] & 0xFFFFF) << 42))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[21] >> 20) | ((in[22] & 0x3FFFF) << 44)))) & 1))^((int64(((in[21] >> 20) | ((in[22] & 0x3FFFF) << 44))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[22] >> 18) | ((in[23] & 0xFFFF) << 46)))) & 1))^((int64(((in[22] >> 18) | ((in[23] & 0xFFFF) << 46))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[23] >> 16) | ((in[24] & 0x3FFF) << 48)))) & 1))^((int64(((in[23] >> 16) | ((in[24] & 0x3FFF) << 48))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[24] >> 14) | ((in[25] & 0xFFF) << 50)))) & 1))^((int64(((in[24] >> 14) | ((in[25] & 0xFFF) << 50))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[25] >> 12) | ((in[26] & 0x3FF) << 52)))) & 1))^((int64(((in[25] >> 12) | ((in[26] & 0x3FF) << 52))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[26] >> 10) | ((in[27] & 0xFF) << 54)))) & 1))^((int64(((in[26] >> 10) | ((in[27] & 0xFF) << 54))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[27] >> 8) | ((in[28] & 0x3F) << 56)))) & 1))^((int64(((in[27] >> 8) | ((in[28] & 0x3F) << 56))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[28] >> 6) | ((in[29] & 0xF) << 58)))) & 1))^((int64(((in[28] >> 6) | ((in[29] & 0xF) << 58))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[29] >> 4) | ((in[30] & 0x3) << 60)))) & 1))^((int64(((in[29] >> 4) | ((in[30] & 0x3) << 60))))>>1))) + out[29] + out[31] = uint64(((-((int64((in[30] >> 2))) & 1))^((int64((in[30] >> 2)))>>1))) + out[30] + out[32] = uint64(((-((int64((in[31] >> 0) & 0x3FFFFFFFFFFFFFFF)) & 1))^((int64((in[31] >> 0) & 0x3FFFFFFFFFFFFFFF))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[31] >> 62) | ((in[32] & 0xFFFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[31] >> 62) | ((in[32] & 0xFFFFFFFFFFFFFFF) << 2))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[32] >> 60) | ((in[33] & 0x3FFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[32] >> 60) | ((in[33] & 0x3FFFFFFFFFFFFFF) << 4))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[33] >> 58) | ((in[34] & 0xFFFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[33] >> 58) | ((in[34] & 0xFFFFFFFFFFFFFF) << 6))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[34] >> 56) | ((in[35] & 0x3FFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[34] >> 56) | ((in[35] & 0x3FFFFFFFFFFFFF) << 8))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[35] >> 54) | ((in[36] & 0xFFFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[35] >> 54) | ((in[36] & 0xFFFFFFFFFFFFF) << 10))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[36] >> 52) | ((in[37] & 0x3FFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[36] >> 52) | ((in[37] & 0x3FFFFFFFFFFFF) << 12))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[37] >> 50) | ((in[38] & 0xFFFFFFFFFFFF) << 14)))) & 1))^((int64(((in[37] >> 50) | ((in[38] & 0xFFFFFFFFFFFF) << 14))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[38] >> 48) | ((in[39] & 0x3FFFFFFFFFFF) << 16)))) & 1))^((int64(((in[38] >> 48) | ((in[39] & 0x3FFFFFFFFFFF) << 16))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[39] >> 46) | ((in[40] & 0xFFFFFFFFFFF) << 18)))) & 1))^((int64(((in[39] >> 46) | ((in[40] & 0xFFFFFFFFFFF) << 18))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[40] >> 44) | ((in[41] & 0x3FFFFFFFFFF) << 20)))) & 1))^((int64(((in[40] >> 44) | ((in[41] & 0x3FFFFFFFFFF) << 20))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[41] >> 42) | ((in[42] & 0xFFFFFFFFFF) << 22)))) & 1))^((int64(((in[41] >> 42) | ((in[42] & 0xFFFFFFFFFF) << 22))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[42] >> 40) | ((in[43] & 0x3FFFFFFFFF) << 24)))) & 1))^((int64(((in[42] >> 40) | ((in[43] & 0x3FFFFFFFFF) << 24))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[43] >> 38) | ((in[44] & 0xFFFFFFFFF) << 26)))) & 1))^((int64(((in[43] >> 38) | ((in[44] & 0xFFFFFFFFF) << 26))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[44] >> 36) | ((in[45] & 0x3FFFFFFFF) << 28)))) & 1))^((int64(((in[44] >> 36) | ((in[45] & 0x3FFFFFFFF) << 28))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[45] >> 34) | ((in[46] & 0xFFFFFFFF) << 30)))) & 1))^((int64(((in[45] >> 34) | ((in[46] & 0xFFFFFFFF) << 30))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[46] >> 32) | ((in[47] & 0x3FFFFFFF) << 32)))) & 1))^((int64(((in[46] >> 32) | ((in[47] & 0x3FFFFFFF) << 32))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[47] >> 30) | ((in[48] & 0xFFFFFFF) << 34)))) & 1))^((int64(((in[47] >> 30) | ((in[48] & 0xFFFFFFF) << 34))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[48] >> 28) | ((in[49] & 0x3FFFFFF) << 36)))) & 1))^((int64(((in[48] >> 28) | ((in[49] & 0x3FFFFFF) << 36))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[49] >> 26) | ((in[50] & 0xFFFFFF) << 38)))) & 1))^((int64(((in[49] >> 26) | ((in[50] & 0xFFFFFF) << 38))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[50] >> 24) | ((in[51] & 0x3FFFFF) << 40)))) & 1))^((int64(((in[50] >> 24) | ((in[51] & 0x3FFFFF) << 40))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[51] >> 22) | ((in[52] & 0xFFFFF) << 42)))) & 1))^((int64(((in[51] >> 22) | ((in[52] & 0xFFFFF) << 42))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[52] >> 20) | ((in[53] & 0x3FFFF) << 44)))) & 1))^((int64(((in[52] >> 20) | ((in[53] & 0x3FFFF) << 44))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[53] >> 18) | ((in[54] & 0xFFFF) << 46)))) & 1))^((int64(((in[53] >> 18) | ((in[54] & 0xFFFF) << 46))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[54] >> 16) | ((in[55] & 0x3FFF) << 48)))) & 1))^((int64(((in[54] >> 16) | ((in[55] & 0x3FFF) << 48))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[55] >> 14) | ((in[56] & 0xFFF) << 50)))) & 1))^((int64(((in[55] >> 14) | ((in[56] & 0xFFF) << 50))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[56] >> 12) | ((in[57] & 0x3FF) << 52)))) & 1))^((int64(((in[56] >> 12) | ((in[57] & 0x3FF) << 52))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[57] >> 10) | ((in[58] & 0xFF) << 54)))) & 1))^((int64(((in[57] >> 10) | ((in[58] & 0xFF) << 54))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[58] >> 8) | ((in[59] & 0x3F) << 56)))) & 1))^((int64(((in[58] >> 8) | ((in[59] & 0x3F) << 56))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[59] >> 6) | ((in[60] & 0xF) << 58)))) & 1))^((int64(((in[59] >> 6) | ((in[60] & 0xF) << 58))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[60] >> 4) | ((in[61] & 0x3) << 60)))) & 1))^((int64(((in[60] >> 4) | ((in[61] & 0x3) << 60))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[61] >> 2))) & 1))^((int64((in[61] >> 2)))>>1))) + out[62] +} + +func deltaunpackzigzag_uint64_63(initoffset uint64, in *[63]uint64, out *[64]uint64) { + out[0] = uint64(((-((int64((in[0] >> 0) & 0x7FFFFFFFFFFFFFFF)) & 1))^((int64((in[0] >> 0) & 0x7FFFFFFFFFFFFFFF))>>1))) + initoffset + out[1] = uint64(((-((int64(((in[0] >> 63) | ((in[1] & 0x3FFFFFFFFFFFFFFF) << 1)))) & 1))^((int64(((in[0] >> 63) | ((in[1] & 0x3FFFFFFFFFFFFFFF) << 1))))>>1))) + out[0] + out[2] = uint64(((-((int64(((in[1] >> 62) | ((in[2] & 0x1FFFFFFFFFFFFFFF) << 2)))) & 1))^((int64(((in[1] >> 62) | ((in[2] & 0x1FFFFFFFFFFFFFFF) << 2))))>>1))) + out[1] + out[3] = uint64(((-((int64(((in[2] >> 61) | ((in[3] & 0xFFFFFFFFFFFFFFF) << 3)))) & 1))^((int64(((in[2] >> 61) | ((in[3] & 0xFFFFFFFFFFFFFFF) << 3))))>>1))) + out[2] + out[4] = uint64(((-((int64(((in[3] >> 60) | ((in[4] & 0x7FFFFFFFFFFFFFF) << 4)))) & 1))^((int64(((in[3] >> 60) | ((in[4] & 0x7FFFFFFFFFFFFFF) << 4))))>>1))) + out[3] + out[5] = uint64(((-((int64(((in[4] >> 59) | ((in[5] & 0x3FFFFFFFFFFFFFF) << 5)))) & 1))^((int64(((in[4] >> 59) | ((in[5] & 0x3FFFFFFFFFFFFFF) << 5))))>>1))) + out[4] + out[6] = uint64(((-((int64(((in[5] >> 58) | ((in[6] & 0x1FFFFFFFFFFFFFF) << 6)))) & 1))^((int64(((in[5] >> 58) | ((in[6] & 0x1FFFFFFFFFFFFFF) << 6))))>>1))) + out[5] + out[7] = uint64(((-((int64(((in[6] >> 57) | ((in[7] & 0xFFFFFFFFFFFFFF) << 7)))) & 1))^((int64(((in[6] >> 57) | ((in[7] & 0xFFFFFFFFFFFFFF) << 7))))>>1))) + out[6] + out[8] = uint64(((-((int64(((in[7] >> 56) | ((in[8] & 0x7FFFFFFFFFFFFF) << 8)))) & 1))^((int64(((in[7] >> 56) | ((in[8] & 0x7FFFFFFFFFFFFF) << 8))))>>1))) + out[7] + out[9] = uint64(((-((int64(((in[8] >> 55) | ((in[9] & 0x3FFFFFFFFFFFFF) << 9)))) & 1))^((int64(((in[8] >> 55) | ((in[9] & 0x3FFFFFFFFFFFFF) << 9))))>>1))) + out[8] + out[10] = uint64(((-((int64(((in[9] >> 54) | ((in[10] & 0x1FFFFFFFFFFFFF) << 10)))) & 1))^((int64(((in[9] >> 54) | ((in[10] & 0x1FFFFFFFFFFFFF) << 10))))>>1))) + out[9] + out[11] = uint64(((-((int64(((in[10] >> 53) | ((in[11] & 0xFFFFFFFFFFFFF) << 11)))) & 1))^((int64(((in[10] >> 53) | ((in[11] & 0xFFFFFFFFFFFFF) << 11))))>>1))) + out[10] + out[12] = uint64(((-((int64(((in[11] >> 52) | ((in[12] & 0x7FFFFFFFFFFFF) << 12)))) & 1))^((int64(((in[11] >> 52) | ((in[12] & 0x7FFFFFFFFFFFF) << 12))))>>1))) + out[11] + out[13] = uint64(((-((int64(((in[12] >> 51) | ((in[13] & 0x3FFFFFFFFFFFF) << 13)))) & 1))^((int64(((in[12] >> 51) | ((in[13] & 0x3FFFFFFFFFFFF) << 13))))>>1))) + out[12] + out[14] = uint64(((-((int64(((in[13] >> 50) | ((in[14] & 0x1FFFFFFFFFFFF) << 14)))) & 1))^((int64(((in[13] >> 50) | ((in[14] & 0x1FFFFFFFFFFFF) << 14))))>>1))) + out[13] + out[15] = uint64(((-((int64(((in[14] >> 49) | ((in[15] & 0xFFFFFFFFFFFF) << 15)))) & 1))^((int64(((in[14] >> 49) | ((in[15] & 0xFFFFFFFFFFFF) << 15))))>>1))) + out[14] + out[16] = uint64(((-((int64(((in[15] >> 48) | ((in[16] & 0x7FFFFFFFFFFF) << 16)))) & 1))^((int64(((in[15] >> 48) | ((in[16] & 0x7FFFFFFFFFFF) << 16))))>>1))) + out[15] + out[17] = uint64(((-((int64(((in[16] >> 47) | ((in[17] & 0x3FFFFFFFFFFF) << 17)))) & 1))^((int64(((in[16] >> 47) | ((in[17] & 0x3FFFFFFFFFFF) << 17))))>>1))) + out[16] + out[18] = uint64(((-((int64(((in[17] >> 46) | ((in[18] & 0x1FFFFFFFFFFF) << 18)))) & 1))^((int64(((in[17] >> 46) | ((in[18] & 0x1FFFFFFFFFFF) << 18))))>>1))) + out[17] + out[19] = uint64(((-((int64(((in[18] >> 45) | ((in[19] & 0xFFFFFFFFFFF) << 19)))) & 1))^((int64(((in[18] >> 45) | ((in[19] & 0xFFFFFFFFFFF) << 19))))>>1))) + out[18] + out[20] = uint64(((-((int64(((in[19] >> 44) | ((in[20] & 0x7FFFFFFFFFF) << 20)))) & 1))^((int64(((in[19] >> 44) | ((in[20] & 0x7FFFFFFFFFF) << 20))))>>1))) + out[19] + out[21] = uint64(((-((int64(((in[20] >> 43) | ((in[21] & 0x3FFFFFFFFFF) << 21)))) & 1))^((int64(((in[20] >> 43) | ((in[21] & 0x3FFFFFFFFFF) << 21))))>>1))) + out[20] + out[22] = uint64(((-((int64(((in[21] >> 42) | ((in[22] & 0x1FFFFFFFFFF) << 22)))) & 1))^((int64(((in[21] >> 42) | ((in[22] & 0x1FFFFFFFFFF) << 22))))>>1))) + out[21] + out[23] = uint64(((-((int64(((in[22] >> 41) | ((in[23] & 0xFFFFFFFFFF) << 23)))) & 1))^((int64(((in[22] >> 41) | ((in[23] & 0xFFFFFFFFFF) << 23))))>>1))) + out[22] + out[24] = uint64(((-((int64(((in[23] >> 40) | ((in[24] & 0x7FFFFFFFFF) << 24)))) & 1))^((int64(((in[23] >> 40) | ((in[24] & 0x7FFFFFFFFF) << 24))))>>1))) + out[23] + out[25] = uint64(((-((int64(((in[24] >> 39) | ((in[25] & 0x3FFFFFFFFF) << 25)))) & 1))^((int64(((in[24] >> 39) | ((in[25] & 0x3FFFFFFFFF) << 25))))>>1))) + out[24] + out[26] = uint64(((-((int64(((in[25] >> 38) | ((in[26] & 0x1FFFFFFFFF) << 26)))) & 1))^((int64(((in[25] >> 38) | ((in[26] & 0x1FFFFFFFFF) << 26))))>>1))) + out[25] + out[27] = uint64(((-((int64(((in[26] >> 37) | ((in[27] & 0xFFFFFFFFF) << 27)))) & 1))^((int64(((in[26] >> 37) | ((in[27] & 0xFFFFFFFFF) << 27))))>>1))) + out[26] + out[28] = uint64(((-((int64(((in[27] >> 36) | ((in[28] & 0x7FFFFFFFF) << 28)))) & 1))^((int64(((in[27] >> 36) | ((in[28] & 0x7FFFFFFFF) << 28))))>>1))) + out[27] + out[29] = uint64(((-((int64(((in[28] >> 35) | ((in[29] & 0x3FFFFFFFF) << 29)))) & 1))^((int64(((in[28] >> 35) | ((in[29] & 0x3FFFFFFFF) << 29))))>>1))) + out[28] + out[30] = uint64(((-((int64(((in[29] >> 34) | ((in[30] & 0x1FFFFFFFF) << 30)))) & 1))^((int64(((in[29] >> 34) | ((in[30] & 0x1FFFFFFFF) << 30))))>>1))) + out[29] + out[31] = uint64(((-((int64(((in[30] >> 33) | ((in[31] & 0xFFFFFFFF) << 31)))) & 1))^((int64(((in[30] >> 33) | ((in[31] & 0xFFFFFFFF) << 31))))>>1))) + out[30] + out[32] = uint64(((-((int64(((in[31] >> 32) | ((in[32] & 0x7FFFFFFF) << 32)))) & 1))^((int64(((in[31] >> 32) | ((in[32] & 0x7FFFFFFF) << 32))))>>1))) + out[31] + out[33] = uint64(((-((int64(((in[32] >> 31) | ((in[33] & 0x3FFFFFFF) << 33)))) & 1))^((int64(((in[32] >> 31) | ((in[33] & 0x3FFFFFFF) << 33))))>>1))) + out[32] + out[34] = uint64(((-((int64(((in[33] >> 30) | ((in[34] & 0x1FFFFFFF) << 34)))) & 1))^((int64(((in[33] >> 30) | ((in[34] & 0x1FFFFFFF) << 34))))>>1))) + out[33] + out[35] = uint64(((-((int64(((in[34] >> 29) | ((in[35] & 0xFFFFFFF) << 35)))) & 1))^((int64(((in[34] >> 29) | ((in[35] & 0xFFFFFFF) << 35))))>>1))) + out[34] + out[36] = uint64(((-((int64(((in[35] >> 28) | ((in[36] & 0x7FFFFFF) << 36)))) & 1))^((int64(((in[35] >> 28) | ((in[36] & 0x7FFFFFF) << 36))))>>1))) + out[35] + out[37] = uint64(((-((int64(((in[36] >> 27) | ((in[37] & 0x3FFFFFF) << 37)))) & 1))^((int64(((in[36] >> 27) | ((in[37] & 0x3FFFFFF) << 37))))>>1))) + out[36] + out[38] = uint64(((-((int64(((in[37] >> 26) | ((in[38] & 0x1FFFFFF) << 38)))) & 1))^((int64(((in[37] >> 26) | ((in[38] & 0x1FFFFFF) << 38))))>>1))) + out[37] + out[39] = uint64(((-((int64(((in[38] >> 25) | ((in[39] & 0xFFFFFF) << 39)))) & 1))^((int64(((in[38] >> 25) | ((in[39] & 0xFFFFFF) << 39))))>>1))) + out[38] + out[40] = uint64(((-((int64(((in[39] >> 24) | ((in[40] & 0x7FFFFF) << 40)))) & 1))^((int64(((in[39] >> 24) | ((in[40] & 0x7FFFFF) << 40))))>>1))) + out[39] + out[41] = uint64(((-((int64(((in[40] >> 23) | ((in[41] & 0x3FFFFF) << 41)))) & 1))^((int64(((in[40] >> 23) | ((in[41] & 0x3FFFFF) << 41))))>>1))) + out[40] + out[42] = uint64(((-((int64(((in[41] >> 22) | ((in[42] & 0x1FFFFF) << 42)))) & 1))^((int64(((in[41] >> 22) | ((in[42] & 0x1FFFFF) << 42))))>>1))) + out[41] + out[43] = uint64(((-((int64(((in[42] >> 21) | ((in[43] & 0xFFFFF) << 43)))) & 1))^((int64(((in[42] >> 21) | ((in[43] & 0xFFFFF) << 43))))>>1))) + out[42] + out[44] = uint64(((-((int64(((in[43] >> 20) | ((in[44] & 0x7FFFF) << 44)))) & 1))^((int64(((in[43] >> 20) | ((in[44] & 0x7FFFF) << 44))))>>1))) + out[43] + out[45] = uint64(((-((int64(((in[44] >> 19) | ((in[45] & 0x3FFFF) << 45)))) & 1))^((int64(((in[44] >> 19) | ((in[45] & 0x3FFFF) << 45))))>>1))) + out[44] + out[46] = uint64(((-((int64(((in[45] >> 18) | ((in[46] & 0x1FFFF) << 46)))) & 1))^((int64(((in[45] >> 18) | ((in[46] & 0x1FFFF) << 46))))>>1))) + out[45] + out[47] = uint64(((-((int64(((in[46] >> 17) | ((in[47] & 0xFFFF) << 47)))) & 1))^((int64(((in[46] >> 17) | ((in[47] & 0xFFFF) << 47))))>>1))) + out[46] + out[48] = uint64(((-((int64(((in[47] >> 16) | ((in[48] & 0x7FFF) << 48)))) & 1))^((int64(((in[47] >> 16) | ((in[48] & 0x7FFF) << 48))))>>1))) + out[47] + out[49] = uint64(((-((int64(((in[48] >> 15) | ((in[49] & 0x3FFF) << 49)))) & 1))^((int64(((in[48] >> 15) | ((in[49] & 0x3FFF) << 49))))>>1))) + out[48] + out[50] = uint64(((-((int64(((in[49] >> 14) | ((in[50] & 0x1FFF) << 50)))) & 1))^((int64(((in[49] >> 14) | ((in[50] & 0x1FFF) << 50))))>>1))) + out[49] + out[51] = uint64(((-((int64(((in[50] >> 13) | ((in[51] & 0xFFF) << 51)))) & 1))^((int64(((in[50] >> 13) | ((in[51] & 0xFFF) << 51))))>>1))) + out[50] + out[52] = uint64(((-((int64(((in[51] >> 12) | ((in[52] & 0x7FF) << 52)))) & 1))^((int64(((in[51] >> 12) | ((in[52] & 0x7FF) << 52))))>>1))) + out[51] + out[53] = uint64(((-((int64(((in[52] >> 11) | ((in[53] & 0x3FF) << 53)))) & 1))^((int64(((in[52] >> 11) | ((in[53] & 0x3FF) << 53))))>>1))) + out[52] + out[54] = uint64(((-((int64(((in[53] >> 10) | ((in[54] & 0x1FF) << 54)))) & 1))^((int64(((in[53] >> 10) | ((in[54] & 0x1FF) << 54))))>>1))) + out[53] + out[55] = uint64(((-((int64(((in[54] >> 9) | ((in[55] & 0xFF) << 55)))) & 1))^((int64(((in[54] >> 9) | ((in[55] & 0xFF) << 55))))>>1))) + out[54] + out[56] = uint64(((-((int64(((in[55] >> 8) | ((in[56] & 0x7F) << 56)))) & 1))^((int64(((in[55] >> 8) | ((in[56] & 0x7F) << 56))))>>1))) + out[55] + out[57] = uint64(((-((int64(((in[56] >> 7) | ((in[57] & 0x3F) << 57)))) & 1))^((int64(((in[56] >> 7) | ((in[57] & 0x3F) << 57))))>>1))) + out[56] + out[58] = uint64(((-((int64(((in[57] >> 6) | ((in[58] & 0x1F) << 58)))) & 1))^((int64(((in[57] >> 6) | ((in[58] & 0x1F) << 58))))>>1))) + out[57] + out[59] = uint64(((-((int64(((in[58] >> 5) | ((in[59] & 0xF) << 59)))) & 1))^((int64(((in[58] >> 5) | ((in[59] & 0xF) << 59))))>>1))) + out[58] + out[60] = uint64(((-((int64(((in[59] >> 4) | ((in[60] & 0x7) << 60)))) & 1))^((int64(((in[59] >> 4) | ((in[60] & 0x7) << 60))))>>1))) + out[59] + out[61] = uint64(((-((int64(((in[60] >> 3) | ((in[61] & 0x3) << 61)))) & 1))^((int64(((in[60] >> 3) | ((in[61] & 0x3) << 61))))>>1))) + out[60] + out[62] = uint64(((-((int64(((in[61] >> 2) | ((in[62] & 0x1) << 62)))) & 1))^((int64(((in[61] >> 2) | ((in[62] & 0x1) << 62))))>>1))) + out[61] + out[63] = uint64(((-((int64((in[62] >> 1))) & 1))^((int64((in[62] >> 1)))>>1))) + out[62] +} diff --git a/galoisd/vendor/modules.txt b/galoisd/vendor/modules.txt index fbd747f01d..c24e7a9328 100644 --- a/galoisd/vendor/modules.txt +++ b/galoisd/vendor/modules.txt @@ -204,8 +204,8 @@ github.com/cometbft/cometbft-db # github.com/consensys/bavard v0.1.13 ## explicit; go 1.15 github.com/consensys/bavard -# github.com/consensys/gnark v0.7.2-0.20230418172633-f83323bdf138 => github.com/consensys/gnark v0.9.2-0.20240312175655-ce0186ef32c1 -## explicit; go 1.20 +# github.com/consensys/gnark v0.7.2-0.20230418172633-f83323bdf138 => github.com/unionlabs/gnark v0.0.0-20240723153903-9d859afe4c14 +## explicit; go 1.21 github.com/consensys/gnark github.com/consensys/gnark/backend github.com/consensys/gnark/backend/groth16 @@ -215,6 +215,7 @@ github.com/consensys/gnark/backend/groth16/bls24-315 github.com/consensys/gnark/backend/groth16/bls24-317 github.com/consensys/gnark/backend/groth16/bn254 github.com/consensys/gnark/backend/groth16/bn254/icicle +github.com/consensys/gnark/backend/groth16/bn254/mpcsetup github.com/consensys/gnark/backend/groth16/bw6-633 github.com/consensys/gnark/backend/groth16/bw6-761 github.com/consensys/gnark/backend/groth16/internal @@ -227,6 +228,7 @@ github.com/consensys/gnark/backend/plonk/bn254 github.com/consensys/gnark/backend/plonk/bw6-633 github.com/consensys/gnark/backend/plonk/bw6-761 github.com/consensys/gnark/backend/plonk/internal +github.com/consensys/gnark/backend/solidity github.com/consensys/gnark/backend/witness github.com/consensys/gnark/constraint github.com/consensys/gnark/constraint/bls12-377 @@ -269,6 +271,7 @@ github.com/consensys/gnark/std/internal/logderivarg github.com/consensys/gnark/std/internal/logderivprecomp github.com/consensys/gnark/std/math/bits github.com/consensys/gnark/std/math/bitslice +github.com/consensys/gnark/std/math/cmp github.com/consensys/gnark/std/math/emulated github.com/consensys/gnark/std/math/emulated/emparams github.com/consensys/gnark/std/math/uints @@ -279,7 +282,7 @@ github.com/consensys/gnark/std/selector github.com/consensys/gnark/std/utils/algo_utils github.com/consensys/gnark/test github.com/consensys/gnark/test/unsafekzg -# github.com/consensys/gnark-crypto v0.12.2-0.20240215234832-d72fcb379d3e => github.com/unionlabs/gnark-crypto v0.0.0-20240112093739-635c1b6963c6 +# github.com/consensys/gnark-crypto v0.12.2-0.20240703135258-5d8b5fab1afb => github.com/unionlabs/gnark-crypto v0.0.0-20240720201413-c0383b2a80e9 ## explicit; go 1.19 github.com/consensys/gnark-crypto/ecc github.com/consensys/gnark-crypto/ecc/bls12-377 @@ -398,6 +401,7 @@ github.com/consensys/gnark-crypto/internal/parallel github.com/consensys/gnark-crypto/kzg github.com/consensys/gnark-crypto/signature github.com/consensys/gnark-crypto/utils +github.com/consensys/gnark-crypto/utils/unsafe # github.com/cosmos/btcutil v1.0.5 ## explicit; go 1.19 github.com/cosmos/btcutil/bech32 @@ -663,6 +667,9 @@ github.com/prometheus/procfs/internal/util # github.com/rogpeppe/go-internal v1.11.0 ## explicit; go 1.19 github.com/rogpeppe/go-internal/fmtsort +# github.com/ronanh/intcomp v1.1.0 +## explicit; go 1.19 +github.com/ronanh/intcomp # github.com/rs/zerolog v1.33.0 ## explicit; go 1.15 github.com/rs/zerolog @@ -873,7 +880,7 @@ rsc.io/tmplfunc/internal/parse sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 # github.com/cometbft/cometbft => github.com/unionlabs/cometbls v0.0.0-20240310221349-e2d54edc212b -# github.com/consensys/gnark => github.com/consensys/gnark v0.9.2-0.20240312175655-ce0186ef32c1 -# github.com/consensys/gnark-crypto => github.com/unionlabs/gnark-crypto v0.0.0-20240112093739-635c1b6963c6 +# github.com/consensys/gnark => github.com/unionlabs/gnark v0.0.0-20240723153903-9d859afe4c14 +# github.com/consensys/gnark-crypto => github.com/unionlabs/gnark-crypto v0.0.0-20240720201413-c0383b2a80e9 # github.com/cosmos/cosmos-sdk => github.com/unionlabs/cosmos-sdk v0.0.0-20240206230727-9973b232e832 # github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.4.11 From 9f0cd3d4bcc6fe90586214c5013b2d702bc33b48 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 26 Jul 2024 17:04:16 +0200 Subject: [PATCH 02/48] feat(mpc): initial shot --- Cargo.lock | 2645 +++++++++++------ Cargo.toml | 5 + flake.nix | 4 +- .../galoisd/cmd/phase1_init.go} | 158 +- galoisd/cmd/galoisd/cmd/phase2_contribute.go | 26 + galoisd/cmd/galoisd/cmd/phase2_extract.go | 50 + galoisd/cmd/galoisd/cmd/phase2_init.go | 38 + galoisd/cmd/galoisd/cmd/phase2_verify.go | 30 + galoisd/cmd/galoisd/cmd/utils.go | 31 + galoisd/cmd/galoisd/lib.go | 83 + galoisd/cmd/galoisd/main.go | 10 + galoisd/galoisd.nix | 23 + .../lightclient/nonadjacent/circuit_test.go | 381 ++- mpc/client/Cargo.toml | 17 + mpc/client/src/main.rs | 263 ++ mpc/coordinator/Cargo.toml | 16 + mpc/coordinator/src/fsm.rs | 22 + mpc/coordinator/src/main.rs | 404 +++ mpc/mpc.nix | 31 + mpc/shared/Cargo.toml | 8 + mpc/shared/src/lib.rs | 88 + mpc/shared/src/types.rs | 8 + tools/rust/rust.nix | 12 +- 23 files changed, 3329 insertions(+), 1024 deletions(-) rename galoisd/{pkg/lightclient/nonadjacent/ptau.go => cmd/galoisd/cmd/phase1_init.go} (80%) create mode 100644 galoisd/cmd/galoisd/cmd/phase2_contribute.go create mode 100644 galoisd/cmd/galoisd/cmd/phase2_extract.go create mode 100644 galoisd/cmd/galoisd/cmd/phase2_init.go create mode 100644 galoisd/cmd/galoisd/cmd/phase2_verify.go create mode 100644 galoisd/cmd/galoisd/cmd/utils.go create mode 100644 galoisd/cmd/galoisd/lib.go create mode 100644 mpc/client/Cargo.toml create mode 100644 mpc/client/src/main.rs create mode 100644 mpc/coordinator/Cargo.toml create mode 100644 mpc/coordinator/src/fsm.rs create mode 100644 mpc/coordinator/src/main.rs create mode 100644 mpc/mpc.nix create mode 100644 mpc/shared/Cargo.toml create mode 100644 mpc/shared/src/lib.rs create mode 100644 mpc/shared/src/types.rs diff --git a/Cargo.lock b/Cargo.lock index fe1cc091eb..bf89afc646 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,6 +48,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aead" version = "0.5.2" @@ -80,7 +86,7 @@ dependencies = [ "cipher", "ctr", "ghash", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -89,7 +95,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -101,7 +107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -124,9 +130,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" @@ -155,12 +161,12 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.24" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ff94ce0f141c2671c23d02c7b88990dd432856639595c5d010663d017c2c58" +checksum = "b68b94c159bcc2ca5f758b8663d7b00fc7c5e40569984595ddf2221b0f7f7f6e" dependencies = [ "num_enum", - "strum 0.26.2", + "strum 0.26.3", ] [[package]] @@ -223,7 +229,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.5", + "winnow 0.6.18", ] [[package]] @@ -236,7 +242,7 @@ dependencies = [ "alloy-rlp", "alloy-serde", "c-kzg", - "derive_more 0.99.17", + "derive_more 0.99.18", "once_cell", "serde", "sha2 0.10.8", @@ -308,7 +314,7 @@ dependencies = [ "bytes", "cfg-if 1.0.0", "const-hex", - "derive_more 0.99.17", + "derive_more 0.99.18", "hex-literal", "itoa", "k256", @@ -345,9 +351,9 @@ dependencies = [ "dashmap", "futures", "futures-utils-wasm", - "lru 0.12.3", + "lru 0.12.4", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", "tokio", @@ -376,20 +382,20 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bytes", ] [[package]] name = "alloy-rlp-derive" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", @@ -411,7 +417,7 @@ dependencies = [ "alloy-transport-ws", "futures", "pin-project", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", "tokio", @@ -533,7 +539,7 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "proc-macro-error", "proc-macro2", "quote", @@ -566,7 +572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ "serde", - "winnow 0.6.5", + "winnow 0.6.18", ] [[package]] @@ -609,7 +615,7 @@ checksum = "86d65871f9f1cafe1ed25cde2f1303be83e6473e995a2d56c275ae4fcce6119c" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde_json", "tower", "tracing", @@ -645,7 +651,7 @@ dependencies = [ "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.7", + "rustls 0.23.13", "serde_json", "tokio", "tokio-tungstenite 0.23.1", @@ -684,47 +690,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -732,9 +739,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "aptos-aggregator" @@ -948,7 +955,7 @@ dependencies = [ "blake2-rfc", "bulletproofs", "byteorder", - "clap 4.5.4", + "clap 4.5.17", "codespan-reporting", "curve25519-dalek-ng", "either", @@ -1137,7 +1144,7 @@ dependencies = [ "anyhow", "aptos-types", "bcs 0.1.4", - "clap 4.5.4", + "clap 4.5.17", "heck 0.4.1", "move-core-types", "once_cell", @@ -1223,7 +1230,7 @@ dependencies = [ "bytes", "fixed", "fxhash", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "itertools 0.13.0", "jsonwebtoken 8.3.0", @@ -1305,6 +1312,20 @@ dependencies = [ "serde", ] +[[package]] +name = "aquamarine" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" +dependencies = [ + "include_dir 0.7.4", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "arbitrary" version = "1.3.2" @@ -1319,14 +1340,14 @@ version = "0.1.0" dependencies = [ "arbitrum-verifier", "base64 0.21.7", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethereum-light-client", "ethereum-verifier", "ethers-core", "hex", "ics008-wasm-client", "protos", - "rlp", + "rlp 0.5.2", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -1346,7 +1367,7 @@ dependencies = [ "ethers-core", "hex", "hex-literal", - "rlp", + "rlp 0.5.2", "serde", "serde-utils", "serde_json", @@ -1473,7 +1494,7 @@ dependencies = [ "num-traits", "paste", "rayon", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -1654,9 +1675,9 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -1669,9 +1690,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" @@ -1690,9 +1711,9 @@ checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" [[package]] name = "async-graphql" -version = "7.0.6" +version = "7.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf338d20ba5bab309f55ce8df95d65ee19446f7737f06f4a64593ab2c6b546ad" +checksum = "9d37c3e9ba322eb00e9e5e997d58f08e8b6de037325b9367ac59bca8e3cd46af" dependencies = [ "async-graphql-derive", "async-graphql-parser", @@ -1703,10 +1724,11 @@ dependencies = [ "bytes", "fast_chemail", "fnv", + "futures-timer", "futures-util", "handlebars", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "mime", "multer", "num-traits", @@ -1723,9 +1745,9 @@ dependencies = [ [[package]] name = "async-graphql-axum" -version = "7.0.6" +version = "7.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f874ad4bc10519f3fa500e36814452033a5ce9ea681ab0a2e0d3b1f18bae44" +checksum = "329afc4fc7359f112b7593bc930b788544cedbc97c4fbdf1db21e58704b4b5d0" dependencies = [ "async-graphql", "async-trait", @@ -1741,26 +1763,26 @@ dependencies = [ [[package]] name = "async-graphql-derive" -version = "7.0.6" +version = "7.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc51fd6b7102acda72bc94e8ae1543844d5688ff394a6cf7c21f2a07fe2d64e4" +checksum = "f1141703c11c6ad4fa9b3b0e1e476dea01dbd18a44db00f949b804afaab2f344" dependencies = [ "Inflector", "async-graphql-parser", - "darling 0.20.8", - "proc-macro-crate 3.1.0", + "darling 0.20.10", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "strum 0.26.2", + "strum 0.26.3", "syn 2.0.77", "thiserror", ] [[package]] name = "async-graphql-parser" -version = "7.0.6" +version = "7.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75361eefd64e39f89bead4cb45fddbaf60ddb0e7b15fb7c852b6088bcd63071f" +checksum = "2f66edcce4c38c18f7eb181fdf561c3d3aa2d644ce7358fc7a928c00a4ffef17" dependencies = [ "async-graphql-value", "pest", @@ -1770,23 +1792,23 @@ dependencies = [ [[package]] name = "async-graphql-value" -version = "7.0.6" +version = "7.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f665d2d52b41c4ed1f01c43f3ef27a2fe0af2452ed5c8bc7ac9b1a8719afaa" +checksum = "3b0206011cad065420c27988f17dd7fe201a0e056b20c262209b7bffcd6fa176" dependencies = [ "bytes", - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_json", ] [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "event-listener-strategy", "pin-project-lite", ] @@ -1846,7 +1868,7 @@ dependencies = [ "futures-util", "log", "pin-project-lite", - "rustls-native-certs 0.7.0", + "rustls-native-certs 0.7.3", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -1861,7 +1883,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -1873,6 +1895,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + [[package]] name = "atomic" version = "0.6.0" @@ -1912,9 +1940,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -1930,7 +1958,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "itoa", "matchit", "memchr", @@ -1960,9 +1988,9 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "itoa", "matchit", @@ -2012,7 +2040,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", "mime", "pin-project-lite", @@ -2063,7 +2091,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -2189,7 +2217,7 @@ version = "0.1.0" dependencies = [ "base64 0.21.7", "bytes", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethereum-light-client", "ethereum-verifier", "hex", @@ -2249,6 +2277,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" +[[package]] +name = "binascii" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" + [[package]] name = "bincode" version = "1.3.3" @@ -2260,9 +2294,9 @@ dependencies = [ [[package]] name = "bip32" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164" +checksum = "aa13fae8b6255872fd86f7faf4b41168661d7d78609f7bfe6771b85c6739a15b" dependencies = [ "bs58 0.5.1", "hmac 0.12.1", @@ -2270,7 +2304,7 @@ dependencies = [ "rand_core 0.6.4", "ripemd", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -2314,9 +2348,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -2380,8 +2414,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.3.0", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] @@ -2391,8 +2425,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.3.0", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] @@ -2466,14 +2500,14 @@ dependencies = [ "pairing", "rand_core 0.6.4", "serde", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] name = "bnum" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9008b6bb9fc80b5277f2fe481c09e828743d9151203e804583eb4c9e15b31d" +checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" [[package]] name = "bnum" @@ -2498,7 +2532,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.77", @@ -2543,9 +2577,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -2561,9 +2595,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -2573,9 +2607,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", ] @@ -2603,15 +2637,16 @@ dependencies = [ [[package]] name = "c-kzg" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" dependencies = [ "blst", "cc", "glob", "hex", "libc", + "once_cell", "serde", ] @@ -2623,9 +2658,9 @@ checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -2646,11 +2681,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56c0a67d3ce899b0cd4a1dc756ff00da63e6198ffe6009467679bc0ead964ae3" dependencies = [ "anyhow", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde-untagged", "serde-value", - "toml 0.8.12", + "toml 0.8.19", "unicode-xid", "url", ] @@ -2663,26 +2698,42 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", ] +[[package]] +name = "cassowary" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" + [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "castaway" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" -version = "1.0.90" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -2693,9 +2744,9 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-expr" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", ] @@ -2776,7 +2827,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -2848,9 +2899,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -2858,22 +2909,22 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2883,9 +2934,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clear_on_drop" @@ -3011,9 +3062,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "colored" @@ -3078,7 +3129,7 @@ dependencies = [ "base64 0.21.7", "bytes", "cometbls-groth16-verifier", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "dlmalloc", "hex", "ics008-wasm-client", @@ -3098,11 +3149,24 @@ dependencies = [ "unionlabs", ] +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if 1.0.0", + "itoa", + "ryu", + "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -3154,7 +3218,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] @@ -3167,9 +3231,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "contracts" @@ -3209,7 +3273,7 @@ dependencies = [ "percent-encoding", "rand 0.8.5", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "time", "version_check", ] @@ -3243,9 +3307,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core_affinity" @@ -3270,18 +3334,17 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d075f6bb1483a6ce83b5cbc73a3a1207e0316ac1e34ed1f2a4d9fc3a0f07bf6" +checksum = "d905990ef3afb5753bb709dc7de88e9e370aa32bcc2f31731d4b533b63e82490" [[package]] name = "cosmwasm-crypto" -version = "1.5.2" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed6aa9f904de106fa16443ad14ec2abe75e94ba003bb61c681c0e43d4c58d2a" +checksum = "0f862b355f7e47711e0acfe6af92cb3fd8fd5936b66a9eaa338b51edabd1e77d" dependencies = [ "digest 0.10.7", - "ecdsa", "ed25519-zebra 3.1.0", "k256", "rand_core 0.6.4", @@ -3290,9 +3353,9 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" -version = "2.1.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ced5a6dd2801a383d3e14e5ae5caa7fdfeff1bd9f22b30e810e0aded8a5869" +checksum = "5b2a7bd9c1dd9a377a4dc0f4ad97d24b03c33798cd5a6d7ceb8869b41c5d2f2d" dependencies = [ "ark-bls12-381", "ark-ec", @@ -3313,18 +3376,18 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.5.3" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5e72e330bd3bdab11c52b5ecbdeb6a8697a004c57964caeb5d876f0b088b3c" +checksum = "cd85de6467cd1073688c86b39833679ae6db18cf4771471edd9809f15f1679f1" dependencies = [ "syn 1.0.109", ] [[package]] name = "cosmwasm-derive" -version = "2.1.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd1873f84d9b17edf8a90ffe10a89a649b82feacc00e36788b81d2c3cbf03c" +checksum = "029910b409398fdf81955d7301b906caf81f2c42b013ea074fbd89720229c424" dependencies = [ "proc-macro2", "quote", @@ -3333,11 +3396,11 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "1.5.3" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e3a2136e2a60e8b6582f5dffca5d1a683ed77bf38537d330bc1dfccd69010" +checksum = "5b4cd28147a66eba73720b47636a58097a979ad8c8bfdb4ed437ebcbfe362576" dependencies = [ - "cosmwasm-schema-derive 1.5.3", + "cosmwasm-schema-derive 1.5.7", "schemars", "serde", "serde_json", @@ -3346,11 +3409,11 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27984b137eb2ac561f97f6bdb02004a98eb6f2ba263062c140b8e231ee1826b7" +checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" dependencies = [ - "cosmwasm-schema-derive 2.1.0", + "cosmwasm-schema-derive 2.1.3", "schemars", "serde", "serde_json", @@ -3359,9 +3422,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.3" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d803bea6bd9ed61bd1ee0b4a2eb09ee20dbb539cc6e0b8795614d20952ebb1" +checksum = "9acd45c63d41bc9b16bc6dc7f6bd604a8c2ad29ce96c8f3c96d7fc8ef384392e" dependencies = [ "proc-macro2", "quote", @@ -3370,9 +3433,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ef0d201f611bdb6c9124207032423eb956f1fc8ab3e3ee7253a9c08a5f5809" +checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" dependencies = [ "proc-macro2", "quote", @@ -3381,15 +3444,15 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "1.5.2" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad011ae7447188e26e4a7dbca2fcd0fc186aa21ae5c86df0503ea44c78f9e469" +checksum = "2685c2182624b2e9e17f7596192de49a3f86b7a0c9a5f6b25c1df5e24592e836" dependencies = [ "base64 0.21.7", "bech32 0.9.1", - "bnum 0.8.1", - "cosmwasm-crypto 1.5.2", - "cosmwasm-derive 1.5.3", + "bnum 0.10.0", + "cosmwasm-crypto 1.5.7", + "cosmwasm-derive 1.5.7", "derivative", "forward_ref", "hex", @@ -3403,17 +3466,17 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2522fb5c9a0409712bb1d036128bccf3564e6b2ac82f942ae4cf3c8df3e26fa8" +checksum = "51dec99a2e478715c0a4277f0dbeadbb8466500eb7dec873d0924edd086e77f1" dependencies = [ "base64 0.22.1", "bech32 0.11.0", "bnum 0.11.0", "cosmwasm-core", - "cosmwasm-crypto 2.1.0", - "cosmwasm-derive 2.1.0", - "derive_more 1.0.0-beta.6", + "cosmwasm-crypto 2.1.3", + "cosmwasm-derive 2.1.3", + "derive_more 1.0.0", "hex", "rand_core 0.6.4", "schemars", @@ -3426,18 +3489,18 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -3450,9 +3513,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if 1.0.0", ] @@ -3532,9 +3595,34 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crossterm" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +dependencies = [ + "bitflags 2.6.0", + "crossterm_winapi", + "libc", + "mio 0.8.11", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi 0.3.9", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi 0.3.9", +] [[package]] name = "crunchy" @@ -3550,7 +3638,7 @@ checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -3582,7 +3670,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -3592,7 +3680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" dependencies = [ "generic-array 0.14.7", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -3634,7 +3722,7 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -3649,8 +3737,8 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version 0.4.0", - "subtle 2.5.0", + "rustc_version 0.4.1", + "subtle 2.6.1", "zeroize", ] @@ -3685,7 +3773,15 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "451a4691083a88a3c0630a8a88799e9d4cd6679b7ce8ff22b8da2873ff31d380" dependencies = [ - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", +] + +[[package]] +name = "cw-address-like" +version = "1.0.4" +source = "git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523#28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523" +dependencies = [ + "cosmwasm-std 1.5.7", ] [[package]] @@ -3693,8 +3789,8 @@ name = "cw-cii" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", ] [[package]] @@ -3703,8 +3799,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50c1804013d21060b994dea28a080f9eab78a3bcb6b617f05e7634b0600bf7b1" dependencies = [ - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "cw-storage-plus 2.0.0", "cw-utils 2.0.0", "schemars", @@ -3719,8 +3815,8 @@ source = "git+https://github.com/CosmWasm/cw-multi-test.git?rev=e1a2f587c7f9d723 dependencies = [ "anyhow", "bech32 0.11.0", - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "cw-storage-plus 2.0.0", "cw-utils 2.0.0", "cw20-ics20", @@ -3742,10 +3838,24 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "093dfb4520c48b5848274dd88ea99e280a04bc08729603341c7fb0d758c74321" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", - "cw-address-like", - "cw-ownable-derive", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", + "cw-address-like 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cw-ownable-derive 0.5.1", + "cw-storage-plus 1.2.0", + "cw-utils 1.0.3", + "thiserror", +] + +[[package]] +name = "cw-ownable" +version = "0.6.0" +source = "git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523#28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523" +dependencies = [ + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", + "cw-address-like 1.0.4 (git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523)", + "cw-ownable-derive 0.6.0", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "thiserror", @@ -3762,12 +3872,22 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "cw-ownable-derive" +version = "0.6.0" +source = "git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523#28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "cw-paginate-storage" -version = "2.4.2" -source = "git+https://github.com/DA0-DA0/dao-contracts.git#3ab701747d6d5571cfee7f5a78d8fe39ffa3a8f7" +version = "2.5.0" +source = "git+https://github.com/DA0-DA0/dao-contracts.git#340b1e19dcbb8a9aa94f6f90f82a536e7002fd47" dependencies = [ - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "cw-storage-plus 1.2.0", "serde", ] @@ -3777,8 +3897,8 @@ name = "cw-pause-once" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "thiserror", @@ -3790,7 +3910,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b6f91c0b94481a3e9ef1ceb183c37d00764f8751e39b45fc09f4d9b970d469" dependencies = [ - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "schemars", "serde", ] @@ -3801,7 +3921,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" dependencies = [ - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "schemars", "serde", ] @@ -3812,7 +3932,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" dependencies = [ - "cosmwasm-std 2.1.0", + "cosmwasm-std 2.1.3", "schemars", "serde", ] @@ -3823,11 +3943,11 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6a84c6c1c0acc3616398eba50783934bd6c964bad6974241eaee3460c8f5b26" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw2 0.16.0", "schemars", - "semver 1.0.22", + "semver 1.0.23", "serde", "thiserror", ] @@ -3838,11 +3958,11 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw2 1.1.2", "schemars", - "semver 1.0.22", + "semver 1.0.23", "serde", "thiserror", ] @@ -3853,8 +3973,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" dependencies = [ - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "schemars", "serde", "thiserror", @@ -3866,8 +3986,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91398113b806f4d2a8d5f8d05684704a20ffd5968bf87e3473e1973710b884ad" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-storage-plus 0.16.0", "schemars", "serde", @@ -3879,11 +3999,11 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-storage-plus 1.2.0", "schemars", - "semver 1.0.22", + "semver 1.0.23", "serde", "thiserror", ] @@ -3894,11 +4014,11 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "cw-storage-plus 2.0.0", "schemars", - "semver 1.0.22", + "semver 1.0.23", "serde", "thiserror", ] @@ -3909,8 +4029,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a42212b6bf29bbdda693743697c621894723f35d3db0d5df930be22903d0e27c" dependencies = [ - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "cw-utils 2.0.0", "schemars", "serde", @@ -3922,15 +4042,15 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80a9e377dbbd1ffb3b6a8a2dbf9128609a6458a3292f88f99e0b6840a7e9762e" dependencies = [ - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "cw-controllers", "cw-storage-plus 2.0.0", "cw-utils 2.0.0", "cw2 2.0.0", "cw20", "schemars", - "semver 1.0.22", + "semver 1.0.23", "serde", "thiserror", ] @@ -3941,8 +4061,20 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94a1ea6e6277bdd6dfc043a9b1380697fe29d6e24b072597439523658d21d791" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", + "cw-utils 0.16.0", + "schemars", + "serde", +] + +[[package]] +name = "cw721" +version = "0.16.0" +source = "git+https://github.com/CosmWasm/cw-nfts?tag=v0.16.0#2cad1d3e15e0a34d466a0b51e02c58b82ebe5ecd" +dependencies = [ + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-utils 0.16.0", "schemars", "serde", @@ -3950,14 +4082,21 @@ dependencies = [ [[package]] name = "cw721" -version = "0.18.0" -source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#e63a7bbb620e6ea39224bb5580967477066cb7ae" +version = "0.19.0" +source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#a5abe476c1028b2563f995adab184b86e3fc03ff" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", + "cw-ownable 0.6.0", + "cw-paginate-storage", + "cw-storage-plus 1.2.0", "cw-utils 1.0.3", + "cw2 1.1.2", + "cw721 0.16.0 (git+https://github.com/CosmWasm/cw-nfts?tag=v0.16.0)", "schemars", "serde", + "thiserror", + "url", ] [[package]] @@ -3966,12 +4105,12 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77518e27431d43214cff4cdfbd788a7508f68d9b1f32389e6fce513e7eaccbef" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-storage-plus 0.16.0", "cw-utils 0.16.0", "cw2 0.16.0", - "cw721 0.16.0", + "cw721 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "schemars", "serde", "thiserror", @@ -3979,20 +4118,15 @@ dependencies = [ [[package]] name = "cw721-base" -version = "0.18.0" -source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#e63a7bbb620e6ea39224bb5580967477066cb7ae" +version = "0.19.0" +source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#a5abe476c1028b2563f995adab184b86e3fc03ff" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", - "cw-ownable", - "cw-storage-plus 1.2.0", - "cw-utils 1.0.3", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", + "cw-ownable 0.6.0", "cw2 1.1.2", - "cw721 0.18.0", - "cw721-base 0.16.0", - "schemars", + "cw721 0.19.0", "serde", - "thiserror", ] [[package]] @@ -4007,12 +4141,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -4031,15 +4165,15 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", + "strsim 0.11.1", "syn 2.0.77", ] @@ -4056,11 +4190,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.10", "quote", "syn 2.0.77", ] @@ -4072,7 +4206,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -4080,9 +4214,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" @@ -4127,6 +4261,17 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "derive-syn-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "derive_arbitrary" version = "1.3.2" @@ -4139,31 +4284,31 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 1.0.109", + "rustc_version 0.4.1", + "syn 2.0.77", ] [[package]] name = "derive_more" -version = "1.0.0-beta.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "1.0.0-beta.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", @@ -4171,6 +4316,39 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "devise" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d90b0c4c777a2cad215e3c7be59ac7c15adf45cf76317009b7d096d46f651d" +dependencies = [ + "devise_codegen", + "devise_core", +] + +[[package]] +name = "devise_codegen" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71b28680d8be17a570a2334922518be6adc3f58ecc880cbb404eaeb8624fd867" +dependencies = [ + "devise_core", + "quote", +] + +[[package]] +name = "devise_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b035a542cf7abf01f2e3c4d5a7acbaebfefe120ae4efc7bde3df98186e4b8af7" +dependencies = [ + "bitflags 2.6.0", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.77", +] + [[package]] name = "devnet-compose" version = "0.1.0" @@ -4181,7 +4359,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "strum 0.26.2", + "strum 0.26.3", ] [[package]] @@ -4190,11 +4368,11 @@ version = "0.1.0" dependencies = [ "base64 0.21.7", "bip39", - "clap 4.5.4", - "cosmwasm-std 2.1.0", + "clap 4.5.17", + "cosmwasm-std 2.1.3", "ed25519-compact", "hex", - "strum 0.26.2", + "strum 0.26.3", "tiny-hderive", "unionlabs", ] @@ -4232,7 +4410,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -4279,9 +4457,9 @@ dependencies = [ [[package]] name = "dissimilar" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" +checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" [[package]] name = "dlmalloc" @@ -4314,7 +4492,7 @@ dependencies = [ "axum 0.7.5", "chain-utils", "chrono", - "clap 4.5.4", + "clap 4.5.17", "dashmap", "prost 0.12.6", "protos", @@ -4346,9 +4524,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" @@ -4439,7 +4617,7 @@ dependencies = [ "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -4466,7 +4644,7 @@ checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek 4.1.3", "ed25519 2.2.3", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "rand_core 0.6.4", "sha2 0.10.8", @@ -4475,9 +4653,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] @@ -4498,15 +4676,15 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] [[package]] name = "ena" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ "log", ] @@ -4519,9 +4697,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if 1.0.0", ] @@ -4538,7 +4716,7 @@ dependencies = [ "k256", "log", "rand 0.8.5", - "rlp", + "rlp 0.5.2", "serde", "sha3 0.10.8", "zeroize", @@ -4548,7 +4726,7 @@ dependencies = [ name = "ensure-blocks" version = "0.0.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.17", "ethers", "reqwest 0.11.27", "tendermint-rpc", @@ -4617,18 +4795,19 @@ dependencies = [ [[package]] name = "erased-serde" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" dependencies = [ "serde", + "typeid", ] [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4679,7 +4858,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" dependencies = [ - "ethereum-types", + "ethereum-types 0.14.1", "hex", "once_cell", "regex", @@ -4687,7 +4866,7 @@ dependencies = [ "serde_json", "sha3 0.10.8", "thiserror", - "uint", + "uint 0.9.5", ] [[package]] @@ -4699,19 +4878,32 @@ dependencies = [ "crunchy", "fixed-hash 0.8.0", "impl-codec 0.6.0", - "impl-rlp", + "impl-rlp 0.3.0", "impl-serde 0.4.0", "scale-info", "tiny-keccak", ] +[[package]] +name = "ethbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" +dependencies = [ + "crunchy", + "fixed-hash 0.8.0", + "impl-rlp 0.4.0", + "impl-serde 0.5.0", + "tiny-keccak", +] + [[package]] name = "ethereum-light-client" version = "0.1.0" dependencies = [ "base64 0.21.7", "bytes", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethereum-verifier", "ethers-contract-derive", "ethers-core", @@ -4721,7 +4913,7 @@ dependencies = [ "lazy_static", "prost 0.12.6", "protos", - "rlp", + "rlp 0.5.2", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -4739,14 +4931,28 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ - "ethbloom", + "ethbloom 0.13.0", "fixed-hash 0.8.0", "impl-codec 0.6.0", - "impl-rlp", + "impl-rlp 0.3.0", "impl-serde 0.4.0", "primitive-types 0.12.2", "scale-info", - "uint", + "uint 0.9.5", +] + +[[package]] +name = "ethereum-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" +dependencies = [ + "ethbloom 0.14.1", + "fixed-hash 0.8.0", + "impl-rlp 0.4.0", + "impl-serde 0.5.0", + "primitive-types 0.13.1", + "uint 0.10.0", ] [[package]] @@ -4762,7 +4968,7 @@ dependencies = [ "memory-db", "milagro_bls", "primitive-types 0.12.2", - "rlp", + "rlp 0.5.2", "serde", "serde-utils", "serde_json", @@ -4838,7 +5044,7 @@ dependencies = [ "serde", "serde_json", "syn 2.0.77", - "toml 0.8.12", + "toml 0.8.19", "walkdir", ] @@ -4862,21 +5068,21 @@ name = "ethers-core" version = "2.0.10" source = "git+https://github.com/unionlabs/ethers-rs?branch=ethers-core-wasm#fd10abba9a9d5347b71bd4cde6418a6f6f2f1279" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bytes", "cargo_metadata", "chrono", "const-hex", "elliptic-curve", "ethabi", - "ethereum-types", + "ethereum-types 0.15.1", "generic-array 0.14.7", "k256", "num_enum", "once_cell", "open-fastrlp", "rand 0.8.5", - "rlp", + "rlp 0.5.2", "serde", "serde_json", "strum 0.25.0", @@ -4894,7 +5100,7 @@ source = "git+https://github.com/unionlabs/ethers-rs?branch=ethers-core-wasm#fd1 dependencies = [ "ethers-core", "reqwest 0.11.27", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -5000,7 +5206,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "solang-parser", @@ -5010,7 +5216,7 @@ dependencies = [ "tokio", "tracing", "walkdir", - "yansi", + "yansi 0.5.1", ] [[package]] @@ -5025,17 +5231,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "5.3.1" @@ -5049,11 +5244,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "pin-project-lite", ] @@ -5061,7 +5256,7 @@ dependencies = [ name = "evm-in-cosmos-light-client" version = "0.1.0" dependencies = [ - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethereum-light-client", "ics008-wasm-client", "ics23", @@ -5072,13 +5267,14 @@ dependencies = [ [[package]] name = "expander" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e83c02035136f1592a47964ea60c05a50e4ed8b5892cfac197063850898d4d" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ "blake2", + "file-guard", "fs-err", - "prettier-please", + "prettyplease", "proc-macro2", "quote", "syn 2.0.77", @@ -5140,9 +5336,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -5150,7 +5346,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "auto_impl", "bytes", ] @@ -5165,7 +5361,7 @@ dependencies = [ "byteorder", "ff_derive", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -5214,29 +5410,34 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "figment" -version = "0.10.15" +version = "0.10.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7270677e7067213e04f323b55084586195f18308cd7546cfac9f873344ccceb6" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" dependencies = [ - "atomic", + "atomic 0.6.0", + "pear", "serde", "serde_json", - "toml 0.8.12", + "toml 0.8.19", "uncased", "version_check", ] [[package]] -name = "finl_unicode" -version = "1.2.0" +name = "file-guard" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi 0.3.9", +] [[package]] name = "fixed" @@ -5288,12 +5489,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -5377,7 +5578,7 @@ checksum = "1e4662a809f559aea6234bd90940fa29df583a3c8124a3cf923f66a0d21126b7" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse", + "derive-syn-parse 0.1.5", "expander", "frame-support-procedural-tools", "itertools 0.11.0", @@ -5415,9 +5616,9 @@ dependencies = [ [[package]] name = "frunk" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a351b59e12f97b4176ee78497dff72e4276fb1ceb13e19056aca7fa0206287" +checksum = "874b6a17738fc273ec753618bac60ddaeac48cb1d7684c3e7bd472e57a28b817" dependencies = [ "frunk_core", "frunk_derives", @@ -5425,15 +5626,15 @@ dependencies = [ [[package]] name = "frunk_core" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2469fab0bd07e64ccf0ad57a1438f63160c69b2e57f04a439653d68eb558d6" +checksum = "3529a07095650187788833d585c219761114005d5976185760cf794d265b6a5c" [[package]] name = "frunk_derives" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" +checksum = "e99b8b3c28ae0e84b604c75f721c21dc77afb3706076af5e8216d15fd1deaae3" dependencies = [ "frunk_proc_macro_helpers", "quote", @@ -5442,9 +5643,9 @@ dependencies = [ [[package]] name = "frunk_proc_macro_helpers" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b54add839292b743aeda6ebedbd8b11e93404f902c56223e51b9ec18a13d2c" +checksum = "05a956ef36c377977e512e227dcad20f68c2786ac7a54dacece3746046fea5ce" dependencies = [ "frunk_core", "proc-macro2", @@ -5640,10 +5841,23 @@ checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" name = "generate-rust-sol-bindings" version = "0.1.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.17", "ethers-contract-abigen", ] +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -5699,9 +5913,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -5823,14 +6037,14 @@ dependencies = [ "rand 0.8.5", "rand_core 0.6.4", "rand_xorshift", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] name = "h2" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -5838,7 +6052,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -5857,7 +6071,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -5929,9 +6143,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", @@ -5952,7 +6166,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -6180,9 +6394,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -6197,15 +6411,15 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -6224,7 +6438,7 @@ dependencies = [ "base64 0.21.7", "chain-utils", "chrono", - "clap 4.5.4", + "clap 4.5.17", "color-eyre", "cometbft-rpc", "const-hex", @@ -6260,15 +6474,15 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -6284,16 +6498,16 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", "futures-util", "h2 0.4.6", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", "httpdate", "itoa", @@ -6311,29 +6525,29 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", - "rustls 0.21.10", + "hyper 0.14.30", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "log", - "rustls 0.23.7", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -6342,7 +6556,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.30", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -6355,7 +6569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.30", "native-tls", "tokio", "tokio-native-tls", @@ -6369,7 +6583,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "native-tls", "tokio", @@ -6379,16 +6593,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2", "tokio", @@ -6399,9 +6613,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -6439,7 +6653,7 @@ dependencies = [ name = "ics008-wasm-client" version = "0.1.0" dependencies = [ - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "dlmalloc", "frame-support-procedural", "macros", @@ -6458,13 +6672,13 @@ version = "0.1.0" dependencies = [ "aptos-verifier", "bcs 0.1.4", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethereum-verifier", "hex", "hex-literal", "ics008-wasm-client", "protos", - "rlp", + "rlp 0.5.2", "serde", "serde_json", "sha2 0.10.8", @@ -6497,17 +6711,17 @@ version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ "bech32 0.9.1", - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-cii", - "cw-ownable", + "cw-ownable 0.5.1", "cw-paginate-storage", "cw-pause-once", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw721 0.18.0", + "cw721 0.19.0", "cw721-base 0.16.0", - "cw721-base 0.18.0", + "cw721-base 0.19.0", "ics721-types", "serde", "sha2 0.10.8", @@ -6520,7 +6734,7 @@ name = "ics721-base" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "cw2 1.1.2", "ics721", ] @@ -6530,10 +6744,10 @@ name = "ics721-types" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-storage-plus 1.2.0", - "cw721 0.18.0", + "cw721 0.19.0", "serde", "thiserror", ] @@ -6593,7 +6807,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.6.9", + "parity-scale-codec 3.6.12", ] [[package]] @@ -6602,7 +6816,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" dependencies = [ - "rlp", + "rlp 0.5.2", +] + +[[package]] +name = "impl-rlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" +dependencies = [ + "rlp 0.6.1", ] [[package]] @@ -6623,6 +6846,15 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -6645,6 +6877,15 @@ dependencies = [ "proc-macro-hack", ] +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + [[package]] name = "include_dir_impl" version = "0.6.2" @@ -6658,6 +6899,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indenter" version = "0.3.3" @@ -6677,12 +6928,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -6705,6 +6956,12 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" +[[package]] +name = "inlinable_string" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" + [[package]] name = "inout" version = "0.1.3" @@ -6716,9 +6973,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if 1.0.0", ] @@ -6753,9 +7010,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is-terminal" @@ -6768,6 +7025,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -6836,7 +7099,7 @@ dependencies = [ "ahash 0.8.11", "dyn-clone", "hifijson", - "indexmap 2.2.6", + "indexmap 2.5.0", "jaq-syn", "once_cell", "serde_json", @@ -6882,27 +7145,27 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonrpsee" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ec465b607a36dc5dd45d48b7689bc83f679f66a3ac6b6b21cc787a11e0f8685" +checksum = "8fd1ead9fb95614e8dc5556d12a8681c2f6d352d0c1d3efc8708c7ccbba47bc6" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -6918,9 +7181,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f0977f9c15694371b8024c35ab58ca043dbbf4b51ccb03db8858a021241df1" +checksum = "89841d4f03a14c055eb41d4f41901819573ef948e8ee0d5c86466fd286b2ce7f" dependencies = [ "base64 0.22.1", "futures-channel", @@ -6929,7 +7192,7 @@ dependencies = [ "http 1.1.0", "jsonrpsee-core", "pin-project", - "rustls 0.23.7", + "rustls 0.23.13", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -6943,22 +7206,22 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e942c55635fbf5dc421938b8558a8141c7e773720640f4f1dbe1f4164ca4e221" +checksum = "ff79651479f69ada7bda604ef2acf3f1aa50755d97cc36d25ff04c2664f9d96f" dependencies = [ "async-trait", "bytes", "futures-timer", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", "jsonrpsee-types", "parking_lot", "pin-project", "rand 0.8.5", - "rustc-hash 2.0.0", + "rustc-hash", "serde", "serde_json", "thiserror", @@ -6970,19 +7233,19 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33774602df12b68a2310b38a535733c477ca4a498751739f89fe8dbbb62ec4c" +checksum = "68ed8b301b19f4dad8ddc66ed956a70fc227def5c19b3898e0a29ce8f0edee06" dependencies = [ "async-trait", "base64 0.22.1", - "http-body 1.0.0", - "hyper 1.3.1", - "hyper-rustls 0.27.2", + "http-body 1.0.1", + "hyper 1.4.1", + "hyper-rustls 0.27.3", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "rustls 0.23.7", + "rustls 0.23.13", "rustls-platform-verifier", "serde", "serde_json", @@ -6995,12 +7258,12 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b07a2daf52077ab1b197aea69a5c990c060143835bf04c77070e98903791715" +checksum = "a0d4c6bec4909c966f59f52db3655c0e9d4685faae8b49185973d9d7389bb884" dependencies = [ "heck 0.5.0", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.77", @@ -7008,15 +7271,15 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038fb697a709bec7134e9ccbdbecfea0e2d15183f7140254afef7c5610a3f488" +checksum = "ebe2198e5fd96cf2153ecc123364f699b6e2151317ea09c7bf799c43c2fe1415" dependencies = [ "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", @@ -7035,9 +7298,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b67d6e008164f027afbc2e7bb79662650158d26df200040282d2aa1cbb093b" +checksum = "531e386460425e49679587871a056f2895a47dade21457324ad1262cd78ef6d9" dependencies = [ "http 1.1.0", "serde", @@ -7047,9 +7310,9 @@ dependencies = [ [[package]] name = "jsonrpsee-wasm-client" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0470d0ae043ffcb0cd323797a631e637fb4b55fe3eaa6002934819458bba62a7" +checksum = "5a2d2206c8f04c6b79a11bd1d92d6726b6f7fd3dec57c91e07fa53e867268bbb" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -7058,9 +7321,9 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992bf67d1132f88edf4a4f8cff474cf01abb2be203004a2b8e11c2b20795b99e" +checksum = "87bc869e143d430e748988261d19b630e8f1692074e68f1a7f0eb4c521d2fc58" dependencies = [ "http 1.1.0", "jsonrpsee-client-transport", @@ -7123,9 +7386,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -7142,9 +7405,9 @@ dependencies = [ "ena", "itertools 0.11.0", "lalrpop-util", - "petgraph 0.6.4", + "petgraph 0.6.5", "regex", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "string_cache", "term", "tiny-keccak", @@ -7158,23 +7421,23 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.6", + "regex-automata 0.4.7", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libm" @@ -7188,7 +7451,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -7204,7 +7467,7 @@ dependencies = [ "hmac-drbg 0.2.0", "rand 0.7.3", "sha2 0.8.2", - "subtle 2.5.0", + "subtle 2.6.1", "typenum", ] @@ -7235,7 +7498,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -7272,7 +7535,7 @@ name = "linea-light-client" version = "0.1.0" dependencies = [ "base64 0.21.7", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethereum-light-client", "ethereum-verifier", "ethers-core", @@ -7282,7 +7545,7 @@ dependencies = [ "linea-verifier", "linea-zktrie", "protos", - "rlp", + "rlp 0.5.2", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -7303,7 +7566,7 @@ dependencies = [ "hex", "hex-literal", "linea-zktrie", - "rlp", + "rlp 0.5.2", "scroll-codec", "serde", "serde-utils", @@ -7335,15 +7598,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -7351,11 +7614,26 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +dependencies = [ + "serde", +] + +[[package]] +name = "loom" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ + "cfg-if 1.0.0", + "generator", + "scoped-tls", "serde", + "serde_json", + "tracing", + "tracing-subscriber 0.3.18", ] [[package]] @@ -7369,11 +7647,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -7395,7 +7673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse", + "derive-syn-parse 0.2.0", "macro_magic_core_macros", "proc-macro2", "quote", @@ -7472,9 +7750,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memory-db" @@ -7542,13 +7820,34 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + [[package]] name = "mio" version = "1.0.2" @@ -7583,7 +7882,7 @@ dependencies = [ "once_cell", "parking_lot", "quanta", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "smallvec", "tagptr", "thiserror", @@ -7735,7 +8034,7 @@ source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b4655 dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.5.4", + "clap 4.5.17", "codespan-reporting", "hex", "move-binary-format", @@ -7762,7 +8061,7 @@ dependencies = [ "abstract-domain-derive", "anyhow", "bcs 0.1.4", - "clap 4.5.4", + "clap 4.5.17", "codespan-reporting", "ethnum", "flexi_logger", @@ -7797,7 +8096,7 @@ dependencies = [ "bcs 0.1.4", "bytes", "ethnum", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "num", "once_cell", @@ -7807,7 +8106,7 @@ dependencies = [ "serde", "serde_bytes", "thiserror", - "uint", + "uint 0.9.5", ] [[package]] @@ -7817,7 +8116,7 @@ source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b4655 dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.5.4", + "clap 4.5.17", "codespan", "colored", "move-binary-format", @@ -7835,7 +8134,7 @@ version = "0.1.0" source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b46551abaf04c640f1d" dependencies = [ "anyhow", - "clap 4.5.4", + "clap 4.5.17", "colored", "move-binary-format", "move-bytecode-source-map", @@ -7852,7 +8151,7 @@ version = "0.1.0" source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b46551abaf04c640f1d" dependencies = [ "anyhow", - "clap 4.5.4", + "clap 4.5.17", "codespan", "codespan-reporting", "itertools 0.13.0", @@ -7941,7 +8240,7 @@ version = "0.1.0" source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b46551abaf04c640f1d" dependencies = [ "anyhow", - "clap 4.5.4", + "clap 4.5.17", "colored", "itertools 0.13.0", "move-abigen", @@ -8020,7 +8319,7 @@ dependencies = [ "better_any", "bytes", "fail", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lazy_static", "lru 0.7.8", "move-binary-format", @@ -8053,6 +8352,47 @@ dependencies = [ "triomphe", ] +[[package]] +name = "mpc-client" +version = "0.1.0" +dependencies = [ + "clap 4.5.17", + "crossterm", + "mpc-shared", + "rand 0.8.5", + "ratatui", + "reqwest 0.11.27", + "serde", + "serde_json", + "sha2 0.10.8", + "thiserror", + "tokio", +] + +[[package]] +name = "mpc-coordinator" +version = "0.1.0" +dependencies = [ + "clap 4.5.17", + "futures", + "mpc-shared", + "priority-queue", + "rocket", + "rocket-authorization", + "rocket_seek_stream", + "rust-fsm", + "sha2 0.10.8", + "thiserror", +] + +[[package]] +name = "mpc-shared" +version = "0.1.0" +dependencies = [ + "rocket", + "thiserror", +] + [[package]] name = "multer" version = "3.1.0" @@ -8068,14 +8408,15 @@ dependencies = [ "mime", "spin 0.9.8", "tokio", + "tokio-util", "version_check", ] [[package]] name = "multimap" -version = "0.8.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" [[package]] name = "named-lock" @@ -8116,7 +8457,7 @@ checksum = "7c49593c9e94454a2368a4c0a511bf4bf1413aff4d23f16e1d8f4e64b5215351" dependencies = [ "borsh", "schemars", - "semver 1.0.22", + "semver 1.0.23", "serde", ] @@ -8133,18 +8474,18 @@ dependencies = [ [[package]] name = "near-contract-standards" -version = "5.1.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e78fe14d389ae76f792735a2108a6b8332a2bed61197310bf5ad718fb1e424" +checksum = "a3b985c4df43237b6ae533a6451cfa13de1f12f79f7d6254ba376f0ccd017286" dependencies = [ "near-sdk", ] [[package]] name = "near-gas" -version = "0.2.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e75c875026229902d065e4435804497337b631ec69ba746b102954273e9ad1" +checksum = "180edcc7dc2fac41f93570d0c7b759c1b6d492f6ad093d749d644a40b4310a97" dependencies = [ "borsh", "schemars", @@ -8195,7 +8536,7 @@ dependencies = [ "base64 0.21.7", "borsh", "bs58 0.4.0", - "derive_more 0.99.17", + "derive_more 0.99.18", "enum-map", "near-account-id", "num-rational 0.3.2", @@ -8209,11 +8550,11 @@ dependencies = [ [[package]] name = "near-sdk" -version = "5.1.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520234cfdf04a805ac2f04715889d096eb83fdd5b99ca7d0f8027ae473f891a8" +checksum = "4e296b02c85539c16659e171242d6c6bbea87eec7c9ef860d8dfd3fb3168a18a" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "borsh", "bs58 0.5.1", "near-abi", @@ -8246,43 +8587,43 @@ version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb88aa0ed4fbc1ad5c689b9b100cae9dadf1f03373ddd657fb9ac9d25a58ebb0" dependencies = [ - "darling 0.20.8", + "darling 0.20.10", "heck 0.5.0", "proc-macro2", "quote", - "strum 0.26.2", - "strum_macros 0.26.2", + "strum 0.26.3", + "strum_macros 0.26.4", "syn 2.0.77", ] [[package]] name = "near-sdk-macros" -version = "5.1.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2fe3fc30068c5f20e89b0985d6104c5cc1c6742dbc6efbf352be4189b9bbf7" +checksum = "0adc79466aa556f56a995c0db34a933b32597ab92bbb0e526597118899c8bcaf" dependencies = [ "Inflector", - "darling 0.20.8", + "darling 0.20.10", "proc-macro2", "quote", "serde", "serde_json", - "strum 0.26.2", - "strum_macros 0.26.2", + "strum 0.26.3", + "strum_macros 0.26.4", "syn 2.0.77", ] [[package]] name = "near-sys" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397688591acf8d3ebf2c2485ba32d4b24fc10aad5334e3ad8ec0b7179bfdf06b" +checksum = "dbf4ca5c805cb78700e10e43484902d8da05f25788db277999d209568aaf4c8e" [[package]] name = "near-token" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b68f3f8a2409f72b43efdbeff8e820b81e70824c49fee8572979d789d1683fb" +checksum = "cd3e60aa26a74dc514b1b6408fdd06cefe2eb0ff029020956c1c6517594048fd" dependencies = [ "borsh", "schemars", @@ -8352,7 +8693,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if 1.0.0", "cfg_aliases 0.1.1", "libc", @@ -8478,7 +8819,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "itoa", ] @@ -8548,20 +8889,20 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.77", @@ -8590,9 +8931,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "opaque-debug" @@ -8612,10 +8953,10 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "auto_impl", "bytes", - "ethereum-types", + "ethereum-types 0.14.1", "open-fastrlp-derive", ] @@ -8633,11 +8974,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -8665,9 +9006,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -8752,7 +9093,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec 0.20.4", "byte-slice-cast", "impl-trait-for-tuples", @@ -8762,15 +9103,15 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec 1.0.1", "byte-slice-cast", "impl-trait-for-tuples", - "parity-scale-codec-derive 3.6.9", + "parity-scale-codec-derive 3.6.12", "serde", ] @@ -8788,11 +9129,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -8800,15 +9141,15 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -8816,22 +9157,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "parse-wasm-client-type" version = "0.1.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.17", "unionlabs", ] @@ -8841,11 +9182,11 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "499cff8432e71c5f8784d9645aac0f9fca604d67f59b68a606170b5e229c6538" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "ciborium", "coset", "data-encoding", - "indexmap 2.2.6", + "indexmap 2.5.0", "rand 0.8.5", "serde", "serde_json", @@ -8862,7 +9203,7 @@ checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -8879,14 +9220,14 @@ dependencies = [ "rand 0.8.5", "serde", "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-slash" @@ -8950,6 +9291,29 @@ dependencies = [ "hmac 0.12.1", ] +[[package]] +name = "pear" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" +dependencies = [ + "inlinable_string", + "pear_codegen", + "yansi 1.0.1", +] + +[[package]] +name = "pear_codegen" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bab5b985dc082b345f812b7df84e1bef27e7207b39e448439ba8bd69c93f147" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.77", +] + [[package]] name = "peg" version = "0.8.4" @@ -9013,9 +9377,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", "thiserror", @@ -9024,9 +9388,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" dependencies = [ "pest", "pest_generator", @@ -9034,9 +9398,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" dependencies = [ "pest", "pest_meta", @@ -9047,9 +9411,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" dependencies = [ "once_cell", "pest", @@ -9068,12 +9432,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.2.6", + "indexmap 2.5.0", ] [[package]] @@ -9098,7 +9462,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -9213,9 +9577,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", @@ -9226,15 +9590,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] @@ -9252,7 +9616,7 @@ dependencies = [ "headers", "http 1.1.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "mime", "multer", @@ -9264,7 +9628,7 @@ dependencies = [ "quick-xml", "regex", "rfc7239", - "rustls-pemfile 2.1.1", + "rustls-pemfile 2.1.3", "serde", "serde_json", "serde_urlencoded", @@ -9287,7 +9651,7 @@ name = "poem-derive" version = "3.0.0" source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.77", @@ -9300,9 +9664,9 @@ source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3 dependencies = [ "base64 0.22.1", "bytes", - "derive_more 0.99.17", + "derive_more 0.99.18", "futures-util", - "indexmap 2.2.6", + "indexmap 2.5.0", "mime", "num-traits", "poem", @@ -9323,11 +9687,11 @@ name = "poem-openapi-derive" version = "5.0.2" source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" dependencies = [ - "darling 0.20.8", + "darling 0.20.10", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "mime", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "regex", @@ -9349,9 +9713,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "poseidon-ark" @@ -9368,7 +9732,7 @@ name = "poseidon-rs" version = "0.0.10" dependencies = [ "criterion", - "ethereum-types", + "ethereum-types 0.14.1", "ff_ce", "primitive-types 0.12.2", "rand 0.4.6", @@ -9378,11 +9742,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" +checksum = "acda0ebdebc28befa84bee35e651e4c5f09073d668c7aed4cf7e23c3cda84b23" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "byteorder", "bytes", "fallible-iterator 0.2.0", @@ -9396,9 +9760,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" +checksum = "f66ea23a2d0e5734297357705193335e0a957696f34bed2f2faefacb2fec336f" dependencies = [ "bytes", "fallible-iterator 0.2.0", @@ -9415,9 +9779,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -9425,16 +9792,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "prettier-please" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" -dependencies = [ - "proc-macro2", - "syn 2.0.77", -] - [[package]] name = "prettyplease" version = "0.2.22" @@ -9463,7 +9820,7 @@ dependencies = [ "fixed-hash 0.7.0", "impl-codec 0.5.1", "impl-serde 0.3.2", - "uint", + "uint 0.9.5", ] [[package]] @@ -9474,38 +9831,52 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash 0.8.0", "impl-codec 0.6.0", - "impl-rlp", + "impl-rlp 0.3.0", "impl-serde 0.4.0", "scale-info", - "uint", + "uint 0.9.5", ] [[package]] -name = "proc-macro-crate" -version = "1.3.1" +name = "primitive-types" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "fixed-hash 0.8.0", + "impl-rlp 0.4.0", + "impl-serde 0.5.0", + "uint 0.10.0", +] + +[[package]] +name = "priority-queue" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "560bcab673ff7f6ca9e270c17bf3affd8a05e3bd9207f123b0d45076fd8197e8" +dependencies = [ + "autocfg", + "equivalent", + "indexmap 2.5.0", ] [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "toml_edit 0.20.7", + "once_cell", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.21", ] [[package]] @@ -9564,13 +9935,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proc-macro2-diagnostics" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "version_check", + "yansi 1.0.1", +] + [[package]] name = "procfs" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "hex", "lazy_static", "procfs-core", @@ -9583,7 +9967,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "hex", ] @@ -9606,19 +9990,19 @@ dependencies = [ [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -9646,24 +10030,23 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.4.1", - "itertools 0.11.0", + "heck 0.5.0", + "itertools 0.12.1", "log", "multimap", "once_cell", - "petgraph 0.6.4", + "petgraph 0.6.5", "prettyplease", "prost 0.12.6", "prost-types", "regex", "syn 2.0.77", "tempfile", - "which", ] [[package]] @@ -9694,9 +10077,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost 0.12.6", ] @@ -9820,22 +10203,23 @@ checksum = "eb55a1aa7668676bb93926cd4e9cdfe60f03bb866553bcca9112554911b6d3dc" dependencies = [ "ahash 0.8.11", "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "parking_lot", ] [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 1.1.0", - "rustls 0.23.7", + "rustc-hash", + "rustls 0.23.13", + "socket2", "thiserror", "tokio", "tracing", @@ -9843,15 +10227,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", "ring 0.17.8", - "rustc-hash 1.1.0", - "rustls 0.23.7", + "rustc-hash", + "rustls 0.23.13", "slab", "thiserror", "tinyvec", @@ -9860,22 +10244,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -9979,7 +10363,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", ] [[package]] @@ -10009,13 +10393,44 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "range_header" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91066bbbc00d9eb5cf42cf9ea0abdf40097d20065e48b6c0cc14a2154d44934" +dependencies = [ + "pest", + "pest_derive", +] + +[[package]] +name = "ratatui" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" +dependencies = [ + "bitflags 2.6.0", + "cassowary", + "compact_str", + "crossterm", + "itertools 0.13.0", + "lru 0.12.4", + "paste", + "stability", + "strum 0.26.3", + "strum_macros 0.26.4", + "unicode-segmentation", + "unicode-truncate", + "unicode-width", +] + [[package]] name = "raw-cpuid" version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -10053,7 +10468,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e3be7b2e46e24637ac96b0c9f70070f188652018573f36f4e511dcad09738a" dependencies = [ - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", ] @@ -10080,20 +10495,20 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "libredox", "thiserror", ] @@ -10126,8 +10541,8 @@ checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -10141,13 +10556,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -10158,9 +10573,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -10175,10 +10590,10 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -10190,7 +10605,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "rustls-pemfile 1.0.4", "serde", @@ -10209,24 +10624,24 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots 0.25.4", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", "bytes", "futures-core", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", - "hyper-rustls 0.27.2", + "hyper 1.4.1", + "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -10238,8 +10653,8 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.7", - "rustls-pemfile 2.1.1", + "rustls 0.23.13", + "rustls-pemfile 2.1.3", "rustls-pki-types", "serde", "serde_json", @@ -10253,14 +10668,14 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.3", - "winreg 0.52.0", + "webpki-roots 0.26.5", + "windows-registry", ] [[package]] name = "reth-ipc" version = "1.0.6" -source = "git+https://github.com/paradigmxyz/reth#fcab695a93526c704ef898a3a8d2b6afb183f579" +source = "git+https://github.com/paradigmxyz/reth#be04f24a69da9d9e511e176432fdbbae623379c3" dependencies = [ "async-trait", "bytes", @@ -10285,7 +10700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -10320,7 +10735,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if 1.0.0", - "getrandom 0.2.12", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -10347,6 +10762,16 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rlp" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" +dependencies = [ + "bytes", + "rustc-hex", +] + [[package]] name = "rlp-derive" version = "0.1.0" @@ -10358,6 +10783,137 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rocket" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f" +dependencies = [ + "async-stream", + "async-trait", + "atomic 0.5.3", + "binascii", + "bytes", + "either", + "figment", + "futures", + "indexmap 2.5.0", + "log", + "memchr", + "multer", + "num_cpus", + "parking_lot", + "pin-project-lite", + "rand 0.8.5", + "ref-cast", + "rmp-serde", + "rocket_codegen", + "rocket_http", + "serde", + "serde_json", + "state", + "tempfile", + "time", + "tokio", + "tokio-stream", + "tokio-util", + "ubyte", + "uuid 1.10.0", + "version_check", + "yansi 1.0.1", +] + +[[package]] +name = "rocket-authorization" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2fe821919cb7646b4b46f0896874c9fd51e04b266349aef9e8f8a1bec36368" +dependencies = [ + "base64 0.21.7", + "rocket", + "thiserror", +] + +[[package]] +name = "rocket_codegen" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46" +dependencies = [ + "devise", + "glob", + "indexmap 2.5.0", + "proc-macro2", + "quote", + "rocket_http", + "syn 2.0.77", + "unicode-xid", + "version_check", +] + +[[package]] +name = "rocket_http" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9" +dependencies = [ + "cookie 0.18.1", + "either", + "futures", + "http 0.2.12", + "hyper 0.14.30", + "indexmap 2.5.0", + "log", + "memchr", + "pear", + "percent-encoding", + "pin-project-lite", + "ref-cast", + "serde", + "smallvec", + "stable-pattern", + "state", + "time", + "tokio", + "uncased", + "uuid 1.10.0", +] + +[[package]] +name = "rocket_seek_stream" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17a8bb18061548f3ee971001d66f97291365327df38ef1d353e61025153fed7a" +dependencies = [ + "futures", + "rand 0.8.5", + "range_header", + "rocket", + "tree_magic_mini", +] + [[package]] name = "route-recognizer" version = "0.3.1" @@ -10389,7 +10945,7 @@ dependencies = [ "rand_core 0.6.4", "signature 2.2.0", "spki", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -10406,11 +10962,11 @@ dependencies = [ "fastrlp", "num-bigint 0.4.6", "num-traits", - "parity-scale-codec 3.6.9", + "parity-scale-codec 3.6.12", "primitive-types 0.12.2", "proptest", "rand 0.8.5", - "rlp", + "rlp 0.5.2", "ruint-macro", "serde", "valuable", @@ -10429,7 +10985,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78046161564f5e7cd9008aff3b2990b3850dc8e0349119b98e8f251e099f24d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "fallible-iterator 0.3.0", "fallible-streaming-iterator", "hashlink", @@ -10438,16 +10994,31 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "rust-fsm" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "cebef9e69ecb76b3cebbbe9c789f41f4be3402a33dca983c24493f45c92351c9" +dependencies = [ + "aquamarine", + "rust-fsm-dsl", +] [[package]] -name = "rustc-hash" -version = "1.1.0" +name = "rust-fsm-dsl" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3adcbccd7feb6960e55a40d116a82ef40281248d630cfa3530586a49efbbd05" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -10472,20 +11043,20 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -10494,9 +11065,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -10506,30 +11077,30 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.2", - "subtle 2.5.0", + "rustls-webpki 0.102.8", + "subtle 2.6.1", "zeroize", ] [[package]] name = "rustls" -version = "0.23.7" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.2", - "subtle 2.5.0", + "rustls-webpki 0.102.8", + "subtle 2.6.1", "zeroize", ] @@ -10547,12 +11118,12 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.1", + "rustls-pemfile 2.1.3", "rustls-pki-types", "schannel", "security-framework", @@ -10569,19 +11140,19 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-platform-verifier" @@ -10594,13 +11165,13 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.7", - "rustls-native-certs 0.7.0", + "rustls 0.23.13", + "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.8", "security-framework", "security-framework-sys", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", "winapi 0.3.9", ] @@ -10622,9 +11193,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -10633,9 +11204,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty-fork" @@ -10651,9 +11222,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -10675,23 +11246,23 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.1" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788745a868b0e751750388f4e6546eb921ef714a4317fa6954f7cde114eb2eb7" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "cfg-if 1.0.0", - "derive_more 0.99.17", - "parity-scale-codec 3.6.9", + "derive_more 0.99.18", + "parity-scale-codec 3.6.12", "scale-info-derive", ] [[package]] name = "scale-info-derive" -version = "2.11.1" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc2f4e8bc344b9fc3d5f74f72c2e55bfc38d28dc2ebc69c194a3df424e4d9ac" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -10699,11 +11270,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -10730,6 +11301,12 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -10767,14 +11344,14 @@ name = "scroll-light-client" version = "0.1.0" dependencies = [ "base64 0.21.7", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethereum-light-client", "ethereum-verifier", "ethers-core", "hex", "ics008-wasm-client", "protos", - "rlp", + "rlp 0.5.2", "schemars", "scroll-codec", "scroll-verifier", @@ -10809,7 +11386,7 @@ dependencies = [ "ethers-core", "hex", "hex-literal", - "rlp", + "rlp 0.5.2", "scroll-codec", "serde", "serde-utils", @@ -10852,17 +11429,17 @@ dependencies = [ "der", "generic-array 0.14.7", "pkcs8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -10872,9 +11449,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -10891,9 +11468,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -10921,9 +11498,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -10956,7 +11533,7 @@ dependencies = [ "bcs 0.1.6", "bincode", "heck 0.3.3", - "include_dir", + "include_dir 0.6.2", "maplit", "serde", "serde-reflection", @@ -11006,12 +11583,13 @@ dependencies = [ [[package]] name = "serde-untagged" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a160535368dfc353348e7eaa299156bd508c60c45a9249725f5f6d370d82a66" +checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6" dependencies = [ - "erased-serde 0.4.4", + "erased-serde 0.4.5", "serde", + "typeid", ] [[package]] @@ -11038,9 +11616,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -11057,9 +11635,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -11079,12 +11657,13 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.118" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", + "memchr", "ryu", "serde", ] @@ -11112,9 +11691,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", @@ -11123,9 +11702,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -11152,7 +11731,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -11166,7 +11745,7 @@ version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ - "darling 0.20.8", + "darling 0.20.10", "proc-macro2", "quote", "syn 2.0.77", @@ -11190,7 +11769,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", "ryu", "serde", @@ -11268,9 +11847,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ "cc", "cfg-if 1.0.0", @@ -11285,11 +11864,38 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio 0.8.11", + "signal-hook", +] + [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -11373,9 +11979,9 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -11452,11 +12058,10 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ - "itertools 0.12.1", "nom", "unicode_categories", ] @@ -11496,13 +12101,13 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.6", + "indexmap 2.5.0", "log", "memchr", "once_cell", "paste", "percent-encoding", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -11566,7 +12171,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "bytes", "crc", @@ -11610,7 +12215,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "crc", "dotenvy", @@ -11712,12 +12317,40 @@ dependencies = [ "unionlabs", ] +[[package]] +name = "stability" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" +dependencies = [ + "quote", + "syn 2.0.77", +] + +[[package]] +name = "stable-pattern" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" +dependencies = [ + "memchr", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "state" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" +dependencies = [ + "loom", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -11750,13 +12383,13 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -11773,9 +12406,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "structopt" @@ -11821,11 +12454,11 @@ dependencies = [ [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] @@ -11856,11 +12489,11 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", @@ -11888,9 +12521,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-encoding" @@ -11918,7 +12551,7 @@ dependencies = [ "hex", "once_cell", "reqwest 0.11.27", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "sha2 0.10.8", @@ -12023,14 +12656,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if 1.0.0", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -12053,7 +12687,7 @@ dependencies = [ "serde_repr", "sha2 0.10.8", "signature 2.2.0", - "subtle 2.5.0", + "subtle 2.6.1", "subtle-encoding", "tendermint-proto", "time", @@ -12069,7 +12703,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.12", + "toml 0.8.19", "url", ] @@ -12079,7 +12713,7 @@ version = "0.1.0" dependencies = [ "base64 0.21.7", "bytes", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "hex", "ics008-wasm-client", "ics23", @@ -12122,16 +12756,16 @@ dependencies = [ "bytes", "flex-error", "futures", - "getrandom 0.2.12", + "getrandom 0.2.15", "peg", "pin-project", "rand 0.8.5", "reqwest 0.11.27", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_bytes", "serde_json", - "subtle 2.5.0", + "subtle 2.6.1", "subtle-encoding", "tendermint", "tendermint-config", @@ -12233,18 +12867,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", @@ -12276,8 +12910,8 @@ version = "0.1.0" dependencies = [ "cargo-util-schemas", "cargo_metadata", - "clap 4.5.4", - "toml 0.8.12", + "clap 4.5.17", + "toml 0.8.19", "tracing", "tracing-subscriber 0.3.18", ] @@ -12367,9 +13001,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -12384,8 +13018,8 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" name = "token-factory-api" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", ] [[package]] @@ -12397,7 +13031,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -12439,9 +13073,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" +checksum = "3b5d3742945bc7d7f210693b0c58ae542c6fd47b17adbbda0885f3dcb34a6bdb" dependencies = [ "async-trait", "byteorder", @@ -12469,7 +13103,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", "tokio", ] @@ -12479,7 +13113,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", ] @@ -12490,16 +13124,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.7", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -12515,7 +13149,7 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.21.10", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", "tungstenite 0.20.1", @@ -12542,12 +13176,12 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.7", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tungstenite 0.23.0", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -12578,21 +13212,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.9", + "toml_edit 0.22.21", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -12603,7 +13237,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", @@ -12612,37 +13246,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" -dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow 0.6.18", ] [[package]] @@ -12657,15 +13269,15 @@ dependencies = [ "base64 0.21.7", "bytes", "flate2", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-timeout", "percent-encoding", "pin-project", "prost 0.12.6", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "rustls-pemfile 1.0.4", "tokio", @@ -12700,15 +13312,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -12818,11 +13430,10 @@ dependencies = [ [[package]] name = "tracing-test" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a2c0ff408fe918a94c428a3f2ad04e4afd5c95bbc08fcf868eff750c15728a4" +checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" dependencies = [ - "lazy_static", "tracing-core", "tracing-subscriber 0.3.18", "tracing-test-macro", @@ -12830,13 +13441,12 @@ dependencies = [ [[package]] name = "tracing-test-macro" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bc1c4f8e2e73a977812ab339d503e6feeb92700f6d07a6de4d321522d5c08" +checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ - "lazy_static", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -12850,6 +13460,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "tree_magic_mini" +version = "3.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" +dependencies = [ + "fnv", + "home", + "memchr", + "nom", + "once_cell", + "petgraph 0.6.5", +] + [[package]] name = "trie-db" version = "0.28.0" @@ -12880,18 +13504,17 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trybuild" -version = "1.0.91" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad7eb6319ebadebca3dacf1f85a93bc54b73dd81b9036795f73de7ddfe27d5a" +checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8" dependencies = [ "dissimilar", "glob", - "once_cell", "serde", "serde_derive", "serde_json", "termcolor", - "toml 0.8.12", + "toml 0.8.19", ] [[package]] @@ -12907,7 +13530,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.21.10", + "rustls 0.21.12", "sha1", "thiserror", "url", @@ -12927,7 +13550,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "sha1", "thiserror", @@ -12948,7 +13571,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.23.7", + "rustls 0.23.13", "rustls-pki-types", "sha1", "thiserror", @@ -12972,6 +13595,12 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + [[package]] name = "typenum" version = "1.17.0" @@ -13000,6 +13629,15 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + [[package]] name = "ucd-trie" version = "0.1.6" @@ -13012,9 +13650,9 @@ version = "0.1.0" dependencies = [ "beacon-api", "chain-utils", - "clap 4.5.4", + "clap 4.5.17", "contracts", - "cosmwasm-std 1.5.2", + "cosmwasm-std 1.5.7", "ethers", "hex", "serde", @@ -13029,8 +13667,8 @@ dependencies = [ name = "ucs00-pingpong" version = "1.0.0" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-storage-plus 1.2.0", "dlmalloc", "ethabi", @@ -13045,8 +13683,8 @@ name = "ucs01-relay" version = "1.0.1" dependencies = [ "base58 0.2.0", - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "cw-controllers", "cw-multi-test", "cw-storage-plus 2.0.0", @@ -13058,7 +13696,7 @@ dependencies = [ "prost 0.12.6", "protos", "schemars", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde-json-wasm 1.0.1", "serde-utils", @@ -13075,8 +13713,8 @@ dependencies = [ name = "ucs01-relay-api" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.1.0", - "cosmwasm-std 2.1.0", + "cosmwasm-schema 2.1.3", + "cosmwasm-std 2.1.3", "ethabi", "go-parse-duration", "prost 0.12.6", @@ -13094,8 +13732,8 @@ dependencies = [ name = "ucs02-nft" version = "1.0.0" dependencies = [ - "cosmwasm-schema 1.5.3", - "cosmwasm-std 1.5.2", + "cosmwasm-schema 1.5.7", + "cosmwasm-std 1.5.7", "cw-storage-plus 1.2.0", "dlmalloc", "ethabi", @@ -13119,6 +13757,18 @@ dependencies = [ "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unarray" version = "0.1.4" @@ -13131,6 +13781,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" dependencies = [ + "serde", "version_check", ] @@ -13151,9 +13802,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-linebreak" @@ -13170,23 +13821,40 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" + [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-truncate" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" +dependencies = [ + "itertools 0.13.0", + "unicode-segmentation", + "unicode-width", +] [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "unicode_categories" @@ -13205,10 +13873,10 @@ dependencies = [ "borsh", "bs58 0.4.0", "chrono", - "clap 4.5.4", + "clap 4.5.17", "contracts", - "cosmwasm-std 1.5.2", - "derive_more 0.99.17", + "cosmwasm-std 1.5.7", + "derive_more 0.99.18", "either", "enumorph", "ethers", @@ -13229,7 +13897,7 @@ dependencies = [ "protos", "rand 0.8.5", "ripemd", - "rlp", + "rlp 0.5.2", "rs_merkle", "schemars", "serde", @@ -13244,7 +13912,7 @@ dependencies = [ "thiserror", "tracing", "typenum", - "uint", + "uint 0.10.0", "wasmparser", ] @@ -13252,7 +13920,7 @@ dependencies = [ name = "unionvisor" version = "0.1.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.17", "color-eyre", "figment", "fs_extra", @@ -13261,7 +13929,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml 0.8.12", + "toml 0.8.19", "tracing", "tracing-subscriber 0.3.18", "tracing-test", @@ -13274,7 +13942,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -13314,9 +13982,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -13338,9 +14006,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -13348,7 +14016,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "serde", ] @@ -13358,7 +14026,8 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", + "serde", ] [[package]] @@ -13405,9 +14074,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "voyager" @@ -13419,10 +14088,10 @@ dependencies = [ "bip32", "bitvec 1.0.1", "chain-utils", - "clap 4.5.4", + "clap 4.5.17", "contracts", "crossbeam-queue", - "derive_more 0.99.17", + "derive_more 0.99.18", "either", "enumorph", "ethers", @@ -13470,7 +14139,7 @@ dependencies = [ name = "voyager-chain-module-cosmos-sdk" version = "0.1.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.17", "cometbft-rpc", "dashmap", "enumorph", @@ -13526,7 +14195,7 @@ dependencies = [ "aptos-rest-client", "aptos-types", "bcs 0.1.6", - "clap 4.5.4", + "clap 4.5.17", "enumorph", "frunk", "futures", @@ -13555,7 +14224,7 @@ dependencies = [ name = "voyager-client-module-cometbls" version = "0.1.0" dependencies = [ - "clap 4.5.4", + "clap 4.5.17", "cometbft-rpc", "dashmap", "enumorph", @@ -13660,7 +14329,7 @@ version = "0.1.0" dependencies = [ "beacon-api", "chain-utils", - "clap 4.5.4", + "clap 4.5.17", "contracts", "dashmap", "enumorph", @@ -13881,19 +14550,20 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if 1.0.0", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -13906,9 +14576,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -13918,9 +14588,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -13928,9 +14598,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -13941,9 +14611,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" @@ -13964,15 +14634,15 @@ version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ - "indexmap 2.2.6", - "semver 1.0.22", + "indexmap 2.5.0", + "semver 1.0.23", ] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -13986,9 +14656,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -14005,23 +14675,11 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ "redox_syscall", "wasite", @@ -14070,11 +14728,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi 0.3.9", + "windows-sys 0.59.0", ] [[package]] @@ -14083,13 +14741,52 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -14107,7 +14804,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -14127,17 +14833,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -14148,9 +14855,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -14160,9 +14867,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -14172,9 +14879,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -14184,9 +14897,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -14196,9 +14909,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -14208,9 +14921,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -14220,9 +14933,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -14235,9 +14948,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -14252,16 +14965,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if 1.0.0", - "windows-sys 0.48.0", -] - [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -14273,7 +14976,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -14321,20 +15024,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +dependencies = [ + "is-terminal", +] + [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", @@ -14343,9 +15056,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -14418,9 +15131,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 23bb91fb44..17a29f8540 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,6 +96,10 @@ members = [ "lib/aptos-verifier", "lib/reconnecting-jsonrpc-ws-client", + + "mpc/shared", + "mpc/client", + "mpc/coordinator", ] [workspace.package] @@ -129,6 +133,7 @@ ics23 = { path = "lib/ics23", default-features = false linea-verifier = { path = "lib/linea-verifier", default-features = false } linea-zktrie = { path = "lib/linea-zktrie", default-features = false } macros = { path = "lib/macros", default-features = false } +mpc-shared = { path = "mpc/shared", default-features = false } move-bindgen = { path = "tools/move-bindgen", default-features = false } move-bindgen-derive = { path = "lib/move-bindgen-derive", default-features = false } pg-queue = { path = "lib/pg-queue", default-features = false } diff --git a/flake.nix b/flake.nix index 7006896fc8..5e8b10d8ce 100644 --- a/flake.nix +++ b/flake.nix @@ -231,6 +231,7 @@ ./galoisd/galoisd.nix ./unionvisor/unionvisor.nix ./voyager/voyager.nix + ./mpc/mpc.nix ./lib/ics23/ics23.nix ./lib/ssz/ssz.nix ./lib/unionlabs/unionlabs.nix @@ -321,7 +322,7 @@ last = pkgs.lib.lists.last complete; }; - goPkgs = import inputs.nixpkgs-go { inherit system; }; + goPkgs = import inputs.nixpkgs-go { inherit system; overlays = [ inputs.rust-overlay.overlays.default ]; }; unstablePkgs = import inputs.nixpkgs-unstable { inherit system; }; in { @@ -560,6 +561,7 @@ self'.packages.tdc self'.packages.voy-send-msg yq + gdb ]) ++ (with unstablePkgs; [ wasm-tools bun # for running TypeScript files on the fly diff --git a/galoisd/pkg/lightclient/nonadjacent/ptau.go b/galoisd/cmd/galoisd/cmd/phase1_init.go similarity index 80% rename from galoisd/pkg/lightclient/nonadjacent/ptau.go rename to galoisd/cmd/galoisd/cmd/phase1_init.go index 2bcdfe00c7..ed31856d4b 100644 --- a/galoisd/pkg/lightclient/nonadjacent/ptau.go +++ b/galoisd/cmd/galoisd/cmd/phase1_init.go @@ -1,6 +1,8 @@ -package nonadjacent +package cmd import ( + "github.com/spf13/cobra" + "encoding/binary" "errors" "fmt" @@ -11,12 +13,34 @@ import ( "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" + mpc "github.com/consensys/gnark/backend/groth16/bn254/mpcsetup" ) +func Phase1InitCmd() *cobra.Command { + var cmd = &cobra.Command{ + Short: "Initialize the phase 1 of the groth16 multi-party computation.", + Use: "mpc-phase1-init [ptau] [phase1FinalOutput]", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ptauPath := args[0] + ptau, err := ReadPtau(ptauPath) + if err != nil { + return err + } + srs1, err := convertPtauToPhase1(ptau) + if err != nil { + return err + } + phase1FinalPath := args[1] + return saveTo(phase1FinalPath, &srs1) + }, + } + return cmd +} + /////////////////////////////////////////////////////////////////// /// PTAU /// /////////////////////////////////////////////////////////////////// - // Format // Taken from the iden3/snarkjs repo powersoftau_new.js file // https://github.com/iden3/snarkjs/blob/master/src/powersoftau_new.js @@ -109,8 +133,6 @@ func InitPtau(path string) (*PtauFile, error) { var ptauStr = make([]byte, 4) _, err = reader.Read(ptauStr) - fmt.Printf("zkeyStr: %s \n", string(ptauStr)) - // version _, err = readULE32(reader) @@ -118,7 +140,6 @@ func InitPtau(path string) (*PtauFile, error) { _, err = readULE32(reader) numSections := uint32(7) - fmt.Printf("num sections: %v \n", numSections) // in practice, all sections have only one segment, but who knows... // 1-based indexing, so we need to allocate one more than the number of sections @@ -126,8 +147,6 @@ func InitPtau(path string) (*PtauFile, error) { for i := uint32(0); i < numSections; i++ { ht, _ := readULE32(reader) hl, _ := readULE64(reader) - fmt.Printf("ht: %v \n", ht) - fmt.Printf("hl: %v \n", hl) if sections[ht] == nil { sections[ht] = make([]SectionSegment, 0) } @@ -136,8 +155,6 @@ func InitPtau(path string) (*PtauFile, error) { reader.Seek(int64(hl), io.SeekCurrent) } - fmt.Printf("sections: %v \n", sections) - // section size _, err = readBigInt(reader, 8) @@ -174,7 +191,6 @@ func (ptauFile *PtauFile) readG1s(out chan bn254.G1Affine, count int) error { y := bytesToElement(g1[1].Bytes()) g1Affine.Y = y if !g1Affine.IsOnCurve() { - fmt.Printf("readG1s: \n index: %v g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) panic("g1Affine is not on curve") } out <- g1Affine @@ -198,7 +214,6 @@ func (ptauFile *PtauFile) readG2() (bn254.G2Affine, error) { g2Affine.Y.A1 = y1 if !g2Affine.IsOnCurve() { - fmt.Printf("readG2s: \n, g2Affine.X.A0: %v \n g2Affine.X.A1: %v \n g2Affine.Y.A0: %v \n g2Affine.Y.A1 %v \n", g2Affine.X.A0.String(), g2Affine.X.A1.String(), g2Affine.Y.A0.String(), g2Affine.Y.A1.String()) panic("g2Affine is not on curve") } return g2Affine, nil @@ -219,7 +234,6 @@ func (ptauFile *PtauFile) ReadTauG1(out chan bn254.G1Affine) error { defer close(out) seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 2) numPoints := ptauFile.DomainSize()*2 - 1 - fmt.Printf("tauG1 numPoints: %v \n", numPoints) ptauFile.readG1s(out, numPoints) return nil } @@ -228,7 +242,6 @@ func (ptauFile *PtauFile) ReadTauG2(out chan bn254.G2Affine) error { defer close(out) seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 3) numPoints := ptauFile.DomainSize() - fmt.Printf("tauG2 numPoints: %v \n", numPoints) ptauFile.readG2s(out, numPoints) return nil } @@ -237,7 +250,6 @@ func (ptauFile *PtauFile) ReadAlphaTauG1(out chan bn254.G1Affine) error { defer close(out) seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 4) numPoints := ptauFile.DomainSize() - fmt.Printf("alphaTauG1 numPoints: %v \n", numPoints) ptauFile.readG1s(out, numPoints) return nil } @@ -246,13 +258,11 @@ func (ptauFile *PtauFile) ReadBetaTauG1(out chan bn254.G1Affine) error { defer close(out) seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 5) numPoints := ptauFile.DomainSize() - fmt.Printf("betaTauG1 numPoints: %v \n", numPoints) ptauFile.readG1s(out, numPoints) return nil } func (ptauFile *PtauFile) ReadBetaG2() (bn254.G2Affine, error) { - fmt.Printf("betaG2: \n") seekToUniqueSection(ptauFile.Reader, ptauFile.Sections, 6) return ptauFile.readG2() } @@ -269,8 +279,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { var ptauStr = make([]byte, 4) _, err = reader.Read(ptauStr) - fmt.Printf("zkeyStr: %s \n", string(ptauStr)) - // version _, err = readULE32(reader) @@ -278,7 +286,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { _, err = readULE32(reader) numSections := uint32(7) - fmt.Printf("num sections: %v \n", numSections) // in practice, all sections have only one segment, but who knows... // 1-based indexing, so we need to allocate one more than the number of sections @@ -286,8 +293,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { for i := uint32(0); i < numSections; i++ { ht, _ := readULE32(reader) hl, _ := readULE64(reader) - fmt.Printf("ht: %v \n", ht) - fmt.Printf("hl: %v \n", hl) if sections[ht] == nil { sections[ht] = make([]SectionSegment, 0) } @@ -296,8 +301,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { reader.Seek(int64(hl), io.SeekCurrent) } - fmt.Printf("sections: %v \n", sections) - // section size _, err = readBigInt(reader, 8) @@ -318,8 +321,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { twoToPower := uint32(1 << header.Power) - fmt.Printf("tauG1: \n") - PtauPubKey.TauG1, err = readG1Array(reader, twoToPower*2-1) if err != nil { @@ -329,8 +330,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { // TauG2 (3) seekToUniqueSection(reader, sections, 3) - fmt.Printf("tauG2: \n") - PtauPubKey.TauG2, err = readG2Array(reader, twoToPower) if err != nil { @@ -340,8 +339,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { // AlphaTauG1 (4) seekToUniqueSection(reader, sections, 4) - fmt.Printf("alphaTauG1: \n") - PtauPubKey.AlphaTauG1, err = readG1Array(reader, twoToPower) if err != nil { @@ -351,8 +348,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { // BetaTauG1 (5) seekToUniqueSection(reader, sections, 5) - fmt.Printf("betaTauG1: \n") - PtauPubKey.BetaTauG1, err = readG1Array(reader, twoToPower) if err != nil { @@ -362,8 +357,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { // BetaG2 (6) seekToUniqueSection(reader, sections, 6) - fmt.Printf("betaG2: \n") - PtauPubKey.BetaG2, err = readG2(reader) if err != nil { @@ -650,14 +643,12 @@ func ReadZkey(zkeyPath string) (Zkey, error) { // zkey var zkeyStr = make([]byte, 4) _, err = reader.Read(zkeyStr) - fmt.Printf("zkeyStr: %s \n", string(zkeyStr)) // version _, err = readULE32(reader) // number of sections numSections, err := readULE32(reader) - fmt.Printf("num sections: %v \n", numSections) // in practice, all sections have only one segment, but who knows... // 1-based indexing, so we need to allocate one more than the number of sections @@ -665,8 +656,6 @@ func ReadZkey(zkeyPath string) (Zkey, error) { for i := uint32(0); i < numSections; i++ { ht, _ := readULE32(reader) hl, _ := readULE64(reader) - fmt.Printf("ht: %v \n", ht) - fmt.Printf("hl: %v \n", hl) if sections[ht] == nil { sections[ht] = make([]SectionSegment, 0) } @@ -675,8 +664,6 @@ func ReadZkey(zkeyPath string) (Zkey, error) { reader.Seek(int64(hl), io.SeekCurrent) } - fmt.Printf("sections: %v \n", sections) - // section size _, err = readBigInt(reader, 8) @@ -734,8 +721,6 @@ func readHeaderGroth16(reader io.ReadSeeker) (HeaderGroth, error) { n8q, err := readULE32(reader) - fmt.Printf("n8q is: %v \n", n8q) - if err != nil { return header, err } @@ -784,3 +769,94 @@ func readHeaderGroth16(reader io.ReadSeeker) (HeaderGroth, error) { return header, nil } + +func convertPtauToPhase1(ptau Ptau) (phase1 mpc.Phase1, err error) { + tauG1 := make([]bn254.G1Affine, len(ptau.PTauPubKey.TauG1)) + for i, g1 := range ptau.PTauPubKey.TauG1 { + g1Affine := bn254.G1Affine{} + x := bytesToElement(g1[0].Bytes()) + g1Affine.X = x + y := bytesToElement(g1[1].Bytes()) + g1Affine.Y = y + if !g1Affine.IsOnCurve() { + fmt.Printf("tauG1: \n index: %v g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) + panic("g1Affine is not on curve") + } + tauG1[i] = g1Affine + } + + alphaTauG1 := make([]bn254.G1Affine, len(ptau.PTauPubKey.AlphaTauG1)) + for i, g1 := range ptau.PTauPubKey.AlphaTauG1 { + g1Affine := bn254.G1Affine{} + x := bytesToElement(g1[0].Bytes()) + g1Affine.X = x + y := bytesToElement(g1[1].Bytes()) + g1Affine.Y = y + if !g1Affine.IsOnCurve() { + fmt.Printf("alphaTauG1: \n index: %v g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) + panic("g1Affine is not on curve") + } + alphaTauG1[i] = g1Affine + } + // fmt.Printf("alphaTauG1: %v \n", alphaTauG1) + + betaTauG1 := make([]bn254.G1Affine, len(ptau.PTauPubKey.BetaTauG1)) + + for i, g1 := range ptau.PTauPubKey.BetaTauG1 { + g1Affine := bn254.G1Affine{} + x := bytesToElement(g1[0].Bytes()) + g1Affine.X = x + y := bytesToElement(g1[1].Bytes()) + g1Affine.Y = y + if !g1Affine.IsOnCurve() { + fmt.Printf("betaTauG1: \n index: %v, g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) + panic("g1Affine is not on curve") + } + betaTauG1[i] = g1Affine + } + tauG2 := make([]bn254.G2Affine, len(ptau.PTauPubKey.TauG2)) + for i, g2 := range ptau.PTauPubKey.TauG2 { + g2Affine := bn254.G2Affine{} + x0 := bytesToElement(g2[0].Bytes()) + x1 := bytesToElement(g2[1].Bytes()) + g2Affine.X.A0 = x0 + g2Affine.X.A1 = x1 + y0 := bytesToElement(g2[2].Bytes()) + y1 := bytesToElement(g2[3].Bytes()) + g2Affine.Y.A0 = y0 + g2Affine.Y.A1 = y1 + if !g2Affine.IsOnCurve() { + fmt.Printf("tauG2: \n index: %v, g2Affine.X.A0: %v \n g2Affine.X.A1: %v \n g2Affine.Y.A0: %v \n g2Affine.Y.A1 %v \n", i, g2Affine.X.A0.String(), g2Affine.X.A1.String(), g2Affine.Y.A0.String(), g2Affine.Y.A1.String()) + panic("g2Affine is not on curve") + } + tauG2[i] = g2Affine + } + + betaG2 := bn254.G2Affine{} + { + g2 := ptau.PTauPubKey.BetaG2 + + x0 := bytesToElement(g2[0].Bytes()) + x1 := bytesToElement(g2[1].Bytes()) + betaG2.X.A0 = x0 + betaG2.X.A1 = x1 + y0 := bytesToElement(g2[2].Bytes()) + y1 := bytesToElement(g2[3].Bytes()) + betaG2.Y.A0 = y0 + betaG2.Y.A1 = y1 + + if !betaG2.IsOnCurve() { + fmt.Printf("g2Affine.X.A0: %v \n g2Affine.X.A1: %v \n g2Affine.Y.A0: %v \n g2Affine.Y.A1 %v \n", betaG2.X.A0.String(), betaG2.X.String(), betaG2.Y.A0.String(), betaG2.Y.A1.String()) + panic("g2Affine is not on curve") + } + } + + phase1.Parameters.G1.Tau = tauG1 + phase1.Parameters.G1.AlphaTau = alphaTauG1 + phase1.Parameters.G1.BetaTau = betaTauG1 + + phase1.Parameters.G2.Tau = tauG2 + phase1.Parameters.G2.Beta = betaG2 + + return phase1, nil +} diff --git a/galoisd/cmd/galoisd/cmd/phase2_contribute.go b/galoisd/cmd/galoisd/cmd/phase2_contribute.go new file mode 100644 index 0000000000..517e7a0fef --- /dev/null +++ b/galoisd/cmd/galoisd/cmd/phase2_contribute.go @@ -0,0 +1,26 @@ +package cmd + +import ( + mpc "github.com/consensys/gnark/backend/groth16/bn254/mpcsetup" + "github.com/spf13/cobra" +) + +func Phase2ContributeCmd() *cobra.Command { + var cmd = &cobra.Command{ + Short: "Initialize the phase 2 of the groth16 multi-party computation.", + Use: "mpc-phase2-contrib [phase2] [phase2Output]", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + phase2Path := args[0] + var srs2 mpc.Phase2 + err := readFrom(phase2Path, &srs2) + if err != nil { + return err + } + srs2.Contribute() + phase2Output := args[1] + return saveTo(phase2Output, &srs2) + }, + } + return cmd +} diff --git a/galoisd/cmd/galoisd/cmd/phase2_extract.go b/galoisd/cmd/galoisd/cmd/phase2_extract.go new file mode 100644 index 0000000000..d0464f6c51 --- /dev/null +++ b/galoisd/cmd/galoisd/cmd/phase2_extract.go @@ -0,0 +1,50 @@ +package cmd + +import ( + mpc "github.com/consensys/gnark/backend/groth16/bn254/mpcsetup" + bn254 "github.com/consensys/gnark/constraint/bn254" + "github.com/spf13/cobra" +) + +func Phase2ExtractCmd() *cobra.Command { + var cmd = &cobra.Command{ + Short: "Initialize the phase 2 of the groth16 multi-party computation.", + Use: "mpc-phase2-extract [r1cs] [phase1Final] [phase2Final] [phase2Evals] [provingKeyOutput] [verifyingKeyOutput]", + Args: cobra.ExactArgs(6), + RunE: func(cmd *cobra.Command, args []string) error { + r1csPath := args[0] + var r1cs bn254.R1CS + err := readFrom(r1csPath, &r1cs) + if err != nil { + return err + } + phase1Path := args[1] + var srs1 mpc.Phase1 + err = readFrom(phase1Path, &srs1) + if err != nil { + return err + } + phase2Path := args[2] + var srs2 mpc.Phase2 + err = readFrom(phase2Path, &srs2) + if err != nil { + return err + } + phase2EvalsPath := args[3] + var evals mpc.Phase2Evaluations + err = readFrom(phase2EvalsPath, &evals) + if err != nil { + return err + } + pk, vk := mpc.ExtractKeys(&r1cs, &srs1, &srs2, &evals) + pkOutput := args[4] + err = saveTo(pkOutput, &pk) + if err != nil { + return err + } + vkOutput := args[5] + return saveTo(vkOutput, &vk) + }, + } + return cmd +} diff --git a/galoisd/cmd/galoisd/cmd/phase2_init.go b/galoisd/cmd/galoisd/cmd/phase2_init.go new file mode 100644 index 0000000000..6b9eba35f6 --- /dev/null +++ b/galoisd/cmd/galoisd/cmd/phase2_init.go @@ -0,0 +1,38 @@ +package cmd + +import ( + mpc "github.com/consensys/gnark/backend/groth16/bn254/mpcsetup" + bn254 "github.com/consensys/gnark/constraint/bn254" + "github.com/spf13/cobra" +) + +func Phase2InitCmd() *cobra.Command { + var cmd = &cobra.Command{ + Short: "Initialize the phase 2 of the groth16 multi-party computation.", + Use: "mpc-phase2-init [r1cs] [phase1Final] [phase2InitOutput] [phase2EvalsOutput]", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) error { + r1csPath := args[0] + var r1cs bn254.R1CS + err := readFrom(r1csPath, &r1cs) + if err != nil { + return err + } + phase1Path := args[1] + var srs1 mpc.Phase1 + err = readFrom(phase1Path, &srs1) + if err != nil { + return err + } + srs2, evals := mpc.InitPhase2(&r1cs, &srs1) + phase2InitPath := args[2] + err = saveTo(phase2InitPath, &srs2) + if err != nil { + return err + } + phase2EvalsOutput := args[3] + return saveTo(phase2EvalsOutput, &evals) + }, + } + return cmd +} diff --git a/galoisd/cmd/galoisd/cmd/phase2_verify.go b/galoisd/cmd/galoisd/cmd/phase2_verify.go new file mode 100644 index 0000000000..8256732d58 --- /dev/null +++ b/galoisd/cmd/galoisd/cmd/phase2_verify.go @@ -0,0 +1,30 @@ +package cmd + +import ( + mpc "github.com/consensys/gnark/backend/groth16/bn254/mpcsetup" + "github.com/spf13/cobra" +) + +func Phase2VerifyCmd() *cobra.Command { + var cmd = &cobra.Command{ + Short: "Verify a phase 2 contribution of the groth16 multi-party computation.", + Use: "mpc-phase2-verify [phase2Previous] [phase2Contrib]", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + phase2Previous := args[0] + var prev mpc.Phase2 + err := readFrom(phase2Previous, &prev) + if err != nil { + return err + } + phase2Contrib := args[1] + var contrib mpc.Phase2 + err = readFrom(phase2Contrib, &contrib) + if err != nil { + return err + } + return mpc.VerifyPhase2(&prev, &contrib) + }, + } + return cmd +} diff --git a/galoisd/cmd/galoisd/cmd/utils.go b/galoisd/cmd/galoisd/cmd/utils.go new file mode 100644 index 0000000000..208387715e --- /dev/null +++ b/galoisd/cmd/galoisd/cmd/utils.go @@ -0,0 +1,31 @@ +package cmd + +import ( + "bufio" + "io" + "os" +) + +func saveTo(file string, x io.WriterTo) error { + f, err := os.Create(file) + if err != nil { + return err + } + defer f.Close() + w := bufio.NewWriter(f) + _, err = x.WriteTo(w) + if err != nil { + return err + } + return w.Flush() +} + +func readFrom(file string, obj io.ReaderFrom) error { + f, err := os.OpenFile(file, os.O_RDONLY, os.ModePerm) + if err != nil { + return err + } + defer f.Close() + _, err = obj.ReadFrom(f) + return err +} diff --git a/galoisd/cmd/galoisd/lib.go b/galoisd/cmd/galoisd/lib.go new file mode 100644 index 0000000000..75adc8fc1b --- /dev/null +++ b/galoisd/cmd/galoisd/lib.go @@ -0,0 +1,83 @@ +//go:build library +// +build library + +package main + +/* + #include + #include + #include +*/ +import "C" + +import ( + "bytes" + "io" + "log" + "unsafe" + + mpc "github.com/consensys/gnark/backend/groth16/bn254/mpcsetup" +) + +//export Phase2Verify +func Phase2Verify(phase2PreviousRaw *C.char, phase2ContribRaw *C.char, l C.int) bool { + phase2PreviousPayload := C.GoBytes(unsafe.Pointer(phase2PreviousRaw), l) + var previous mpc.Phase2 + err := readFromBuffer(phase2PreviousPayload, &previous) + if err != nil { + log.Printf("Failed to read phase2PreviousPayload: %v\n", err) + return false + } + phase2ContribPayload := C.GoBytes(unsafe.Pointer(phase2ContribRaw), l) + var contrib mpc.Phase2 + err = readFromBuffer(phase2ContribPayload, &contrib) + if err != nil { + log.Printf("Failed to read phase2ContribPayload: %v\n", err) + return false + } + err = mpc.VerifyPhase2(&previous, &contrib) + if err != nil { + log.Printf("Failed to verify phase2 contribution: %v\n", err) + return false + } + return true +} + +//export Phase2Contribute +func Phase2Contribute(phase2PayloadRaw *C.char, phase2ContribRaw *C.char, l C.int) bool { + phase2Payload := C.GoBytes(unsafe.Pointer(phase2PayloadRaw), l) + phase2Contrib, err := phase2Contribute(phase2Payload) + if err != nil { + log.Printf("Failed to contribute %v\n", err) + return false + } + phase2ContribOutput := unsafe.Slice(phase2ContribRaw, l) + for i := 0; i < int(l); i++ { + phase2ContribOutput[i] = C.char(phase2Contrib[i]) + } + return true +} + +func phase2Contribute(phase2Payload []byte) ([]byte, error) { + var srs2 mpc.Phase2 + err := readFromBuffer(phase2Payload, &srs2) + if err != nil { + log.Printf("Failed to read phase2Payload: %v\n", err) + return nil, err + } + srs2.Contribute() + var phase2Output bytes.Buffer + _, err = srs2.WriteTo(&phase2Output) + if err != nil { + log.Printf("Failed to write phase2Payload: %v\n", err) + return nil, err + } + return phase2Output.Bytes(), nil +} + +func readFromBuffer(buffer []byte, obj io.ReaderFrom) error { + _, err := obj.ReadFrom(bytes.NewReader(buffer)) + return err +} + +func main() {} diff --git a/galoisd/cmd/galoisd/main.go b/galoisd/cmd/galoisd/main.go index 56b51aebd9..fdfa06fd2c 100644 --- a/galoisd/cmd/galoisd/main.go +++ b/galoisd/cmd/galoisd/main.go @@ -1,3 +1,6 @@ +//go:build binary +// +build binary + package main import ( @@ -13,5 +16,12 @@ func main() { rootCmd.AddCommand(cmd.ExampleVerifyCmd()) rootCmd.AddCommand(cmd.QueryStats()) rootCmd.AddCommand(cmd.QueryStatsHealth()) + rootCmd.AddCommand( + cmd.Phase1InitCmd(), + cmd.Phase2InitCmd(), + cmd.Phase2ContributeCmd(), + cmd.Phase2VerifyCmd(), + cmd.Phase2ExtractCmd(), + ) rootCmd.Execute() } diff --git a/galoisd/galoisd.nix b/galoisd/galoisd.nix index 6912ad9f52..600dace88a 100644 --- a/galoisd/galoisd.nix +++ b/galoisd/galoisd.nix @@ -28,6 +28,7 @@ src = ./.; vendorHash = null; meta = { mainProgram = "galoisd"; }; + tags = [ "binary" ]; } // (if pkgs.stdenv.isLinux then { nativeBuildInputs = [ pkgs.musl ]; CGO_ENABLED = 0; @@ -38,6 +39,28 @@ } else { })); + galoisd-library = goPkgs.pkgsStatic.buildGoModule ({ + name = "libgalois"; + src = ./.; + vendorHash = null; + tags = [ "library" ]; + } // (if pkgs.stdenv.isLinux then { + nativeBuildInputs = [ goPkgs.musl goPkgs.pkgsStatic.binutils ]; + doCheck = false; + CGO_ENABLED = 1; + GOBIN = "${placeholder "out"}/lib"; + postInstall = '' + mv $out/lib/galoisd $out/lib/libgalois.a + ''; + ldflags = [ + "-s" + "-w" + "-buildmode c-archive" + ]; + } else + { })); + + galoisd-image = pkgs.dockerTools.buildImage { name = "${self'.packages.galoisd.name}-image"; copyToRoot = pkgs.buildEnv { diff --git a/galoisd/pkg/lightclient/nonadjacent/circuit_test.go b/galoisd/pkg/lightclient/nonadjacent/circuit_test.go index c4c287032f..5dca1e7123 100644 --- a/galoisd/pkg/lightclient/nonadjacent/circuit_test.go +++ b/galoisd/pkg/lightclient/nonadjacent/circuit_test.go @@ -1,35 +1,33 @@ package nonadjacent import ( + "cosmossdk.io/math" "crypto/sha256" "encoding/hex" "fmt" "galois/pkg/lightclient" - "math/big" - "math/rand" - "time" - - "cosmossdk.io/math" cometbn254 "github.com/cometbft/cometbft/crypto/bn254" + ce "github.com/cometbft/cometbft/crypto/encoding" + "github.com/cometbft/cometbft/crypto/merkle" tmtypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cometbft/cometbft/proto/tendermint/version" "github.com/cometbft/cometbft/types" comettypes "github.com/cometbft/cometbft/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" - - ce "github.com/cometbft/cometbft/crypto/encoding" - "github.com/cometbft/cometbft/crypto/merkle" "github.com/consensys/gnark-crypto/ecc" curve "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fr" - + "github.com/consensys/gnark/backend/witness" + bn254 "github.com/consensys/gnark/constraint/bn254" "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/frontend/cs/r1cs" gadget "github.com/consensys/gnark/std/algebra/emulated/sw_bn254" - - "testing" - "github.com/consensys/gnark/test" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/assert" + "math/big" + "math/rand" + "testing" + "time" ) type Pairing struct { @@ -625,3 +623,358 @@ func TestCantSelectPaddedValidator(t *testing.T) { func TestCantSelectPaddedPower(t *testing.T) { AttackFailing(t, AttackSelectPaddedPower) } + +func buildCircuit(t *testing.T) (*bn254.R1CS, *witness.Witness, error) { + r := rand.New(rand.NewSource(0xCAFEBABE)) + + nbOfValidators := 1 + r.Uint32()%lightclient.MaxVal + + privKeys := make([]cometbn254.PrivKey, nbOfValidators) + validators := make([]*tmtypes.SimpleValidator, nbOfValidators) + totalPower := int64(0) + for i := 0; i < len(validators); i++ { + privKeys[i] = cometbn254.GenPrivKey() + val, err := toValidator(privKeys[i].PubKey().Bytes(), 100000000+r.Int63n(100000000)) + if err != nil { + t.Fatal(err) + } + totalPower += val.VotingPower + validators[i] = val + } + + trustedValidators := validators + untrustedValidators := validators + + trustedValidatorsInput, trustedValidatorsRoot, err := marshalValidators(trustedValidators) + if err != nil { + t.Fatal(err) + } + + untrustedValidatorsInput, untrustedValidatorsRoot, err := marshalValidators(untrustedValidators) + if err != nil { + t.Fatal(err) + } + + header, vote, cometblsHeader, cometblsVote := getBlockHeader(r, trustedValidatorsRoot, untrustedValidatorsRoot) + + signedBytes := comettypes.VoteSignBytes(cometblsHeader.ChainID, cometblsVote) + + var signatures [][]byte + var bitmap big.Int + votingPower := 0 + + for true { + if votingPower > int(totalPower)/3*2+1 { + break + } + index := uint32(rand.Int31n(int32(nbOfValidators) - 1)) + i := index + for bitmap.Bit(int(i)) == 1 { + i = (i + 1) % nbOfValidators + } + votingPower += int(validators[i].VotingPower) + bitmap.SetBit(&bitmap, int(i), 1) + sig, err := privKeys[i].Sign(signedBytes) + if err != nil { + t.Fatal(err) + } + signatures = append(signatures, sig) + } + + trustedSignatures := signatures + untrustedSignatures := signatures + + trustedAggregatedSignature, err := aggregateSignatures(trustedSignatures) + if err != nil { + t.Fatal(err) + } + + untrustedAggregatedSignature, err := aggregateSignatures(untrustedSignatures) + if err != nil { + t.Fatal(err) + } + + trustedBitmap := bitmap + untrustedBitmap := bitmap + + trustedInput := TendermintNonAdjacentLightClientInput{ + Sig: gadget.NewG2Affine(trustedAggregatedSignature), + Validators: trustedValidatorsInput, + NbOfVal: nbOfValidators, + NbOfSignature: len(trustedSignatures), + Bitmap: trustedBitmap, + } + + untrustedInput := TendermintNonAdjacentLightClientInput{ + Sig: gadget.NewG2Affine(untrustedAggregatedSignature), + Validators: untrustedValidatorsInput, + NbOfVal: nbOfValidators, + NbOfSignature: len(untrustedSignatures), + Bitmap: untrustedBitmap, + } + + circuit := Circuit{ + DomainSeparationTag: []byte(cometbn254.CometblsSigDST), + TrustedInput: trustedInput, + TrustedValRoot: trustedValidatorsRoot, + UntrustedInput: untrustedInput, + Vote: *vote, + Header: *header, + InputsHash: inputsHash(cometblsHeader), + } + + err = test.IsSolved( + &Circuit{}, + &circuit, + ecc.BN254.ScalarField(), + ) + assert.NoError(t, err) + + witness, err := frontend.NewWitness(&circuit, ecc.BN254.ScalarField()) + if err != nil { + return nil, nil, err + } + + r1cs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit) + if err != nil { + return nil, nil, err + } + + return r1cs.(*bn254.R1CS), &witness, err +} + +// func TestNonAdjacentSetup(t *testing.T) { +// const ( +// nContributionsPhase1 = 1 +// nContributionsPhase2 = 1 +// power = 22 +// ) + +// assert := require.New(t) + +// t.Log("InitPhase1") +// start := time.Now() +// var srs1 mpc.Phase1 +// err := readFrom("final.ph1", &srs1) +// assert.NoError(err) +// t.Logf("InitPhase1: %v", time.Since(start)) + +// t.Log("Building circuit...") +// start = time.Now() +// r1cs, witness, err := buildCircuit(t) +// assert.NoError(err) +// t.Logf("Built in: %v", time.Since(start)) + +// t.Log("InitPhase2") +// start = time.Now() +// var srs2 mpc.Phase2 +// err = readFrom("init.ph2", &srs2) +// assert.NoError(err) +// var evals mpc.Phase2Evaluations +// err = readFrom("evals.ph2", &evals) +// assert.NoError(err) +// t.Logf("InitPhase2: %v", time.Since(start)) + +// err = saveTo("init.ph2", &srs2) +// assert.NoError(err) +// err = saveTo("evals.ph2", &evals) +// assert.NoError(err) + +// err = saveTo("contrib.ph2", &srs2) +// assert.NoError(err) + +// // Make and verify contributions for phase1 +// for i := 0; i < nContributionsPhase2; i++ { +// // we clone for test purposes; but in practice, participant will receive a []byte, deserialize it, +// // add his contribution and send back to coordinator. +// t.Log("ContributePhase2") +// assert.NoError(err) +// start = time.Now() +// srs2.Contribute() +// t.Logf("ContributePhase2: %v", time.Since(start)) +// t.Log("VerifyPhase2") +// var prev mpc.Phase2 +// start = time.Now() +// err = readFrom("contrib.ph2", &prev) +// t.Logf("VerifyPhase2Read: %v", time.Since(start)) +// start = time.Now() +// assert.NoError(mpc.VerifyPhase2(&prev, &srs2)) +// err = saveTo("contrib.ph2", &srs2) +// assert.NoError(err) +// t.Logf("VerifyPhase2: %v", time.Since(start)) +// } + +// t.Log("ExtractKeys") +// // Extract the proving and verifying keys +// pk, vk := mpc.ExtractKeys(r1cs, &srs1, &srs2, &evals) + +// t.Log("Save") +// err = saveTo("r1cs.bin", r1cs) +// assert.NoError(err) +// err = saveTo("pk.bin", &pk) +// assert.NoError(err) +// err = saveTo("vk.bin", &vk) +// assert.NoError(err) + +// t.Log("Prove...") +// proof, err := groth16.Prove(r1cs, &pk, *witness) +// assert.NoError(err) + +// pubWitness, err := (*witness).Public() +// assert.NoError(err) + +// t.Log("Verify...") +// err = groth16.Verify(proof, &vk, pubWitness) +// assert.NoError(err) +// } + +// func readFrom(file string, obj io.ReaderFrom) error { +// f, err := os.OpenFile(file, os.O_RDONLY, os.ModePerm) +// if err != nil { +// return err +// } +// defer f.Close() +// obj.ReadFrom(f) +// return nil +// } + +// func saveTo(file string, x io.WriterTo) error { +// f, err := os.Create(file) +// if err != nil { +// return err +// } +// defer f.Close() +// w := bufio.NewWriter(f) +// _, err = x.WriteTo(w) +// if err != nil { +// return err +// } +// w.Flush() +// return nil +// } + +// func clonePhase1(phase1 *mpc.Phase1) mpc.Phase1 { +// r := mpc.Phase1{} +// r.Parameters.G1.Tau = append(r.Parameters.G1.Tau, phase1.Parameters.G1.Tau...) +// r.Parameters.G1.AlphaTau = append(r.Parameters.G1.AlphaTau, phase1.Parameters.G1.AlphaTau...) +// r.Parameters.G1.BetaTau = append(r.Parameters.G1.BetaTau, phase1.Parameters.G1.BetaTau...) + +// r.Parameters.G2.Tau = append(r.Parameters.G2.Tau, phase1.Parameters.G2.Tau...) +// r.Parameters.G2.Beta = phase1.Parameters.G2.Beta + +// r.PublicKeys = phase1.PublicKeys +// r.Hash = append(r.Hash, phase1.Hash...) + +// return r +// } + +// func clonePhase2(phase2 *mpc.Phase2) mpc.Phase2 { +// r := mpc.Phase2{} +// r.Parameters.G1.BasisExpSigma = make([][]curve.G1Affine, len(r.Parameters.G1.BasisExpSigma)) +// for i := 0; i < len(r.Parameters.G1.BasisExpSigma); i++ { +// r.Parameters.G1.BasisExpSigma[i] = append( +// r.Parameters.G1.BasisExpSigma[i], +// phase2.Parameters.G1.BasisExpSigma[i]..., +// ) +// } +// r.Parameters.G1.Delta = phase2.Parameters.G1.Delta +// r.Parameters.G1.L = append(r.Parameters.G1.L, phase2.Parameters.G1.L...) +// r.Parameters.G1.Z = append(r.Parameters.G1.Z, phase2.Parameters.G1.Z...) +// r.Parameters.G2.Delta = phase2.Parameters.G2.Delta +// r.Parameters.G2.GRootSigmaNeg = phase2.Parameters.G2.GRootSigmaNeg +// r.PublicKey = phase2.PublicKey +// r.Hash = append(r.Hash, phase2.Hash...) + +// return r +// } + +// func convertPtauToPhase1(ptau Ptau) (phase1 mpc.Phase1, err error) { +// tauG1 := make([]curve.G1Affine, len(ptau.PTauPubKey.TauG1)) +// for i, g1 := range ptau.PTauPubKey.TauG1 { +// g1Affine := curve.G1Affine{} +// x := bytesToElement(g1[0].Bytes()) +// g1Affine.X = x +// y := bytesToElement(g1[1].Bytes()) +// g1Affine.Y = y +// if !g1Affine.IsOnCurve() { +// fmt.Printf("tauG1: \n index: %v g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) +// panic("g1Affine is not on curve") +// } +// tauG1[i] = g1Affine +// } + +// alphaTauG1 := make([]curve.G1Affine, len(ptau.PTauPubKey.AlphaTauG1)) +// for i, g1 := range ptau.PTauPubKey.AlphaTauG1 { +// g1Affine := curve.G1Affine{} +// x := bytesToElement(g1[0].Bytes()) +// g1Affine.X = x +// y := bytesToElement(g1[1].Bytes()) +// g1Affine.Y = y +// if !g1Affine.IsOnCurve() { +// fmt.Printf("alphaTauG1: \n index: %v g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) +// panic("g1Affine is not on curve") +// } +// alphaTauG1[i] = g1Affine +// } +// // fmt.Printf("alphaTauG1: %v \n", alphaTauG1) + +// betaTauG1 := make([]curve.G1Affine, len(ptau.PTauPubKey.BetaTauG1)) + +// for i, g1 := range ptau.PTauPubKey.BetaTauG1 { +// g1Affine := curve.G1Affine{} +// x := bytesToElement(g1[0].Bytes()) +// g1Affine.X = x +// y := bytesToElement(g1[1].Bytes()) +// g1Affine.Y = y +// if !g1Affine.IsOnCurve() { +// fmt.Printf("betaTauG1: \n index: %v, g1Affine.X: %v \n g1Affine.Y: %v \n", i, g1Affine.X.String(), g1Affine.Y.String()) +// panic("g1Affine is not on curve") +// } +// betaTauG1[i] = g1Affine +// } +// tauG2 := make([]curve.G2Affine, len(ptau.PTauPubKey.TauG2)) +// for i, g2 := range ptau.PTauPubKey.TauG2 { +// g2Affine := curve.G2Affine{} +// x0 := bytesToElement(g2[0].Bytes()) +// x1 := bytesToElement(g2[1].Bytes()) +// g2Affine.X.A0 = x0 +// g2Affine.X.A1 = x1 +// y0 := bytesToElement(g2[2].Bytes()) +// y1 := bytesToElement(g2[3].Bytes()) +// g2Affine.Y.A0 = y0 +// g2Affine.Y.A1 = y1 +// if !g2Affine.IsOnCurve() { +// fmt.Printf("tauG2: \n index: %v, g2Affine.X.A0: %v \n g2Affine.X.A1: %v \n g2Affine.Y.A0: %v \n g2Affine.Y.A1 %v \n", i, g2Affine.X.A0.String(), g2Affine.X.A1.String(), g2Affine.Y.A0.String(), g2Affine.Y.A1.String()) +// panic("g2Affine is not on curve") +// } +// tauG2[i] = g2Affine +// } + +// betaG2 := curve.G2Affine{} +// { +// g2 := ptau.PTauPubKey.BetaG2 + +// x0 := bytesToElement(g2[0].Bytes()) +// x1 := bytesToElement(g2[1].Bytes()) +// betaG2.X.A0 = x0 +// betaG2.X.A1 = x1 +// y0 := bytesToElement(g2[2].Bytes()) +// y1 := bytesToElement(g2[3].Bytes()) +// betaG2.Y.A0 = y0 +// betaG2.Y.A1 = y1 + +// if !betaG2.IsOnCurve() { +// fmt.Printf("g2Affine.X.A0: %v \n g2Affine.X.A1: %v \n g2Affine.Y.A0: %v \n g2Affine.Y.A1 %v \n", betaG2.X.A0.String(), betaG2.X.String(), betaG2.Y.A0.String(), betaG2.Y.A1.String()) +// panic("g2Affine is not on curve") +// } +// } + +// phase1.Parameters.G1.Tau = tauG1 +// phase1.Parameters.G1.AlphaTau = alphaTauG1 +// phase1.Parameters.G1.BetaTau = betaTauG1 + +// phase1.Parameters.G2.Tau = tauG2 +// phase1.Parameters.G2.Beta = betaG2 + +// return phase1, nil +// } diff --git a/mpc/client/Cargo.toml b/mpc/client/Cargo.toml new file mode 100644 index 0000000000..d076ebe5e5 --- /dev/null +++ b/mpc/client/Cargo.toml @@ -0,0 +1,17 @@ +[package] +edition = { workspace = true } +name = "mpc-client" +version = "0.1.0" + +[dependencies] +clap = { version = "4.5", features = ["derive"] } +crossterm = "0.27.0" +mpc-shared = { workspace = true } +rand = "0.8.5" +ratatui = "0.27.0" +reqwest = { workspace = true, features = ["json"] } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +sha2 = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full"] } diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs new file mode 100644 index 0000000000..ad58024b87 --- /dev/null +++ b/mpc/client/src/main.rs @@ -0,0 +1,263 @@ +use std::{io::SeekFrom, path::Path, str::FromStr}; + +use clap::{Parser, Subcommand}; +use mpc_shared::{ + phase2_contribute, phase2_verify, types::Contribution, CONTRIBUTION_CHUNKS, + CONTRIBUTION_CHUNK_SIZE, CONTRIBUTION_SIZE, +}; +use reqwest::{ + header::{ + HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_ENCODING, CONTENT_LENGTH, RANGE, + TRANSFER_ENCODING, + }, + StatusCode, +}; +use sha2::Digest; +use tokio::io::{AsyncSeekExt, AsyncWriteExt}; + +#[derive(Parser, Debug)] +#[command(version, about, long_about = None)] +struct Args { + #[command(subcommand)] + command: Command, +} + +#[derive(Subcommand, Debug, Clone)] +enum Command { + Contribute { + #[arg(short, long)] + token: String, + }, + Verify { + #[arg(short, long)] + phase2_payload_path: String, + #[arg(short, long)] + phase2_contrib_path: String, + }, +} + +#[derive(thiserror::Error, Debug, Copy, Clone)] +enum Error { + #[error(transparent)] + Phase2ContributionFailed(#[from] mpc_shared::Phase2ContributionError), + #[error(transparent)] + Phase2VerificationFailed(#[from] mpc_shared::Phase2VerificationError), + #[error("Failed to read current state file.")] + FailedToReadPhase2Payload, + #[error("Failed to read contrib state file.")] + FailedToReadPhase2Contrib, + #[error("Failed to write the contribution file.")] + FailedToWriteContribution, +} + +async fn get_state_file(path: &Path) -> (Vec, [u8; 32]) { + if !tokio::fs::try_exists(path).await.unwrap() { + tokio::fs::write(path, []).await.unwrap(); + } + let content = tokio::fs::read(path).await.unwrap(); + let hash = sha2::Sha256::new().chain_update(&content).finalize(); + (content, hash.into()) +} + +#[derive(Debug)] +pub enum CompressionType { + Gzip, + Deflate, + Brotli, + Zstd, +} + +impl FromStr for CompressionType { + type Err = (); + fn from_str(value: &str) -> Result { + match value { + "gzip" => Ok(CompressionType::Gzip), + "deflate" => Ok(CompressionType::Deflate), + "br" => Ok(CompressionType::Brotli), + "zstd" => Ok(CompressionType::Zstd), + _ => Err(()), + } + } +} + +fn get_compression_type(headers: &HeaderMap) -> Option { + let mut compression_type = headers + .get_all(CONTENT_ENCODING) + .iter() + .find_map(|value| value.to_str().ok().and_then(|value| value.parse().ok())); + + if compression_type.is_none() { + compression_type = headers + .get_all(TRANSFER_ENCODING) + .iter() + .find_map(|value| value.to_str().ok().and_then(|value| value.parse().ok())); + } + + if compression_type.is_some() { + if let Some(content_length) = headers.get(CONTENT_LENGTH) { + if content_length == "0" { + return None; + } + } + } + + compression_type +} + +#[tokio::main] +async fn main() -> Result<(), Error> { + let args = Args::parse(); + match args.command { + Command::Contribute { token } => { + let url = |path: String| format!("http://localhost:8000/{}", path); + println!("client token {}", token); + let client = reqwest::ClientBuilder::new() + .default_headers(HeaderMap::from_iter([( + AUTHORIZATION, + HeaderValue::from_str(&format!("Bearer {}", token)).unwrap(), + )])) + .build() + .unwrap(); + println!("joining the queue"); + client + .post(url("join".into())) + .send() + .await + .unwrap() + .error_for_status() + .unwrap(); + println!("waiting our turn..."); + let expected_state_file_hash = loop { + let response = client.get(url("me".into())).send().await.unwrap(); + if response.status().is_success() { + println!("finally our turn!"); + let expected_hash = response.bytes().await.unwrap(); + break expected_hash; + } + let response = client.get(url("contribution".into())).send().await.unwrap(); + match response.status() { + StatusCode::OK => { + println!( + "contribution done: {:?}", + response.json::().await.unwrap() + ); + return Ok(()); + } + _ => {} + } + println!("checking contribution status..."); + tokio::time::sleep(std::time::Duration::from_millis(1000)).await; + }; + println!("verifying state file integrity..."); + enum StateFileAction { + Download(usize), + Done(Vec), + } + let state_path = Path::new("./state.ph2"); + let action = match get_state_file(&state_path).await { + (content, _) if content.len() < CONTRIBUTION_SIZE => { + println!("partial download, continuing from {}...", content.len()); + StateFileAction::Download(content.len()) + } + (content, hash) + if content.len() == CONTRIBUTION_SIZE && hash == *expected_state_file_hash => + { + println!("integrity verified, download complete."); + StateFileAction::Done(content) + } + _ => { + println!("invalid size or invalid hash detected, redownloading..."); + StateFileAction::Download(0) + } + }; + let payload = match action { + StateFileAction::Download(start_position) => { + let mut response = client + .get(url("state".into())) + .header(RANGE, format!("bytes={}-", start_position)) + .send() + .await + .unwrap() + .error_for_status() + .unwrap(); + let headers = response.headers(); + assert!( + get_compression_type(headers).is_none(), + "compression not supported." + ); + let total_length = start_position + + u64::from_str(headers.get(CONTENT_LENGTH).unwrap().to_str().unwrap()) + .unwrap() as usize; + println!("state file length: {}", total_length); + assert!( + total_length == CONTRIBUTION_SIZE, + "contribution length mismatch." + ); + let mut state_file = tokio::fs::OpenOptions::new() + .write(true) + .create(false) + .open(state_path) + .await + .unwrap(); + state_file.set_len(start_position as u64).await.unwrap(); + state_file + .seek(SeekFrom::Start(start_position as u64)) + .await + .unwrap(); + let mut i = 0; + while let Some(chunk) = response.chunk().await.unwrap() { + if i % 10 == 0 { + println!("eta: chunk {}.", i); + } + let written = state_file.write(&chunk).await.unwrap(); + assert!(written == chunk.len(), "couldn't write chunk."); + state_file.sync_data().await.unwrap(); + i += 1; + } + println!("download complete"); + println!("verifying integrity..."); + let final_content = tokio::fs::read(state_path).await.unwrap(); + let final_content_hash = sha2::Sha256::new() + .chain_update(&final_content) + .finalize() + .to_vec(); + assert!( + &final_content_hash == expected_state_file_hash.as_ref(), + "invalid file hash after download." + ); + println!("integrity verified"); + final_content + } + StateFileAction::Done(content) => content, + }; + println!("generating contribution, may take some time..."); + let phase2_contribution = phase2_contribute(&payload).unwrap(); + println!("uploading contribution..."); + for i in 0..=CONTRIBUTION_CHUNKS { + println!("eta: chunk {}.", i); + let chunk = &phase2_contribution[i * CONTRIBUTION_CHUNK_SIZE + ..std::cmp::min((i + 1) * CONTRIBUTION_CHUNK_SIZE, CONTRIBUTION_SIZE)]; + client + .post(url(format!("contribute/{}", i))) + .body(chunk.to_vec()) + .send() + .await + .unwrap() + .error_for_status() + .unwrap(); + } + Ok(()) + } + Command::Verify { + phase2_payload_path, + phase2_contrib_path, + } => { + // let phase2_payload = + // std::fs::read(phase2_payload_path).map_err(|_| Error::FailedToReadPhase2Payload)?; + // let phase2_contrib = + // std::fs::read(phase2_contrib_path).map_err(|_| Error::FailedToReadPhase2Contrib)?; + // phase2_verify(&phase2_payload, &phase2_contrib)?; + Ok(()) + } + } +} diff --git a/mpc/coordinator/Cargo.toml b/mpc/coordinator/Cargo.toml new file mode 100644 index 0000000000..9ed39e7388 --- /dev/null +++ b/mpc/coordinator/Cargo.toml @@ -0,0 +1,16 @@ +[package] +edition = { workspace = true } +name = "mpc-coordinator" +version = "0.1.0" + +[dependencies] +clap = { version = "4.5", features = ["derive"] } +futures.workspace = true +mpc-shared = { workspace = true } +priority-queue = "2.0.3" +rocket = { version = "0.5.1", features = ["json", "msgpack", "uuid"] } +rocket-authorization = "1.0.0" +rocket_seek_stream = "0.2.6" +rust-fsm = { version = "0.7.0", features = ["diagram"] } +sha2 = { workspace = true } +thiserror = { workspace = true } diff --git a/mpc/coordinator/src/fsm.rs b/mpc/coordinator/src/fsm.rs new file mode 100644 index 0000000000..b5ca516fb2 --- /dev/null +++ b/mpc/coordinator/src/fsm.rs @@ -0,0 +1,22 @@ +use rust_fsm::state_machine; + +state_machine! { + #[derive(Debug, Copy, Clone, PartialEq, Eq)] + pub union_mpc(AwaitContribution) + InitContributor => { + NoContributor => AwaitContributor, + ContributorSet => AwaitContribution, + }, + AwaitContributor => { + Join => InitContributor, + }, + AwaitContribution => { + Contribute => Verify, + Join => AwaitContribution, + SetPriority => AwaitContribution, + }, + Verify => { + Valid => InitContributor, + Invalid => InitContributor, + }, +} diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs new file mode 100644 index 0000000000..272612446d --- /dev/null +++ b/mpc/coordinator/src/main.rs @@ -0,0 +1,404 @@ +pub mod fsm; + +use std::{ + collections::{HashMap, HashSet}, + io::Cursor, + marker::PhantomData, + sync::{ + mpsc::{channel, Sender, TryRecvError}, + Arc, RwLock, + }, + time::{SystemTime, UNIX_EPOCH}, +}; + +use clap::{Parser, Subcommand}; +use mpc_shared::{ + phase2_verify, types::Contribution, CONTRIBUTION_CHUNKS, CONTRIBUTION_CHUNK_SIZE, + CONTRIBUTION_CHUNK_SIZE_FINAL, +}; +use priority_queue::PriorityQueue; +use rocket::{ + data::{Limits, ToByteUnit}, + fs::TempFile, + get, + http::{ + hyper::{header::AUTHORIZATION, HeaderValue}, + ContentType, Cookie, CookieJar, Header, Status, + }, + post, + request::{FromParam, FromRequest, Outcome, Request}, + response::status::{self, Forbidden, NotFound, Unauthorized}, + routes, + serde::{ + json::{json, Json, Value}, + Deserialize, Serialize, + }, + Response, State, +}; +use rocket_authorization::{AuthError, Authorization, Credential}; +use rocket_seek_stream::SeekStream; +use sha2::Digest; + +#[derive(Parser, Debug)] +#[command(version, about, long_about = None)] +struct Args { + #[command(subcommand)] + command: Command, +} + +#[derive(Subcommand, Debug, Clone)] +enum Command { + Start { + #[arg(short, long)] + phase2_payload_path: String, + }, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize)] +#[serde(crate = "rocket::serde")] +struct Contributor { + token: String, +} + +#[derive(Debug)] +struct AppState { + queue: PriorityQueue, + processed: HashMap, + payload: Vec, + payload_hash: Vec, + contributor: Contributor, + upload_index: Index, + contribution_payload: Vec, + machine: fsm::union_mpc::StateMachine, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +enum AppMessage { + Join { + token: String, + }, + ContributePartial { + token: String, + index: Index, + payload_fraction: Vec, + }, +} + +struct Current; +struct Any; +struct AuthContributor(String, PhantomData); +#[rocket::async_trait] +impl Authorization for AuthContributor { + const KIND: &'static str = "Bearer"; + async fn parse(_: &str, token: &str, request: &Request) -> Result { + let app_state = request + .rocket() + .state::>>() + .unwrap() + .read() + .unwrap(); + if app_state.machine.state() == &fsm::union_mpc::State::AwaitContribution + && app_state.contributor.token == token + { + Ok(Self(token.to_string(), PhantomData)) + } else { + Err(AuthError::Unauthorized) + } + } +} +#[rocket::async_trait] +impl Authorization for AuthContributor { + const KIND: &'static str = "Bearer"; + async fn parse(_: &str, token: &str, request: &Request) -> Result { + Ok(Self(token.to_string(), PhantomData)) + } +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize)] +#[serde(crate = "rocket::serde")] +struct Index(u8); +impl<'a> FromParam<'a> for Index { + type Error = (); + fn from_param(param: &'a str) -> Result { + let result = u8::from_param(param).map_err(|_| ())?; + if result as usize <= CONTRIBUTION_CHUNKS { + Ok(Index(result)) + } else { + Err(()) + } + } +} + +#[get("/contribution")] +async fn contribution( + c: Credential>, + app_state: &State>>, +) -> Result, NotFound<()>> { + match app_state + .read() + .unwrap() + .processed + .get(&Contributor { token: c.0 .0 }) + { + Some(contribution) => Ok(Json(contribution.clone())), + None => Err(NotFound(())), + } +} + +#[post("/contribute/", data = "")] +async fn contribute( + c: Credential>, + index: Index, + payload: Vec, + app_state: &State>>, + tx: &State>, +) -> Result<(), Forbidden<()>> { + tx.send(AppMessage::ContributePartial { + token: c.0 .0, + index, + payload_fraction: payload, + }) + .unwrap(); + Ok(()) +} + +#[get("/me")] +async fn me( + c: Credential>, + app_state: &State>>, +) -> Result, Forbidden<()>> { + let hash = { app_state.read().unwrap().payload_hash.clone() }; + Ok(hash) +} + +#[get("/state")] +async fn state<'a>( + c: Credential>, + app_state: &State>>, +) -> Result, Forbidden<()>> { + let bytes = { app_state.read().unwrap().payload.clone() }; + let len = bytes.len() as u64; + Ok(SeekStream::with_opts( + Cursor::new(bytes), + len, + "application/octet-stream", + )) +} + +#[post("/join")] +async fn join(c: Credential>, tx: &State>) -> Status { + // TODO: verify token + tx.send(AppMessage::Join { token: c.0 .0 }).unwrap(); + Status::Ok +} + +#[get("/")] +fn index() -> &'static str { + " + Bruh u ain't mess with the kraken + " +} + +#[rocket::main] +async fn main() -> std::io::Result<()> { + let args = Args::parse(); + match args.command { + Command::Start { + phase2_payload_path, + } => { + let payload = std::fs::read(phase2_payload_path).unwrap(); + let payload_hash = sha2::Sha256::new() + .chain_update(&payload) + .finalize() + .to_vec(); + let (tx, rx) = channel::(); + let initial_contributor = Contributor { + token: "union".into(), + }; + let app_state = Arc::new(RwLock::new(AppState { + queue: PriorityQueue::with_capacity(4096), + processed: HashMap::with_capacity(4096), + contributor: initial_contributor, + payload, + payload_hash, + upload_index: Index(0), + contribution_payload: Vec::new(), + machine: fsm::union_mpc::StateMachine::new(), + })); + let app_state_clone = app_state.clone(); + rocket::tokio::spawn(async move { + let figment = rocket::Config::figment() + .merge(("limits", Limits::new().limit("bytes", 12.mebibytes()))); + rocket::custom(figment) + .manage(app_state_clone) + .manage(tx) + .mount( + "/", + routes![index, join, me, state, contribute, contribution], + ) + .launch() + .await + .unwrap(); + }); + let (tx_verify, rx_verify) = channel::<(Vec, Vec)>(); + let (tx_verify_result, rx_verify_result) = channel::(); + rocket::tokio::spawn(async move { + loop { + let (payload, contribution_payload) = rx_verify.recv().unwrap(); + println!("verifying contribution payloads"); + if phase2_verify(&payload, &contribution_payload).is_ok() { + println!("valid"); + tx_verify_result.send(true).unwrap(); + } else { + println!("invalid"); + tx_verify_result.send(false).unwrap(); + } + } + }); + + loop { + { + let mut app_state = app_state.write().unwrap(); + let machine_state = *app_state.machine.state(); + let mut join = |token: String| { + let new_contributor = Contributor { token }; + if app_state.queue.get(&new_contributor).is_none() + && app_state.processed.get(&new_contributor).is_none() + && app_state.contributor != new_contributor + { + let queue_len = app_state.queue.len(); + const BASE_PRORITY: usize = 1000000; + let priority = BASE_PRORITY - queue_len; + println!( + "contributor joined: {} with priority {}", + new_contributor.token, priority + ); + app_state.queue.push(new_contributor, priority); + app_state + .machine + .consume(&fsm::union_mpc::Input::Join) + .unwrap(); + } + }; + match machine_state { + fsm::union_mpc::State::InitContributor => { + let input = match app_state.queue.pop() { + Some((contributor, _)) => { + println!("new contributor slot"); + app_state.contributor = contributor; + app_state.upload_index = Index(0); + app_state.contribution_payload.clear(); + fsm::union_mpc::Input::ContributorSet + } + None => { + println!("no contributor"); + fsm::union_mpc::Input::NoContributor + } + }; + app_state.machine.consume(&input).unwrap(); + } + fsm::union_mpc::State::AwaitContributor => match rx.try_recv() { + Ok(message) => match message { + AppMessage::Join { token } => { + join(token); + } + _ => {} + }, + Err(TryRecvError::Empty) => {} + Err(e) => { + println!("error in awaiting contributor {:?}", e); + break; + } + }, + fsm::union_mpc::State::AwaitContribution => match rx.try_recv() { + Ok(message) => match message { + AppMessage::Join { token } => { + join(token); + } + AppMessage::ContributePartial { + token, + index: Index(index), + mut payload_fraction, + } => { + if app_state.contributor.token == token + && app_state.upload_index == Index(index) + { + let expected_len = if (index as usize) < CONTRIBUTION_CHUNKS + { + CONTRIBUTION_CHUNK_SIZE + } else { + CONTRIBUTION_CHUNK_SIZE_FINAL + }; + if payload_fraction.len() == expected_len { + println!("partial contribution chunk {}", index); + app_state.upload_index = Index(index + 1); + app_state + .contribution_payload + .append(&mut payload_fraction); + if index as usize == CONTRIBUTION_CHUNKS { + println!("contribution complete"); + tx_verify + .send(( + app_state.payload.clone(), + app_state.contribution_payload.clone(), + )) + .unwrap(); + app_state.payload = + app_state.contribution_payload.clone(); + app_state + .machine + .consume(&fsm::union_mpc::Input::Contribute) + .unwrap(); + } + } else { + println!("invalid chunk length {}", index); + } + } + } + }, + Err(TryRecvError::Empty) => {} + Err(e) => { + println!("error in await {:?}", e); + break; + } + }, + fsm::union_mpc::State::Verify => match rx_verify_result.try_recv() { + Ok(result) => { + let timestamp = SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap() + .as_secs(); + let contribution = Contribution { + success: result, + timestamp, + }; + let contributor = app_state.contributor.clone(); + app_state.processed.insert(contributor, contribution); + if result { + println!("verification succeeded."); + app_state + .machine + .consume(&fsm::union_mpc::Input::Valid) + .unwrap(); + } else { + println!("verification failed."); + app_state + .machine + .consume(&fsm::union_mpc::Input::Invalid) + .unwrap(); + } + } + Err(TryRecvError::Empty) => {} + Err(e) => { + println!("error in verify {:?}", e); + break; + } + }, + }; + } + rocket::tokio::time::sleep(std::time::Duration::from_millis(1000 / 30)).await; + } + Ok(()) + } + } +} diff --git a/mpc/mpc.nix b/mpc/mpc.nix new file mode 100644 index 0000000000..206acf4665 --- /dev/null +++ b/mpc/mpc.nix @@ -0,0 +1,31 @@ +{ self, ... }: { + perSystem = { self', pkgs, crane, ... }: + let + attrs = { + rustflags = "-L${self'.packages.galoisd-library}/lib"; + }; + mpc-client = crane.buildWorkspaceMember (attrs // { + crateDirFromRoot = "mpc/client"; + }); + mpc-coordinator = crane.buildWorkspaceMember (attrs // { + crateDirFromRoot = "mpc/coordinator"; + }); + in + { + packages = mpc-coordinator.packages // mpc-client.packages // { + mpc-image = pkgs.dockerTools.buildImage { + name = "${self'.packages.mpc-client.name}-image"; + copyToRoot = pkgs.buildEnv { + name = "image-root"; + paths = [ pkgs.coreutils-full pkgs.cacert ]; + pathsToLink = [ "/bin" ]; + }; + config = { + Entrypoint = [ (pkgs.lib.getExe self'.packages.mpc) ]; + Env = [ "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]; + }; + }; + }; + checks = mpc-coordinator.checks // mpc-client.checks; + }; +} diff --git a/mpc/shared/Cargo.toml b/mpc/shared/Cargo.toml new file mode 100644 index 0000000000..44a4b1f80f --- /dev/null +++ b/mpc/shared/Cargo.toml @@ -0,0 +1,8 @@ +[package] +edition = { workspace = true } +name = "mpc-shared" +version = "0.1.0" + +[dependencies] +rocket = { version = "0.5.1", features = ["json", "msgpack", "uuid"] } +thiserror = { workspace = true } diff --git a/mpc/shared/src/lib.rs b/mpc/shared/src/lib.rs new file mode 100644 index 0000000000..ee50387ef9 --- /dev/null +++ b/mpc/shared/src/lib.rs @@ -0,0 +1,88 @@ +pub mod types; + +use std::ffi::{c_char, c_int}; + +pub const CONTRIBUTION_SIZE: usize = 306032532; +pub const CONTRIBUTION_CHUNKS: usize = 30; +pub const CONTRIBUTION_CHUNK_SIZE: usize = CONTRIBUTION_SIZE / CONTRIBUTION_CHUNKS; +pub const CONTRIBUTION_CHUNK_SIZE_FINAL: usize = + CONTRIBUTION_SIZE - (CONTRIBUTION_CHUNK_SIZE * CONTRIBUTION_CHUNKS); + +#[link(name = "galois")] +extern "C" { + fn Phase2Contribute( + phase2_payload_raw: *const c_char, + phase2_contrib_raw: *mut c_char, + len: c_int, + ) -> bool; + + fn Phase2Verify( + phase2_previous_raw: *const c_char, + phase2_contrib_raw: *const c_char, + len: c_int, + ) -> bool; +} + +#[derive(thiserror::Error, Debug, Copy, Clone)] +pub enum Phase2ContributionError { + #[error("Failed to convert initial payload size, based af is you reached this.")] + FailedToConvertPayloadSize, + #[error("Looks like you spent time contributing for no reason because it failed.")] + FailedToContribute, +} + +#[derive(thiserror::Error, Debug, Copy, Clone)] +pub enum Phase2VerificationError { + #[error("Failed to convert contribution payload size, based af is you reached this.")] + FailedToConvertPayloadSize, + #[error("1 BTC = 1 BTC, what are you trying to achieve?")] + InconsistentPayloadSize, + #[error("Cheating is great, but not allowed. You may lose your slot if the coordinator chose to :'(.")] + Phase2VerificationFailed, +} + +pub fn phase2_contribute(phase2_payload: &[u8]) -> Result, Phase2ContributionError> { + let payload_len = phase2_payload + .len() + .try_into() + .map_err(|_| Phase2ContributionError::FailedToConvertPayloadSize)?; + let mut phase2_contrib_raw = vec![0u8; phase2_payload.len()]; + let result = unsafe { + Phase2Contribute( + phase2_payload.as_ptr() as *const _, + phase2_contrib_raw.as_mut_ptr() as *mut _, + payload_len, + ) + }; + if result { + Ok(phase2_contrib_raw) + } else { + Err(Phase2ContributionError::FailedToContribute) + } +} + +pub fn phase2_verify( + phase2_payload: &[u8], + phase2_contrib: &[u8], +) -> Result<(), Phase2VerificationError> { + let payload_len = phase2_payload + .len() + .try_into() + .map_err(|_| Phase2VerificationError::FailedToConvertPayloadSize)?; + if phase2_contrib.len() != phase2_payload.len() { + Err(Phase2VerificationError::InconsistentPayloadSize) + } else { + let result = unsafe { + Phase2Verify( + phase2_payload.as_ptr() as *const _, + phase2_contrib.as_ptr() as *mut _, + payload_len, + ) + }; + if result { + Ok(()) + } else { + Err(Phase2VerificationError::Phase2VerificationFailed) + } + } +} diff --git a/mpc/shared/src/types.rs b/mpc/shared/src/types.rs new file mode 100644 index 0000000000..9e6e7e1a69 --- /dev/null +++ b/mpc/shared/src/types.rs @@ -0,0 +1,8 @@ +use rocket::serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(crate = "rocket::serde")] +pub struct Contribution { + pub success: bool, + pub timestamp: u64, +} diff --git a/tools/rust/rust.nix b/tools/rust/rust.nix index dbad2cad4a..d420cbe8de 100644 --- a/tools/rust/rust.nix +++ b/tools/rust/rust.nix @@ -104,12 +104,20 @@ inherit mkBuildStdToolchain mkNightly rustSrc; toolchains = { - nightly = mkNightly { }; + nightly = mkNightly { + targets = [ + "wasm32-unknown-unknown" + "x86_64-unknown-linux-musl" + ]; + }; # for use in the devShell dev = (pkgs.rust-bin.nightly.${nightlyVersion}.default.override { extensions = builtins.attrValues availableComponents; - targets = [ "wasm32-unknown-unknown" ]; + targets = [ + "wasm32-unknown-unknown" + "x86_64-unknown-linux-musl" + ]; }); }; }; From 0b4a56079704c48ee53c2ebf3439bdf5d56c46d5 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 26 Jul 2024 21:30:47 +0200 Subject: [PATCH 03/48] feat: mpc schema --- mpc/coordinator/database.sql | 99 ++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 mpc/coordinator/database.sql diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql new file mode 100644 index 0000000000..ce8fe9b172 --- /dev/null +++ b/mpc/coordinator/database.sql @@ -0,0 +1,99 @@ +CREATE TABLE queue ( + id uuid PRIMARY KEY, + payload_id uuid NOT NULL DEFAULT(gen_random_uuid()), + joined timestamptz NOT NULL DEFAULT (now()), + score integer NOT NULL +); + +CREATE OR REPLACE FUNCTION min_score() RETURNS INTEGER AS $$ + SELECT COALESCE(MIN(score) - 1, 1000000) FROM queue +$$ LANGUAGE SQL; + +CREATE OR REPLACE FUNCTION set_initial_score_trigger() RETURNS TRIGGER AS $$ +BEGIN + NEW.score := min_score(); + RETURN NEW; +END +$$ LANGUAGE plpgsql; + +CREATE TRIGGER queue_set_initial_score BEFORE INSERT ON queue FOR EACH ROW EXECUTE FUNCTION set_initial_score_trigger(); + +CREATE UNIQUE INDEX idx_queue_score_id ON queue(score, id); +CREATE UNIQUE INDEX idx_queue_score ON queue(score); + +ALTER TABLE queue ADD FOREIGN KEY (id) REFERENCES users(id); + +CREATE TABLE contribution_status( + id uuid PRIMARY KEY, + started timestamptz NOT NULL DEFAULT(now()), + expire timestamptz NOT NULL DEFAULT(now() + INTERVAL '30 minutes') +); + +CREATE UNIQUE INDEX idx_contribution_status_id_expire ON contribution_status(id, expire); + +ALTER TABLE contribution_status ADD FOREIGN KEY (id) REFERENCES queue(id); + +CREATE TABLE contribution( + id uuid PRIMARY KEY, + seq SMALLSERIAL NOT NULL, + created_at timestamptz NOT NULL DEFAULT(now()), + success boolean +); + +ALTER TABLE contribution ADD FOREIGN KEY (id) REFERENCES queue(id); + +CREATE UNIQUE INDEX idx_contribution_seq ON contribution(seq); +CREATE UNIQUE INDEX idx_contribution_seq_success ON contribution(seq, success); + +-- The next contributor is the one with the higest score that didn't contribute yet. +CREATE OR REPLACE FUNCTION set_next_contributor_trigger() RETURNS TRIGGER AS $$ +BEGIN + CALL set_next_contributor(); + RETURN NEW; +END +$$ LANGUAGE plpgsql; + +-- Rotate the current contributor whenever a contribution is done. +CREATE TRIGGER contribution_added AFTER INSERT ON contribution FOR EACH ROW EXECUTE FUNCTION set_next_contributor_trigger(); + +-- Current contributor is the highest score in the queue with the contribution +-- not done yet and it's status not expired. +CREATE OR REPLACE VIEW current_contributor_id AS + SELECT q.id + FROM queue q + WHERE q.score = ( + SELECT MAX(qq.score) + FROM queue qq + WHERE NOT EXISTS ( + SELECT * FROM contribution c WHERE c.id = qq.id + ) AND EXISTS ( + SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire > now() + ) + ); + +-- The current payload is from the latest successfull contribution +CREATE OR REPLACE VIEW current_payload_id AS + SELECT q.payload_id + FROM contribution c + INNER JOIN queue q ON q.id = c.id + WHERE c.seq = ( + SELECT MAX(cc.seq) FROM contribution cc WHERE cc.success + ); + +CREATE OR REPLACE PROCEDURE set_next_contributor() AS $$ +BEGIN + IF (SELECT COUNT(*) FROM current_contributor_id) = 0 THEN + INSERT INTO contribution_status(id) SELECT q.id FROM queue q WHERE q.score = ( + SELECT MAX(qq.score) + FROM queue qq + WHERE NOT EXISTS ( + SELECT * FROM contribution c WHERE c.id = qq.id + ) AND NOT EXISTS( + SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire < now() + ) + ); + END IF; +END +$$ LANGUAGE plpgsql; + +SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); From 25415edb7f9858af52e19fe23e009641d23d526b Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 29 Jul 2024 23:05:11 +0200 Subject: [PATCH 04/48] feat: mpc use supa --- Cargo.lock | 2671 ++++++++++---------------- app/src/routes/ceremony/+page.svelte | 195 ++ flake.nix | 1 + mpc/client/Cargo.toml | 28 +- mpc/client/src/main.rs | 494 +++-- mpc/coordinator/Cargo.toml | 19 +- mpc/coordinator/database.sql | 218 ++- mpc/coordinator/src/fsm.rs | 22 - mpc/coordinator/src/main.rs | 572 ++---- mpc/shared/Cargo.toml | 2 +- mpc/shared/src/lib.rs | 4 - mpc/shared/src/types.rs | 16 +- 12 files changed, 1927 insertions(+), 2315 deletions(-) create mode 100644 app/src/routes/ceremony/+page.svelte delete mode 100644 mpc/coordinator/src/fsm.rs diff --git a/Cargo.lock b/Cargo.lock index bf89afc646..d32b19425e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,12 +48,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - [[package]] name = "aead" version = "0.5.2" @@ -86,7 +80,7 @@ dependencies = [ "cipher", "ctr", "ghash", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -95,7 +89,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "once_cell", "version_check", ] @@ -107,7 +101,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.15", + "getrandom 0.2.12", "once_cell", "version_check", "zerocopy", @@ -130,9 +124,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "alloy" @@ -161,12 +155,12 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.31" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68b94c159bcc2ca5f758b8663d7b00fc7c5e40569984595ddf2221b0f7f7f6e" +checksum = "47ff94ce0f141c2671c23d02c7b88990dd432856639595c5d010663d017c2c58" dependencies = [ "num_enum", - "strum 0.26.3", + "strum 0.26.2", ] [[package]] @@ -229,7 +223,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.18", + "winnow 0.6.5", ] [[package]] @@ -242,7 +236,7 @@ dependencies = [ "alloy-rlp", "alloy-serde", "c-kzg", - "derive_more 0.99.18", + "derive_more 0.99.17", "once_cell", "serde", "sha2 0.10.8", @@ -314,7 +308,7 @@ dependencies = [ "bytes", "cfg-if 1.0.0", "const-hex", - "derive_more 0.99.18", + "derive_more 0.99.17", "hex-literal", "itoa", "k256", @@ -351,9 +345,9 @@ dependencies = [ "dashmap", "futures", "futures-utils-wasm", - "lru 0.12.4", + "lru 0.12.3", "pin-project", - "reqwest 0.12.7", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -382,20 +376,20 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" dependencies = [ "alloy-rlp-derive", - "arrayvec 0.7.6", + "arrayvec 0.7.4", "bytes", ] [[package]] name = "alloy-rlp-derive" -version = "0.3.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", @@ -417,7 +411,7 @@ dependencies = [ "alloy-transport-ws", "futures", "pin-project", - "reqwest 0.12.7", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -539,7 +533,7 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.5.0", + "indexmap 2.2.6", "proc-macro-error", "proc-macro2", "quote", @@ -572,7 +566,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ "serde", - "winnow 0.6.18", + "winnow 0.6.5", ] [[package]] @@ -615,7 +609,7 @@ checksum = "86d65871f9f1cafe1ed25cde2f1303be83e6473e995a2d56c275ae4fcce6119c" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.7", + "reqwest 0.12.5", "serde_json", "tower", "tracing", @@ -651,7 +645,7 @@ dependencies = [ "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.13", + "rustls 0.23.7", "serde_json", "tokio", "tokio-tungstenite 0.23.1", @@ -690,48 +684,47 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -739,9 +732,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "aptos-aggregator" @@ -955,7 +948,7 @@ dependencies = [ "blake2-rfc", "bulletproofs", "byteorder", - "clap 4.5.17", + "clap 4.5.4", "codespan-reporting", "curve25519-dalek-ng", "either", @@ -1144,7 +1137,7 @@ dependencies = [ "anyhow", "aptos-types", "bcs 0.1.4", - "clap 4.5.17", + "clap 4.5.4", "heck 0.4.1", "move-core-types", "once_cell", @@ -1230,7 +1223,7 @@ dependencies = [ "bytes", "fixed", "fxhash", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "hex", "itertools 0.13.0", "jsonwebtoken 8.3.0", @@ -1312,20 +1305,6 @@ dependencies = [ "serde", ] -[[package]] -name = "aquamarine" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" -dependencies = [ - "include_dir 0.7.4", - "itertools 0.10.5", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "arbitrary" version = "1.3.2" @@ -1340,14 +1319,14 @@ version = "0.1.0" dependencies = [ "arbitrum-verifier", "base64 0.21.7", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethereum-light-client", "ethereum-verifier", "ethers-core", "hex", "ics008-wasm-client", "protos", - "rlp 0.5.2", + "rlp", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -1367,7 +1346,7 @@ dependencies = [ "ethers-core", "hex", "hex-literal", - "rlp 0.5.2", + "rlp", "serde", "serde-utils", "serde_json", @@ -1494,7 +1473,7 @@ dependencies = [ "num-traits", "paste", "rayon", - "rustc_version 0.4.1", + "rustc_version 0.4.0", "zeroize", ] @@ -1675,9 +1654,9 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.9" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -1690,9 +1669,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "ascii-canvas" @@ -1711,9 +1690,9 @@ checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" [[package]] name = "async-graphql" -version = "7.0.9" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d37c3e9ba322eb00e9e5e997d58f08e8b6de037325b9367ac59bca8e3cd46af" +checksum = "bf338d20ba5bab309f55ce8df95d65ee19446f7737f06f4a64593ab2c6b546ad" dependencies = [ "async-graphql-derive", "async-graphql-parser", @@ -1724,11 +1703,10 @@ dependencies = [ "bytes", "fast_chemail", "fnv", - "futures-timer", "futures-util", "handlebars", "http 1.1.0", - "indexmap 2.5.0", + "indexmap 2.2.6", "mime", "multer", "num-traits", @@ -1745,9 +1723,9 @@ dependencies = [ [[package]] name = "async-graphql-axum" -version = "7.0.9" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329afc4fc7359f112b7593bc930b788544cedbc97c4fbdf1db21e58704b4b5d0" +checksum = "28f874ad4bc10519f3fa500e36814452033a5ce9ea681ab0a2e0d3b1f18bae44" dependencies = [ "async-graphql", "async-trait", @@ -1763,26 +1741,26 @@ dependencies = [ [[package]] name = "async-graphql-derive" -version = "7.0.9" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1141703c11c6ad4fa9b3b0e1e476dea01dbd18a44db00f949b804afaab2f344" +checksum = "fc51fd6b7102acda72bc94e8ae1543844d5688ff394a6cf7c21f2a07fe2d64e4" dependencies = [ "Inflector", "async-graphql-parser", - "darling 0.20.10", - "proc-macro-crate 3.2.0", + "darling 0.20.8", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "strum 0.26.3", + "strum 0.26.2", "syn 2.0.77", "thiserror", ] [[package]] name = "async-graphql-parser" -version = "7.0.9" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f66edcce4c38c18f7eb181fdf561c3d3aa2d644ce7358fc7a928c00a4ffef17" +checksum = "75361eefd64e39f89bead4cb45fddbaf60ddb0e7b15fb7c852b6088bcd63071f" dependencies = [ "async-graphql-value", "pest", @@ -1792,23 +1770,23 @@ dependencies = [ [[package]] name = "async-graphql-value" -version = "7.0.9" +version = "7.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0206011cad065420c27988f17dd7fe201a0e056b20c262209b7bffcd6fa176" +checksum = "c1f665d2d52b41c4ed1f01c43f3ef27a2fe0af2452ed5c8bc7ac9b1a8719afaa" dependencies = [ "bytes", - "indexmap 2.5.0", + "indexmap 2.2.6", "serde", "serde_json", ] [[package]] name = "async-lock" -version = "3.4.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 5.3.1", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite", ] @@ -1849,9 +1827,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", @@ -1868,7 +1846,7 @@ dependencies = [ "futures-util", "log", "pin-project-lite", - "rustls-native-certs 0.7.3", + "rustls-native-certs 0.7.0", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -1883,7 +1861,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.1", + "rustc_version 0.4.0", ] [[package]] @@ -1895,12 +1873,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "atomic" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" - [[package]] name = "atomic" version = "0.6.0" @@ -1940,9 +1912,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "axum" @@ -1958,7 +1930,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.28", "itoa", "matchit", "memchr", @@ -1988,9 +1960,9 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -2040,7 +2012,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "http-body-util", "mime", "pin-project-lite", @@ -2091,7 +2063,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", ] @@ -2217,7 +2189,7 @@ version = "0.1.0" dependencies = [ "base64 0.21.7", "bytes", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethereum-light-client", "ethereum-verifier", "hex", @@ -2277,12 +2249,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" -[[package]] -name = "binascii" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" - [[package]] name = "bincode" version = "1.3.3" @@ -2294,9 +2260,9 @@ dependencies = [ [[package]] name = "bip32" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa13fae8b6255872fd86f7faf4b41168661d7d78609f7bfe6771b85c6739a15b" +checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164" dependencies = [ "bs58 0.5.1", "hmac 0.12.1", @@ -2304,7 +2270,7 @@ dependencies = [ "rand_core 0.6.4", "ripemd", "sha2 0.10.8", - "subtle 2.6.1", + "subtle 2.5.0", "zeroize", ] @@ -2348,9 +2314,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -2414,8 +2380,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", - "arrayvec 0.7.6", - "constant_time_eq 0.3.1", + "arrayvec 0.7.4", + "constant_time_eq 0.3.0", ] [[package]] @@ -2425,8 +2391,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", - "arrayvec 0.7.6", - "constant_time_eq 0.3.1", + "arrayvec 0.7.4", + "constant_time_eq 0.3.0", ] [[package]] @@ -2500,14 +2466,14 @@ dependencies = [ "pairing", "rand_core 0.6.4", "serde", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] name = "bnum" -version = "0.10.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" +checksum = "ab9008b6bb9fc80b5277f2fe481c09e828743d9151203e804583eb4c9e15b31d" [[package]] name = "bnum" @@ -2532,7 +2498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.77", @@ -2577,9 +2543,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byte-slice-cast" @@ -2595,9 +2561,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "byteorder" @@ -2607,9 +2573,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] @@ -2637,16 +2603,15 @@ dependencies = [ [[package]] name = "c-kzg" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" +checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" dependencies = [ "blst", "cc", "glob", "hex", "libc", - "once_cell", "serde", ] @@ -2658,9 +2623,9 @@ checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" [[package]] name = "camino" -version = "1.1.9" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] @@ -2681,11 +2646,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56c0a67d3ce899b0cd4a1dc756ff00da63e6198ffe6009467679bc0ead964ae3" dependencies = [ "anyhow", - "semver 1.0.23", + "semver 1.0.22", "serde", "serde-untagged", "serde-value", - "toml 0.8.19", + "toml 0.8.12", "unicode-xid", "url", ] @@ -2698,42 +2663,26 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.22", "serde", "serde_json", "thiserror", ] -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" - [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" -[[package]] -name = "castaway" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" -dependencies = [ - "rustversion", -] - [[package]] name = "cc" -version = "1.1.21" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", - "shlex", ] [[package]] @@ -2744,9 +2693,9 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-expr" -version = "0.15.8" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" dependencies = [ "smallvec", ] @@ -2827,7 +2776,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-targets 0.52.4", ] [[package]] @@ -2899,9 +2848,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -2909,22 +2858,22 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim 0.11.0", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2934,9 +2883,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "clear_on_drop" @@ -3062,9 +3011,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" @@ -3129,7 +3078,7 @@ dependencies = [ "base64 0.21.7", "bytes", "cometbls-groth16-verifier", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "dlmalloc", "hex", "ics008-wasm-client", @@ -3149,24 +3098,11 @@ dependencies = [ "unionlabs", ] -[[package]] -name = "compact_str" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" -dependencies = [ - "castaway", - "cfg-if 1.0.0", - "itoa", - "ryu", - "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "concurrent-queue" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -3218,7 +3154,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "once_cell", "tiny-keccak", ] @@ -3231,9 +3167,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "contracts" @@ -3273,7 +3209,7 @@ dependencies = [ "percent-encoding", "rand 0.8.5", "sha2 0.10.8", - "subtle 2.6.1", + "subtle 2.5.0", "time", "version_check", ] @@ -3307,9 +3243,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.7" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core_affinity" @@ -3334,17 +3270,18 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d905990ef3afb5753bb709dc7de88e9e370aa32bcc2f31731d4b533b63e82490" +checksum = "8d075f6bb1483a6ce83b5cbc73a3a1207e0316ac1e34ed1f2a4d9fc3a0f07bf6" [[package]] name = "cosmwasm-crypto" -version = "1.5.7" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f862b355f7e47711e0acfe6af92cb3fd8fd5936b66a9eaa338b51edabd1e77d" +checksum = "8ed6aa9f904de106fa16443ad14ec2abe75e94ba003bb61c681c0e43d4c58d2a" dependencies = [ "digest 0.10.7", + "ecdsa", "ed25519-zebra 3.1.0", "k256", "rand_core 0.6.4", @@ -3353,9 +3290,9 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" -version = "2.1.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b2a7bd9c1dd9a377a4dc0f4ad97d24b03c33798cd5a6d7ceb8869b41c5d2f2d" +checksum = "88ced5a6dd2801a383d3e14e5ae5caa7fdfeff1bd9f22b30e810e0aded8a5869" dependencies = [ "ark-bls12-381", "ark-ec", @@ -3376,18 +3313,18 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.5.7" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd85de6467cd1073688c86b39833679ae6db18cf4771471edd9809f15f1679f1" +checksum = "bc5e72e330bd3bdab11c52b5ecbdeb6a8697a004c57964caeb5d876f0b088b3c" dependencies = [ "syn 1.0.109", ] [[package]] name = "cosmwasm-derive" -version = "2.1.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029910b409398fdf81955d7301b906caf81f2c42b013ea074fbd89720229c424" +checksum = "35bd1873f84d9b17edf8a90ffe10a89a649b82feacc00e36788b81d2c3cbf03c" dependencies = [ "proc-macro2", "quote", @@ -3396,11 +3333,11 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "1.5.7" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b4cd28147a66eba73720b47636a58097a979ad8c8bfdb4ed437ebcbfe362576" +checksum = "ac3e3a2136e2a60e8b6582f5dffca5d1a683ed77bf38537d330bc1dfccd69010" dependencies = [ - "cosmwasm-schema-derive 1.5.7", + "cosmwasm-schema-derive 1.5.3", "schemars", "serde", "serde_json", @@ -3409,11 +3346,11 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" +checksum = "27984b137eb2ac561f97f6bdb02004a98eb6f2ba263062c140b8e231ee1826b7" dependencies = [ - "cosmwasm-schema-derive 2.1.3", + "cosmwasm-schema-derive 2.1.0", "schemars", "serde", "serde_json", @@ -3422,9 +3359,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.7" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9acd45c63d41bc9b16bc6dc7f6bd604a8c2ad29ce96c8f3c96d7fc8ef384392e" +checksum = "f5d803bea6bd9ed61bd1ee0b4a2eb09ee20dbb539cc6e0b8795614d20952ebb1" dependencies = [ "proc-macro2", "quote", @@ -3433,9 +3370,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" +checksum = "f4ef0d201f611bdb6c9124207032423eb956f1fc8ab3e3ee7253a9c08a5f5809" dependencies = [ "proc-macro2", "quote", @@ -3444,15 +3381,15 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "1.5.7" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2685c2182624b2e9e17f7596192de49a3f86b7a0c9a5f6b25c1df5e24592e836" +checksum = "ad011ae7447188e26e4a7dbca2fcd0fc186aa21ae5c86df0503ea44c78f9e469" dependencies = [ "base64 0.21.7", "bech32 0.9.1", - "bnum 0.10.0", - "cosmwasm-crypto 1.5.7", - "cosmwasm-derive 1.5.7", + "bnum 0.8.1", + "cosmwasm-crypto 1.5.2", + "cosmwasm-derive 1.5.3", "derivative", "forward_ref", "hex", @@ -3466,17 +3403,17 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51dec99a2e478715c0a4277f0dbeadbb8466500eb7dec873d0924edd086e77f1" +checksum = "2522fb5c9a0409712bb1d036128bccf3564e6b2ac82f942ae4cf3c8df3e26fa8" dependencies = [ "base64 0.22.1", "bech32 0.11.0", "bnum 0.11.0", "cosmwasm-core", - "cosmwasm-crypto 2.1.3", - "cosmwasm-derive 2.1.3", - "derive_more 1.0.0", + "cosmwasm-crypto 2.1.0", + "cosmwasm-derive 2.1.0", + "derive_more 1.0.0-beta.6", "hex", "rand_core 0.6.4", "schemars", @@ -3489,18 +3426,18 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.2.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] @@ -3513,9 +3450,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if 1.0.0", ] @@ -3595,34 +3532,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crossterm" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" -dependencies = [ - "bitflags 2.6.0", - "crossterm_winapi", - "libc", - "mio 0.8.11", - "parking_lot", - "signal-hook", - "signal-hook-mio", - "winapi 0.3.9", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi 0.3.9", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -3638,7 +3550,7 @@ checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle 2.6.1", + "subtle 2.5.0", "zeroize", ] @@ -3670,7 +3582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -3680,7 +3592,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" dependencies = [ "generic-array 0.14.7", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -3722,7 +3634,7 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.6.1", + "subtle 2.5.0", "zeroize", ] @@ -3737,8 +3649,8 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version 0.4.1", - "subtle 2.6.1", + "rustc_version 0.4.0", + "subtle 2.5.0", "zeroize", ] @@ -3773,15 +3685,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "451a4691083a88a3c0630a8a88799e9d4cd6679b7ce8ff22b8da2873ff31d380" dependencies = [ - "cosmwasm-std 1.5.7", -] - -[[package]] -name = "cw-address-like" -version = "1.0.4" -source = "git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523#28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523" -dependencies = [ - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", ] [[package]] @@ -3789,8 +3693,8 @@ name = "cw-cii" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", ] [[package]] @@ -3799,8 +3703,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50c1804013d21060b994dea28a080f9eab78a3bcb6b617f05e7634b0600bf7b1" dependencies = [ - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw-utils 2.0.0", "schemars", @@ -3815,8 +3719,8 @@ source = "git+https://github.com/CosmWasm/cw-multi-test.git?rev=e1a2f587c7f9d723 dependencies = [ "anyhow", "bech32 0.11.0", - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw-utils 2.0.0", "cw20-ics20", @@ -3838,24 +3742,10 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "093dfb4520c48b5848274dd88ea99e280a04bc08729603341c7fb0d758c74321" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", - "cw-address-like 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cw-ownable-derive 0.5.1", - "cw-storage-plus 1.2.0", - "cw-utils 1.0.3", - "thiserror", -] - -[[package]] -name = "cw-ownable" -version = "0.6.0" -source = "git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523#28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523" -dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", - "cw-address-like 1.0.4 (git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523)", - "cw-ownable-derive 0.6.0", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", + "cw-address-like", + "cw-ownable-derive", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "thiserror", @@ -3872,22 +3762,12 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "cw-ownable-derive" -version = "0.6.0" -source = "git+https://github.com/public-awesome/cw-plus-plus.git?rev=28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523#28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "cw-paginate-storage" -version = "2.5.0" -source = "git+https://github.com/DA0-DA0/dao-contracts.git#340b1e19dcbb8a9aa94f6f90f82a536e7002fd47" +version = "2.4.2" +source = "git+https://github.com/DA0-DA0/dao-contracts.git#3ab701747d6d5571cfee7f5a78d8fe39ffa3a8f7" dependencies = [ - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "cw-storage-plus 1.2.0", "serde", ] @@ -3897,8 +3777,8 @@ name = "cw-pause-once" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "thiserror", @@ -3910,7 +3790,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b6f91c0b94481a3e9ef1ceb183c37d00764f8751e39b45fc09f4d9b970d469" dependencies = [ - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "schemars", "serde", ] @@ -3921,7 +3801,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" dependencies = [ - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "schemars", "serde", ] @@ -3932,7 +3812,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" dependencies = [ - "cosmwasm-std 2.1.3", + "cosmwasm-std 2.1.0", "schemars", "serde", ] @@ -3943,11 +3823,11 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6a84c6c1c0acc3616398eba50783934bd6c964bad6974241eaee3460c8f5b26" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw2 0.16.0", "schemars", - "semver 1.0.23", + "semver 1.0.22", "serde", "thiserror", ] @@ -3958,11 +3838,11 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw2 1.1.2", "schemars", - "semver 1.0.23", + "semver 1.0.22", "serde", "thiserror", ] @@ -3973,8 +3853,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" dependencies = [ - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "schemars", "serde", "thiserror", @@ -3986,8 +3866,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91398113b806f4d2a8d5f8d05684704a20ffd5968bf87e3473e1973710b884ad" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-storage-plus 0.16.0", "schemars", "serde", @@ -3999,11 +3879,11 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-storage-plus 1.2.0", "schemars", - "semver 1.0.23", + "semver 1.0.22", "serde", "thiserror", ] @@ -4014,11 +3894,11 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "schemars", - "semver 1.0.23", + "semver 1.0.22", "serde", "thiserror", ] @@ -4029,8 +3909,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a42212b6bf29bbdda693743697c621894723f35d3db0d5df930be22903d0e27c" dependencies = [ - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-utils 2.0.0", "schemars", "serde", @@ -4042,15 +3922,15 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80a9e377dbbd1ffb3b6a8a2dbf9128609a6458a3292f88f99e0b6840a7e9762e" dependencies = [ - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-controllers", "cw-storage-plus 2.0.0", "cw-utils 2.0.0", "cw2 2.0.0", "cw20", "schemars", - "semver 1.0.23", + "semver 1.0.22", "serde", "thiserror", ] @@ -4061,20 +3941,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94a1ea6e6277bdd6dfc043a9b1380697fe29d6e24b072597439523658d21d791" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", - "cw-utils 0.16.0", - "schemars", - "serde", -] - -[[package]] -name = "cw721" -version = "0.16.0" -source = "git+https://github.com/CosmWasm/cw-nfts?tag=v0.16.0#2cad1d3e15e0a34d466a0b51e02c58b82ebe5ecd" -dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-utils 0.16.0", "schemars", "serde", @@ -4082,21 +3950,14 @@ dependencies = [ [[package]] name = "cw721" -version = "0.19.0" -source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#a5abe476c1028b2563f995adab184b86e3fc03ff" +version = "0.18.0" +source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#e63a7bbb620e6ea39224bb5580967477066cb7ae" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", - "cw-ownable 0.6.0", - "cw-paginate-storage", - "cw-storage-plus 1.2.0", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-utils 1.0.3", - "cw2 1.1.2", - "cw721 0.16.0 (git+https://github.com/CosmWasm/cw-nfts?tag=v0.16.0)", "schemars", "serde", - "thiserror", - "url", ] [[package]] @@ -4105,12 +3966,12 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77518e27431d43214cff4cdfbd788a7508f68d9b1f32389e6fce513e7eaccbef" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-storage-plus 0.16.0", "cw-utils 0.16.0", "cw2 0.16.0", - "cw721 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cw721 0.16.0", "schemars", "serde", "thiserror", @@ -4118,15 +3979,20 @@ dependencies = [ [[package]] name = "cw721-base" -version = "0.19.0" -source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#a5abe476c1028b2563f995adab184b86e3fc03ff" +version = "0.18.0" +source = "git+https://github.com/CosmWasm/cw-nfts?branch=main#e63a7bbb620e6ea39224bb5580967477066cb7ae" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", - "cw-ownable 0.6.0", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", + "cw-ownable", + "cw-storage-plus 1.2.0", + "cw-utils 1.0.3", "cw2 1.1.2", - "cw721 0.19.0", + "cw721 0.18.0", + "cw721-base 0.16.0", + "schemars", "serde", + "thiserror", ] [[package]] @@ -4141,12 +4007,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "darling_core 0.20.8", + "darling_macro 0.20.8", ] [[package]] @@ -4165,15 +4031,15 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim 0.10.0", "syn 2.0.77", ] @@ -4190,11 +4056,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core 0.20.10", + "darling_core 0.20.8", "quote", "syn 2.0.77", ] @@ -4206,7 +4072,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core", @@ -4214,9 +4080,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" @@ -4261,17 +4127,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "derive-syn-parse" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "derive_arbitrary" version = "1.3.2" @@ -4284,31 +4139,31 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.1", - "syn 2.0.77", + "rustc_version 0.4.0", + "syn 1.0.109", ] [[package]] name = "derive_more" -version = "1.0.0" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "1.0.0" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" dependencies = [ "proc-macro2", "quote", @@ -4316,39 +4171,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "devise" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d90b0c4c777a2cad215e3c7be59ac7c15adf45cf76317009b7d096d46f651d" -dependencies = [ - "devise_codegen", - "devise_core", -] - -[[package]] -name = "devise_codegen" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b28680d8be17a570a2334922518be6adc3f58ecc880cbb404eaeb8624fd867" -dependencies = [ - "devise_core", - "quote", -] - -[[package]] -name = "devise_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b035a542cf7abf01f2e3c4d5a7acbaebfefe120ae4efc7bde3df98186e4b8af7" -dependencies = [ - "bitflags 2.6.0", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn 2.0.77", -] - [[package]] name = "devnet-compose" version = "0.1.0" @@ -4359,7 +4181,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "strum 0.26.3", + "strum 0.26.2", ] [[package]] @@ -4368,11 +4190,11 @@ version = "0.1.0" dependencies = [ "base64 0.21.7", "bip39", - "clap 4.5.17", - "cosmwasm-std 2.1.3", + "clap 4.5.4", + "cosmwasm-std 2.1.0", "ed25519-compact", "hex", - "strum 0.26.3", + "strum 0.26.2", "tiny-hderive", "unionlabs", ] @@ -4410,7 +4232,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -4457,9 +4279,9 @@ dependencies = [ [[package]] name = "dissimilar" -version = "1.0.9" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" +checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" [[package]] name = "dlmalloc" @@ -4492,7 +4314,7 @@ dependencies = [ "axum 0.7.5", "chain-utils", "chrono", - "clap 4.5.17", + "clap 4.5.4", "dashmap", "prost 0.12.6", "protos", @@ -4524,9 +4346,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" @@ -4617,7 +4439,7 @@ dependencies = [ "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle 2.6.1", + "subtle 2.5.0", "zeroize", ] @@ -4644,7 +4466,7 @@ checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek 4.1.3", "ed25519 2.2.3", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "hex", "rand_core 0.6.4", "sha2 0.10.8", @@ -4653,9 +4475,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" dependencies = [ "serde", ] @@ -4676,15 +4498,15 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", - "subtle 2.6.1", + "subtle 2.5.0", "zeroize", ] [[package]] name = "ena" -version = "0.14.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" dependencies = [ "log", ] @@ -4697,9 +4519,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if 1.0.0", ] @@ -4716,7 +4538,7 @@ dependencies = [ "k256", "log", "rand 0.8.5", - "rlp 0.5.2", + "rlp", "serde", "sha3 0.10.8", "zeroize", @@ -4726,7 +4548,7 @@ dependencies = [ name = "ensure-blocks" version = "0.0.0" dependencies = [ - "clap 4.5.17", + "clap 4.5.4", "ethers", "reqwest 0.11.27", "tendermint-rpc", @@ -4795,19 +4617,18 @@ dependencies = [ [[package]] name = "erased-serde" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" dependencies = [ "serde", - "typeid", ] [[package]] name = "errno" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4858,7 +4679,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" dependencies = [ - "ethereum-types 0.14.1", + "ethereum-types", "hex", "once_cell", "regex", @@ -4866,7 +4687,7 @@ dependencies = [ "serde_json", "sha3 0.10.8", "thiserror", - "uint 0.9.5", + "uint", ] [[package]] @@ -4878,32 +4699,19 @@ dependencies = [ "crunchy", "fixed-hash 0.8.0", "impl-codec 0.6.0", - "impl-rlp 0.3.0", + "impl-rlp", "impl-serde 0.4.0", "scale-info", "tiny-keccak", ] -[[package]] -name = "ethbloom" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c321610643004cf908ec0f5f2aa0d8f1f8e14b540562a2887a1111ff1ecbf7b" -dependencies = [ - "crunchy", - "fixed-hash 0.8.0", - "impl-rlp 0.4.0", - "impl-serde 0.5.0", - "tiny-keccak", -] - [[package]] name = "ethereum-light-client" version = "0.1.0" dependencies = [ "base64 0.21.7", "bytes", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethereum-verifier", "ethers-contract-derive", "ethers-core", @@ -4913,7 +4721,7 @@ dependencies = [ "lazy_static", "prost 0.12.6", "protos", - "rlp 0.5.2", + "rlp", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -4931,28 +4739,14 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ - "ethbloom 0.13.0", + "ethbloom", "fixed-hash 0.8.0", "impl-codec 0.6.0", - "impl-rlp 0.3.0", + "impl-rlp", "impl-serde 0.4.0", "primitive-types 0.12.2", "scale-info", - "uint 0.9.5", -] - -[[package]] -name = "ethereum-types" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" -dependencies = [ - "ethbloom 0.14.1", - "fixed-hash 0.8.0", - "impl-rlp 0.4.0", - "impl-serde 0.5.0", - "primitive-types 0.13.1", - "uint 0.10.0", + "uint", ] [[package]] @@ -4968,7 +4762,7 @@ dependencies = [ "memory-db", "milagro_bls", "primitive-types 0.12.2", - "rlp 0.5.2", + "rlp", "serde", "serde-utils", "serde_json", @@ -5044,7 +4838,7 @@ dependencies = [ "serde", "serde_json", "syn 2.0.77", - "toml 0.8.19", + "toml 0.8.12", "walkdir", ] @@ -5068,21 +4862,21 @@ name = "ethers-core" version = "2.0.10" source = "git+https://github.com/unionlabs/ethers-rs?branch=ethers-core-wasm#fd10abba9a9d5347b71bd4cde6418a6f6f2f1279" dependencies = [ - "arrayvec 0.7.6", + "arrayvec 0.7.4", "bytes", "cargo_metadata", "chrono", "const-hex", "elliptic-curve", "ethabi", - "ethereum-types 0.15.1", + "ethereum-types", "generic-array 0.14.7", "k256", "num_enum", "once_cell", "open-fastrlp", "rand 0.8.5", - "rlp 0.5.2", + "rlp", "serde", "serde_json", "strum 0.25.0", @@ -5100,7 +4894,7 @@ source = "git+https://github.com/unionlabs/ethers-rs?branch=ethers-core-wasm#fd1 dependencies = [ "ethers-core", "reqwest 0.11.27", - "semver 1.0.23", + "semver 1.0.22", "serde", "serde_json", "thiserror", @@ -5206,7 +5000,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.23", + "semver 1.0.22", "serde", "serde_json", "solang-parser", @@ -5216,7 +5010,7 @@ dependencies = [ "tokio", "tracing", "walkdir", - "yansi 0.5.1", + "yansi", ] [[package]] @@ -5231,6 +5025,17 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + [[package]] name = "event-listener" version = "5.3.1" @@ -5244,11 +5049,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 5.3.1", + "event-listener 4.0.3", "pin-project-lite", ] @@ -5256,7 +5061,7 @@ dependencies = [ name = "evm-in-cosmos-light-client" version = "0.1.0" dependencies = [ - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethereum-light-client", "ics008-wasm-client", "ics23", @@ -5267,14 +5072,13 @@ dependencies = [ [[package]] name = "expander" -version = "2.2.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" +checksum = "00e83c02035136f1592a47964ea60c05a50e4ed8b5892cfac197063850898d4d" dependencies = [ "blake2", - "file-guard", "fs-err", - "prettyplease", + "prettier-please", "proc-macro2", "quote", "syn 2.0.77", @@ -5336,9 +5140,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "fastrlp" @@ -5346,7 +5150,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec 0.7.6", + "arrayvec 0.7.4", "auto_impl", "bytes", ] @@ -5361,7 +5165,7 @@ dependencies = [ "byteorder", "ff_derive", "rand_core 0.6.4", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -5410,34 +5214,29 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.9" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" [[package]] name = "figment" -version = "0.10.19" +version = "0.10.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +checksum = "7270677e7067213e04f323b55084586195f18308cd7546cfac9f873344ccceb6" dependencies = [ - "atomic 0.6.0", - "pear", + "atomic", "serde", "serde_json", - "toml 0.8.19", + "toml 0.8.12", "uncased", "version_check", ] [[package]] -name = "file-guard" -version = "0.2.0" +name = "finl_unicode" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" -dependencies = [ - "libc", - "winapi 0.3.9", -] +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] name = "fixed" @@ -5489,12 +5288,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -5578,7 +5377,7 @@ checksum = "1e4662a809f559aea6234bd90940fa29df583a3c8124a3cf923f66a0d21126b7" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse 0.1.5", + "derive-syn-parse", "expander", "frame-support-procedural-tools", "itertools 0.11.0", @@ -5616,9 +5415,9 @@ dependencies = [ [[package]] name = "frunk" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874b6a17738fc273ec753618bac60ddaeac48cb1d7684c3e7bd472e57a28b817" +checksum = "11a351b59e12f97b4176ee78497dff72e4276fb1ceb13e19056aca7fa0206287" dependencies = [ "frunk_core", "frunk_derives", @@ -5626,15 +5425,15 @@ dependencies = [ [[package]] name = "frunk_core" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3529a07095650187788833d585c219761114005d5976185760cf794d265b6a5c" +checksum = "af2469fab0bd07e64ccf0ad57a1438f63160c69b2e57f04a439653d68eb558d6" [[package]] name = "frunk_derives" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99b8b3c28ae0e84b604c75f721c21dc77afb3706076af5e8216d15fd1deaae3" +checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", @@ -5643,9 +5442,9 @@ dependencies = [ [[package]] name = "frunk_proc_macro_helpers" -version = "0.1.3" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a956ef36c377977e512e227dcad20f68c2786ac7a54dacece3746046fea5ce" +checksum = "35b54add839292b743aeda6ebedbd8b11e93404f902c56223e51b9ec18a13d2c" dependencies = [ "frunk_core", "proc-macro2", @@ -5841,23 +5640,10 @@ checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" name = "generate-rust-sol-bindings" version = "0.1.0" dependencies = [ - "clap 4.5.17", + "clap 4.5.4", "ethers-contract-abigen", ] -[[package]] -name = "generator" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" -dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "windows", -] - [[package]] name = "generic-array" version = "0.12.4" @@ -5913,9 +5699,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -6037,14 +5823,14 @@ dependencies = [ "rand 0.8.5", "rand_core 0.6.4", "rand_xorshift", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] name = "h2" -version = "0.3.26" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" dependencies = [ "bytes", "fnv", @@ -6052,7 +5838,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.5.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -6071,7 +5857,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.5.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -6143,9 +5929,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash 0.8.11", "allocator-api2", @@ -6166,7 +5952,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.14.3", ] [[package]] @@ -6394,9 +6180,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", "http 1.1.0", @@ -6411,15 +6197,15 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.9.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -6438,7 +6224,7 @@ dependencies = [ "base64 0.21.7", "chain-utils", "chrono", - "clap 4.5.17", + "clap 4.5.4", "color-eyre", "cometbft-rpc", "const-hex", @@ -6474,15 +6260,15 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2 0.3.25", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -6498,16 +6284,16 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", "futures-util", "h2 0.4.6", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "httparse", "httpdate", "itoa", @@ -6525,29 +6311,29 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", - "rustls 0.21.12", + "hyper 0.14.28", + "rustls 0.21.10", "tokio", "tokio-rustls 0.24.1", ] [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.3.1", "hyper-util", "log", - "rustls 0.23.13", + "rustls 0.23.7", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.5", + "webpki-roots 0.26.3", ] [[package]] @@ -6556,7 +6342,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.30", + "hyper 0.14.28", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -6569,7 +6355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.30", + "hyper 0.14.28", "native-tls", "tokio", "tokio-native-tls", @@ -6583,7 +6369,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper 1.3.1", "hyper-util", "native-tls", "tokio", @@ -6593,16 +6379,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.1", - "hyper 1.4.1", + "http-body 1.0.0", + "hyper 1.3.1", "pin-project-lite", "socket2", "tokio", @@ -6613,9 +6399,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -6653,7 +6439,7 @@ dependencies = [ name = "ics008-wasm-client" version = "0.1.0" dependencies = [ - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "dlmalloc", "frame-support-procedural", "macros", @@ -6672,13 +6458,13 @@ version = "0.1.0" dependencies = [ "aptos-verifier", "bcs 0.1.4", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethereum-verifier", "hex", "hex-literal", "ics008-wasm-client", "protos", - "rlp 0.5.2", + "rlp", "serde", "serde_json", "sha2 0.10.8", @@ -6711,17 +6497,17 @@ version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ "bech32 0.9.1", - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-cii", - "cw-ownable 0.5.1", + "cw-ownable", "cw-paginate-storage", "cw-pause-once", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw721 0.19.0", + "cw721 0.18.0", "cw721-base 0.16.0", - "cw721-base 0.19.0", + "cw721-base 0.18.0", "ics721-types", "serde", "sha2 0.10.8", @@ -6734,7 +6520,7 @@ name = "ics721-base" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "cw2 1.1.2", "ics721", ] @@ -6744,10 +6530,10 @@ name = "ics721-types" version = "0.1.0" source = "git+https://github.com/hussein-aitlahcen/cw-ics721?rev=dd5b7add6fdc81e633084031f8512e5e909dd42a#dd5b7add6fdc81e633084031f8512e5e909dd42a" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-storage-plus 1.2.0", - "cw721 0.19.0", + "cw721 0.18.0", "serde", "thiserror", ] @@ -6807,7 +6593,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.6.12", + "parity-scale-codec 3.6.9", ] [[package]] @@ -6816,16 +6602,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" dependencies = [ - "rlp 0.5.2", -] - -[[package]] -name = "impl-rlp" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" -dependencies = [ - "rlp 0.6.1", + "rlp", ] [[package]] @@ -6846,15 +6623,6 @@ dependencies = [ "serde", ] -[[package]] -name = "impl-serde" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" -dependencies = [ - "serde", -] - [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -6877,15 +6645,6 @@ dependencies = [ "proc-macro-hack", ] -[[package]] -name = "include_dir" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" -dependencies = [ - "include_dir_macros", -] - [[package]] name = "include_dir_impl" version = "0.6.2" @@ -6899,16 +6658,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "include_dir_macros" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" -dependencies = [ - "proc-macro2", - "quote", -] - [[package]] name = "indenter" version = "0.3.3" @@ -6928,12 +6677,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "serde", ] @@ -6956,12 +6705,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" -[[package]] -name = "inlinable_string" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" - [[package]] name = "inout" version = "0.1.3" @@ -6973,9 +6716,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", ] @@ -7010,9 +6753,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -7025,12 +6768,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - [[package]] name = "itertools" version = "0.10.5" @@ -7099,7 +6836,7 @@ dependencies = [ "ahash 0.8.11", "dyn-clone", "hifijson", - "indexmap 2.5.0", + "indexmap 2.2.6", "jaq-syn", "once_cell", "serde_json", @@ -7145,27 +6882,27 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonrpsee" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd1ead9fb95614e8dc5556d12a8681c2f6d352d0c1d3efc8708c7ccbba47bc6" +checksum = "5ec465b607a36dc5dd45d48b7689bc83f679f66a3ac6b6b21cc787a11e0f8685" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -7181,9 +6918,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89841d4f03a14c055eb41d4f41901819573ef948e8ee0d5c86466fd286b2ce7f" +checksum = "90f0977f9c15694371b8024c35ab58ca043dbbf4b51ccb03db8858a021241df1" dependencies = [ "base64 0.22.1", "futures-channel", @@ -7192,7 +6929,7 @@ dependencies = [ "http 1.1.0", "jsonrpsee-core", "pin-project", - "rustls 0.23.13", + "rustls 0.23.7", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -7206,22 +6943,22 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff79651479f69ada7bda604ef2acf3f1aa50755d97cc36d25ff04c2664f9d96f" +checksum = "e942c55635fbf5dc421938b8558a8141c7e773720640f4f1dbe1f4164ca4e221" dependencies = [ "async-trait", "bytes", "futures-timer", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "http-body-util", "jsonrpsee-types", "parking_lot", "pin-project", "rand 0.8.5", - "rustc-hash", + "rustc-hash 2.0.0", "serde", "serde_json", "thiserror", @@ -7233,19 +6970,19 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ed8b301b19f4dad8ddc66ed956a70fc227def5c19b3898e0a29ce8f0edee06" +checksum = "e33774602df12b68a2310b38a535733c477ca4a498751739f89fe8dbbb62ec4c" dependencies = [ "async-trait", "base64 0.22.1", - "http-body 1.0.1", - "hyper 1.4.1", - "hyper-rustls 0.27.3", + "http-body 1.0.0", + "hyper 1.3.1", + "hyper-rustls 0.27.2", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "rustls 0.23.13", + "rustls 0.23.7", "rustls-platform-verifier", "serde", "serde_json", @@ -7258,12 +6995,12 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d4c6bec4909c966f59f52db3655c0e9d4685faae8b49185973d9d7389bb884" +checksum = "6b07a2daf52077ab1b197aea69a5c990c060143835bf04c77070e98903791715" dependencies = [ "heck 0.5.0", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.77", @@ -7271,15 +7008,15 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe2198e5fd96cf2153ecc123364f699b6e2151317ea09c7bf799c43c2fe1415" +checksum = "038fb697a709bec7134e9ccbdbecfea0e2d15183f7140254afef7c5610a3f488" dependencies = [ "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.3.1", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", @@ -7298,9 +7035,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e386460425e49679587871a056f2895a47dade21457324ad1262cd78ef6d9" +checksum = "23b67d6e008164f027afbc2e7bb79662650158d26df200040282d2aa1cbb093b" dependencies = [ "http 1.1.0", "serde", @@ -7310,9 +7047,9 @@ dependencies = [ [[package]] name = "jsonrpsee-wasm-client" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a2d2206c8f04c6b79a11bd1d92d6726b6f7fd3dec57c91e07fa53e867268bbb" +checksum = "0470d0ae043ffcb0cd323797a631e637fb4b55fe3eaa6002934819458bba62a7" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -7321,9 +7058,9 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.24.4" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87bc869e143d430e748988261d19b630e8f1692074e68f1a7f0eb4c521d2fc58" +checksum = "992bf67d1132f88edf4a4f8cff474cf01abb2be203004a2b8e11c2b20795b99e" dependencies = [ "http 1.1.0", "jsonrpsee-client-transport", @@ -7386,9 +7123,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.4" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -7405,9 +7142,9 @@ dependencies = [ "ena", "itertools 0.11.0", "lalrpop-util", - "petgraph 0.6.5", + "petgraph 0.6.4", "regex", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", "string_cache", "term", "tiny-keccak", @@ -7421,23 +7158,23 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.7", + "regex-automata 0.4.6", ] [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin 0.9.8", + "spin 0.5.2", ] [[package]] name = "libc" -version = "0.2.158" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -7451,7 +7188,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "libc", ] @@ -7467,7 +7204,7 @@ dependencies = [ "hmac-drbg 0.2.0", "rand 0.7.3", "sha2 0.8.2", - "subtle 2.6.1", + "subtle 2.5.0", "typenum", ] @@ -7498,7 +7235,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -7535,7 +7272,7 @@ name = "linea-light-client" version = "0.1.0" dependencies = [ "base64 0.21.7", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethereum-light-client", "ethereum-verifier", "ethers-core", @@ -7545,7 +7282,7 @@ dependencies = [ "linea-verifier", "linea-zktrie", "protos", - "rlp 0.5.2", + "rlp", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -7566,7 +7303,7 @@ dependencies = [ "hex", "hex-literal", "linea-zktrie", - "rlp 0.5.2", + "rlp", "scroll-codec", "serde", "serde-utils", @@ -7598,15 +7335,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -7614,26 +7351,11 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "serde", -] - -[[package]] -name = "loom" -version = "0.5.6" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" dependencies = [ - "cfg-if 1.0.0", - "generator", - "scoped-tls", "serde", - "serde_json", - "tracing", - "tracing-subscriber 0.3.18", ] [[package]] @@ -7647,18 +7369,18 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.4" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.14.3", ] [[package]] name = "macro_magic" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" dependencies = [ "macro_magic_core", "macro_magic_macros", @@ -7668,12 +7390,12 @@ dependencies = [ [[package]] name = "macro_magic_core" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" dependencies = [ "const-random", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", @@ -7682,9 +7404,9 @@ dependencies = [ [[package]] name = "macro_magic_core_macros" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" +checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", @@ -7693,9 +7415,9 @@ dependencies = [ [[package]] name = "macro_magic_macros" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" +checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", @@ -7750,9 +7472,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memory-db" @@ -7820,34 +7542,13 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - [[package]] name = "mio" version = "1.0.2" @@ -7882,7 +7583,7 @@ dependencies = [ "once_cell", "parking_lot", "quanta", - "rustc_version 0.4.1", + "rustc_version 0.4.0", "smallvec", "tagptr", "thiserror", @@ -8034,7 +7735,7 @@ source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b4655 dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.5.17", + "clap 4.5.4", "codespan-reporting", "hex", "move-binary-format", @@ -8061,7 +7762,7 @@ dependencies = [ "abstract-domain-derive", "anyhow", "bcs 0.1.4", - "clap 4.5.17", + "clap 4.5.4", "codespan-reporting", "ethnum", "flexi_logger", @@ -8096,7 +7797,7 @@ dependencies = [ "bcs 0.1.4", "bytes", "ethnum", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "hex", "num", "once_cell", @@ -8106,7 +7807,7 @@ dependencies = [ "serde", "serde_bytes", "thiserror", - "uint 0.9.5", + "uint", ] [[package]] @@ -8116,7 +7817,7 @@ source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b4655 dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.5.17", + "clap 4.5.4", "codespan", "colored", "move-binary-format", @@ -8134,7 +7835,7 @@ version = "0.1.0" source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b46551abaf04c640f1d" dependencies = [ "anyhow", - "clap 4.5.17", + "clap 4.5.4", "colored", "move-binary-format", "move-bytecode-source-map", @@ -8151,7 +7852,7 @@ version = "0.1.0" source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b46551abaf04c640f1d" dependencies = [ "anyhow", - "clap 4.5.17", + "clap 4.5.4", "codespan", "codespan-reporting", "itertools 0.13.0", @@ -8240,7 +7941,7 @@ version = "0.1.0" source = "git+https://github.com/unionlabs/aptos-core#119e510cb6be4b380bc82b46551abaf04c640f1d" dependencies = [ "anyhow", - "clap 4.5.17", + "clap 4.5.4", "colored", "itertools 0.13.0", "move-abigen", @@ -8319,7 +8020,7 @@ dependencies = [ "better_any", "bytes", "fail", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "lazy_static", "lru 0.7.8", "move-binary-format", @@ -8352,47 +8053,6 @@ dependencies = [ "triomphe", ] -[[package]] -name = "mpc-client" -version = "0.1.0" -dependencies = [ - "clap 4.5.17", - "crossterm", - "mpc-shared", - "rand 0.8.5", - "ratatui", - "reqwest 0.11.27", - "serde", - "serde_json", - "sha2 0.10.8", - "thiserror", - "tokio", -] - -[[package]] -name = "mpc-coordinator" -version = "0.1.0" -dependencies = [ - "clap 4.5.17", - "futures", - "mpc-shared", - "priority-queue", - "rocket", - "rocket-authorization", - "rocket_seek_stream", - "rust-fsm", - "sha2 0.10.8", - "thiserror", -] - -[[package]] -name = "mpc-shared" -version = "0.1.0" -dependencies = [ - "rocket", - "thiserror", -] - [[package]] name = "multer" version = "3.1.0" @@ -8408,15 +8068,14 @@ dependencies = [ "mime", "spin 0.9.8", "tokio", - "tokio-util", "version_check", ] [[package]] name = "multimap" -version = "0.10.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "named-lock" @@ -8457,7 +8116,7 @@ checksum = "7c49593c9e94454a2368a4c0a511bf4bf1413aff4d23f16e1d8f4e64b5215351" dependencies = [ "borsh", "schemars", - "semver 1.0.23", + "semver 1.0.22", "serde", ] @@ -8474,18 +8133,18 @@ dependencies = [ [[package]] name = "near-contract-standards" -version = "5.5.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b985c4df43237b6ae533a6451cfa13de1f12f79f7d6254ba376f0ccd017286" +checksum = "a0e78fe14d389ae76f792735a2108a6b8332a2bed61197310bf5ad718fb1e424" dependencies = [ "near-sdk", ] [[package]] name = "near-gas" -version = "0.3.0" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180edcc7dc2fac41f93570d0c7b759c1b6d492f6ad093d749d644a40b4310a97" +checksum = "14e75c875026229902d065e4435804497337b631ec69ba746b102954273e9ad1" dependencies = [ "borsh", "schemars", @@ -8536,7 +8195,7 @@ dependencies = [ "base64 0.21.7", "borsh", "bs58 0.4.0", - "derive_more 0.99.18", + "derive_more 0.99.17", "enum-map", "near-account-id", "num-rational 0.3.2", @@ -8550,11 +8209,11 @@ dependencies = [ [[package]] name = "near-sdk" -version = "5.5.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e296b02c85539c16659e171242d6c6bbea87eec7c9ef860d8dfd3fb3168a18a" +checksum = "520234cfdf04a805ac2f04715889d096eb83fdd5b99ca7d0f8027ae473f891a8" dependencies = [ - "base64 0.22.1", + "base64 0.21.7", "borsh", "bs58 0.5.1", "near-abi", @@ -8587,43 +8246,43 @@ version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb88aa0ed4fbc1ad5c689b9b100cae9dadf1f03373ddd657fb9ac9d25a58ebb0" dependencies = [ - "darling 0.20.10", + "darling 0.20.8", "heck 0.5.0", "proc-macro2", "quote", - "strum 0.26.3", - "strum_macros 0.26.4", + "strum 0.26.2", + "strum_macros 0.26.2", "syn 2.0.77", ] [[package]] name = "near-sdk-macros" -version = "5.5.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0adc79466aa556f56a995c0db34a933b32597ab92bbb0e526597118899c8bcaf" +checksum = "ee2fe3fc30068c5f20e89b0985d6104c5cc1c6742dbc6efbf352be4189b9bbf7" dependencies = [ "Inflector", - "darling 0.20.10", + "darling 0.20.8", "proc-macro2", "quote", "serde", "serde_json", - "strum 0.26.3", - "strum_macros 0.26.4", + "strum 0.26.2", + "strum_macros 0.26.2", "syn 2.0.77", ] [[package]] name = "near-sys" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf4ca5c805cb78700e10e43484902d8da05f25788db277999d209568aaf4c8e" +checksum = "397688591acf8d3ebf2c2485ba32d4b24fc10aad5334e3ad8ec0b7179bfdf06b" [[package]] name = "near-token" -version = "0.3.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3e60aa26a74dc514b1b6408fdd06cefe2eb0ff029020956c1c6517594048fd" +checksum = "7b68f3f8a2409f72b43efdbeff8e820b81e70824c49fee8572979d789d1683fb" dependencies = [ "borsh", "schemars", @@ -8693,7 +8352,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if 1.0.0", "cfg_aliases 0.1.1", "libc", @@ -8819,7 +8478,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.6", + "arrayvec 0.7.4", "itoa", ] @@ -8889,20 +8548,20 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.77", @@ -8931,9 +8590,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "opaque-debug" @@ -8953,10 +8612,10 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec 0.7.6", + "arrayvec 0.7.4", "auto_impl", "bytes", - "ethereum-types 0.14.1", + "ethereum-types", "open-fastrlp-derive", ] @@ -8974,11 +8633,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -9006,9 +8665,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -9093,7 +8752,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" dependencies = [ - "arrayvec 0.7.6", + "arrayvec 0.7.4", "bitvec 0.20.4", "byte-slice-cast", "impl-trait-for-tuples", @@ -9103,15 +8762,15 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ - "arrayvec 0.7.6", + "arrayvec 0.7.4", "bitvec 1.0.1", "byte-slice-cast", "impl-trait-for-tuples", - "parity-scale-codec-derive 3.6.12", + "parity-scale-codec-derive 3.6.9", "serde", ] @@ -9129,11 +8788,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -9141,15 +8800,15 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -9157,22 +8816,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] name = "parse-wasm-client-type" version = "0.1.0" dependencies = [ - "clap 4.5.17", + "clap 4.5.4", "unionlabs", ] @@ -9182,11 +8841,11 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "499cff8432e71c5f8784d9645aac0f9fca604d67f59b68a606170b5e229c6538" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "ciborium", "coset", "data-encoding", - "indexmap 2.5.0", + "indexmap 2.2.6", "rand 0.8.5", "serde", "serde_json", @@ -9203,7 +8862,7 @@ checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core 0.6.4", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -9220,14 +8879,14 @@ dependencies = [ "rand 0.8.5", "serde", "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] name = "paste" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "path-slash" @@ -9291,29 +8950,6 @@ dependencies = [ "hmac 0.12.1", ] -[[package]] -name = "pear" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" -dependencies = [ - "inlinable_string", - "pear_codegen", - "yansi 1.0.1", -] - -[[package]] -name = "pear_codegen" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bab5b985dc082b345f812b7df84e1bef27e7207b39e448439ba8bd69c93f147" -dependencies = [ - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn 2.0.77", -] - [[package]] name = "peg" version = "0.8.4" @@ -9377,9 +9013,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.12" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -9388,9 +9024,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.12" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" dependencies = [ "pest", "pest_generator", @@ -9398,9 +9034,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.12" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ "pest", "pest_meta", @@ -9411,9 +9047,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.12" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ "once_cell", "pest", @@ -9432,12 +9068,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.5.0", + "indexmap 2.2.6", ] [[package]] @@ -9462,7 +9098,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.1", + "rustc_version 0.4.0", ] [[package]] @@ -9577,9 +9213,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ "num-traits", "plotters-backend", @@ -9590,15 +9226,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-svg" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ "plotters-backend", ] @@ -9616,7 +9252,7 @@ dependencies = [ "headers", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.3.1", "hyper-util", "mime", "multer", @@ -9628,7 +9264,7 @@ dependencies = [ "quick-xml", "regex", "rfc7239", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.1.1", "serde", "serde_json", "serde_urlencoded", @@ -9651,7 +9287,7 @@ name = "poem-derive" version = "3.0.0" source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.77", @@ -9664,9 +9300,9 @@ source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3 dependencies = [ "base64 0.22.1", "bytes", - "derive_more 0.99.18", + "derive_more 0.99.17", "futures-util", - "indexmap 2.5.0", + "indexmap 2.2.6", "mime", "num-traits", "poem", @@ -9687,11 +9323,11 @@ name = "poem-openapi-derive" version = "5.0.2" source = "git+https://github.com/poem-web/poem.git?rev=809b2816d3504beeba140fef3fdfe9432d654c5b#809b2816d3504beeba140fef3fdfe9432d654c5b" dependencies = [ - "darling 0.20.10", + "darling 0.20.8", "http 1.1.0", - "indexmap 2.5.0", + "indexmap 2.2.6", "mime", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "regex", @@ -9713,9 +9349,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "poseidon-ark" @@ -9732,7 +9368,7 @@ name = "poseidon-rs" version = "0.0.10" dependencies = [ "criterion", - "ethereum-types 0.14.1", + "ethereum-types", "ff_ce", "primitive-types 0.12.2", "rand 0.4.6", @@ -9742,11 +9378,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.7" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acda0ebdebc28befa84bee35e651e4c5f09073d668c7aed4cf7e23c3cda84b23" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.22.1", + "base64 0.21.7", "byteorder", "bytes", "fallible-iterator 0.2.0", @@ -9760,9 +9396,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.8" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66ea23a2d0e5734297357705193335e0a957696f34bed2f2faefacb2fec336f" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", "fallible-iterator 0.2.0", @@ -9779,12 +9415,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "precomputed-hash" @@ -9792,6 +9425,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "prettier-please" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" +dependencies = [ + "proc-macro2", + "syn 2.0.77", +] + [[package]] name = "prettyplease" version = "0.2.22" @@ -9820,7 +9463,7 @@ dependencies = [ "fixed-hash 0.7.0", "impl-codec 0.5.1", "impl-serde 0.3.2", - "uint 0.9.5", + "uint", ] [[package]] @@ -9831,52 +9474,38 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash 0.8.0", "impl-codec 0.6.0", - "impl-rlp 0.3.0", + "impl-rlp", "impl-serde 0.4.0", "scale-info", - "uint 0.9.5", + "uint", ] [[package]] -name = "primitive-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" -dependencies = [ - "fixed-hash 0.8.0", - "impl-rlp 0.4.0", - "impl-serde 0.5.0", - "uint 0.10.0", -] - -[[package]] -name = "priority-queue" -version = "2.1.0" +name = "proc-macro-crate" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560bcab673ff7f6ca9e270c17bf3affd8a05e3bd9207f123b0d45076fd8197e8" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "autocfg", - "equivalent", - "indexmap 2.5.0", + "once_cell", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "toml_edit 0.20.7", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.22.21", + "toml_edit 0.21.1", ] [[package]] @@ -9936,25 +9565,12 @@ dependencies = [ ] [[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" +name = "procfs" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", - "version_check", - "yansi 1.0.1", -] - -[[package]] -name = "procfs" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" -dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "hex", "lazy_static", "procfs-core", @@ -9967,7 +9583,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "hex", ] @@ -9990,19 +9606,19 @@ dependencies = [ [[package]] name = "proptest" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.5.0", "lazy_static", "num-traits", "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", "rusty-fork", "tempfile", "unarray", @@ -10030,23 +9646,24 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.6" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", - "heck 0.5.0", - "itertools 0.12.1", + "heck 0.4.1", + "itertools 0.11.0", "log", "multimap", "once_cell", - "petgraph 0.6.5", + "petgraph 0.6.4", "prettyplease", "prost 0.12.6", "prost-types", "regex", "syn 2.0.77", "tempfile", + "which", ] [[package]] @@ -10077,9 +9694,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost 0.12.6", ] @@ -10203,23 +9820,22 @@ checksum = "eb55a1aa7668676bb93926cd4e9cdfe60f03bb866553bcca9112554911b6d3dc" dependencies = [ "ahash 0.8.11", "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.14.3", "parking_lot", ] [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", - "rustls 0.23.13", - "socket2", + "rustc-hash 1.1.0", + "rustls 0.23.7", "thiserror", "tokio", "tracing", @@ -10227,15 +9843,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", "rand 0.8.5", "ring 0.17.8", - "rustc-hash", - "rustls 0.23.13", + "rustc-hash 1.1.0", + "rustls 0.23.7", "slab", "thiserror", "tinyvec", @@ -10244,22 +9860,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" dependencies = [ "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -10363,7 +9979,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", ] [[package]] @@ -10393,44 +10009,13 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "range_header" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91066bbbc00d9eb5cf42cf9ea0abdf40097d20065e48b6c0cc14a2154d44934" -dependencies = [ - "pest", - "pest_derive", -] - -[[package]] -name = "ratatui" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" -dependencies = [ - "bitflags 2.6.0", - "cassowary", - "compact_str", - "crossterm", - "itertools 0.13.0", - "lru 0.12.4", - "paste", - "stability", - "strum 0.26.3", - "strum_macros 0.26.4", - "unicode-segmentation", - "unicode-truncate", - "unicode-width", -] - [[package]] name = "raw-cpuid" version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", ] [[package]] @@ -10468,7 +10053,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e3be7b2e46e24637ac96b0c9f70070f188652018573f36f4e511dcad09738a" dependencies = [ - "reqwest 0.12.7", + "reqwest 0.12.5", "serde", "serde_json", ] @@ -10495,20 +10080,20 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags 2.6.0", + "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "libredox", "thiserror", ] @@ -10541,8 +10126,8 @@ checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -10556,13 +10141,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", ] [[package]] @@ -10573,9 +10158,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" @@ -10590,10 +10175,10 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", + "h2 0.3.25", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.28", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -10605,7 +10190,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.12", + "rustls 0.21.10", "rustls-native-certs 0.6.3", "rustls-pemfile 1.0.4", "serde", @@ -10624,24 +10209,24 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots 0.25.4", - "winreg", + "winreg 0.50.0", ] [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", "futures-core", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "http-body-util", - "hyper 1.4.1", - "hyper-rustls 0.27.3", + "hyper 1.3.1", + "hyper-rustls 0.27.2", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -10653,8 +10238,8 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.13", - "rustls-pemfile 2.1.3", + "rustls 0.23.7", + "rustls-pemfile 2.1.1", "rustls-pki-types", "serde", "serde_json", @@ -10668,14 +10253,14 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.5", - "windows-registry", + "webpki-roots 0.26.3", + "winreg 0.52.0", ] [[package]] name = "reth-ipc" version = "1.0.6" -source = "git+https://github.com/paradigmxyz/reth#be04f24a69da9d9e511e176432fdbbae623379c3" +source = "git+https://github.com/paradigmxyz/reth#fcab695a93526c704ef898a3a8d2b6afb183f579" dependencies = [ "async-trait", "bytes", @@ -10700,7 +10285,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -10735,7 +10320,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if 1.0.0", - "getrandom 0.2.15", + "getrandom 0.2.12", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -10762,16 +10347,6 @@ dependencies = [ "rustc-hex", ] -[[package]] -name = "rlp" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24e92bb2a83198bb76d661a71df9f7076b8c420b8696e4d3d97d50d94479e3" -dependencies = [ - "bytes", - "rustc-hex", -] - [[package]] name = "rlp-derive" version = "0.1.0" @@ -10783,137 +10358,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "rmp" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" -dependencies = [ - "byteorder", - "num-traits", - "paste", -] - -[[package]] -name = "rmp-serde" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" -dependencies = [ - "byteorder", - "rmp", - "serde", -] - -[[package]] -name = "rocket" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f" -dependencies = [ - "async-stream", - "async-trait", - "atomic 0.5.3", - "binascii", - "bytes", - "either", - "figment", - "futures", - "indexmap 2.5.0", - "log", - "memchr", - "multer", - "num_cpus", - "parking_lot", - "pin-project-lite", - "rand 0.8.5", - "ref-cast", - "rmp-serde", - "rocket_codegen", - "rocket_http", - "serde", - "serde_json", - "state", - "tempfile", - "time", - "tokio", - "tokio-stream", - "tokio-util", - "ubyte", - "uuid 1.10.0", - "version_check", - "yansi 1.0.1", -] - -[[package]] -name = "rocket-authorization" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa2fe821919cb7646b4b46f0896874c9fd51e04b266349aef9e8f8a1bec36368" -dependencies = [ - "base64 0.21.7", - "rocket", - "thiserror", -] - -[[package]] -name = "rocket_codegen" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46" -dependencies = [ - "devise", - "glob", - "indexmap 2.5.0", - "proc-macro2", - "quote", - "rocket_http", - "syn 2.0.77", - "unicode-xid", - "version_check", -] - -[[package]] -name = "rocket_http" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9" -dependencies = [ - "cookie 0.18.1", - "either", - "futures", - "http 0.2.12", - "hyper 0.14.30", - "indexmap 2.5.0", - "log", - "memchr", - "pear", - "percent-encoding", - "pin-project-lite", - "ref-cast", - "serde", - "smallvec", - "stable-pattern", - "state", - "time", - "tokio", - "uncased", - "uuid 1.10.0", -] - -[[package]] -name = "rocket_seek_stream" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17a8bb18061548f3ee971001d66f97291365327df38ef1d353e61025153fed7a" -dependencies = [ - "futures", - "rand 0.8.5", - "range_header", - "rocket", - "tree_magic_mini", -] - [[package]] name = "route-recognizer" version = "0.3.1" @@ -10945,7 +10389,7 @@ dependencies = [ "rand_core 0.6.4", "signature 2.2.0", "spki", - "subtle 2.6.1", + "subtle 2.5.0", "zeroize", ] @@ -10962,11 +10406,11 @@ dependencies = [ "fastrlp", "num-bigint 0.4.6", "num-traits", - "parity-scale-codec 3.6.12", + "parity-scale-codec 3.6.9", "primitive-types 0.12.2", "proptest", "rand 0.8.5", - "rlp 0.5.2", + "rlp", "ruint-macro", "serde", "valuable", @@ -10985,7 +10429,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78046161564f5e7cd9008aff3b2990b3850dc8e0349119b98e8f251e099f24d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "fallible-iterator 0.3.0", "fallible-streaming-iterator", "hashlink", @@ -10994,31 +10438,16 @@ dependencies = [ ] [[package]] -name = "rust-fsm" -version = "0.7.0" +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cebef9e69ecb76b3cebbbe9c789f41f4be3402a33dca983c24493f45c92351c9" -dependencies = [ - "aquamarine", - "rust-fsm-dsl", -] +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] -name = "rust-fsm-dsl" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3adcbccd7feb6960e55a40d116a82ef40281248d630cfa3530586a49efbbd05" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" @@ -11043,20 +10472,20 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.23", + "semver 1.0.22", ] [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -11065,9 +10494,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.12" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring 0.17.8", @@ -11077,30 +10506,30 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.8", - "subtle 2.6.1", + "rustls-webpki 0.102.2", + "subtle 2.5.0", "zeroize", ] [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" dependencies = [ "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.8", - "subtle 2.6.1", + "rustls-webpki 0.102.2", + "subtle 2.5.0", "zeroize", ] @@ -11118,12 +10547,12 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.1.1", "rustls-pki-types", "schannel", "security-framework", @@ -11140,19 +10569,19 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" dependencies = [ - "base64 0.22.1", + "base64 0.21.7", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" [[package]] name = "rustls-platform-verifier" @@ -11165,13 +10594,13 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.13", - "rustls-native-certs 0.7.3", + "rustls 0.23.7", + "rustls-native-certs 0.7.0", "rustls-platform-verifier-android", - "rustls-webpki 0.102.8", + "rustls-webpki 0.102.2", "security-framework", "security-framework-sys", - "webpki-roots 0.26.5", + "webpki-roots 0.26.3", "winapi 0.3.9", ] @@ -11193,9 +10622,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -11204,9 +10633,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rusty-fork" @@ -11222,9 +10651,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "salsa20" @@ -11246,23 +10675,23 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.3" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +checksum = "788745a868b0e751750388f4e6546eb921ef714a4317fa6954f7cde114eb2eb7" dependencies = [ "cfg-if 1.0.0", - "derive_more 0.99.18", - "parity-scale-codec 3.6.12", + "derive_more 0.99.17", + "parity-scale-codec 3.6.9", "scale-info-derive", ] [[package]] name = "scale-info-derive" -version = "2.11.3" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +checksum = "7dc2f4e8bc344b9fc3d5f74f72c2e55bfc38d28dc2ebc69c194a3df424e4d9ac" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -11270,11 +10699,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -11301,12 +10730,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -11344,14 +10767,14 @@ name = "scroll-light-client" version = "0.1.0" dependencies = [ "base64 0.21.7", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethereum-light-client", "ethereum-verifier", "ethers-core", "hex", "ics008-wasm-client", "protos", - "rlp 0.5.2", + "rlp", "schemars", "scroll-codec", "scroll-verifier", @@ -11386,7 +10809,7 @@ dependencies = [ "ethers-core", "hex", "hex-literal", - "rlp 0.5.2", + "rlp", "scroll-codec", "serde", "serde-utils", @@ -11429,17 +10852,17 @@ dependencies = [ "der", "generic-array 0.14.7", "pkcs8", - "subtle 2.6.1", + "subtle 2.5.0", "zeroize", ] [[package]] name = "security-framework" -version = "2.11.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -11449,9 +10872,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -11468,9 +10891,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -11498,9 +10921,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -11533,7 +10956,7 @@ dependencies = [ "bcs 0.1.6", "bincode", "heck 0.3.3", - "include_dir 0.6.2", + "include_dir", "maplit", "serde", "serde-reflection", @@ -11583,13 +11006,12 @@ dependencies = [ [[package]] name = "serde-untagged" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6" +checksum = "6a160535368dfc353348e7eaa299156bd508c60c45a9249725f5f6d370d82a66" dependencies = [ - "erased-serde 0.4.5", + "erased-serde 0.4.4", "serde", - "typeid", ] [[package]] @@ -11616,9 +11038,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] @@ -11635,9 +11057,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", @@ -11657,13 +11079,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.2.6", "itoa", - "memchr", "ryu", "serde", ] @@ -11691,9 +11112,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.19" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", @@ -11702,9 +11123,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -11731,7 +11152,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", @@ -11745,7 +11166,7 @@ version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ - "darling 0.20.10", + "darling 0.20.8", "proc-macro2", "quote", "syn 2.0.77", @@ -11769,7 +11190,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -11847,9 +11268,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.4" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" dependencies = [ "cc", "cfg-if 1.0.0", @@ -11864,38 +11285,11 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" -dependencies = [ - "libc", - "mio 0.8.11", - "signal-hook", -] - [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -11979,9 +11373,9 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", "windows-sys 0.52.0", @@ -12058,10 +11452,11 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.6" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" dependencies = [ + "itertools 0.12.1", "nom", "unicode_categories", ] @@ -12101,13 +11496,13 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.5.0", + "indexmap 2.2.6", "log", "memchr", "once_cell", "paste", "percent-encoding", - "rustls 0.21.12", + "rustls 0.21.10", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -12171,7 +11566,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.6.0", + "bitflags 2.5.0", "byteorder", "bytes", "crc", @@ -12215,7 +11610,7 @@ dependencies = [ "atoi", "base64 0.21.7", "bigdecimal", - "bitflags 2.6.0", + "bitflags 2.5.0", "byteorder", "crc", "dotenvy", @@ -12317,40 +11712,12 @@ dependencies = [ "unionlabs", ] -[[package]] -name = "stability" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" -dependencies = [ - "quote", - "syn 2.0.77", -] - -[[package]] -name = "stable-pattern" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" -dependencies = [ - "memchr", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "state" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" -dependencies = [ - "loom", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -12383,13 +11750,13 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", - "unicode-properties", ] [[package]] @@ -12406,9 +11773,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "structopt" @@ -12454,11 +11821,11 @@ dependencies = [ [[package]] name = "strum" -version = "0.26.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros 0.26.4", + "strum_macros 0.26.2", ] [[package]] @@ -12489,11 +11856,11 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.4" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -12521,9 +11888,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.6.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "subtle-encoding" @@ -12551,7 +11918,7 @@ dependencies = [ "hex", "once_cell", "reqwest 0.11.27", - "semver 1.0.23", + "semver 1.0.22", "serde", "serde_json", "sha2 0.10.8", @@ -12656,15 +12023,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if 1.0.0", "fastrand", - "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -12687,7 +12053,7 @@ dependencies = [ "serde_repr", "sha2 0.10.8", "signature 2.2.0", - "subtle 2.6.1", + "subtle 2.5.0", "subtle-encoding", "tendermint-proto", "time", @@ -12703,7 +12069,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.19", + "toml 0.8.12", "url", ] @@ -12713,7 +12079,7 @@ version = "0.1.0" dependencies = [ "base64 0.21.7", "bytes", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "hex", "ics008-wasm-client", "ics23", @@ -12756,16 +12122,16 @@ dependencies = [ "bytes", "flex-error", "futures", - "getrandom 0.2.15", + "getrandom 0.2.12", "peg", "pin-project", "rand 0.8.5", "reqwest 0.11.27", - "semver 1.0.23", + "semver 1.0.22", "serde", "serde_bytes", "serde_json", - "subtle 2.6.1", + "subtle 2.5.0", "subtle-encoding", "tendermint", "tendermint-config", @@ -12867,18 +12233,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", @@ -12910,8 +12276,8 @@ version = "0.1.0" dependencies = [ "cargo-util-schemas", "cargo_metadata", - "clap 4.5.17", - "toml 0.8.19", + "clap 4.5.4", + "toml 0.8.12", "tracing", "tracing-subscriber 0.3.18", ] @@ -13001,9 +12367,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -13018,8 +12384,8 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" name = "token-factory-api" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", ] [[package]] @@ -13031,7 +12397,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.2", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -13073,9 +12439,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.12" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b5d3742945bc7d7f210693b0c58ae542c6fd47b17adbbda0885f3dcb34a6bdb" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" dependencies = [ "async-trait", "byteorder", @@ -13103,7 +12469,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.12", + "rustls 0.21.10", "tokio", ] @@ -13113,7 +12479,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.4", + "rustls 0.22.3", "rustls-pki-types", "tokio", ] @@ -13124,16 +12490,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.7", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -13149,7 +12515,7 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.21.12", + "rustls 0.21.10", "tokio", "tokio-rustls 0.24.1", "tungstenite 0.20.1", @@ -13176,12 +12542,12 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.13", + "rustls 0.23.7", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tungstenite 0.23.0", - "webpki-roots 0.26.5", + "webpki-roots 0.26.3", ] [[package]] @@ -13212,21 +12578,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.21", + "toml_edit 0.22.9", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -13237,7 +12603,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -13246,15 +12612,37 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow 0.6.5", ] [[package]] @@ -13269,15 +12657,15 @@ dependencies = [ "base64 0.21.7", "bytes", "flate2", - "h2 0.3.26", + "h2 0.3.25", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.28", "hyper-timeout", "percent-encoding", "pin-project", "prost 0.12.6", - "rustls 0.21.12", + "rustls 0.21.10", "rustls-native-certs 0.6.3", "rustls-pemfile 1.0.4", "tokio", @@ -13312,15 +12700,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" @@ -13430,10 +12818,11 @@ dependencies = [ [[package]] name = "tracing-test" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" +checksum = "3a2c0ff408fe918a94c428a3f2ad04e4afd5c95bbc08fcf868eff750c15728a4" dependencies = [ + "lazy_static", "tracing-core", "tracing-subscriber 0.3.18", "tracing-test-macro", @@ -13441,12 +12830,13 @@ dependencies = [ [[package]] name = "tracing-test-macro" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" +checksum = "258bc1c4f8e2e73a977812ab339d503e6feeb92700f6d07a6de4d321522d5c08" dependencies = [ + "lazy_static", "quote", - "syn 2.0.77", + "syn 1.0.109", ] [[package]] @@ -13460,20 +12850,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "tree_magic_mini" -version = "3.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" -dependencies = [ - "fnv", - "home", - "memchr", - "nom", - "once_cell", - "petgraph 0.6.5", -] - [[package]] name = "trie-db" version = "0.28.0" @@ -13504,17 +12880,18 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trybuild" -version = "1.0.99" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8" +checksum = "8ad7eb6319ebadebca3dacf1f85a93bc54b73dd81b9036795f73de7ddfe27d5a" dependencies = [ "dissimilar", "glob", + "once_cell", "serde", "serde_derive", "serde_json", "termcolor", - "toml 0.8.19", + "toml 0.8.12", ] [[package]] @@ -13530,7 +12907,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.21.12", + "rustls 0.21.10", "sha1", "thiserror", "url", @@ -13550,7 +12927,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.22.4", + "rustls 0.22.3", "rustls-pki-types", "sha1", "thiserror", @@ -13571,7 +12948,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.23.13", + "rustls 0.23.7", "rustls-pki-types", "sha1", "thiserror", @@ -13595,12 +12972,6 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" -[[package]] -name = "typeid" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" - [[package]] name = "typenum" version = "1.17.0" @@ -13629,15 +13000,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "ubyte" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" -dependencies = [ - "serde", -] - [[package]] name = "ucd-trie" version = "0.1.6" @@ -13650,9 +13012,9 @@ version = "0.1.0" dependencies = [ "beacon-api", "chain-utils", - "clap 4.5.17", + "clap 4.5.4", "contracts", - "cosmwasm-std 1.5.7", + "cosmwasm-std 1.5.2", "ethers", "hex", "serde", @@ -13667,8 +13029,8 @@ dependencies = [ name = "ucs00-pingpong" version = "1.0.0" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-storage-plus 1.2.0", "dlmalloc", "ethabi", @@ -13683,8 +13045,8 @@ name = "ucs01-relay" version = "1.0.1" dependencies = [ "base58 0.2.0", - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-controllers", "cw-multi-test", "cw-storage-plus 2.0.0", @@ -13696,7 +13058,7 @@ dependencies = [ "prost 0.12.6", "protos", "schemars", - "semver 1.0.23", + "semver 1.0.22", "serde", "serde-json-wasm 1.0.1", "serde-utils", @@ -13713,8 +13075,8 @@ dependencies = [ name = "ucs01-relay-api" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.1.3", - "cosmwasm-std 2.1.3", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "ethabi", "go-parse-duration", "prost 0.12.6", @@ -13732,8 +13094,8 @@ dependencies = [ name = "ucs02-nft" version = "1.0.0" dependencies = [ - "cosmwasm-schema 1.5.7", - "cosmwasm-std 1.5.7", + "cosmwasm-schema 1.5.3", + "cosmwasm-std 1.5.2", "cw-storage-plus 1.2.0", "dlmalloc", "ethabi", @@ -13757,18 +13119,6 @@ dependencies = [ "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "uint" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "unarray" version = "0.1.4" @@ -13781,7 +13131,6 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" dependencies = [ - "serde", "version_check", ] @@ -13802,9 +13151,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-linebreak" @@ -13821,40 +13170,23 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-properties" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" - [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-truncate" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" -dependencies = [ - "itertools 0.13.0", - "unicode-segmentation", - "unicode-width", -] +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unicode_categories" @@ -13873,10 +13205,10 @@ dependencies = [ "borsh", "bs58 0.4.0", "chrono", - "clap 4.5.17", + "clap 4.5.4", "contracts", - "cosmwasm-std 1.5.7", - "derive_more 0.99.18", + "cosmwasm-std 1.5.2", + "derive_more 0.99.17", "either", "enumorph", "ethers", @@ -13897,7 +13229,7 @@ dependencies = [ "protos", "rand 0.8.5", "ripemd", - "rlp 0.5.2", + "rlp", "rs_merkle", "schemars", "serde", @@ -13912,7 +13244,7 @@ dependencies = [ "thiserror", "tracing", "typenum", - "uint 0.10.0", + "uint", "wasmparser", ] @@ -13920,7 +13252,7 @@ dependencies = [ name = "unionvisor" version = "0.1.0" dependencies = [ - "clap 4.5.17", + "clap 4.5.4", "color-eyre", "figment", "fs_extra", @@ -13929,7 +13261,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml 0.8.19", + "toml 0.8.12", "tracing", "tracing-subscriber 0.3.18", "tracing-test", @@ -13942,7 +13274,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.6.1", + "subtle 2.5.0", ] [[package]] @@ -13982,9 +13314,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -14006,9 +13338,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" @@ -14016,7 +13348,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.12", "serde", ] @@ -14026,8 +13358,7 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ - "getrandom 0.2.15", - "serde", + "getrandom 0.2.12", ] [[package]] @@ -14074,9 +13405,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "voyager" @@ -14088,10 +13419,10 @@ dependencies = [ "bip32", "bitvec 1.0.1", "chain-utils", - "clap 4.5.17", + "clap 4.5.4", "contracts", "crossbeam-queue", - "derive_more 0.99.18", + "derive_more 0.99.17", "either", "enumorph", "ethers", @@ -14139,7 +13470,7 @@ dependencies = [ name = "voyager-chain-module-cosmos-sdk" version = "0.1.0" dependencies = [ - "clap 4.5.17", + "clap 4.5.4", "cometbft-rpc", "dashmap", "enumorph", @@ -14195,7 +13526,7 @@ dependencies = [ "aptos-rest-client", "aptos-types", "bcs 0.1.6", - "clap 4.5.17", + "clap 4.5.4", "enumorph", "frunk", "futures", @@ -14224,7 +13555,7 @@ dependencies = [ name = "voyager-client-module-cometbls" version = "0.1.0" dependencies = [ - "clap 4.5.17", + "clap 4.5.4", "cometbft-rpc", "dashmap", "enumorph", @@ -14329,7 +13660,7 @@ version = "0.1.0" dependencies = [ "beacon-api", "chain-utils", - "clap 4.5.17", + "clap 4.5.4", "contracts", "dashmap", "enumorph", @@ -14550,20 +13881,19 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if 1.0.0", - "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -14576,9 +13906,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -14588,9 +13918,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -14598,9 +13928,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -14611,9 +13941,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" @@ -14634,15 +13964,15 @@ version = "0.113.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "286049849b5a5bd09a8773171be96824afabffc7cc3df6caaf33a38db6cd07ae" dependencies = [ - "indexmap 2.5.0", - "semver 1.0.23", + "indexmap 2.2.6", + "semver 1.0.22", ] [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -14656,9 +13986,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -14675,11 +14005,23 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "whoami" -version = "1.5.2" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ "redox_syscall", "wasite", @@ -14728,11 +14070,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "windows-sys 0.59.0", + "winapi 0.3.9", ] [[package]] @@ -14741,52 +14083,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-registry" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" -dependencies = [ - "windows-result", - "windows-strings", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result", - "windows-targets 0.52.6", + "windows-targets 0.52.4", ] [[package]] @@ -14804,16 +14107,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.4", ] [[package]] @@ -14833,18 +14127,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -14855,9 +14148,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -14867,9 +14160,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -14879,15 +14172,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -14897,9 +14184,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -14909,9 +14196,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -14921,9 +14208,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -14933,9 +14220,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" @@ -14948,9 +14235,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -14965,6 +14252,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys 0.48.0", +] + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -14976,7 +14273,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.1", + "rustc_version 0.4.0", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -15024,30 +14321,20 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" -dependencies = [ - "is-terminal", -] - [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", @@ -15056,9 +14343,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -15131,9 +14418,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/app/src/routes/ceremony/+page.svelte b/app/src/routes/ceremony/+page.svelte new file mode 100644 index 0000000000..e30a462c79 --- /dev/null +++ b/app/src/routes/ceremony/+page.svelte @@ -0,0 +1,195 @@ + + + + Union | Ceremony + + + +
+ {#if queuePosition != null} + Queue position: {queuePosition} + {:else} +
+ Queue position: +
+ {/if} + + {#each messages as message} +
+ {@html message} +
+ {/each} +
diff --git a/flake.nix b/flake.nix index 5e8b10d8ce..8e84c01d65 100644 --- a/flake.nix +++ b/flake.nix @@ -562,6 +562,7 @@ self'.packages.voy-send-msg yq gdb + typescript ]) ++ (with unstablePkgs; [ wasm-tools bun # for running TypeScript files on the fly diff --git a/mpc/client/Cargo.toml b/mpc/client/Cargo.toml index d076ebe5e5..17a4dae0ce 100644 --- a/mpc/client/Cargo.toml +++ b/mpc/client/Cargo.toml @@ -4,14 +4,20 @@ name = "mpc-client" version = "0.1.0" [dependencies] -clap = { version = "4.5", features = ["derive"] } -crossterm = "0.27.0" -mpc-shared = { workspace = true } -rand = "0.8.5" -ratatui = "0.27.0" -reqwest = { workspace = true, features = ["json"] } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } -sha2 = { workspace = true } -thiserror = { workspace = true } -tokio = { workspace = true, features = ["full"] } +async-sqlite = "0.2.2" +base64 = { workspace = true } +clap = { version = "4.5", features = ["derive"] } +crossterm = "0.27.0" +http-body-util = "0.1" +httpdate = "1.0" +hyper = { version = "1", features = ["full"] } +hyper-util = { version = "0.1", features = ["full"] } +mpc-shared = { workspace = true } +postgrest = "1.0" +rand = "0.8.5" +ratatui = "0.27.0" +reqwest = { workspace = true, features = ["json"] } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full"] } diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index ad58024b87..f05a298301 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -1,193 +1,159 @@ -use std::{io::SeekFrom, path::Path, str::FromStr}; +use std::{ + convert::Infallible, io::SeekFrom, net::SocketAddr, os::unix::fs::MetadataExt, path::Path, + str::FromStr, time::UNIX_EPOCH, +}; +use async_sqlite::{rusqlite::params, JournalMode, Pool, PoolBuilder}; +use base64::{prelude::BASE64_STANDARD, Engine}; use clap::{Parser, Subcommand}; +use http_body_util::{BodyExt, Full}; +use httpdate::parse_http_date; +use hyper::{body::Buf, service::service_fn, Method}; +use hyper_util::rt::TokioIo; use mpc_shared::{ - phase2_contribute, phase2_verify, types::Contribution, CONTRIBUTION_CHUNKS, - CONTRIBUTION_CHUNK_SIZE, CONTRIBUTION_SIZE, + phase2_contribute, phase2_verify, + types::{Contribution, ContributorId, PayloadId}, + CONTRIBUTION_CHUNKS, CONTRIBUTION_CHUNK_SIZE, CONTRIBUTION_SIZE, }; +use postgrest::Postgrest; use reqwest::{ header::{ - HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_ENCODING, CONTENT_LENGTH, RANGE, - TRANSFER_ENCODING, + HeaderMap, HeaderName, HeaderValue, AUTHORIZATION, CONTENT_ENCODING, CONTENT_LENGTH, + LOCATION, RANGE, TRANSFER_ENCODING, }, StatusCode, }; -use sha2::Digest; -use tokio::io::{AsyncSeekExt, AsyncWriteExt}; +use serde::{Deserialize, Serialize}; +use tokio::{ + io::{empty, AsyncSeekExt, AsyncWriteExt}, + net::TcpListener, +}; -#[derive(Parser, Debug)] -#[command(version, about, long_about = None)] -struct Args { - #[command(subcommand)] - command: Command, -} +static INTERNAL_SERVER_ERROR: &[u8] = b"Internal Server Error"; +static NOTFOUND: &[u8] = b"Not Found"; -#[derive(Subcommand, Debug, Clone)] -enum Command { - Contribute { - #[arg(short, long)] - token: String, - }, - Verify { - #[arg(short, long)] - phase2_payload_path: String, - #[arg(short, long)] - phase2_contrib_path: String, - }, +#[derive(PartialEq, Eq, Debug, Clone, Deserialize)] +#[serde(rename_all = "camelCase")] +struct Contribute { + bucket: String, + jwt: String, + api_key: String, + contributor_id: String, + payload_id: String, } -#[derive(thiserror::Error, Debug, Copy, Clone)] +#[derive(thiserror::Error, Debug, Clone)] enum Error { + #[error("couldn't find expected header: {0}")] + HeaderNotFound(String), + #[error("current contributor not found.")] + ContributorNotFound, + #[error("current payload not found.")] + PayloadNotFound, #[error(transparent)] Phase2ContributionFailed(#[from] mpc_shared::Phase2ContributionError), #[error(transparent)] Phase2VerificationFailed(#[from] mpc_shared::Phase2VerificationError), - #[error("Failed to read current state file.")] - FailedToReadPhase2Payload, - #[error("Failed to read contrib state file.")] - FailedToReadPhase2Contrib, - #[error("Failed to write the contribution file.")] - FailedToWriteContribution, } -async fn get_state_file(path: &Path) -> (Vec, [u8; 32]) { +async fn get_state_file(path: &str) -> Vec { if !tokio::fs::try_exists(path).await.unwrap() { tokio::fs::write(path, []).await.unwrap(); } - let content = tokio::fs::read(path).await.unwrap(); - let hash = sha2::Sha256::new().chain_update(&content).finalize(); - (content, hash.into()) + tokio::fs::read(path).await.unwrap() } -#[derive(Debug)] -pub enum CompressionType { - Gzip, - Deflate, - Brotli, - Zstd, -} +type BoxBody = http_body_util::combinators::BoxBody; -impl FromStr for CompressionType { - type Err = (); - fn from_str(value: &str) -> Result { - match value { - "gzip" => Ok(CompressionType::Gzip), - "deflate" => Ok(CompressionType::Deflate), - "br" => Ok(CompressionType::Brotli), - "zstd" => Ok(CompressionType::Zstd), - _ => Err(()), - } - } -} - -fn get_compression_type(headers: &HeaderMap) -> Option { - let mut compression_type = headers - .get_all(CONTENT_ENCODING) - .iter() - .find_map(|value| value.to_str().ok().and_then(|value| value.parse().ok())); - - if compression_type.is_none() { - compression_type = headers - .get_all(TRANSFER_ENCODING) - .iter() - .find_map(|value| value.to_str().ok().and_then(|value| value.parse().ok())); - } - - if compression_type.is_some() { - if let Some(content_length) = headers.get(CONTENT_LENGTH) { - if content_length == "0" { - return None; - } - } - } - - compression_type -} - -#[tokio::main] -async fn main() -> Result<(), Error> { - let args = Args::parse(); - match args.command { - Command::Contribute { token } => { - let url = |path: String| format!("http://localhost:8000/{}", path); - println!("client token {}", token); +async fn handle( + req: hyper::Request, +) -> Result, Box> { + match (req.method(), req.uri().path()) { + (&Method::POST, "/contribute") => { + let whole_body = req.collect().await?.aggregate(); + let Contribute { + bucket, + jwt, + api_key, + contributor_id, + payload_id, + } = serde_json::from_reader(whole_body.reader())?; + const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; + const APIKEY: &str = "apikey"; + let authorization_header = format!("Bearer {}", jwt); + let client = Postgrest::new(format!("{SUPABASE_PROJECT}/rest/v1")) + .insert_header(APIKEY, api_key) + .insert_header(AUTHORIZATION, authorization_header.clone()); + let current_contributor = client + .from("current_contributor_id") + .select("id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned() + .ok_or(Error::ContributorNotFound)?; + assert!( + current_contributor.id == contributor_id, + "not current contributor." + ); + let current_payload = client + .from("current_payload_id") + .select("payload_id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned() + .ok_or(Error::PayloadNotFound)?; + let current_payload_download_url = format!( + "{SUPABASE_PROJECT}/storage/v1/object/contributions/{}", + ¤t_payload.id + ); let client = reqwest::ClientBuilder::new() .default_headers(HeaderMap::from_iter([( AUTHORIZATION, - HeaderValue::from_str(&format!("Bearer {}", token)).unwrap(), + HeaderValue::from_str(&authorization_header)?, )])) - .build() - .unwrap(); - println!("joining the queue"); - client - .post(url("join".into())) - .send() - .await - .unwrap() - .error_for_status() - .unwrap(); - println!("waiting our turn..."); - let expected_state_file_hash = loop { - let response = client.get(url("me".into())).send().await.unwrap(); - if response.status().is_success() { - println!("finally our turn!"); - let expected_hash = response.bytes().await.unwrap(); - break expected_hash; - } - let response = client.get(url("contribution".into())).send().await.unwrap(); - match response.status() { - StatusCode::OK => { - println!( - "contribution done: {:?}", - response.json::().await.unwrap() - ); - return Ok(()); - } - _ => {} - } - println!("checking contribution status..."); - tokio::time::sleep(std::time::Duration::from_millis(1000)).await; - }; - println!("verifying state file integrity..."); + .build()?; + println!("checking payload file..."); enum StateFileAction { Download(usize), Done(Vec), } - let state_path = Path::new("./state.ph2"); + let state_path = current_payload.id; let action = match get_state_file(&state_path).await { - (content, _) if content.len() < CONTRIBUTION_SIZE => { + content if content.len() < CONTRIBUTION_SIZE => { println!("partial download, continuing from {}...", content.len()); StateFileAction::Download(content.len()) } - (content, hash) - if content.len() == CONTRIBUTION_SIZE && hash == *expected_state_file_hash => - { - println!("integrity verified, download complete."); + content if content.len() == CONTRIBUTION_SIZE => { + println!("download complete."); StateFileAction::Done(content) } _ => { - println!("invalid size or invalid hash detected, redownloading..."); + println!("invalid size detected, redownloading..."); StateFileAction::Download(0) } }; let payload = match action { StateFileAction::Download(start_position) => { let mut response = client - .get(url("state".into())) + .get(current_payload_download_url) .header(RANGE, format!("bytes={}-", start_position)) .send() - .await - .unwrap() - .error_for_status() - .unwrap(); + .await? + .error_for_status()?; let headers = response.headers(); - assert!( - get_compression_type(headers).is_none(), - "compression not supported." - ); let total_length = start_position - + u64::from_str(headers.get(CONTENT_LENGTH).unwrap().to_str().unwrap()) - .unwrap() as usize; + + u64::from_str( + headers + .get(CONTENT_LENGTH) + .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? + .to_str()?, + )? as usize; println!("state file length: {}", total_length); assert!( total_length == CONTRIBUTION_SIZE, @@ -196,68 +162,230 @@ async fn main() -> Result<(), Error> { let mut state_file = tokio::fs::OpenOptions::new() .write(true) .create(false) - .open(state_path) - .await - .unwrap(); - state_file.set_len(start_position as u64).await.unwrap(); + .open(&state_path) + .await?; + state_file.set_len(start_position as u64).await?; state_file .seek(SeekFrom::Start(start_position as u64)) - .await - .unwrap(); + .await?; let mut i = 0; - while let Some(chunk) = response.chunk().await.unwrap() { + while let Some(chunk) = response.chunk().await? { if i % 10 == 0 { println!("eta: chunk {}.", i); } - let written = state_file.write(&chunk).await.unwrap(); + let written = state_file.write(&chunk).await?; assert!(written == chunk.len(), "couldn't write chunk."); - state_file.sync_data().await.unwrap(); + state_file.sync_data().await?; i += 1; } println!("download complete"); - println!("verifying integrity..."); - let final_content = tokio::fs::read(state_path).await.unwrap(); - let final_content_hash = sha2::Sha256::new() - .chain_update(&final_content) - .finalize() - .to_vec(); - assert!( - &final_content_hash == expected_state_file_hash.as_ref(), - "invalid file hash after download." - ); - println!("integrity verified"); + let final_content = tokio::fs::read(&state_path).await?; final_content } StateFileAction::Done(content) => content, }; - println!("generating contribution, may take some time..."); - let phase2_contribution = phase2_contribute(&payload).unwrap(); + let phase2_contribution = if let Ok(true) = tokio::fs::metadata(&payload_id) + .await + .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) + { + println!("loading completed contribution..."); + tokio::fs::read(&payload_id).await? + } else { + println!("generating contribution, may take some time..."); + let phase2_contribution = phase2_contribute(&payload)?; + tokio::fs::write(&payload_id, &phase2_contribution).await?; + phase2_contribution + }; println!("uploading contribution..."); - for i in 0..=CONTRIBUTION_CHUNKS { - println!("eta: chunk {}.", i); - let chunk = &phase2_contribution[i * CONTRIBUTION_CHUNK_SIZE - ..std::cmp::min((i + 1) * CONTRIBUTION_CHUNK_SIZE, CONTRIBUTION_SIZE)]; - client - .post(url(format!("contribute/{}", i))) - .body(chunk.to_vec()) + let pool = PoolBuilder::new() + .path("db.sqlite3") + .journal_mode(JournalMode::Wal) + .open() + .await?; + + pool.conn(|conn| { + conn.execute( + "CREATE TABLE IF NOT EXISTS resumable_upload ( + location TEXT PRIMARY KEY NOT NULL, + create_at TIMESTAMPTZ NOT NULL DEFAULT(unixepoch()), + expire TIMSTAMPTZ NOT NULL + )", + (), // empty list of parameters. + )?; + Ok(()) + }) + .await?; + let mut upload_location = pool + .conn(move |conn| { + let mut stmt = conn.prepare_cached( + "SELECT location FROM resumable_upload WHERE expire > unixepoch() LIMIT 1", + )?; + let mut rows = stmt.query(())?; + if let Some(row) = rows.next()? { + Ok(Some(row.get::<_, String>(0)?)) + } else { + Ok(None) + } + }) + .await?; + if let Some(ref location) = upload_location { + if client + .head(location) + .header("Tus-Resumable", "1.0.0") .send() - .await - .unwrap() + .await? .error_for_status() - .unwrap(); + .is_err() + { + upload_location = None; + } } - Ok(()) - } - Command::Verify { - phase2_payload_path, - phase2_contrib_path, - } => { - // let phase2_payload = - // std::fs::read(phase2_payload_path).map_err(|_| Error::FailedToReadPhase2Payload)?; - // let phase2_contrib = - // std::fs::read(phase2_contrib_path).map_err(|_| Error::FailedToReadPhase2Contrib)?; - // phase2_verify(&phase2_payload, &phase2_contrib)?; - Ok(()) + let upload_location = match upload_location { + Some(location) => { + println!("location already stored in db."); + location + } + None => { + println!("location not found, generating a new one..."); + // ===================================================== + // https://tus.io/protocols/resumable-upload#creation == + // ===================================================== + let response = client + .post(format!("{SUPABASE_PROJECT}/storage/v1/upload/resumable")) + .header("Tus-Resumable", "1.0.0") + .header("Upload-Length", CONTRIBUTION_SIZE.to_string()) + .header( + "Upload-Metadata", + format!( + "bucketName {},objectName {}", + BASE64_STANDARD.encode(&bucket), + BASE64_STANDARD.encode(&payload_id) + ), + ) + .send() + .await?; + let location = response + .headers() + .get(LOCATION) + .ok_or(Error::HeaderNotFound(LOCATION.as_str().into()))? + .to_str()? + .to_string(); + let expire = response + .headers() + .get("Upload-Expires") + .ok_or(Error::HeaderNotFound("Upload-Expires".into()))? + .to_str()? + .into(); + let expire = parse_http_date(expire)?; + let expire_timestamp = expire.duration_since(UNIX_EPOCH)?.as_secs(); + let location_clone = location.clone(); + pool.conn(move |conn| { + let mut stmt = conn.prepare_cached( + "INSERT INTO resumable_upload (location, expire) VALUES (?, ?)", + )?; + let r = stmt.execute((location_clone, expire_timestamp))?; + assert!(r == 1); + Ok(()) + }) + .await?; + location + } + }; + + println!("upload location: {upload_location}"); + + // ================================================= + // https://tus.io/protocols/resumable-upload#head == + // ================================================= + let response = client + .head(&upload_location) + .header("Tus-Resumable", "1.0.0") + .send() + .await? + .error_for_status()?; + let upload_length = usize::from_str( + response + .headers() + .get("Upload-Length") + .ok_or(Error::HeaderNotFound("Upload-Length".into()))? + .to_str()?, + )?; + let upload_offset = usize::from_str( + response + .headers() + .get("Upload-Offset") + .ok_or(Error::HeaderNotFound("Upload-Offset".into()))? + .to_str()?, + )?; + assert!(upload_length == CONTRIBUTION_SIZE, "invalid upload-length."); + println!("upload-offset: {}", upload_offset); + if upload_offset < upload_length { + println!("uploading contribution..."); + // ================================================== + // https://tus.io/protocols/resumable-upload#patch == + // ================================================== + client + .patch(&upload_location) + .header("Tus-Resumable", "1.0.0") + .header("Content-Type", "application/offset+octet-stream") + .header("Upload-Offset", upload_offset.to_string()) + .body( + phase2_contribution + .into_iter() + .skip(upload_offset) + .collect::>(), + ) + .send() + .await? + .error_for_status()?; + } + println!("upload complete."); + Ok(hyper::Response::builder() + .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .header(hyper::header::CONTENT_TYPE, "application/json") + .status(hyper::StatusCode::OK) + .body(BoxBody::default()) + .unwrap()) } + // Preflight options request from the browser. + (&Method::OPTIONS, "/contribute") => Ok(hyper::Response::builder() + .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .header( + hyper::header::ACCESS_CONTROL_ALLOW_HEADERS, + hyper::header::CONTENT_TYPE, + ) + .header(hyper::header::ACCESS_CONTROL_ALLOW_METHODS, "POST, OPTIONS") + .status(hyper::StatusCode::OK) + .body(BoxBody::default()) + .unwrap()), + _ => Ok(hyper::Response::builder() + .status(hyper::StatusCode::NOT_FOUND) + .body(full(NOTFOUND)) + .unwrap()), + } +} + +fn full>(chunk: T) -> BoxBody { + Full::new(chunk.into()) + .map_err(|never| match never {}) + .boxed() +} + +#[tokio::main] +async fn main() -> Result<(), Box> { + let addr = SocketAddr::from(([127, 0, 0, 1], 0x1337)); + let listener = TcpListener::bind(addr).await?; + loop { + let (stream, _) = listener.accept().await?; + let io = TokioIo::new(stream); + tokio::task::spawn(async move { + // Finally, we bind the incoming connection to our `hello` service + if let Err(err) = hyper::server::conn::http1::Builder::new() + .serve_connection(io, service_fn(handle)) + .await + { + eprintln!("Error serving connection: {:?}", err); + } + }); } } diff --git a/mpc/coordinator/Cargo.toml b/mpc/coordinator/Cargo.toml index 9ed39e7388..55eb53abe0 100644 --- a/mpc/coordinator/Cargo.toml +++ b/mpc/coordinator/Cargo.toml @@ -4,13 +4,12 @@ name = "mpc-coordinator" version = "0.1.0" [dependencies] -clap = { version = "4.5", features = ["derive"] } -futures.workspace = true -mpc-shared = { workspace = true } -priority-queue = "2.0.3" -rocket = { version = "0.5.1", features = ["json", "msgpack", "uuid"] } -rocket-authorization = "1.0.0" -rocket_seek_stream = "0.2.6" -rust-fsm = { version = "0.7.0", features = ["diagram"] } -sha2 = { workspace = true } -thiserror = { workspace = true } +async-sqlite = "0.2.2" +clap = { version = "4.5", features = ["derive"] } +futures.workspace = true +mpc-shared = { workspace = true } +postgrest = "1.0" +reqwest = { workspace = true, features = ["json"] } +serde_json = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full"] } diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index ce8fe9b172..43a932db82 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -1,3 +1,6 @@ +----------- +-- Queue -- +----------- CREATE TABLE queue ( id uuid PRIMARY KEY, payload_id uuid NOT NULL DEFAULT(gen_random_uuid()), @@ -5,9 +8,34 @@ CREATE TABLE queue ( score integer NOT NULL ); +ALTER TABLE queue ENABLE ROW LEVEL SECURITY; +ALTER TABLE queue ADD FOREIGN KEY (id) REFERENCES auth.users(id); +CREATE UNIQUE INDEX idx_queue_score_id ON queue(score, id); +CREATE UNIQUE INDEX idx_queue_score ON queue(score); +CREATE UNIQUE INDEX idx_queue_id_payload ON queue(id, payload_id); + +CREATE POLICY view_all + ON queue + FOR SELECT + TO authenticated + USING ( + true + ); + +CREATE OR REPLACE VIEW current_queue_position AS + SELECT COUNT(*) AS position + FROM queue q + WHERE q.score > ( + SELECT qq.score FROM queue qq WHERE qq.id = auth.uid() + ) AND NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id); + +ALTER VIEW current_queue_position SET (security_invoker = on); + CREATE OR REPLACE FUNCTION min_score() RETURNS INTEGER AS $$ - SELECT COALESCE(MIN(score) - 1, 1000000) FROM queue -$$ LANGUAGE SQL; +BEGIN + RETURN (SELECT COALESCE(MIN(score) - 1, 1000000) FROM queue); +END +$$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION set_initial_score_trigger() RETURNS TRIGGER AS $$ BEGIN @@ -18,32 +46,68 @@ $$ LANGUAGE plpgsql; CREATE TRIGGER queue_set_initial_score BEFORE INSERT ON queue FOR EACH ROW EXECUTE FUNCTION set_initial_score_trigger(); -CREATE UNIQUE INDEX idx_queue_score_id ON queue(score, id); -CREATE UNIQUE INDEX idx_queue_score ON queue(score); - -ALTER TABLE queue ADD FOREIGN KEY (id) REFERENCES users(id); - +------------------------- +-- Contribution Status -- +------------------------- CREATE TABLE contribution_status( id uuid PRIMARY KEY, started timestamptz NOT NULL DEFAULT(now()), expire timestamptz NOT NULL DEFAULT(now() + INTERVAL '30 minutes') ); +ALTER TABLE contribution ENABLE ROW LEVEL SECURITY; +ALTER TABLE contribution_status ADD FOREIGN KEY (id) REFERENCES queue(id); CREATE UNIQUE INDEX idx_contribution_status_id_expire ON contribution_status(id, expire); -ALTER TABLE contribution_status ADD FOREIGN KEY (id) REFERENCES queue(id); +CREATE POLICY view_all + ON contribution_status + FOR SELECT + TO authenticated + USING ( + true + ); + +---------------------------- +-- Contribution Submitted -- +---------------------------- +CREATE TABLE contribution_submitted( + id uuid PRIMARY KEY, + created_at timestamptz NOT NULL DEFAULT(now()) +); + +ALTER TABLE contribution_submitted ENABLE ROW LEVEL SECURITY; +ALTER TABLE contribution_submitted ADD FOREIGN KEY (id) REFERENCES queue(id); + +CREATE POLICY view_all + ON contribution_submitted + FOR SELECT + TO authenticated + USING ( + true + ); +------------------ +-- Contribution -- +------------------ CREATE TABLE contribution( id uuid PRIMARY KEY, - seq SMALLSERIAL NOT NULL, + seq smallserial NOT NULL, created_at timestamptz NOT NULL DEFAULT(now()), success boolean ); +ALTER TABLE contribution ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution ADD FOREIGN KEY (id) REFERENCES queue(id); - CREATE UNIQUE INDEX idx_contribution_seq ON contribution(seq); -CREATE UNIQUE INDEX idx_contribution_seq_success ON contribution(seq, success); +CREATE UNIQUE INDEX idx_contribution_seq_success ON contribution(success, seq); + +CREATE POLICY view_all + ON contribution + FOR SELECT + TO authenticated + USING ( + true + ); -- The next contributor is the one with the higest score that didn't contribute yet. CREATE OR REPLACE FUNCTION set_next_contributor_trigger() RETURNS TRIGGER AS $$ @@ -57,7 +121,7 @@ $$ LANGUAGE plpgsql; CREATE TRIGGER contribution_added AFTER INSERT ON contribution FOR EACH ROW EXECUTE FUNCTION set_next_contributor_trigger(); -- Current contributor is the highest score in the queue with the contribution --- not done yet and it's status not expired. +-- not done yet and it's status expired without payload submitted. CREATE OR REPLACE VIEW current_contributor_id AS SELECT q.id FROM queue q @@ -65,20 +129,34 @@ CREATE OR REPLACE VIEW current_contributor_id AS SELECT MAX(qq.score) FROM queue qq WHERE NOT EXISTS ( - SELECT * FROM contribution c WHERE c.id = qq.id - ) AND EXISTS ( - SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire > now() + SELECT c.id FROM contribution c WHERE c.id = qq.id + ) AND ( + EXISTS (SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire > now()) + OR + ( + EXISTS (SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire <= now()) + AND + EXISTS (SELECT cs.id FROM contribution_submitted cs WHERE cs.id = qq.id) + ) ) ); +ALTER VIEW current_contributor_id SET (security_invoker = on); + -- The current payload is from the latest successfull contribution CREATE OR REPLACE VIEW current_payload_id AS - SELECT q.payload_id - FROM contribution c - INNER JOIN queue q ON q.id = c.id - WHERE c.seq = ( - SELECT MAX(cc.seq) FROM contribution cc WHERE cc.success - ); + SELECT COALESCE( + (SELECT q.payload_id + FROM contribution c + INNER JOIN queue q USING(id) + WHERE c.seq = ( + SELECT MAX(cc.seq) FROM contribution cc WHERE cc.success + ) + ), + uuid_nil() + ) AS payload_id; + +ALTER VIEW current_payload_id SET (security_invoker = on); CREATE OR REPLACE PROCEDURE set_next_contributor() AS $$ BEGIN @@ -87,8 +165,8 @@ BEGIN SELECT MAX(qq.score) FROM queue qq WHERE NOT EXISTS ( - SELECT * FROM contribution c WHERE c.id = qq.id - ) AND NOT EXISTS( + SELECT c.id FROM contribution c WHERE c.id = qq.id + ) AND NOT EXISTS ( SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire < now() ) ); @@ -96,4 +174,98 @@ BEGIN END $$ LANGUAGE plpgsql; +-- On expiry, rotate the contributor SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); + +CREATE OR REPLACE FUNCTION can_upload(name varchar) RETURNS BOOLEAN AS $$ +BEGIN + RETURN ( + -- User must be the current contributor. + (SELECT cci.id FROM current_contributor_id cci) = auth.uid() + AND + -- User is only allowed to submit the expected payload. + storage.filename(name) = (SELECT q.payload_id::text FROM queue q WHERE q.id = auth.uid()) + AND + -- Do not allow the user to interact with the file after its been submitted. + NOT EXISTS (SELECT * FROM contribution_submitted cs WHERE cs.id = auth.uid()) + ); +END +$$ LANGUAGE plpgsql; + +CREATE POLICY allow_authenticated_contributor_upload_insert + ON storage.objects + FOR INSERT + TO authenticated + WITH CHECK ( + bucket_id = 'contributions' + AND + can_upload(name) + ); + +CREATE OR REPLACE FUNCTION can_download(name varchar) RETURNS BOOLEAN AS $$ +BEGIN + RETURN ( + -- User must be the current contributor. + (SELECT cci.id FROM current_contributor_id cci) = auth.uid() + AND + -- User is only allowed to download the last verified contribution. + storage.filename(name) = (SELECT cpi.payload_id::text FROM current_payload_id cpi) + AND + -- Do not allow the user to interact with the file after its contribution has been submitted. + NOT EXISTS (SELECT * FROM contribution_submitted cs WHERE cs.id = auth.uid()) + ); +END +$$ LANGUAGE plpgsql; + +CREATE POLICY allow_authenticated_contributor_download + ON storage.objects + FOR SELECT + TO authenticated + USING ( + bucket_id = 'contributions' + AND + can_download(name) + ); + +CREATE OR REPLACE PROCEDURE set_contribution_submitted(queue_id uuid) AS $$ +BEGIN + INSERT INTO contribution_submitted(id) VALUES(queue_id); +END +$$ LANGUAGE plpgsql; + +-- Phase 2 contribution payload is constant size +CREATE OR REPLACE FUNCTION expected_payload_size() RETURNS INTEGER AS $$ +BEGIN + RETURN 306032532; +END +$$ LANGUAGE plpgsql; + +-- Metadata pushed on upload. +-- { +-- "eTag": "\"c019643e056d8d687086c1e125f66ad8-1\"", +-- "size": 1000, +-- "mimetype": "binary/octet-stream", +-- "cacheControl": "no-cache", +-- "lastModified": "2024-07-27T23:03:32.000Z", +-- "contentLength": 1000, +-- "httpStatusCode": 200 +-- } +CREATE OR REPLACE FUNCTION set_contribution_submitted_trigger() RETURNS TRIGGER AS $$ +DECLARE + file_size integer; +BEGIN + IF (NEW.metadata IS NOT NULL) THEN + file_size := (NEW.metadata->>'size')::integer; + CASE + WHEN file_size = expected_payload_size() + THEN CALL set_contribution_submitted(uuid(NEW.owner_id)); + ELSE + RAISE EXCEPTION 'invalid file size, name: %, got: %, expected: %, meta: %', NEW.name, file_size, expected_payload_size(), NEW.metadata; + END CASE; + END IF; + RETURN NEW; +END +$$ LANGUAGE plpgsql; + +-- Rotate the current contributor whenever a contribution is done. +CREATE TRIGGER contribution_payload_uploaded AFTER INSERT OR UPDATE ON storage.objects FOR EACH ROW EXECUTE FUNCTION set_contribution_submitted_trigger(); diff --git a/mpc/coordinator/src/fsm.rs b/mpc/coordinator/src/fsm.rs deleted file mode 100644 index b5ca516fb2..0000000000 --- a/mpc/coordinator/src/fsm.rs +++ /dev/null @@ -1,22 +0,0 @@ -use rust_fsm::state_machine; - -state_machine! { - #[derive(Debug, Copy, Clone, PartialEq, Eq)] - pub union_mpc(AwaitContribution) - InitContributor => { - NoContributor => AwaitContributor, - ContributorSet => AwaitContribution, - }, - AwaitContributor => { - Join => InitContributor, - }, - AwaitContribution => { - Contribute => Verify, - Join => AwaitContribution, - SetPriority => AwaitContribution, - }, - Verify => { - Valid => InitContributor, - Invalid => InitContributor, - }, -} diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index 272612446d..1f0dd7f371 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -1,43 +1,17 @@ -pub mod fsm; - -use std::{ - collections::{HashMap, HashSet}, - io::Cursor, - marker::PhantomData, - sync::{ - mpsc::{channel, Sender, TryRecvError}, - Arc, RwLock, - }, - time::{SystemTime, UNIX_EPOCH}, -}; +use std::{io::SeekFrom, str::FromStr}; use clap::{Parser, Subcommand}; use mpc_shared::{ - phase2_verify, types::Contribution, CONTRIBUTION_CHUNKS, CONTRIBUTION_CHUNK_SIZE, - CONTRIBUTION_CHUNK_SIZE_FINAL, -}; -use priority_queue::PriorityQueue; -use rocket::{ - data::{Limits, ToByteUnit}, - fs::TempFile, - get, - http::{ - hyper::{header::AUTHORIZATION, HeaderValue}, - ContentType, Cookie, CookieJar, Header, Status, - }, - post, - request::{FromParam, FromRequest, Outcome, Request}, - response::status::{self, Forbidden, NotFound, Unauthorized}, - routes, - serde::{ - json::{json, Json, Value}, - Deserialize, Serialize, - }, - Response, State, + phase2_verify, + types::{Contribution, ContributorId, PayloadId}, + CONTRIBUTION_SIZE, }; -use rocket_authorization::{AuthError, Authorization, Credential}; -use rocket_seek_stream::SeekStream; -use sha2::Digest; +use postgrest::Postgrest; +use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_LENGTH, RANGE}; +use tokio::io::{AsyncSeekExt, AsyncWriteExt}; + +const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; +const APIKEY: &str = "apikey"; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] @@ -50,355 +24,221 @@ struct Args { enum Command { Start { #[arg(short, long)] - phase2_payload_path: String, + jwt: String, + #[arg(short, long)] + api_key: String, }, } -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize)] -#[serde(crate = "rocket::serde")] -struct Contributor { - token: String, -} - -#[derive(Debug)] -struct AppState { - queue: PriorityQueue, - processed: HashMap, - payload: Vec, - payload_hash: Vec, - contributor: Contributor, - upload_index: Index, - contribution_payload: Vec, - machine: fsm::union_mpc::StateMachine, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -enum AppMessage { - Join { - token: String, - }, - ContributePartial { - token: String, - index: Index, - payload_fraction: Vec, - }, +#[derive(thiserror::Error, Debug, Clone)] +enum Error { + #[error("couldn't find expected header: {0}")] + HeaderNotFound(String), + #[error("current contributor not found.")] + ContributorNotFound, + #[error("current payload not found.")] + CurrentPayloadNotFound, + #[error("next payload not found.")] + NextPayloadNotFound, } -struct Current; -struct Any; -struct AuthContributor(String, PhantomData); -#[rocket::async_trait] -impl Authorization for AuthContributor { - const KIND: &'static str = "Bearer"; - async fn parse(_: &str, token: &str, request: &Request) -> Result { - let app_state = request - .rocket() - .state::>>() - .unwrap() - .read() - .unwrap(); - if app_state.machine.state() == &fsm::union_mpc::State::AwaitContribution - && app_state.contributor.token == token - { - Ok(Self(token.to_string(), PhantomData)) - } else { - Err(AuthError::Unauthorized) - } - } -} -#[rocket::async_trait] -impl Authorization for AuthContributor { - const KIND: &'static str = "Bearer"; - async fn parse(_: &str, token: &str, request: &Request) -> Result { - Ok(Self(token.to_string(), PhantomData)) +async fn get_state_file(path: &str) -> Vec { + if !tokio::fs::try_exists(path).await.unwrap() { + tokio::fs::write(path, []).await.unwrap(); } + tokio::fs::read(path).await.unwrap() } -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize)] -#[serde(crate = "rocket::serde")] -struct Index(u8); -impl<'a> FromParam<'a> for Index { - type Error = (); - fn from_param(param: &'a str) -> Result { - let result = u8::from_param(param).map_err(|_| ())?; - if result as usize <= CONTRIBUTION_CHUNKS { - Ok(Index(result)) - } else { - Err(()) - } +async fn download_payload( + authorization_header: String, + payload_id: &str, + payload_output: &str, +) -> Result, Box> { + let current_payload_download_url = format!( + "{SUPABASE_PROJECT}/storage/v1/object/contributions/{}", + &payload_id + ); + let client = reqwest::ClientBuilder::new() + .default_headers(HeaderMap::from_iter([( + AUTHORIZATION, + HeaderValue::from_str(&authorization_header)?, + )])) + .build()?; + println!("checking payload file..."); + enum StateFileAction { + Download(usize), + Done(Vec), } -} - -#[get("/contribution")] -async fn contribution( - c: Credential>, - app_state: &State>>, -) -> Result, NotFound<()>> { - match app_state - .read() - .unwrap() - .processed - .get(&Contributor { token: c.0 .0 }) - { - Some(contribution) => Ok(Json(contribution.clone())), - None => Err(NotFound(())), + let state_path = payload_output; + let action = match get_state_file(&state_path).await { + content if content.len() < CONTRIBUTION_SIZE => { + println!("partial download, continuing from {}...", content.len()); + StateFileAction::Download(content.len()) + } + content if content.len() == CONTRIBUTION_SIZE => { + println!("download complete."); + StateFileAction::Done(content) + } + _ => { + println!("invalid size detected, redownloading..."); + StateFileAction::Download(0) + } + }; + match action { + StateFileAction::Download(start_position) => { + let mut response = client + .get(current_payload_download_url) + .header(RANGE, format!("bytes={}-", start_position)) + .send() + .await? + .error_for_status()?; + let headers = response.headers(); + let total_length = start_position + + u64::from_str( + headers + .get(CONTENT_LENGTH) + .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? + .to_str()?, + )? as usize; + println!("state file length: {}", total_length); + assert!( + total_length == CONTRIBUTION_SIZE, + "contribution length mismatch." + ); + let mut state_file = tokio::fs::OpenOptions::new() + .write(true) + .create(false) + .open(&state_path) + .await?; + state_file.set_len(start_position as u64).await?; + state_file + .seek(SeekFrom::Start(start_position as u64)) + .await?; + let mut i = 0; + while let Some(chunk) = response.chunk().await? { + if i % 10 == 0 { + println!("Eta: chunk {}.", i); + } + let written = state_file.write(&chunk).await?; + assert!(written == chunk.len(), "couldn't write chunk."); + state_file.sync_data().await?; + i += 1; + } + println!("download complete"); + let final_content = tokio::fs::read(&state_path).await?; + Ok(final_content) + } + StateFileAction::Done(content) => Ok(content), } } -#[post("/contribute/", data = "")] -async fn contribute( - c: Credential>, - index: Index, - payload: Vec, - app_state: &State>>, - tx: &State>, -) -> Result<(), Forbidden<()>> { - tx.send(AppMessage::ContributePartial { - token: c.0 .0, - index, - payload_fraction: payload, - }) - .unwrap(); - Ok(()) -} - -#[get("/me")] -async fn me( - c: Credential>, - app_state: &State>>, -) -> Result, Forbidden<()>> { - let hash = { app_state.read().unwrap().payload_hash.clone() }; - Ok(hash) -} - -#[get("/state")] -async fn state<'a>( - c: Credential>, - app_state: &State>>, -) -> Result, Forbidden<()>> { - let bytes = { app_state.read().unwrap().payload.clone() }; - let len = bytes.len() as u64; - Ok(SeekStream::with_opts( - Cursor::new(bytes), - len, - "application/octet-stream", - )) -} - -#[post("/join")] -async fn join(c: Credential>, tx: &State>) -> Status { - // TODO: verify token - tx.send(AppMessage::Join { token: c.0 .0 }).unwrap(); - Status::Ok -} - -#[get("/")] -fn index() -> &'static str { - " - Bruh u ain't mess with the kraken - " -} - -#[rocket::main] -async fn main() -> std::io::Result<()> { +#[tokio::main] +async fn main() -> Result<(), Box> { let args = Args::parse(); match args.command { - Command::Start { - phase2_payload_path, - } => { - let payload = std::fs::read(phase2_payload_path).unwrap(); - let payload_hash = sha2::Sha256::new() - .chain_update(&payload) - .finalize() - .to_vec(); - let (tx, rx) = channel::(); - let initial_contributor = Contributor { - token: "union".into(), - }; - let app_state = Arc::new(RwLock::new(AppState { - queue: PriorityQueue::with_capacity(4096), - processed: HashMap::with_capacity(4096), - contributor: initial_contributor, - payload, - payload_hash, - upload_index: Index(0), - contribution_payload: Vec::new(), - machine: fsm::union_mpc::StateMachine::new(), - })); - let app_state_clone = app_state.clone(); - rocket::tokio::spawn(async move { - let figment = rocket::Config::figment() - .merge(("limits", Limits::new().limit("bytes", 12.mebibytes()))); - rocket::custom(figment) - .manage(app_state_clone) - .manage(tx) - .mount( - "/", - routes![index, join, me, state, contribute, contribution], - ) - .launch() - .await - .unwrap(); - }); - let (tx_verify, rx_verify) = channel::<(Vec, Vec)>(); - let (tx_verify_result, rx_verify_result) = channel::(); - rocket::tokio::spawn(async move { + Command::Start { jwt, api_key } => { + let authorization_header = format!("Bearer {}", jwt); + let client = Postgrest::new(format!("{SUPABASE_PROJECT}/rest/v1")) + .insert_header(APIKEY, api_key) + .insert_header(AUTHORIZATION, authorization_header.clone()); + loop { + let current_contributor = { + let contributor = client + .from("current_contributor_id") + .select("id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned() + .ok_or(Error::ContributorNotFound); + match contributor { + Ok(contributor) => contributor, + Err(_) => { + println!("no more contributor to process."); + tokio::time::sleep(std::time::Duration::from_secs(10)).await; + continue; + } + } + }; + let current_payload = client + .from("current_payload_id") + .select("payload_id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned() + .ok_or(Error::CurrentPayloadNotFound)?; + let payload_current = download_payload( + authorization_header.clone(), + ¤t_payload.id, + ¤t_payload.id, + ) + .await?; + println!("awaiting contribution of {}...", ¤t_contributor.id); loop { - let (payload, contribution_payload) = rx_verify.recv().unwrap(); - println!("verifying contribution payloads"); - if phase2_verify(&payload, &contribution_payload).is_ok() { - println!("valid"); - tx_verify_result.send(true).unwrap(); - } else { - println!("invalid"); - tx_verify_result.send(false).unwrap(); + if client + .from("contribution_submitted") + .eq("id", ¤t_contributor.id) + .select("id") + .execute() + .await? + .json::>() + .await? + .len() + == 1 + { + break; } + tokio::time::sleep(std::time::Duration::from_secs(10)).await; } - }); - - loop { - { - let mut app_state = app_state.write().unwrap(); - let machine_state = *app_state.machine.state(); - let mut join = |token: String| { - let new_contributor = Contributor { token }; - if app_state.queue.get(&new_contributor).is_none() - && app_state.processed.get(&new_contributor).is_none() - && app_state.contributor != new_contributor - { - let queue_len = app_state.queue.len(); - const BASE_PRORITY: usize = 1000000; - let priority = BASE_PRORITY - queue_len; - println!( - "contributor joined: {} with priority {}", - new_contributor.token, priority - ); - app_state.queue.push(new_contributor, priority); - app_state - .machine - .consume(&fsm::union_mpc::Input::Join) - .unwrap(); - } - }; - match machine_state { - fsm::union_mpc::State::InitContributor => { - let input = match app_state.queue.pop() { - Some((contributor, _)) => { - println!("new contributor slot"); - app_state.contributor = contributor; - app_state.upload_index = Index(0); - app_state.contribution_payload.clear(); - fsm::union_mpc::Input::ContributorSet - } - None => { - println!("no contributor"); - fsm::union_mpc::Input::NoContributor - } - }; - app_state.machine.consume(&input).unwrap(); - } - fsm::union_mpc::State::AwaitContributor => match rx.try_recv() { - Ok(message) => match message { - AppMessage::Join { token } => { - join(token); - } - _ => {} - }, - Err(TryRecvError::Empty) => {} - Err(e) => { - println!("error in awaiting contributor {:?}", e); - break; - } - }, - fsm::union_mpc::State::AwaitContribution => match rx.try_recv() { - Ok(message) => match message { - AppMessage::Join { token } => { - join(token); - } - AppMessage::ContributePartial { - token, - index: Index(index), - mut payload_fraction, - } => { - if app_state.contributor.token == token - && app_state.upload_index == Index(index) - { - let expected_len = if (index as usize) < CONTRIBUTION_CHUNKS - { - CONTRIBUTION_CHUNK_SIZE - } else { - CONTRIBUTION_CHUNK_SIZE_FINAL - }; - if payload_fraction.len() == expected_len { - println!("partial contribution chunk {}", index); - app_state.upload_index = Index(index + 1); - app_state - .contribution_payload - .append(&mut payload_fraction); - if index as usize == CONTRIBUTION_CHUNKS { - println!("contribution complete"); - tx_verify - .send(( - app_state.payload.clone(), - app_state.contribution_payload.clone(), - )) - .unwrap(); - app_state.payload = - app_state.contribution_payload.clone(); - app_state - .machine - .consume(&fsm::union_mpc::Input::Contribute) - .unwrap(); - } - } else { - println!("invalid chunk length {}", index); - } - } - } - }, - Err(TryRecvError::Empty) => {} - Err(e) => { - println!("error in await {:?}", e); - break; - } - }, - fsm::union_mpc::State::Verify => match rx_verify_result.try_recv() { - Ok(result) => { - let timestamp = SystemTime::now() - .duration_since(UNIX_EPOCH) - .unwrap() - .as_secs(); - let contribution = Contribution { - success: result, - timestamp, - }; - let contributor = app_state.contributor.clone(); - app_state.processed.insert(contributor, contribution); - if result { - println!("verification succeeded."); - app_state - .machine - .consume(&fsm::union_mpc::Input::Valid) - .unwrap(); - } else { - println!("verification failed."); - app_state - .machine - .consume(&fsm::union_mpc::Input::Invalid) - .unwrap(); - } - } - Err(TryRecvError::Empty) => {} - Err(e) => { - println!("error in verify {:?}", e); - break; - } - }, - }; + println!("contribution submitted!"); + let next_payload = client + .from("queue") + .eq("id", ¤t_contributor.id) + .select("payload_id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned() + .ok_or(Error::NextPayloadNotFound)?; + let payload_next = download_payload( + authorization_header.clone(), + &next_payload.id, + &next_payload.id, + ) + .await?; + if phase2_verify(&payload_current, &payload_next).is_ok() { + println!("verification succeeded."); + client + .from("contribution") + .insert(serde_json::to_string(&Contribution { + id: current_contributor.id.clone(), + success: true, + })?) + .execute() + .await? + .error_for_status()?; + tokio::fs::remove_file(¤t_payload.id).await?; + } else { + println!("verification failed."); + client + .from("contribution") + .insert(serde_json::to_string(&Contribution { + id: current_contributor.id.clone(), + success: false, + })?) + .execute() + .await? + .error_for_status()?; } - rocket::tokio::time::sleep(std::time::Duration::from_millis(1000 / 30)).await; + tokio::time::sleep(std::time::Duration::from_secs(10)).await; } - Ok(()) } } } diff --git a/mpc/shared/Cargo.toml b/mpc/shared/Cargo.toml index 44a4b1f80f..1c8b4846f3 100644 --- a/mpc/shared/Cargo.toml +++ b/mpc/shared/Cargo.toml @@ -4,5 +4,5 @@ name = "mpc-shared" version = "0.1.0" [dependencies] -rocket = { version = "0.5.1", features = ["json", "msgpack", "uuid"] } +serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } diff --git a/mpc/shared/src/lib.rs b/mpc/shared/src/lib.rs index ee50387ef9..ae058ef5b2 100644 --- a/mpc/shared/src/lib.rs +++ b/mpc/shared/src/lib.rs @@ -3,10 +3,6 @@ pub mod types; use std::ffi::{c_char, c_int}; pub const CONTRIBUTION_SIZE: usize = 306032532; -pub const CONTRIBUTION_CHUNKS: usize = 30; -pub const CONTRIBUTION_CHUNK_SIZE: usize = CONTRIBUTION_SIZE / CONTRIBUTION_CHUNKS; -pub const CONTRIBUTION_CHUNK_SIZE_FINAL: usize = - CONTRIBUTION_SIZE - (CONTRIBUTION_CHUNK_SIZE * CONTRIBUTION_CHUNKS); #[link(name = "galois")] extern "C" { diff --git a/mpc/shared/src/types.rs b/mpc/shared/src/types.rs index 9e6e7e1a69..72bdf1ba1f 100644 --- a/mpc/shared/src/types.rs +++ b/mpc/shared/src/types.rs @@ -1,8 +1,18 @@ -use rocket::serde::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ContributorId { + pub id: String, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct PayloadId { + #[serde(rename = "payload_id")] + pub id: String, +} #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] pub struct Contribution { + pub id: String, pub success: bool, - pub timestamp: u64, } From b96676cd1187ebb307dc7d00f36c03e7b1ae444d Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Tue, 30 Jul 2024 11:25:41 +0200 Subject: [PATCH 05/48] feat(mpc): better sql and client handling --- mpc/client/src/main.rs | 605 ++++++++++++++++++----------------- mpc/coordinator/database.sql | 27 +- 2 files changed, 332 insertions(+), 300 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index f05a298301..8fce0b901c 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -1,37 +1,34 @@ use std::{ - convert::Infallible, io::SeekFrom, net::SocketAddr, os::unix::fs::MetadataExt, path::Path, - str::FromStr, time::UNIX_EPOCH, + io::SeekFrom, + net::SocketAddr, + os::unix::fs::MetadataExt, + str::FromStr, + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, + }, + time::UNIX_EPOCH, }; -use async_sqlite::{rusqlite::params, JournalMode, Pool, PoolBuilder}; +use async_sqlite::{JournalMode, PoolBuilder}; use base64::{prelude::BASE64_STANDARD, Engine}; -use clap::{Parser, Subcommand}; -use http_body_util::{BodyExt, Full}; +use http_body_util::BodyExt; use httpdate::parse_http_date; use hyper::{body::Buf, service::service_fn, Method}; use hyper_util::rt::TokioIo; use mpc_shared::{ - phase2_contribute, phase2_verify, - types::{Contribution, ContributorId, PayloadId}, - CONTRIBUTION_CHUNKS, CONTRIBUTION_CHUNK_SIZE, CONTRIBUTION_SIZE, + phase2_contribute, + types::{ContributorId, PayloadId}, + CONTRIBUTION_SIZE, }; use postgrest::Postgrest; -use reqwest::{ - header::{ - HeaderMap, HeaderName, HeaderValue, AUTHORIZATION, CONTENT_ENCODING, CONTENT_LENGTH, - LOCATION, RANGE, TRANSFER_ENCODING, - }, - StatusCode, -}; -use serde::{Deserialize, Serialize}; +use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_LENGTH, LOCATION, RANGE}; +use serde::Deserialize; use tokio::{ - io::{empty, AsyncSeekExt, AsyncWriteExt}, + io::{AsyncSeekExt, AsyncWriteExt}, net::TcpListener, }; -static INTERNAL_SERVER_ERROR: &[u8] = b"Internal Server Error"; -static NOTFOUND: &[u8] = b"Not Found"; - #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] struct Contribute { @@ -65,281 +62,302 @@ async fn get_state_file(path: &str) -> Vec { type BoxBody = http_body_util::combinators::BoxBody; -async fn handle( - req: hyper::Request, -) -> Result, Box> { - match (req.method(), req.uri().path()) { - (&Method::POST, "/contribute") => { - let whole_body = req.collect().await?.aggregate(); - let Contribute { - bucket, - jwt, - api_key, - contributor_id, - payload_id, - } = serde_json::from_reader(whole_body.reader())?; - const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; - const APIKEY: &str = "apikey"; - let authorization_header = format!("Bearer {}", jwt); - let client = Postgrest::new(format!("{SUPABASE_PROJECT}/rest/v1")) - .insert_header(APIKEY, api_key) - .insert_header(AUTHORIZATION, authorization_header.clone()); - let current_contributor = client - .from("current_contributor_id") - .select("id") - .execute() - .await? - .json::>() +type DynError = Box; + +async fn contribute( + Contribute { + bucket, + jwt, + api_key, + contributor_id, + payload_id, + }: Contribute, +) -> Result<(), DynError> { + const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; + const APIKEY: &str = "apikey"; + let authorization_header = format!("Bearer {}", jwt); + let client = Postgrest::new(format!("{SUPABASE_PROJECT}/rest/v1")) + .insert_header(APIKEY, api_key) + .insert_header(AUTHORIZATION, authorization_header.clone()); + let current_contributor = client + .from("current_contributor_id") + .select("id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned() + .ok_or(Error::ContributorNotFound)?; + assert!( + current_contributor.id == contributor_id, + "not current contributor." + ); + let current_payload = client + .from("current_payload_id") + .select("payload_id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned() + .ok_or(Error::PayloadNotFound)?; + let current_payload_download_url = format!( + "{SUPABASE_PROJECT}/storage/v1/object/contributions/{}", + ¤t_payload.id + ); + let client = reqwest::ClientBuilder::new() + .default_headers(HeaderMap::from_iter([( + AUTHORIZATION, + HeaderValue::from_str(&authorization_header)?, + )])) + .build()?; + println!("checking payload file..."); + enum StateFileAction { + Download(usize), + Done(Vec), + } + let state_path = current_payload.id; + let action = match get_state_file(&state_path).await { + content if content.len() < CONTRIBUTION_SIZE => { + println!("partial download, continuing from {}...", content.len()); + StateFileAction::Download(content.len()) + } + content if content.len() == CONTRIBUTION_SIZE => { + println!("download complete."); + StateFileAction::Done(content) + } + _ => { + println!("invalid size detected, redownloading..."); + StateFileAction::Download(0) + } + }; + let payload = match action { + StateFileAction::Download(start_position) => { + let mut response = client + .get(current_payload_download_url) + .header(RANGE, format!("bytes={}-", start_position)) + .send() .await? - .first() - .cloned() - .ok_or(Error::ContributorNotFound)?; + .error_for_status()?; + let headers = response.headers(); + let total_length = start_position + + u64::from_str( + headers + .get(CONTENT_LENGTH) + .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? + .to_str()?, + )? as usize; + println!("state file length: {}", total_length); assert!( - current_contributor.id == contributor_id, - "not current contributor." - ); - let current_payload = client - .from("current_payload_id") - .select("payload_id") - .execute() - .await? - .json::>() - .await? - .first() - .cloned() - .ok_or(Error::PayloadNotFound)?; - let current_payload_download_url = format!( - "{SUPABASE_PROJECT}/storage/v1/object/contributions/{}", - ¤t_payload.id + total_length == CONTRIBUTION_SIZE, + "contribution length mismatch." ); - let client = reqwest::ClientBuilder::new() - .default_headers(HeaderMap::from_iter([( - AUTHORIZATION, - HeaderValue::from_str(&authorization_header)?, - )])) - .build()?; - println!("checking payload file..."); - enum StateFileAction { - Download(usize), - Done(Vec), - } - let state_path = current_payload.id; - let action = match get_state_file(&state_path).await { - content if content.len() < CONTRIBUTION_SIZE => { - println!("partial download, continuing from {}...", content.len()); - StateFileAction::Download(content.len()) - } - content if content.len() == CONTRIBUTION_SIZE => { - println!("download complete."); - StateFileAction::Done(content) - } - _ => { - println!("invalid size detected, redownloading..."); - StateFileAction::Download(0) - } - }; - let payload = match action { - StateFileAction::Download(start_position) => { - let mut response = client - .get(current_payload_download_url) - .header(RANGE, format!("bytes={}-", start_position)) - .send() - .await? - .error_for_status()?; - let headers = response.headers(); - let total_length = start_position - + u64::from_str( - headers - .get(CONTENT_LENGTH) - .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? - .to_str()?, - )? as usize; - println!("state file length: {}", total_length); - assert!( - total_length == CONTRIBUTION_SIZE, - "contribution length mismatch." - ); - let mut state_file = tokio::fs::OpenOptions::new() - .write(true) - .create(false) - .open(&state_path) - .await?; - state_file.set_len(start_position as u64).await?; - state_file - .seek(SeekFrom::Start(start_position as u64)) - .await?; - let mut i = 0; - while let Some(chunk) = response.chunk().await? { - if i % 10 == 0 { - println!("eta: chunk {}.", i); - } - let written = state_file.write(&chunk).await?; - assert!(written == chunk.len(), "couldn't write chunk."); - state_file.sync_data().await?; - i += 1; - } - println!("download complete"); - let final_content = tokio::fs::read(&state_path).await?; - final_content - } - StateFileAction::Done(content) => content, - }; - let phase2_contribution = if let Ok(true) = tokio::fs::metadata(&payload_id) - .await - .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) - { - println!("loading completed contribution..."); - tokio::fs::read(&payload_id).await? - } else { - println!("generating contribution, may take some time..."); - let phase2_contribution = phase2_contribute(&payload)?; - tokio::fs::write(&payload_id, &phase2_contribution).await?; - phase2_contribution - }; - println!("uploading contribution..."); - let pool = PoolBuilder::new() - .path("db.sqlite3") - .journal_mode(JournalMode::Wal) - .open() + let mut state_file = tokio::fs::OpenOptions::new() + .write(true) + .create(false) + .open(&state_path) .await?; + state_file.set_len(start_position as u64).await?; + state_file + .seek(SeekFrom::Start(start_position as u64)) + .await?; + let mut i = 0; + while let Some(chunk) = response.chunk().await? { + if i % 10 == 0 { + println!("eta: chunk {}.", i); + } + let written = state_file.write(&chunk).await?; + assert!(written == chunk.len(), "couldn't write chunk."); + state_file.sync_data().await?; + i += 1; + } + println!("download complete"); + let final_content = tokio::fs::read(&state_path).await?; + final_content + } + StateFileAction::Done(content) => content, + }; + let phase2_contribution = if let Ok(true) = tokio::fs::metadata(&payload_id) + .await + .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) + { + println!("loading completed contribution..."); + tokio::fs::read(&payload_id).await? + } else { + println!("generating contribution, may take some time..."); + let phase2_contribution = phase2_contribute(&payload)?; + tokio::fs::write(&payload_id, &phase2_contribution).await?; + phase2_contribution + }; + println!("uploading contribution..."); + let pool = PoolBuilder::new() + .path("db.sqlite3") + .journal_mode(JournalMode::Wal) + .open() + .await?; - pool.conn(|conn| { - conn.execute( - "CREATE TABLE IF NOT EXISTS resumable_upload ( + pool.conn(|conn| { + conn.execute( + "CREATE TABLE IF NOT EXISTS resumable_upload ( location TEXT PRIMARY KEY NOT NULL, create_at TIMESTAMPTZ NOT NULL DEFAULT(unixepoch()), expire TIMSTAMPTZ NOT NULL )", - (), // empty list of parameters. + (), // empty list of parameters. + )?; + Ok(()) + }) + .await?; + let mut upload_location = pool + .conn(move |conn| { + let mut stmt = conn.prepare_cached( + "SELECT location FROM resumable_upload WHERE expire > unixepoch() LIMIT 1", + )?; + let mut rows = stmt.query(())?; + if let Some(row) = rows.next()? { + Ok(Some(row.get::<_, String>(0)?)) + } else { + Ok(None) + } + }) + .await?; + if let Some(ref location) = upload_location { + if client + .head(location) + .header("Tus-Resumable", "1.0.0") + .send() + .await? + .error_for_status() + .is_err() + { + upload_location = None; + } + } + let upload_location = match upload_location { + Some(location) => { + println!("location already stored in db."); + location + } + None => { + println!("location not found, generating a new one..."); + // ===================================================== + // https://tus.io/protocols/resumable-upload#creation == + // ===================================================== + let response = client + .post(format!("{SUPABASE_PROJECT}/storage/v1/upload/resumable")) + .header("Tus-Resumable", "1.0.0") + .header("Upload-Length", CONTRIBUTION_SIZE.to_string()) + .header( + "Upload-Metadata", + format!( + "bucketName {},objectName {}", + BASE64_STANDARD.encode(&bucket), + BASE64_STANDARD.encode(&payload_id) + ), + ) + .send() + .await?; + let location = response + .headers() + .get(LOCATION) + .ok_or(Error::HeaderNotFound(LOCATION.as_str().into()))? + .to_str()? + .to_string(); + let expire = response + .headers() + .get("Upload-Expires") + .ok_or(Error::HeaderNotFound("Upload-Expires".into()))? + .to_str()? + .into(); + let expire = parse_http_date(expire)?; + let expire_timestamp = expire.duration_since(UNIX_EPOCH)?.as_secs(); + let location_clone = location.clone(); + pool.conn(move |conn| { + let mut stmt = conn.prepare_cached( + "INSERT INTO resumable_upload (location, expire) VALUES (?, ?)", )?; + let r = stmt.execute((location_clone, expire_timestamp))?; + assert!(r == 1); Ok(()) }) .await?; - let mut upload_location = pool - .conn(move |conn| { - let mut stmt = conn.prepare_cached( - "SELECT location FROM resumable_upload WHERE expire > unixepoch() LIMIT 1", - )?; - let mut rows = stmt.query(())?; - if let Some(row) = rows.next()? { - Ok(Some(row.get::<_, String>(0)?)) - } else { - Ok(None) - } - }) - .await?; - if let Some(ref location) = upload_location { - if client - .head(location) - .header("Tus-Resumable", "1.0.0") - .send() - .await? - .error_for_status() - .is_err() - { - upload_location = None; - } - } - let upload_location = match upload_location { - Some(location) => { - println!("location already stored in db."); - location - } - None => { - println!("location not found, generating a new one..."); - // ===================================================== - // https://tus.io/protocols/resumable-upload#creation == - // ===================================================== - let response = client - .post(format!("{SUPABASE_PROJECT}/storage/v1/upload/resumable")) - .header("Tus-Resumable", "1.0.0") - .header("Upload-Length", CONTRIBUTION_SIZE.to_string()) - .header( - "Upload-Metadata", - format!( - "bucketName {},objectName {}", - BASE64_STANDARD.encode(&bucket), - BASE64_STANDARD.encode(&payload_id) - ), - ) - .send() - .await?; - let location = response - .headers() - .get(LOCATION) - .ok_or(Error::HeaderNotFound(LOCATION.as_str().into()))? - .to_str()? - .to_string(); - let expire = response - .headers() - .get("Upload-Expires") - .ok_or(Error::HeaderNotFound("Upload-Expires".into()))? - .to_str()? - .into(); - let expire = parse_http_date(expire)?; - let expire_timestamp = expire.duration_since(UNIX_EPOCH)?.as_secs(); - let location_clone = location.clone(); - pool.conn(move |conn| { - let mut stmt = conn.prepare_cached( - "INSERT INTO resumable_upload (location, expire) VALUES (?, ?)", - )?; - let r = stmt.execute((location_clone, expire_timestamp))?; - assert!(r == 1); - Ok(()) - }) - .await?; - location - } - }; + location + } + }; - println!("upload location: {upload_location}"); + println!("upload location: {upload_location}"); - // ================================================= - // https://tus.io/protocols/resumable-upload#head == - // ================================================= - let response = client - .head(&upload_location) - .header("Tus-Resumable", "1.0.0") - .send() - .await? - .error_for_status()?; - let upload_length = usize::from_str( - response - .headers() - .get("Upload-Length") - .ok_or(Error::HeaderNotFound("Upload-Length".into()))? - .to_str()?, - )?; - let upload_offset = usize::from_str( - response - .headers() - .get("Upload-Offset") - .ok_or(Error::HeaderNotFound("Upload-Offset".into()))? - .to_str()?, - )?; - assert!(upload_length == CONTRIBUTION_SIZE, "invalid upload-length."); - println!("upload-offset: {}", upload_offset); - if upload_offset < upload_length { - println!("uploading contribution..."); - // ================================================== - // https://tus.io/protocols/resumable-upload#patch == - // ================================================== - client - .patch(&upload_location) - .header("Tus-Resumable", "1.0.0") - .header("Content-Type", "application/offset+octet-stream") - .header("Upload-Offset", upload_offset.to_string()) - .body( - phase2_contribution - .into_iter() - .skip(upload_offset) - .collect::>(), - ) - .send() - .await? - .error_for_status()?; - } - println!("upload complete."); + // ================================================= + // https://tus.io/protocols/resumable-upload#head == + // ================================================= + let response = client + .head(&upload_location) + .header("Tus-Resumable", "1.0.0") + .send() + .await? + .error_for_status()?; + let upload_length = usize::from_str( + response + .headers() + .get("Upload-Length") + .ok_or(Error::HeaderNotFound("Upload-Length".into()))? + .to_str()?, + )?; + let upload_offset = usize::from_str( + response + .headers() + .get("Upload-Offset") + .ok_or(Error::HeaderNotFound("Upload-Offset".into()))? + .to_str()?, + )?; + assert!(upload_length == CONTRIBUTION_SIZE, "invalid upload-length."); + println!("upload-offset: {}", upload_offset); + if upload_offset < upload_length { + println!("uploading contribution..."); + // ================================================== + // https://tus.io/protocols/resumable-upload#patch == + // ================================================== + client + .patch(&upload_location) + .header("Tus-Resumable", "1.0.0") + .header("Content-Type", "application/offset+octet-stream") + .header("Upload-Offset", upload_offset.to_string()) + .body( + phase2_contribution + .into_iter() + .skip(upload_offset) + .collect::>(), + ) + .send() + .await? + .error_for_status()?; + } + println!("upload complete."); + Ok(()) +} + +async fn handle( + handling: Arc, + req: hyper::Request, +) -> Result, DynError> { + match (req.method(), req.uri().path()) { + (&Method::POST, "/contribute") + if handling + .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) + .is_ok() => + { + let result = (|| async { + let whole_body = req.collect().await?.aggregate(); + contribute(serde_json::from_reader(whole_body.reader())?).await?; + Ok::<_, DynError>(()) + })() + .await; + handling + .compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) + .expect("impossible"); + result?; Ok(hyper::Response::builder() .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") .header(hyper::header::CONTENT_TYPE, "application/json") @@ -347,7 +365,14 @@ async fn handle( .body(BoxBody::default()) .unwrap()) } - // Preflight options request from the browser. + // Busy building + (&Method::POST, "/contribute") => Ok(hyper::Response::builder() + .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .header(hyper::header::CONTENT_TYPE, "application/json") + .status(hyper::StatusCode::TOO_MANY_REQUESTS) + .body(BoxBody::default()) + .unwrap()), + // CORS preflight request. (&Method::OPTIONS, "/contribute") => Ok(hyper::Response::builder() .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") .header( @@ -360,28 +385,28 @@ async fn handle( .unwrap()), _ => Ok(hyper::Response::builder() .status(hyper::StatusCode::NOT_FOUND) - .body(full(NOTFOUND)) + .body(BoxBody::default()) .unwrap()), } } -fn full>(chunk: T) -> BoxBody { - Full::new(chunk.into()) - .map_err(|never| match never {}) - .boxed() -} - #[tokio::main] -async fn main() -> Result<(), Box> { +async fn main() -> Result<(), DynError> { let addr = SocketAddr::from(([127, 0, 0, 1], 0x1337)); let listener = TcpListener::bind(addr).await?; + let handling = Arc::new(AtomicBool::new(false)); loop { let (stream, _) = listener.accept().await?; let io = TokioIo::new(stream); + // TODO: can't we avoid the clone tower? + let handling_clone = handling.clone(); tokio::task::spawn(async move { // Finally, we bind the incoming connection to our `hello` service if let Err(err) = hyper::server::conn::http1::Builder::new() - .serve_connection(io, service_fn(handle)) + .serve_connection( + io, + service_fn(move |req| handle(handling_clone.clone(), req)), + ) .await { eprintln!("Error serving connection: {:?}", err); diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 43a932db82..0265b1947a 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -22,12 +22,23 @@ CREATE POLICY view_all true ); +-- Materialized ? CREATE OR REPLACE VIEW current_queue_position AS - SELECT COUNT(*) AS position - FROM queue q - WHERE q.score > ( - SELECT qq.score FROM queue qq WHERE qq.id = auth.uid() - ) AND NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id); + SELECT + CASE WHEN (SELECT cci.id FROM current_contributor_id cci) = auth.uid() THEN + 0 + ELSE + ( + SELECT COUNT(*) + 1 + FROM queue q + WHERE + -- Better score + q.score > (SELECT qq.score FROM queue qq WHERE qq.id = auth.uid()) + AND + -- Contribution round not started + NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id) + ) + END AS position; ALTER VIEW current_queue_position SET (security_invoker = on); @@ -133,11 +144,7 @@ CREATE OR REPLACE VIEW current_contributor_id AS ) AND ( EXISTS (SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire > now()) OR - ( - EXISTS (SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire <= now()) - AND - EXISTS (SELECT cs.id FROM contribution_submitted cs WHERE cs.id = qq.id) - ) + EXISTS (SELECT cs.id FROM contribution_submitted cs WHERE cs.id = qq.id) ) ); From 087c58806b126690ed9eeb47b65314d285caeaa1 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Tue, 30 Jul 2024 12:08:47 +0200 Subject: [PATCH 06/48] fix(mpc): non-static --- flake.nix | 2 +- tools/rust/rust.nix | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 8e84c01d65..19f96c1a6c 100644 --- a/flake.nix +++ b/flake.nix @@ -322,7 +322,7 @@ last = pkgs.lib.lists.last complete; }; - goPkgs = import inputs.nixpkgs-go { inherit system; overlays = [ inputs.rust-overlay.overlays.default ]; }; + goPkgs = import inputs.nixpkgs-go { inherit system; }; unstablePkgs = import inputs.nixpkgs-unstable { inherit system; }; in { diff --git a/tools/rust/rust.nix b/tools/rust/rust.nix index d420cbe8de..dbad2cad4a 100644 --- a/tools/rust/rust.nix +++ b/tools/rust/rust.nix @@ -104,20 +104,12 @@ inherit mkBuildStdToolchain mkNightly rustSrc; toolchains = { - nightly = mkNightly { - targets = [ - "wasm32-unknown-unknown" - "x86_64-unknown-linux-musl" - ]; - }; + nightly = mkNightly { }; # for use in the devShell dev = (pkgs.rust-bin.nightly.${nightlyVersion}.default.override { extensions = builtins.attrValues availableComponents; - targets = [ - "wasm32-unknown-unknown" - "x86_64-unknown-linux-musl" - ]; + targets = [ "wasm32-unknown-unknown" ]; }); }; }; From b9cd032794d59c476d42911e207984a8021fb6b2 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Tue, 30 Jul 2024 12:16:24 +0200 Subject: [PATCH 07/48] fix(galois): properly convert ptau to phase1 --- galoisd/cmd/galoisd/cmd/phase1_init.go | 75 +++++++++++++---------- galoisd/cmd/galoisd/cmd/phase2_extract.go | 12 ++-- 2 files changed, 48 insertions(+), 39 deletions(-) diff --git a/galoisd/cmd/galoisd/cmd/phase1_init.go b/galoisd/cmd/galoisd/cmd/phase1_init.go index ed31856d4b..bb20d0719f 100644 --- a/galoisd/cmd/galoisd/cmd/phase1_init.go +++ b/galoisd/cmd/galoisd/cmd/phase1_init.go @@ -1,6 +1,8 @@ package cmd import ( + "crypto/sha256" + "github.com/spf13/cobra" "encoding/binary" @@ -269,7 +271,6 @@ func (ptauFile *PtauFile) ReadBetaG2() (bn254.G2Affine, error) { func ReadPtau(zkeyPath string) (Ptau, error) { reader, err := os.Open(zkeyPath) - if err != nil { return Ptau{}, err } @@ -278,12 +279,21 @@ func ReadPtau(zkeyPath string) (Ptau, error) { var ptauStr = make([]byte, 4) _, err = reader.Read(ptauStr) + if err != nil { + return Ptau{}, err + } // version _, err = readULE32(reader) + if err != nil { + return Ptau{}, err + } // number of sections _, err = readULE32(reader) + if err != nil { + return Ptau{}, err + } numSections := uint32(7) @@ -291,25 +301,36 @@ func ReadPtau(zkeyPath string) (Ptau, error) { // 1-based indexing, so we need to allocate one more than the number of sections sections := make([][]SectionSegment, numSections+1) for i := uint32(0); i < numSections; i++ { - ht, _ := readULE32(reader) - hl, _ := readULE64(reader) + ht, err := readULE32(reader) + if err != nil { + return Ptau{}, err + } + hl, err := readULE64(reader) + if err != nil { + return Ptau{}, err + } if sections[ht] == nil { sections[ht] = make([]SectionSegment, 0) } - pos, _ := reader.Seek(0, io.SeekCurrent) + pos, err := reader.Seek(0, io.SeekCurrent) + if err != nil { + return Ptau{}, err + } sections[ht] = append(sections[ht], SectionSegment{pos: uint64(pos), size: hl}) reader.Seek(int64(hl), io.SeekCurrent) } // section size _, err = readBigInt(reader, 8) + if err != nil { + return Ptau{}, err + } // Header (1) seekToUniqueSection(reader, sections, 1) // Read header header, err := readPtauHeader(reader) - if err != nil { return Ptau{}, err } @@ -322,7 +343,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { twoToPower := uint32(1 << header.Power) PtauPubKey.TauG1, err = readG1Array(reader, twoToPower*2-1) - if err != nil { return Ptau{}, err } @@ -331,7 +351,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { seekToUniqueSection(reader, sections, 3) PtauPubKey.TauG2, err = readG2Array(reader, twoToPower) - if err != nil { return Ptau{}, err } @@ -340,7 +359,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { seekToUniqueSection(reader, sections, 4) PtauPubKey.AlphaTauG1, err = readG1Array(reader, twoToPower) - if err != nil { return Ptau{}, err } @@ -349,7 +367,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { seekToUniqueSection(reader, sections, 5) PtauPubKey.BetaTauG1, err = readG1Array(reader, twoToPower) - if err != nil { return Ptau{}, err } @@ -358,7 +375,6 @@ func ReadPtau(zkeyPath string) (Ptau, error) { seekToUniqueSection(reader, sections, 6) PtauPubKey.BetaG2, err = readG2(reader) - if err != nil { return Ptau{}, err } @@ -368,9 +384,7 @@ func ReadPtau(zkeyPath string) (Ptau, error) { func readPtauHeader(reader io.ReadSeeker) (PtauHeader, error) { var header PtauHeader - n8, err := readULE32(reader) - if err != nil { return PtauHeader{}, err } @@ -378,7 +392,6 @@ func readPtauHeader(reader io.ReadSeeker) (PtauHeader, error) { header.N8 = n8 prime, err := readBigInt(reader, n8) - if err != nil { return PtauHeader{}, err } @@ -386,13 +399,11 @@ func readPtauHeader(reader io.ReadSeeker) (PtauHeader, error) { header.Prime = prime power, err := readULE32(reader) - if err != nil { return PtauHeader{}, err } header.Power = power - return header, nil } @@ -400,7 +411,6 @@ func readG1Array(reader io.ReadSeeker, numPoints uint32) ([]G1, error) { g1s := make([]G1, numPoints) for i := uint32(0); i < numPoints; i++ { g1, err := readG1(reader) - if err != nil { return []G1{}, err } @@ -428,13 +438,11 @@ func readG2Array(reader io.ReadSeeker, numPoints uint32) ([]G2, error) { func readTauG2(reader io.ReadSeeker) ([]G2, error) { tauG2_s, err := readG2(reader) - if err != nil { return []G2{}, err } tauG2_sx, err := readG2(reader) - if err != nil { return []G2{}, err } @@ -446,7 +454,6 @@ func readG1(reader io.ReadSeeker) (G1, error) { var g1 G1 x, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) - if err != nil { return G1{}, err } @@ -454,7 +461,6 @@ func readG1(reader io.ReadSeeker) (G1, error) { g1[0] = x y, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) - if err != nil { return G1{}, err } @@ -468,7 +474,6 @@ func readG2(reader io.ReadSeeker) (G2, error) { var g2 G2 x0, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) - if err != nil { return G2{}, err } @@ -476,7 +481,6 @@ func readG2(reader io.ReadSeeker) (G2, error) { g2[0] = x0 x1, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) - if err != nil { return G2{}, err } @@ -484,7 +488,6 @@ func readG2(reader io.ReadSeeker) (G2, error) { g2[1] = x1 y0, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) - if err != nil { return G2{}, err } @@ -492,7 +495,6 @@ func readG2(reader io.ReadSeeker) (G2, error) { g2[2] = y0 y1, err := readBigInt(reader, BN254_FIELD_ELEMENT_SIZE) - if err != nil { return G2{}, err } @@ -506,7 +508,6 @@ func readULE32(reader io.Reader) (uint32, error) { var buffer = make([]byte, 4) _, err := reader.Read(buffer) - if err != nil { return 0, err } @@ -518,7 +519,6 @@ func readULE64(reader io.Reader) (uint64, error) { var buffer = make([]byte, 8) _, err := reader.Read(buffer) - if err != nil { return 0, err } @@ -643,9 +643,15 @@ func ReadZkey(zkeyPath string) (Zkey, error) { // zkey var zkeyStr = make([]byte, 4) _, err = reader.Read(zkeyStr) + if err != nil { + return Zkey{}, err + } // version _, err = readULE32(reader) + if err != nil { + return Zkey{}, err + } // number of sections numSections, err := readULE32(reader) @@ -666,10 +672,12 @@ func ReadZkey(zkeyPath string) (Zkey, error) { // section size _, err = readBigInt(reader, 8) + if err != nil { + return Zkey{}, err + } seekToUniqueSection(reader, sections, 1) header, err := readHeader(reader, sections) - if err != nil { return Zkey{}, err } @@ -720,43 +728,36 @@ func readHeaderGroth16(reader io.ReadSeeker) (HeaderGroth, error) { var header = HeaderGroth{} n8q, err := readULE32(reader) - if err != nil { return header, err } q, err := readBigInt(reader, n8q) - if err != nil { return header, err } n8r, err := readULE32(reader) - if err != nil { return header, err } r, err := readBigInt(reader, n8r) - if err != nil { return header, err } nVars, err := readULE32(reader) - if err != nil { return header, err } nPublic, err := readULE32(reader) - if err != nil { return header, err } domainSize, err := readULE32(reader) - if err != nil { return header, err } @@ -851,6 +852,8 @@ func convertPtauToPhase1(ptau Ptau) (phase1 mpc.Phase1, err error) { } } + phase1 = mpc.InitPhase1(int(ptau.Header.Power)); + phase1.Parameters.G1.Tau = tauG1 phase1.Parameters.G1.AlphaTau = alphaTauG1 phase1.Parameters.G1.BetaTau = betaTauG1 @@ -858,5 +861,9 @@ func convertPtauToPhase1(ptau Ptau) (phase1 mpc.Phase1, err error) { phase1.Parameters.G2.Tau = tauG2 phase1.Parameters.G2.Beta = betaG2 + sha := sha256.New() + phase1.WriteTo(sha) + phase1.Hash = sha.Sum(nil) + return phase1, nil } diff --git a/galoisd/cmd/galoisd/cmd/phase2_extract.go b/galoisd/cmd/galoisd/cmd/phase2_extract.go index d0464f6c51..d58438b9cf 100644 --- a/galoisd/cmd/galoisd/cmd/phase2_extract.go +++ b/galoisd/cmd/galoisd/cmd/phase2_extract.go @@ -1,6 +1,8 @@ package cmd import ( + "fmt" + mpc "github.com/consensys/gnark/backend/groth16/bn254/mpcsetup" bn254 "github.com/consensys/gnark/constraint/bn254" "github.com/spf13/cobra" @@ -16,31 +18,31 @@ func Phase2ExtractCmd() *cobra.Command { var r1cs bn254.R1CS err := readFrom(r1csPath, &r1cs) if err != nil { - return err + return fmt.Errorf("failed to read r1cs: %v", err); } phase1Path := args[1] var srs1 mpc.Phase1 err = readFrom(phase1Path, &srs1) if err != nil { - return err + return fmt.Errorf("failed to read phase1: %v", err); } phase2Path := args[2] var srs2 mpc.Phase2 err = readFrom(phase2Path, &srs2) if err != nil { - return err + return fmt.Errorf("failed to read phase2: %v", err); } phase2EvalsPath := args[3] var evals mpc.Phase2Evaluations err = readFrom(phase2EvalsPath, &evals) if err != nil { - return err + return fmt.Errorf("failed to read phase2 evals: %v", err); } pk, vk := mpc.ExtractKeys(&r1cs, &srs1, &srs2, &evals) pkOutput := args[4] err = saveTo(pkOutput, &pk) if err != nil { - return err + return fmt.Errorf("failed to write pk: %v", err); } vkOutput := args[5] return saveTo(vkOutput, &vk) From 6c57251dd4d05b570a538b9eb044b9a4df54f967 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Tue, 30 Jul 2024 19:20:59 +0200 Subject: [PATCH 08/48] fix(mpc): refactor in shared --- mpc/client/src/main.rs | 134 +++------------------- mpc/coordinator/src/main.rs | 193 ++++--------------------------- mpc/shared/Cargo.toml | 4 + mpc/shared/src/lib.rs | 1 + mpc/shared/src/supabase.rs | 223 ++++++++++++++++++++++++++++++++++++ 5 files changed, 266 insertions(+), 289 deletions(-) create mode 100644 mpc/shared/src/supabase.rs diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 8fce0b901c..8e1e1ddad8 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -1,5 +1,4 @@ use std::{ - io::SeekFrom, net::SocketAddr, os::unix::fs::MetadataExt, str::FromStr, @@ -16,18 +15,10 @@ use http_body_util::BodyExt; use httpdate::parse_http_date; use hyper::{body::Buf, service::service_fn, Method}; use hyper_util::rt::TokioIo; -use mpc_shared::{ - phase2_contribute, - types::{ContributorId, PayloadId}, - CONTRIBUTION_SIZE, -}; -use postgrest::Postgrest; -use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_LENGTH, LOCATION, RANGE}; +use mpc_shared::{phase2_contribute, supabase::SupabaseMPCApi, CONTRIBUTION_SIZE}; +use reqwest::header::LOCATION; use serde::Deserialize; -use tokio::{ - io::{AsyncSeekExt, AsyncWriteExt}, - net::TcpListener, -}; +use tokio::net::TcpListener; #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] @@ -53,13 +44,6 @@ enum Error { Phase2VerificationFailed(#[from] mpc_shared::Phase2VerificationError), } -async fn get_state_file(path: &str) -> Vec { - if !tokio::fs::try_exists(path).await.unwrap() { - tokio::fs::write(path, []).await.unwrap(); - } - tokio::fs::read(path).await.unwrap() -} - type BoxBody = http_body_util::combinators::BoxBody; type DynError = Box; @@ -74,111 +58,22 @@ async fn contribute( }: Contribute, ) -> Result<(), DynError> { const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; - const APIKEY: &str = "apikey"; - let authorization_header = format!("Bearer {}", jwt); - let client = Postgrest::new(format!("{SUPABASE_PROJECT}/rest/v1")) - .insert_header(APIKEY, api_key) - .insert_header(AUTHORIZATION, authorization_header.clone()); + let client = SupabaseMPCApi::new(SUPABASE_PROJECT.into(), api_key, jwt); let current_contributor = client - .from("current_contributor_id") - .select("id") - .execute() - .await? - .json::>() + .current_contributor() .await? - .first() - .cloned() .ok_or(Error::ContributorNotFound)?; assert!( current_contributor.id == contributor_id, "not current contributor." ); let current_payload = client - .from("current_payload_id") - .select("payload_id") - .execute() + .current_payload() .await? - .json::>() - .await? - .first() - .cloned() .ok_or(Error::PayloadNotFound)?; - let current_payload_download_url = format!( - "{SUPABASE_PROJECT}/storage/v1/object/contributions/{}", - ¤t_payload.id - ); - let client = reqwest::ClientBuilder::new() - .default_headers(HeaderMap::from_iter([( - AUTHORIZATION, - HeaderValue::from_str(&authorization_header)?, - )])) - .build()?; - println!("checking payload file..."); - enum StateFileAction { - Download(usize), - Done(Vec), - } - let state_path = current_payload.id; - let action = match get_state_file(&state_path).await { - content if content.len() < CONTRIBUTION_SIZE => { - println!("partial download, continuing from {}...", content.len()); - StateFileAction::Download(content.len()) - } - content if content.len() == CONTRIBUTION_SIZE => { - println!("download complete."); - StateFileAction::Done(content) - } - _ => { - println!("invalid size detected, redownloading..."); - StateFileAction::Download(0) - } - }; - let payload = match action { - StateFileAction::Download(start_position) => { - let mut response = client - .get(current_payload_download_url) - .header(RANGE, format!("bytes={}-", start_position)) - .send() - .await? - .error_for_status()?; - let headers = response.headers(); - let total_length = start_position - + u64::from_str( - headers - .get(CONTENT_LENGTH) - .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? - .to_str()?, - )? as usize; - println!("state file length: {}", total_length); - assert!( - total_length == CONTRIBUTION_SIZE, - "contribution length mismatch." - ); - let mut state_file = tokio::fs::OpenOptions::new() - .write(true) - .create(false) - .open(&state_path) - .await?; - state_file.set_len(start_position as u64).await?; - state_file - .seek(SeekFrom::Start(start_position as u64)) - .await?; - let mut i = 0; - while let Some(chunk) = response.chunk().await? { - if i % 10 == 0 { - println!("eta: chunk {}.", i); - } - let written = state_file.write(&chunk).await?; - assert!(written == chunk.len(), "couldn't write chunk."); - state_file.sync_data().await?; - i += 1; - } - println!("download complete"); - let final_content = tokio::fs::read(&state_path).await?; - final_content - } - StateFileAction::Done(content) => content, - }; + let payload = client + .download_payload(¤t_payload.id, ¤t_payload.id) + .await?; let phase2_contribution = if let Ok(true) = tokio::fs::metadata(&payload_id) .await .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) @@ -197,7 +92,6 @@ async fn contribute( .journal_mode(JournalMode::Wal) .open() .await?; - pool.conn(|conn| { conn.execute( "CREATE TABLE IF NOT EXISTS resumable_upload ( @@ -223,8 +117,9 @@ async fn contribute( } }) .await?; + let upload_client = client.new_reqwest_builder()?.build()?; if let Some(ref location) = upload_location { - if client + if upload_client .head(location) .header("Tus-Resumable", "1.0.0") .send() @@ -232,6 +127,7 @@ async fn contribute( .error_for_status() .is_err() { + println!("upload location expired, removing it..."); upload_location = None; } } @@ -245,7 +141,7 @@ async fn contribute( // ===================================================== // https://tus.io/protocols/resumable-upload#creation == // ===================================================== - let response = client + let response = upload_client .post(format!("{SUPABASE_PROJECT}/storage/v1/upload/resumable")) .header("Tus-Resumable", "1.0.0") .header("Upload-Length", CONTRIBUTION_SIZE.to_string()) @@ -292,7 +188,7 @@ async fn contribute( // ================================================= // https://tus.io/protocols/resumable-upload#head == // ================================================= - let response = client + let response = upload_client .head(&upload_location) .header("Tus-Resumable", "1.0.0") .send() @@ -319,7 +215,7 @@ async fn contribute( // ================================================== // https://tus.io/protocols/resumable-upload#patch == // ================================================== - client + upload_client .patch(&upload_location) .header("Tus-Resumable", "1.0.0") .header("Content-Type", "application/offset+octet-stream") diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index 1f0dd7f371..0a79dec8b9 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -1,17 +1,7 @@ -use std::{io::SeekFrom, str::FromStr}; - use clap::{Parser, Subcommand}; -use mpc_shared::{ - phase2_verify, - types::{Contribution, ContributorId, PayloadId}, - CONTRIBUTION_SIZE, -}; -use postgrest::Postgrest; -use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_LENGTH, RANGE}; -use tokio::io::{AsyncSeekExt, AsyncWriteExt}; +use mpc_shared::{phase2_verify, supabase::SupabaseMPCApi}; const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; -const APIKEY: &str = "apikey"; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] @@ -32,8 +22,6 @@ enum Command { #[derive(thiserror::Error, Debug, Clone)] enum Error { - #[error("couldn't find expected header: {0}")] - HeaderNotFound(String), #[error("current contributor not found.")] ContributorNotFound, #[error("current payload not found.")] @@ -42,200 +30,65 @@ enum Error { NextPayloadNotFound, } -async fn get_state_file(path: &str) -> Vec { - if !tokio::fs::try_exists(path).await.unwrap() { - tokio::fs::write(path, []).await.unwrap(); - } - tokio::fs::read(path).await.unwrap() -} - -async fn download_payload( - authorization_header: String, - payload_id: &str, - payload_output: &str, -) -> Result, Box> { - let current_payload_download_url = format!( - "{SUPABASE_PROJECT}/storage/v1/object/contributions/{}", - &payload_id - ); - let client = reqwest::ClientBuilder::new() - .default_headers(HeaderMap::from_iter([( - AUTHORIZATION, - HeaderValue::from_str(&authorization_header)?, - )])) - .build()?; - println!("checking payload file..."); - enum StateFileAction { - Download(usize), - Done(Vec), - } - let state_path = payload_output; - let action = match get_state_file(&state_path).await { - content if content.len() < CONTRIBUTION_SIZE => { - println!("partial download, continuing from {}...", content.len()); - StateFileAction::Download(content.len()) - } - content if content.len() == CONTRIBUTION_SIZE => { - println!("download complete."); - StateFileAction::Done(content) - } - _ => { - println!("invalid size detected, redownloading..."); - StateFileAction::Download(0) - } - }; - match action { - StateFileAction::Download(start_position) => { - let mut response = client - .get(current_payload_download_url) - .header(RANGE, format!("bytes={}-", start_position)) - .send() - .await? - .error_for_status()?; - let headers = response.headers(); - let total_length = start_position - + u64::from_str( - headers - .get(CONTENT_LENGTH) - .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? - .to_str()?, - )? as usize; - println!("state file length: {}", total_length); - assert!( - total_length == CONTRIBUTION_SIZE, - "contribution length mismatch." - ); - let mut state_file = tokio::fs::OpenOptions::new() - .write(true) - .create(false) - .open(&state_path) - .await?; - state_file.set_len(start_position as u64).await?; - state_file - .seek(SeekFrom::Start(start_position as u64)) - .await?; - let mut i = 0; - while let Some(chunk) = response.chunk().await? { - if i % 10 == 0 { - println!("Eta: chunk {}.", i); - } - let written = state_file.write(&chunk).await?; - assert!(written == chunk.len(), "couldn't write chunk."); - state_file.sync_data().await?; - i += 1; - } - println!("download complete"); - let final_content = tokio::fs::read(&state_path).await?; - Ok(final_content) - } - StateFileAction::Done(content) => Ok(content), - } -} - #[tokio::main] async fn main() -> Result<(), Box> { let args = Args::parse(); match args.command { Command::Start { jwt, api_key } => { - let authorization_header = format!("Bearer {}", jwt); - let client = Postgrest::new(format!("{SUPABASE_PROJECT}/rest/v1")) - .insert_header(APIKEY, api_key) - .insert_header(AUTHORIZATION, authorization_header.clone()); + let client = SupabaseMPCApi::new(SUPABASE_PROJECT.into(), api_key, jwt); loop { + println!("awaiting current contributor slot..."); let current_contributor = { - let contributor = client - .from("current_contributor_id") - .select("id") - .execute() + match client + .current_contributor() .await? - .json::>() - .await? - .first() - .cloned() - .ok_or(Error::ContributorNotFound); - match contributor { + .ok_or(Error::ContributorNotFound) + { Ok(contributor) => contributor, Err(_) => { - println!("no more contributor to process."); tokio::time::sleep(std::time::Duration::from_secs(10)).await; continue; } } }; + println!("current contributor slot: {}", ¤t_contributor.id); let current_payload = client - .from("current_payload_id") - .select("payload_id") - .execute() + .current_payload() .await? - .json::>() - .await? - .first() - .cloned() .ok_or(Error::CurrentPayloadNotFound)?; - let payload_current = download_payload( - authorization_header.clone(), - ¤t_payload.id, - ¤t_payload.id, - ) - .await?; + let payload_current = client + .download_payload(¤t_payload.id, ¤t_payload.id) + .await?; println!("awaiting contribution of {}...", ¤t_contributor.id); loop { if client - .from("contribution_submitted") - .eq("id", ¤t_contributor.id) - .select("id") - .execute() - .await? - .json::>() + .contribution_submitted(¤t_contributor.id) .await? - .len() - == 1 { break; } tokio::time::sleep(std::time::Duration::from_secs(10)).await; } - println!("contribution submitted!"); + println!("detected contribution submission, downloading..."); let next_payload = client - .from("queue") - .eq("id", ¤t_contributor.id) - .select("payload_id") - .execute() - .await? - .json::>() + .contributor_payload(¤t_contributor.id) .await? - .first() - .cloned() .ok_or(Error::NextPayloadNotFound)?; - let payload_next = download_payload( - authorization_header.clone(), - &next_payload.id, - &next_payload.id, - ) - .await?; + let payload_next = client + .download_payload(&next_payload.id, &next_payload.id) + .await?; + println!("verifying payload..."); if phase2_verify(&payload_current, &payload_next).is_ok() { println!("verification succeeded."); client - .from("contribution") - .insert(serde_json::to_string(&Contribution { - id: current_contributor.id.clone(), - success: true, - })?) - .execute() - .await? - .error_for_status()?; + .insert_contribution(current_contributor.id.clone(), true) + .await?; tokio::fs::remove_file(¤t_payload.id).await?; } else { println!("verification failed."); client - .from("contribution") - .insert(serde_json::to_string(&Contribution { - id: current_contributor.id.clone(), - success: false, - })?) - .execute() - .await? - .error_for_status()?; + .insert_contribution(current_contributor.id.clone(), false) + .await?; } tokio::time::sleep(std::time::Duration::from_secs(10)).await; } diff --git a/mpc/shared/Cargo.toml b/mpc/shared/Cargo.toml index 1c8b4846f3..c642afe909 100644 --- a/mpc/shared/Cargo.toml +++ b/mpc/shared/Cargo.toml @@ -6,3 +6,7 @@ version = "0.1.0" [dependencies] serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } +postgrest = "1.0" +reqwest = { workspace = true, features = ["json"] } +serde_json = { workspace = true } +tokio = { workspace = true, features = ["full"] } \ No newline at end of file diff --git a/mpc/shared/src/lib.rs b/mpc/shared/src/lib.rs index ae058ef5b2..c3618fb265 100644 --- a/mpc/shared/src/lib.rs +++ b/mpc/shared/src/lib.rs @@ -1,4 +1,5 @@ pub mod types; +pub mod supabase; use std::ffi::{c_char, c_int}; diff --git a/mpc/shared/src/supabase.rs b/mpc/shared/src/supabase.rs new file mode 100644 index 0000000000..2dc6089767 --- /dev/null +++ b/mpc/shared/src/supabase.rs @@ -0,0 +1,223 @@ +use std::{io::SeekFrom, str::FromStr}; + +use postgrest::Postgrest; +use reqwest::{ + header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_LENGTH, RANGE}, + ClientBuilder, +}; +use tokio::io::{AsyncSeekExt, AsyncWriteExt}; + +use crate::{ + types::{Contribution, ContributorId, PayloadId}, + CONTRIBUTION_SIZE, +}; + +const API_KEY: &str = "apikey"; + +pub type DynError = Box; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum StateFileAction { + Download(usize), + Done(Vec), +} + +#[derive(thiserror::Error, Debug, Clone)] +pub enum Error { + #[error("couldn't find expected header: {0}")] + HeaderNotFound(String), + #[error("current contributor not found.")] + ContributorNotFound, + #[error("current payload not found.")] + CurrentPayloadNotFound, + #[error("next payload not found.")] + NextPayloadNotFound, +} + +pub struct SupabaseMPCApi { + project_url: String, + jwt: String, + client: Postgrest, +} + +impl SupabaseMPCApi { + pub fn new(project_url: String, api_key: String, jwt: String) -> Self { + let client = Postgrest::new(format!("{project_url}/rest/v1")) + .insert_header(API_KEY, &api_key) + .insert_header(AUTHORIZATION, format!("Bearer {}", &jwt)); + Self { + project_url, + jwt, + client, + } + } + + pub fn new_reqwest_builder(&self) -> Result { + Ok(ClientBuilder::new().default_headers(HeaderMap::from_iter([( + AUTHORIZATION, + HeaderValue::from_str(&format!("Bearer {}", &self.jwt))?, + )]))) + } + + pub async fn current_contributor(&self) -> Result, DynError> { + Ok(self + .client + .from("current_contributor_id") + .select("id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned()) + } + + pub async fn current_payload(&self) -> Result, DynError> { + Ok(self + .client + .from("current_payload_id") + .select("payload_id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned()) + } + + pub async fn contribution_submitted(&self, contributor_id: &str) -> Result { + Ok(self + .client + .from("contribution_submitted") + .eq("id", &contributor_id) + .select("id") + .execute() + .await? + .json::>() + .await? + .len() + == 1) + } + + pub async fn contributor_payload( + &self, + contributor_id: &str, + ) -> Result, DynError> { + Ok(self + .client + .from("queue") + .eq("id", &contributor_id) + .select("payload_id") + .execute() + .await? + .json::>() + .await? + .first() + .cloned()) + } + + pub async fn insert_contribution( + &self, + contributor_id: String, + success: bool, + ) -> Result<(), DynError> { + self.client + .from("contribution") + .insert(serde_json::to_string(&Contribution { + id: contributor_id, + success, + })?) + .execute() + .await? + .error_for_status()?; + Ok(()) + } + + pub async fn download_payload( + &self, + payload_id: &str, + payload_output: &str, + ) -> Result, Box> { + let current_payload_download_url = format!( + "{}/storage/v1/object/contributions/{}", + &self.project_url, &payload_id + ); + let client = ClientBuilder::new() + .default_headers(HeaderMap::from_iter([( + AUTHORIZATION, + HeaderValue::from_str(&format!("Bearer {}", &self.jwt))?, + )])) + .build()?; + println!("checking payload file..."); + let state_path = payload_output; + let action = match get_state_file(&state_path).await { + content if content.len() < CONTRIBUTION_SIZE => { + println!("partial download, continuing from {}...", content.len()); + StateFileAction::Download(content.len()) + } + content if content.len() == CONTRIBUTION_SIZE => { + println!("download complete."); + StateFileAction::Done(content) + } + _ => { + println!("invalid size detected, redownloading..."); + StateFileAction::Download(0) + } + }; + match action { + StateFileAction::Download(start_position) => { + let mut response = client + .get(current_payload_download_url) + .header(RANGE, format!("bytes={}-", start_position)) + .send() + .await? + .error_for_status()?; + let headers = response.headers(); + let total_length = start_position + + u64::from_str( + headers + .get(CONTENT_LENGTH) + .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? + .to_str()?, + )? as usize; + println!("state file length: {}", total_length); + assert!( + total_length == CONTRIBUTION_SIZE, + "contribution length mismatch." + ); + let mut state_file = tokio::fs::OpenOptions::new() + .write(true) + .create(false) + .open(&state_path) + .await?; + state_file.set_len(start_position as u64).await?; + state_file + .seek(SeekFrom::Start(start_position as u64)) + .await?; + let mut i = 0; + while let Some(chunk) = response.chunk().await? { + let k = CONTRIBUTION_SIZE / i; + if k > 10 { + println!("downloaded: {}%", i); + i = 0; + } + let written = state_file.write(&chunk).await?; + assert!(written == chunk.len(), "couldn't write chunk."); + state_file.sync_data().await?; + i += written; + } + println!("download complete"); + let final_content = tokio::fs::read(&state_path).await?; + Ok(final_content) + } + StateFileAction::Done(content) => Ok(content), + } + } +} + +async fn get_state_file(path: &str) -> Vec { + if !tokio::fs::try_exists(path).await.unwrap() { + tokio::fs::write(path, []).await.unwrap(); + } + tokio::fs::read(path).await.unwrap() +} From 0480499acb9eee66d618f96a0fa96c9d0464b87d Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 31 Jul 2024 13:27:36 +0200 Subject: [PATCH 09/48] feat(mpc): ui for cli --- mpc/client/Cargo.toml | 1 + mpc/client/src/main.rs | 316 +++++++++++++++++++++++++--------- mpc/client/src/types.rs | 17 ++ mpc/client/src/ui.rs | 321 +++++++++++++++++++++++++++++++++++ mpc/coordinator/database.sql | 2 +- mpc/coordinator/src/main.rs | 41 +++-- mpc/shared/src/supabase.rs | 37 ++-- 7 files changed, 612 insertions(+), 123 deletions(-) create mode 100644 mpc/client/src/types.rs create mode 100644 mpc/client/src/ui.rs diff --git a/mpc/client/Cargo.toml b/mpc/client/Cargo.toml index 17a4dae0ce..dafe51e673 100644 --- a/mpc/client/Cargo.toml +++ b/mpc/client/Cargo.toml @@ -16,6 +16,7 @@ mpc-shared = { workspace = true } postgrest = "1.0" rand = "0.8.5" ratatui = "0.27.0" +throbber-widgets-tui = "0.6" reqwest = { workspace = true, features = ["json"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 8e1e1ddad8..2083c98f3d 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -1,4 +1,8 @@ +mod types; +mod ui; + use std::{ + io, net::SocketAddr, os::unix::fs::MetadataExt, str::FromStr, @@ -6,19 +10,35 @@ use std::{ atomic::{AtomicBool, Ordering}, Arc, }, - time::UNIX_EPOCH, + time::{Duration, Instant, UNIX_EPOCH}, }; use async_sqlite::{JournalMode, PoolBuilder}; use base64::{prelude::BASE64_STANDARD, Engine}; -use http_body_util::BodyExt; +use crossterm::event; +use http_body_util::{BodyExt, Full}; use httpdate::parse_http_date; -use hyper::{body::Buf, service::service_fn, Method}; -use hyper_util::rt::TokioIo; +use hyper::{ + body::{Buf, Bytes}, + service::service_fn, + Method, +}; +use hyper_util::{rt::TokioIo, server::graceful::GracefulShutdown}; use mpc_shared::{phase2_contribute, supabase::SupabaseMPCApi, CONTRIBUTION_SIZE}; +use ratatui::{backend::CrosstermBackend, Terminal, Viewport}; use reqwest::header::LOCATION; use serde::Deserialize; -use tokio::net::TcpListener; +use tokio::{ + net::TcpListener, + sync::{ + broadcast::{self, Receiver, Sender}, + mpsc, oneshot, RwLock, + }, +}; +use types::Status; + +const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; +const ENDPOINT: &str = "/contribute"; #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] @@ -32,6 +52,8 @@ struct Contribute { #[derive(thiserror::Error, Debug, Clone)] enum Error { + #[error("we are not the current contributor.")] + NotCurrentContributor, #[error("couldn't find expected header: {0}")] HeaderNotFound(String), #[error("current contributor not found.")] @@ -44,11 +66,12 @@ enum Error { Phase2VerificationFailed(#[from] mpc_shared::Phase2VerificationError), } -type BoxBody = http_body_util::combinators::BoxBody; +type BoxBody = http_body_util::combinators::BoxBody; type DynError = Box; async fn contribute( + tx_status: Sender, Contribute { bucket, jwt, @@ -57,36 +80,58 @@ async fn contribute( payload_id, }: Contribute, ) -> Result<(), DynError> { - const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; let client = SupabaseMPCApi::new(SUPABASE_PROJECT.into(), api_key, jwt); let current_contributor = client .current_contributor() .await? .ok_or(Error::ContributorNotFound)?; - assert!( - current_contributor.id == contributor_id, - "not current contributor." - ); + if current_contributor.id != contributor_id { + return Err(Error::NotCurrentContributor.into()); + } let current_payload = client .current_payload() .await? .ok_or(Error::PayloadNotFound)?; + tx_status + .send(Status::DownloadStarted(current_payload.id.clone())) + .expect("impossible"); let payload = client - .download_payload(¤t_payload.id, ¤t_payload.id) + .download_payload(¤t_payload.id, ¤t_payload.id, |percent| { + let tx_status = tx_status.clone(); + let current_payload_clone = current_payload.id.clone(); + async move { + tx_status + .send(Status::Downloading(current_payload_clone, percent as u8)) + .expect("impossible"); + } + }) .await?; + tx_status + .send(Status::DownloadEnded(current_payload.id.clone())) + .expect("impossible"); let phase2_contribution = if let Ok(true) = tokio::fs::metadata(&payload_id) .await .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) { - println!("loading completed contribution..."); tokio::fs::read(&payload_id).await? } else { - println!("generating contribution, may take some time..."); - let phase2_contribution = phase2_contribute(&payload)?; + tx_status + .send(Status::ContributionStarted) + .expect("impossible"); + let (tx_contrib, rx_contrib) = oneshot::channel(); + let handle = tokio::task::spawn_blocking(move || { + tx_contrib + .send(phase2_contribute(&payload)) + .expect("impossible"); + }); + let phase2_contribution = rx_contrib.await??; + handle.await?; + tx_status + .send(Status::ContributionEnded) + .expect("impossible"); tokio::fs::write(&payload_id, &phase2_contribution).await?; phase2_contribution }; - println!("uploading contribution..."); let pool = PoolBuilder::new() .path("db.sqlite3") .journal_mode(JournalMode::Wal) @@ -127,17 +172,12 @@ async fn contribute( .error_for_status() .is_err() { - println!("upload location expired, removing it..."); upload_location = None; } } let upload_location = match upload_location { - Some(location) => { - println!("location already stored in db."); - location - } + Some(location) => location, None => { - println!("location not found, generating a new one..."); // ===================================================== // https://tus.io/protocols/resumable-upload#creation == // ===================================================== @@ -182,9 +222,6 @@ async fn contribute( location } }; - - println!("upload location: {upload_location}"); - // ================================================= // https://tus.io/protocols/resumable-upload#head == // ================================================= @@ -209,9 +246,10 @@ async fn contribute( .to_str()?, )?; assert!(upload_length == CONTRIBUTION_SIZE, "invalid upload-length."); - println!("upload-offset: {}", upload_offset); if upload_offset < upload_length { - println!("uploading contribution..."); + tx_status + .send(Status::UploadStarted(payload_id.clone())) + .expect("impossible"); // ================================================== // https://tus.io/protocols/resumable-upload#patch == // ================================================== @@ -229,84 +267,202 @@ async fn contribute( .send() .await? .error_for_status()?; + tx_status + .send(Status::UploadEnded(payload_id.clone())) + .expect("impossible"); } - println!("upload complete."); Ok(()) } +fn full>(chunk: T) -> BoxBody { + Full::new(chunk.into()) + .map_err(|never| match never {}) + .boxed() +} + async fn handle( - handling: Arc, + lock: Arc, + tx_status: Sender, + latest_status: Arc>, req: hyper::Request, ) -> Result, DynError> { + let response = |status, body| { + Ok(hyper::Response::builder() + .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .header(hyper::header::CONTENT_TYPE, "application/json") + .status(status) + .body(body) + .unwrap()) + }; + let response_empty = |status| response(status, BoxBody::default()); match (req.method(), req.uri().path()) { - (&Method::POST, "/contribute") - if handling + (&Method::POST, ENDPOINT) + if lock .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) .is_ok() => { - let result = (|| async { - let whole_body = req.collect().await?.aggregate(); - contribute(serde_json::from_reader(whole_body.reader())?).await?; - Ok::<_, DynError>(()) - })() - .await; - handling - .compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) - .expect("impossible"); - result?; - Ok(hyper::Response::builder() - .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") - .header(hyper::header::CONTENT_TYPE, "application/json") - .status(hyper::StatusCode::OK) - .body(BoxBody::default()) - .unwrap()) + tx_status.send(Status::Initializing).expect("impossible"); + tokio::spawn(async move { + let result = (|| async { + let whole_body = req.collect().await?.aggregate(); + contribute( + tx_status.clone(), + serde_json::from_reader(whole_body.reader())?, + ) + .await?; + Ok::<_, DynError>(()) + })() + .await; + match result { + Ok(_) => { + lock.compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) + .expect("impossible"); + tx_status.send(Status::Successful).expect("impossible") + } + Err(e) => tx_status + .send(Status::Failed(format!("{:#?}", e))) + .expect("impossible"), + } + }); + response_empty(hyper::StatusCode::ACCEPTED) } - // Busy building - (&Method::POST, "/contribute") => Ok(hyper::Response::builder() - .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") - .header(hyper::header::CONTENT_TYPE, "application/json") - .status(hyper::StatusCode::TOO_MANY_REQUESTS) - .body(BoxBody::default()) - .unwrap()), + // FE must poll GET and dispatch accordingly. + (&Method::POST, ENDPOINT) => response_empty(hyper::StatusCode::SERVICE_UNAVAILABLE), + (&Method::GET, ENDPOINT) => match latest_status.read().await.clone() { + Status::Failed(e) => { + lock.compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) + .expect("impossible"); + // Only idle if the FE poll after a failure. + tx_status.send(Status::Idle).expect("impossible"); + response( + hyper::StatusCode::INTERNAL_SERVER_ERROR, + full(serde_json::to_vec(&format!("{:#?}", e)).expect("impossible")), + ) + } + x => response( + hyper::StatusCode::OK, + full(serde_json::to_vec(&x).expect("impossible")), + ), + }, // CORS preflight request. - (&Method::OPTIONS, "/contribute") => Ok(hyper::Response::builder() + (&Method::OPTIONS, ENDPOINT) => Ok(hyper::Response::builder() .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") .header( hyper::header::ACCESS_CONTROL_ALLOW_HEADERS, hyper::header::CONTENT_TYPE, ) - .header(hyper::header::ACCESS_CONTROL_ALLOW_METHODS, "POST, OPTIONS") + .header( + hyper::header::ACCESS_CONTROL_ALLOW_METHODS, + format!( + "{}, {}, {}", + Method::OPTIONS.as_str(), + Method::GET.as_str(), + Method::POST.as_str() + ), + ) .status(hyper::StatusCode::OK) .body(BoxBody::default()) .unwrap()), - _ => Ok(hyper::Response::builder() - .status(hyper::StatusCode::NOT_FOUND) - .body(BoxBody::default()) - .unwrap()), + _ => response_empty(hyper::StatusCode::NOT_FOUND), } } +async fn input_and_status_handling( + latest_status: Arc>, + mut rx_status: Receiver, + tx_ui: mpsc::UnboundedSender, +) { + let tx_ui_clone = tx_ui.clone(); + tokio::spawn(async move { + while let Ok(status) = rx_status.recv().await { + *latest_status.write().await = status.clone(); + tx_ui_clone + .send(ui::Event::NewStatus(status)) + .expect("impossible"); + } + }); + tokio::spawn(async move { + let tick_rate = Duration::from_millis(1000 / 60); + let mut last_tick = Instant::now(); + loop { + // poll for tick rate duration, if no events, sent tick event. + let timeout = tick_rate.saturating_sub(last_tick.elapsed()); + if event::poll(timeout).unwrap() { + match event::read().unwrap() { + event::Event::Key(key) => tx_ui.send(ui::Event::Input(key)).unwrap(), + event::Event::Resize(_, _) => tx_ui.send(ui::Event::Resize).unwrap(), + _ => {} + }; + } + if last_tick.elapsed() >= tick_rate { + if let Err(_) = tx_ui.send(ui::Event::Tick) { + break; + } + last_tick = Instant::now(); + } + } + }); +} + #[tokio::main] async fn main() -> Result<(), DynError> { - let addr = SocketAddr::from(([127, 0, 0, 1], 0x1337)); - let listener = TcpListener::bind(addr).await?; - let handling = Arc::new(AtomicBool::new(false)); - loop { - let (stream, _) = listener.accept().await?; - let io = TokioIo::new(stream); - // TODO: can't we avoid the clone tower? - let handling_clone = handling.clone(); - tokio::task::spawn(async move { - // Finally, we bind the incoming connection to our `hello` service - if let Err(err) = hyper::server::conn::http1::Builder::new() - .serve_connection( - io, - service_fn(move |req| handle(handling_clone.clone(), req)), - ) - .await - { - eprintln!("Error serving connection: {:?}", err); + let status = Arc::new(RwLock::new(Status::Idle)); + let lock = Arc::new(AtomicBool::new(false)); + let (tx_status, rx_status) = broadcast::channel(64); + let graceful = GracefulShutdown::new(); + let (tx_shutdown, mut rx_shutdown) = oneshot::channel::<()>(); + let status_clone = status.clone(); + let handle = tokio::spawn(async move { + let addr = SocketAddr::from(([127, 0, 0, 1], 0x1337)); + let listener = TcpListener::bind(addr).await.unwrap(); + loop { + tokio::select! { + Ok((stream, _)) = listener.accept() => { + let io = TokioIo::new(stream); + let status_clone = status_clone.clone(); + let tx_status_clone = tx_status.clone(); + let lock_clone = lock.clone(); + let conn = hyper::server::conn::http1::Builder::new().serve_connection( + io, + service_fn(move |req| { + handle( + lock_clone.clone(), + tx_status_clone.clone(), + status_clone.clone(), + req, + ) + }), + ); + let fut = graceful.watch(conn); + tokio::task::spawn(async move { + if let Err(err) = fut.await { + eprintln!("error serving connection: {:?}", err); + } + }); + } + _ = &mut rx_shutdown => { + graceful.shutdown().await; + break + } } - }); - } + } + }); + // Dispatch terminal + let (tx_ui, rx_ui) = mpsc::unbounded_channel(); + crossterm::terminal::enable_raw_mode()?; + let stdout = io::stdout(); + let backend = CrosstermBackend::new(stdout); + let mut terminal = Terminal::with_options( + backend, + ratatui::TerminalOptions { + viewport: Viewport::Inline(8), + }, + )?; + input_and_status_handling(status, rx_status, tx_ui).await; + ui::run_ui(&mut terminal, rx_ui).await?; + crossterm::terminal::disable_raw_mode()?; + terminal.clear()?; + tx_shutdown.send(()).expect("impossible"); + handle.await.expect("impossible"); + Ok(()) } diff --git a/mpc/client/src/types.rs b/mpc/client/src/types.rs new file mode 100644 index 0000000000..c224eb7452 --- /dev/null +++ b/mpc/client/src/types.rs @@ -0,0 +1,17 @@ +use serde::Serialize; + +#[derive(PartialEq, Eq, Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +pub enum Status { + Idle, + Initializing, + DownloadStarted(String), + Downloading(String, u8), + DownloadEnded(String), + ContributionStarted, + ContributionEnded, + UploadStarted(String), + UploadEnded(String), + Failed(String), + Successful, +} diff --git a/mpc/client/src/ui.rs b/mpc/client/src/ui.rs new file mode 100644 index 0000000000..ba76a7b8ba --- /dev/null +++ b/mpc/client/src/ui.rs @@ -0,0 +1,321 @@ +use std::time::Instant; + +use ratatui::{ + crossterm::event::{self, KeyEvent}, + prelude::{ + symbols, Alignment, Backend, Color, Constraint, Frame, Layout, Line, Modifier, Rect, Span, + Style, Terminal, Widget, + }, + widgets::{block, Block, Gauge, LineGauge, List, ListItem, Paragraph}, +}; +use throbber_widgets_tui::ThrobberState; +use tokio::sync::mpsc::{self, error::TryRecvError}; + +use crate::types::Status; + +pub enum Event { + Input(KeyEvent), + Tick, + NewStatus(Status), + Resize, +} + +enum UiState { + Idle, + Downloading(String, u8, Instant), + Contributing(Instant), + Uploading(String, u8, Instant), + Successful, + Failed(String), +} + +fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { + let area = f.size(); + + let block = + Block::new().title(block::Title::from("Contribution Steps").alignment(Alignment::Center)); + f.render_widget(block, area); + + let vertical = Layout::vertical([Constraint::Length(2), Constraint::Length(4)]).margin(1); + let horizontal = Layout::horizontal([Constraint::Percentage(20), Constraint::Percentage(80)]); + let [progress_area, main] = vertical.areas(area); + let [list_area, gauge_area] = horizontal.areas(main); + let chunks = ratatui::layout::Layout::default() + .direction(ratatui::layout::Direction::Horizontal) + .constraints( + [ + ratatui::layout::Constraint::Min(10), + ratatui::layout::Constraint::Percentage(100), + ] + .as_ref(), + ) + .split(list_area); + + // total progress + let steps_done = match state { + UiState::Idle => 0, + UiState::Downloading(_, _, _) => 0, + UiState::Contributing(_) => 1, + UiState::Uploading(_, _, _) => 2, + UiState::Successful => 3, + UiState::Failed(_) => 3, + }; + let num_steps = 3; + #[allow(clippy::cast_precision_loss)] + let progress = LineGauge::default() + .filled_style(Style::default().fg(Color::Blue)) + .label(format!("{steps_done}/{num_steps}")) + .ratio(steps_done as f64 / num_steps as f64); + f.render_widget(progress, progress_area); + + match state { + UiState::Idle => { + // Set full with state + let full = throbber_widgets_tui::Throbber::default() + .label("Awaiting...") + .style(ratatui::style::Style::default().fg(ratatui::style::Color::Cyan)) + .throbber_style( + ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), + ) + .throbber_set(throbber_widgets_tui::CLOCK) + .use_type(throbber_widgets_tui::WhichUse::Spin); + f.render_stateful_widget(full, chunks[0], throbber_state); + } + UiState::Downloading(name, progress, started_at) => { + // in progress download + let item = ListItem::new(Line::from(vec![ + Span::raw(symbols::DOT), + Span::styled( + format!(" download {:>2}", name), + Style::default() + .fg(Color::LightGreen) + .add_modifier(Modifier::BOLD), + ), + Span::raw(format!(" ({}s)", started_at.elapsed().as_secs())), + ])); + + let list = List::new(vec![item]); + f.render_widget(list, list_area); + + let gauge = Gauge::default() + .gauge_style(Style::default().fg(Color::Yellow)) + .ratio(*progress as f64 / 100.0); + if gauge_area.top().saturating_add(0 as u16) > area.bottom() { + return; + } + f.render_widget( + gauge, + Rect { + x: gauge_area.left(), + y: gauge_area.top().saturating_add(0 as u16), + width: gauge_area.width, + height: 1, + }, + ); + } + UiState::Contributing(_) => { + let full = throbber_widgets_tui::Throbber::default() + .label("Your contribution is being computed, please be patient.") + .style(ratatui::style::Style::default().fg(ratatui::style::Color::Cyan)) + .throbber_style( + ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), + ) + .throbber_set(throbber_widgets_tui::CLOCK) + .use_type(throbber_widgets_tui::WhichUse::Spin); + f.render_stateful_widget(full, chunks[0], throbber_state); + } + UiState::Uploading(name, progress, started_at) => { + let item = ListItem::new(Line::from(vec![ + Span::raw(symbols::DOT), + Span::styled( + format!(" upload {:>2}", name), + Style::default() + .fg(Color::LightGreen) + .add_modifier(Modifier::BOLD), + ), + Span::raw(format!(" ({}s)", started_at.elapsed().as_secs())), + ])); + + let list = List::new(vec![item]); + f.render_widget(list, list_area); + + let gauge = Gauge::default() + .gauge_style(Style::default().fg(Color::Yellow)) + .ratio(*progress as f64 / 100.0); + if gauge_area.top().saturating_add(0 as u16) > area.bottom() { + return; + } + f.render_widget( + gauge, + Rect { + x: gauge_area.left(), + y: gauge_area.top().saturating_add(0 as u16), + width: gauge_area.width, + height: 1, + }, + ); + } + UiState::Successful => { + // Set full with state + let full = throbber_widgets_tui::Throbber::default() + .label("Contribution successfully upload...") + .style(ratatui::style::Style::default().fg(ratatui::style::Color::Cyan)) + .throbber_style( + ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), + ) + .throbber_set(throbber_widgets_tui::CLOCK) + .use_type(throbber_widgets_tui::WhichUse::Spin); + f.render_stateful_widget(full, chunks[0], throbber_state); + } + UiState::Failed(error) => { + // Set full with state + let full = throbber_widgets_tui::Throbber::default() + .label(format!("Failed to contribute: {}", error)) + .style(ratatui::style::Style::default().fg(ratatui::style::Color::Red)) + .throbber_style( + ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), + ) + .throbber_set(throbber_widgets_tui::CLOCK) + .use_type(throbber_widgets_tui::WhichUse::Spin); + f.render_stateful_widget(full, chunks[0], throbber_state); + } + } +} + +pub async fn run_ui( + terminal: &mut Terminal, + mut rx: mpsc::UnboundedReceiver, +) -> Result<(), Box> { + let mut state = UiState::Idle; + // let mut download_name = "".into(); + // let mut download_started_at = Instant::now(); + // let mut upload_name = "".into(); + // let mut upload_started_at = Instant::now(); + let mut throbber_state = ThrobberState::default(); + let mut redraw = false; + loop { + if redraw { + throbber_state.calc_next(); + terminal.draw(|f| ui(f, &state, &mut throbber_state))?; + redraw = false; + } + match rx.try_recv() { + Ok(e) => match e { + Event::Input(event) => { + if event.code == event::KeyCode::Char('q') { + break; + } + } + Event::Resize => { + terminal.autoresize()?; + } + Event::Tick => { + redraw = true; + } + Event::NewStatus(new_status) => { + state = match (new_status, state) { + (Status::Idle, _) => UiState::Idle, + (Status::DownloadStarted(name), _) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Started "), + Span::styled( + format!("downloading checkpoint {}", &name), + Style::default().add_modifier(Modifier::BOLD), + ), + ])) + .render(buf.area, buf); + })?; + UiState::Downloading(name, 0, Instant::now()) + } + ( + Status::Downloading(name, progress), + UiState::Downloading(_, _, started_at), + ) => UiState::Downloading(name, progress, started_at), + ( + Status::DownloadEnded(_), + UiState::Downloading(name, progress, started_at), + ) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Finished "), + Span::styled( + format!("downloading checkpoint {}", &name), + Style::default().add_modifier(Modifier::BOLD), + ), + Span::from(format!(" in {}s", started_at.elapsed().as_secs())), + ])) + .render(buf.area, buf); + })?; + UiState::Downloading(name, progress, started_at) + } + (Status::ContributionStarted, _) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Started "), + Span::styled( + "contribution computation", + Style::default().add_modifier(Modifier::BOLD), + ), + ])) + .render(buf.area, buf); + })?; + UiState::Contributing(Instant::now()) + } + (Status::ContributionEnded, UiState::Contributing(started_at)) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Finished "), + Span::styled( + "contribution computation", + Style::default().add_modifier(Modifier::BOLD), + ), + Span::from(format!(" in {}s", started_at.elapsed().as_secs())), + ])) + .render(buf.area, buf); + })?; + UiState::Contributing(started_at) + } + (Status::UploadStarted(name), _) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Started "), + Span::styled( + format!("uploading contribution {}", &name), + Style::default().add_modifier(Modifier::BOLD), + ), + ])) + .render(buf.area, buf); + })?; + UiState::Uploading(name, 0, Instant::now()) + } + ( + Status::UploadEnded(_), + UiState::Uploading(name, progress, started_at), + ) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Finished "), + Span::styled( + format!("uploading contribution {}", &name), + Style::default().add_modifier(Modifier::BOLD), + ), + Span::from(format!(" in {}s", started_at.elapsed().as_secs())), + ])) + .render(buf.area, buf); + })?; + UiState::Uploading(name, progress, started_at) + } + (Status::Successful, _) => UiState::Successful, + (Status::Failed(err), _) => UiState::Failed(err), + (_, s) => s, + }; + } + }, + Err(TryRecvError::Empty) => {} + _ => panic!("impossible"), + }; + tokio::time::sleep(std::time::Duration::from_millis(10)).await; + } + Ok(()) +} diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 0265b1947a..15c10b54f3 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -38,7 +38,7 @@ CREATE OR REPLACE VIEW current_queue_position AS -- Contribution round not started NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id) ) - END AS position; + END AS position; ALTER VIEW current_queue_position SET (security_invoker = on); diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index 0a79dec8b9..69e652feaf 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -36,46 +36,45 @@ async fn main() -> Result<(), Box> { match args.command { Command::Start { jwt, api_key } => { let client = SupabaseMPCApi::new(SUPABASE_PROJECT.into(), api_key, jwt); + let progress = |percent| async move { println!("downloaded: {:.2}%", percent) }; loop { - println!("awaiting current contributor slot..."); + println!("downloading current payload..."); + let current_payload = client + .current_payload() + .await? + .ok_or(Error::CurrentPayloadNotFound)?; + let payload_current = client + .download_payload(¤t_payload.id, ¤t_payload.id, progress) + .await?; let current_contributor = { match client .current_contributor() .await? .ok_or(Error::ContributorNotFound) { - Ok(contributor) => contributor, + Ok(contributor) => { + println!("awaiting contribution of {}...", &contributor.id); + if client.contribution_submitted(&contributor.id).await? { + contributor + } else { + tokio::time::sleep(std::time::Duration::from_secs(10)).await; + continue; + } + } Err(_) => { + println!("awaiting contributor to join queue..."); tokio::time::sleep(std::time::Duration::from_secs(10)).await; continue; } } }; - println!("current contributor slot: {}", ¤t_contributor.id); - let current_payload = client - .current_payload() - .await? - .ok_or(Error::CurrentPayloadNotFound)?; - let payload_current = client - .download_payload(¤t_payload.id, ¤t_payload.id) - .await?; - println!("awaiting contribution of {}...", ¤t_contributor.id); - loop { - if client - .contribution_submitted(¤t_contributor.id) - .await? - { - break; - } - tokio::time::sleep(std::time::Duration::from_secs(10)).await; - } println!("detected contribution submission, downloading..."); let next_payload = client .contributor_payload(¤t_contributor.id) .await? .ok_or(Error::NextPayloadNotFound)?; let payload_next = client - .download_payload(&next_payload.id, &next_payload.id) + .download_payload(&next_payload.id, &next_payload.id, progress) .await?; println!("verifying payload..."); if phase2_verify(&payload_current, &payload_next).is_ok() { diff --git a/mpc/shared/src/supabase.rs b/mpc/shared/src/supabase.rs index 2dc6089767..4996a7353a 100644 --- a/mpc/shared/src/supabase.rs +++ b/mpc/shared/src/supabase.rs @@ -1,4 +1,4 @@ -use std::{io::SeekFrom, str::FromStr}; +use std::{future::Future, io::SeekFrom, str::FromStr}; use postgrest::Postgrest; use reqwest::{ @@ -133,11 +133,15 @@ impl SupabaseMPCApi { Ok(()) } - pub async fn download_payload( + pub async fn download_payload( &self, payload_id: &str, payload_output: &str, - ) -> Result, Box> { + mut progress: impl FnMut(f64) -> F, + ) -> Result, Box> + where + F: Future, + { let current_payload_download_url = format!( "{}/storage/v1/object/contributions/{}", &self.project_url, &payload_id @@ -148,21 +152,13 @@ impl SupabaseMPCApi { HeaderValue::from_str(&format!("Bearer {}", &self.jwt))?, )])) .build()?; - println!("checking payload file..."); let state_path = payload_output; let action = match get_state_file(&state_path).await { content if content.len() < CONTRIBUTION_SIZE => { - println!("partial download, continuing from {}...", content.len()); StateFileAction::Download(content.len()) } - content if content.len() == CONTRIBUTION_SIZE => { - println!("download complete."); - StateFileAction::Done(content) - } - _ => { - println!("invalid size detected, redownloading..."); - StateFileAction::Download(0) - } + content if content.len() == CONTRIBUTION_SIZE => StateFileAction::Done(content), + _ => StateFileAction::Download(0), }; match action { StateFileAction::Download(start_position) => { @@ -180,7 +176,6 @@ impl SupabaseMPCApi { .ok_or(Error::HeaderNotFound(CONTENT_LENGTH.as_str().into()))? .to_str()?, )? as usize; - println!("state file length: {}", total_length); assert!( total_length == CONTRIBUTION_SIZE, "contribution length mismatch." @@ -194,19 +189,19 @@ impl SupabaseMPCApi { state_file .seek(SeekFrom::Start(start_position as u64)) .await?; - let mut i = 0; + let mut i = start_position; + let mut freq = 0; while let Some(chunk) = response.chunk().await? { - let k = CONTRIBUTION_SIZE / i; - if k > 10 { - println!("downloaded: {}%", i); - i = 0; + let k = (i as f64 / CONTRIBUTION_SIZE as f64) * 100.; + if freq % 200 == 0 { + progress(k).await; } let written = state_file.write(&chunk).await?; assert!(written == chunk.len(), "couldn't write chunk."); - state_file.sync_data().await?; i += written; + freq += 1; } - println!("download complete"); + state_file.sync_data().await?; let final_content = tokio::fs::read(&state_path).await?; Ok(final_content) } From c8f659f8008b034d54297b553636a229a0681da0 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 31 Jul 2024 15:23:13 +0200 Subject: [PATCH 10/48] feat(mpc): better ui and messages --- mpc/client/src/main.rs | 2 +- mpc/client/src/ui.rs | 130 +++++++++++++++++++++++------------ mpc/coordinator/database.sql | 4 +- 3 files changed, 88 insertions(+), 48 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 2083c98f3d..f9adfefc33 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -320,7 +320,7 @@ async fn handle( tx_status.send(Status::Successful).expect("impossible") } Err(e) => tx_status - .send(Status::Failed(format!("{:#?}", e))) + .send(Status::Failed(format!("{:?}", e))) .expect("impossible"), } }); diff --git a/mpc/client/src/ui.rs b/mpc/client/src/ui.rs index ba76a7b8ba..c8de9e57b4 100644 --- a/mpc/client/src/ui.rs +++ b/mpc/client/src/ui.rs @@ -23,7 +23,9 @@ pub enum Event { enum UiState { Idle, Downloading(String, u8, Instant), + DownloadEnded, Contributing(Instant), + ContributionEnded, Uploading(String, u8, Instant), Successful, Failed(String), @@ -32,12 +34,13 @@ enum UiState { fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { let area = f.size(); - let block = - Block::new().title(block::Title::from("Contribution Steps").alignment(Alignment::Center)); + let block = Block::new().title( + block::Title::from("Contribution Steps (press `q` to exit)").alignment(Alignment::Center), + ); f.render_widget(block, area); let vertical = Layout::vertical([Constraint::Length(2), Constraint::Length(4)]).margin(1); - let horizontal = Layout::horizontal([Constraint::Percentage(20), Constraint::Percentage(80)]); + let horizontal = Layout::horizontal([Constraint::Percentage(40), Constraint::Percentage(60)]); let [progress_area, main] = vertical.areas(area); let [list_area, gauge_area] = horizontal.areas(main); let chunks = ratatui::layout::Layout::default() @@ -55,7 +58,9 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { let steps_done = match state { UiState::Idle => 0, UiState::Downloading(_, _, _) => 0, + UiState::DownloadEnded => 1, UiState::Contributing(_) => 1, + UiState::ContributionEnded => 2, UiState::Uploading(_, _, _) => 2, UiState::Successful => 3, UiState::Failed(_) => 3, @@ -72,8 +77,8 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { UiState::Idle => { // Set full with state let full = throbber_widgets_tui::Throbber::default() - .label("Awaiting...") - .style(ratatui::style::Style::default().fg(ratatui::style::Color::Cyan)) + .label("Awaiting orders...") + .style(ratatui::style::Style::default().fg(ratatui::style::Color::White)) .throbber_style( ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), ) @@ -86,9 +91,9 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { let item = ListItem::new(Line::from(vec![ Span::raw(symbols::DOT), Span::styled( - format!(" download {:>2}", name), + format!(" downloading {:>2}", name), Style::default() - .fg(Color::LightGreen) + .fg(Color::White) .add_modifier(Modifier::BOLD), ), Span::raw(format!(" ({}s)", started_at.elapsed().as_secs())), @@ -98,7 +103,7 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { f.render_widget(list, list_area); let gauge = Gauge::default() - .gauge_style(Style::default().fg(Color::Yellow)) + .gauge_style(Style::default().fg(Color::Cyan)) .ratio(*progress as f64 / 100.0); if gauge_area.top().saturating_add(0 as u16) > area.bottom() { return; @@ -115,8 +120,8 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { } UiState::Contributing(_) => { let full = throbber_widgets_tui::Throbber::default() - .label("Your contribution is being computed, please be patient.") - .style(ratatui::style::Style::default().fg(ratatui::style::Color::Cyan)) + .label("Your contribution is being computed, please be patient...") + .style(ratatui::style::Style::default().fg(ratatui::style::Color::White)) .throbber_style( ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), ) @@ -124,36 +129,18 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { .use_type(throbber_widgets_tui::WhichUse::Spin); f.render_stateful_widget(full, chunks[0], throbber_state); } - UiState::Uploading(name, progress, started_at) => { + UiState::Uploading(name, _, started_at) => { let item = ListItem::new(Line::from(vec![ Span::raw(symbols::DOT), Span::styled( - format!(" upload {:>2}", name), + format!(" uploading {:>2}", name), Style::default() - .fg(Color::LightGreen) + .fg(Color::White) .add_modifier(Modifier::BOLD), ), Span::raw(format!(" ({}s)", started_at.elapsed().as_secs())), ])); - - let list = List::new(vec![item]); - f.render_widget(list, list_area); - - let gauge = Gauge::default() - .gauge_style(Style::default().fg(Color::Yellow)) - .ratio(*progress as f64 / 100.0); - if gauge_area.top().saturating_add(0 as u16) > area.bottom() { - return; - } - f.render_widget( - gauge, - Rect { - x: gauge_area.left(), - y: gauge_area.top().saturating_add(0 as u16), - width: gauge_area.width, - height: 1, - }, - ); + f.render_widget(List::new(vec![item]), list_area); } UiState::Successful => { // Set full with state @@ -179,6 +166,30 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { .use_type(throbber_widgets_tui::WhichUse::Spin); f.render_stateful_widget(full, chunks[0], throbber_state); } + UiState::DownloadEnded => { + // Set full with state + let full = throbber_widgets_tui::Throbber::default() + .label("Initializing contribution...") + .style(ratatui::style::Style::default().fg(ratatui::style::Color::White)) + .throbber_style( + ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), + ) + .throbber_set(throbber_widgets_tui::CLOCK) + .use_type(throbber_widgets_tui::WhichUse::Spin); + f.render_stateful_widget(full, chunks[0], throbber_state); + } + UiState::ContributionEnded => { + // Set full with state + let full = throbber_widgets_tui::Throbber::default() + .label("Initializing upload...") + .style(ratatui::style::Style::default().fg(ratatui::style::Color::White)) + .throbber_style( + ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), + ) + .throbber_set(throbber_widgets_tui::CLOCK) + .use_type(throbber_widgets_tui::WhichUse::Spin); + f.render_stateful_widget(full, chunks[0], throbber_state); + } } } @@ -193,6 +204,7 @@ pub async fn run_ui( // let mut upload_started_at = Instant::now(); let mut throbber_state = ThrobberState::default(); let mut redraw = false; + let mut start_time = Instant::now(); loop { if redraw { throbber_state.calc_next(); @@ -216,11 +228,12 @@ pub async fn run_ui( state = match (new_status, state) { (Status::Idle, _) => UiState::Idle, (Status::DownloadStarted(name), _) => { + start_time = Instant::now(); terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ - Span::from("Started "), + Span::from("Started downloading"), Span::styled( - format!("downloading checkpoint {}", &name), + format!("checkpoint {}", &name), Style::default().add_modifier(Modifier::BOLD), ), ])) @@ -232,10 +245,7 @@ pub async fn run_ui( Status::Downloading(name, progress), UiState::Downloading(_, _, started_at), ) => UiState::Downloading(name, progress, started_at), - ( - Status::DownloadEnded(_), - UiState::Downloading(name, progress, started_at), - ) => { + (Status::DownloadEnded(_), UiState::Downloading(name, _, started_at)) => { terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ Span::from("Finished "), @@ -247,14 +257,14 @@ pub async fn run_ui( ])) .render(buf.area, buf); })?; - UiState::Downloading(name, progress, started_at) + UiState::DownloadEnded } (Status::ContributionStarted, _) => { terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ Span::from("Started "), Span::styled( - "contribution computation", + "contribution computation...", Style::default().add_modifier(Modifier::BOLD), ), ])) @@ -274,14 +284,14 @@ pub async fn run_ui( ])) .render(buf.area, buf); })?; - UiState::Contributing(started_at) + UiState::ContributionEnded } (Status::UploadStarted(name), _) => { terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ - Span::from("Started "), + Span::from("Started uploading"), Span::styled( - format!("uploading contribution {}", &name), + format!("contribution {}", &name), Style::default().add_modifier(Modifier::BOLD), ), ])) @@ -306,8 +316,38 @@ pub async fn run_ui( })?; UiState::Uploading(name, progress, started_at) } - (Status::Successful, _) => UiState::Successful, - (Status::Failed(err), _) => UiState::Failed(err), + (Status::Successful, _) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Done, "), + Span::styled( + "successfully contributed", + Style::default() + .add_modifier(Modifier::BOLD) + .fg(Color::Green), + ), + Span::from(format!(" in {}s", start_time.elapsed().as_secs())), + ])) + .render(buf.area, buf); + })?; + UiState::Successful + } + (Status::Failed(err), _) => { + terminal.insert_before(1, |buf| { + Paragraph::new(Line::from(vec![ + Span::from("Done "), + Span::styled( + format!("contribution failed: {}", err), + Style::default() + .add_modifier(Modifier::BOLD) + .fg(Color::Red), + ), + Span::from(format!(" in {}s", start_time.elapsed().as_secs())), + ])) + .render(buf.area, buf); + })?; + UiState::Failed(err) + } (_, s) => s, }; } diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 15c10b54f3..67e0163f28 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -87,7 +87,7 @@ CREATE TABLE contribution_submitted( ); ALTER TABLE contribution_submitted ENABLE ROW LEVEL SECURITY; -ALTER TABLE contribution_submitted ADD FOREIGN KEY (id) REFERENCES queue(id); +ALTER TABLE contribution_submitted ADD FOREIGN KEY (id) REFERENCES contribution_status(id); CREATE POLICY view_all ON contribution_submitted @@ -108,7 +108,7 @@ CREATE TABLE contribution( ); ALTER TABLE contribution ENABLE ROW LEVEL SECURITY; -ALTER TABLE contribution ADD FOREIGN KEY (id) REFERENCES queue(id); +ALTER TABLE contribution ADD FOREIGN KEY (id) REFERENCES contribution_status(id); CREATE UNIQUE INDEX idx_contribution_seq ON contribution(seq); CREATE UNIQUE INDEX idx_contribution_seq_success ON contribution(success, seq); From c38ffdb8dd43f65526480807dcb7cbeeba882859 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 31 Jul 2024 15:49:56 +0200 Subject: [PATCH 11/48] fix(mpc): final sql --- mpc/coordinator/database.sql | 82 +++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 67e0163f28..6f57c89231 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -1,3 +1,8 @@ +BEGIN; + +-- Default bucket for contributions upload +INSERT INTO storage.buckets(id, name, public) VALUES('contributions', 'contributions', false); + ----------- -- Queue -- ----------- @@ -22,26 +27,6 @@ CREATE POLICY view_all true ); --- Materialized ? -CREATE OR REPLACE VIEW current_queue_position AS - SELECT - CASE WHEN (SELECT cci.id FROM current_contributor_id cci) = auth.uid() THEN - 0 - ELSE - ( - SELECT COUNT(*) + 1 - FROM queue q - WHERE - -- Better score - q.score > (SELECT qq.score FROM queue qq WHERE qq.id = auth.uid()) - AND - -- Contribution round not started - NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id) - ) - END AS position; - -ALTER VIEW current_queue_position SET (security_invoker = on); - CREATE OR REPLACE FUNCTION min_score() RETURNS INTEGER AS $$ BEGIN RETURN (SELECT COALESCE(MIN(score) - 1, 1000000) FROM queue); @@ -55,7 +40,11 @@ BEGIN END $$ LANGUAGE plpgsql; -CREATE TRIGGER queue_set_initial_score BEFORE INSERT ON queue FOR EACH ROW EXECUTE FUNCTION set_initial_score_trigger(); +CREATE TRIGGER queue_set_initial_score +BEFORE INSERT +ON queue +FOR EACH ROW +EXECUTE FUNCTION set_initial_score_trigger(); ------------------------- -- Contribution Status -- @@ -66,7 +55,7 @@ CREATE TABLE contribution_status( expire timestamptz NOT NULL DEFAULT(now() + INTERVAL '30 minutes') ); -ALTER TABLE contribution ENABLE ROW LEVEL SECURITY; +ALTER TABLE contribution_status ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution_status ADD FOREIGN KEY (id) REFERENCES queue(id); CREATE UNIQUE INDEX idx_contribution_status_id_expire ON contribution_status(id, expire); @@ -83,11 +72,13 @@ CREATE POLICY view_all ---------------------------- CREATE TABLE contribution_submitted( id uuid PRIMARY KEY, + object_id uuid NOT NULL, created_at timestamptz NOT NULL DEFAULT(now()) ); ALTER TABLE contribution_submitted ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution_submitted ADD FOREIGN KEY (id) REFERENCES contribution_status(id); +ALTER TABLE contribution_submitted ADD FOREIGN KEY (object_id) REFERENCES storage.objects(id); CREATE POLICY view_all ON contribution_submitted @@ -129,7 +120,11 @@ END $$ LANGUAGE plpgsql; -- Rotate the current contributor whenever a contribution is done. -CREATE TRIGGER contribution_added AFTER INSERT ON contribution FOR EACH ROW EXECUTE FUNCTION set_next_contributor_trigger(); +CREATE TRIGGER contribution_added +AFTER INSERT +ON contribution +FOR EACH ROW +EXECUTE FUNCTION set_next_contributor_trigger(); -- Current contributor is the highest score in the queue with the contribution -- not done yet and it's status expired without payload submitted. @@ -150,6 +145,26 @@ CREATE OR REPLACE VIEW current_contributor_id AS ALTER VIEW current_contributor_id SET (security_invoker = on); +-- Materialized ? +CREATE OR REPLACE VIEW current_queue_position AS + SELECT + CASE WHEN (SELECT cci.id FROM current_contributor_id cci) = auth.uid() THEN + 0 + ELSE + ( + SELECT COUNT(*) + 1 + FROM queue q + WHERE + -- Better score + q.score > (SELECT qq.score FROM queue qq WHERE qq.id = auth.uid()) + AND + -- Contribution round not started + NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id) + ) + END AS position; + +ALTER VIEW current_queue_position SET (security_invoker = on); + -- The current payload is from the latest successfull contribution CREATE OR REPLACE VIEW current_payload_id AS SELECT COALESCE( @@ -181,9 +196,6 @@ BEGIN END $$ LANGUAGE plpgsql; --- On expiry, rotate the contributor -SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); - CREATE OR REPLACE FUNCTION can_upload(name varchar) RETURNS BOOLEAN AS $$ BEGIN RETURN ( @@ -234,9 +246,9 @@ CREATE POLICY allow_authenticated_contributor_download can_download(name) ); -CREATE OR REPLACE PROCEDURE set_contribution_submitted(queue_id uuid) AS $$ +CREATE OR REPLACE PROCEDURE set_contribution_submitted(queue_id uuid, object_id uuid) AS $$ BEGIN - INSERT INTO contribution_submitted(id) VALUES(queue_id); + INSERT INTO contribution_submitted(id, object_id) VALUES(queue_id, object_id); END $$ LANGUAGE plpgsql; @@ -261,11 +273,12 @@ CREATE OR REPLACE FUNCTION set_contribution_submitted_trigger() RETURNS TRIGGER DECLARE file_size integer; BEGIN + -- For some reason, supa pushes placeholder files. IF (NEW.metadata IS NOT NULL) THEN file_size := (NEW.metadata->>'size')::integer; CASE WHEN file_size = expected_payload_size() - THEN CALL set_contribution_submitted(uuid(NEW.owner_id)); + THEN CALL set_contribution_submitted(uuid(NEW.owner_id), NEW.id); ELSE RAISE EXCEPTION 'invalid file size, name: %, got: %, expected: %, meta: %', NEW.name, file_size, expected_payload_size(), NEW.metadata; END CASE; @@ -275,4 +288,13 @@ END $$ LANGUAGE plpgsql; -- Rotate the current contributor whenever a contribution is done. -CREATE TRIGGER contribution_payload_uploaded AFTER INSERT OR UPDATE ON storage.objects FOR EACH ROW EXECUTE FUNCTION set_contribution_submitted_trigger(); +CREATE TRIGGER contribution_payload_uploaded +AFTER INSERT OR UPDATE +ON storage.objects +FOR EACH ROW +EXECUTE FUNCTION set_contribution_submitted_trigger(); + +-- Will rotate the current contributor if the slot expired without any contribution submitted +SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); + +COMMIT; From b91a47160da68ba7928a0ddf0f27cf851ab82c42 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 31 Jul 2024 18:00:12 +0200 Subject: [PATCH 12/48] fix(mpc): allow exiting cli at any point --- app/src/routes/ceremony/+page.svelte | 4 ++-- mpc/client/Cargo.toml | 1 + mpc/client/src/main.rs | 22 ++++++++++++---------- mpc/coordinator/src/main.rs | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/src/routes/ceremony/+page.svelte b/app/src/routes/ceremony/+page.svelte index e30a462c79..b1cb587985 100644 --- a/app/src/routes/ceremony/+page.svelte +++ b/app/src/routes/ceremony/+page.svelte @@ -3,9 +3,9 @@ import { createClient, type Provider } from "@supabase/supabase-js"; const apiKey = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJmZmNvbHdjYWtxcmhsem55am5zIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjIwOTc5OTgsImV4cCI6MjAzNzY3Mzk5OH0.9dVeafP8atsYqwdtPVYmzIhqMr_DEkHKdfoN3eqxjC0"; + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Ind3cXB5bGJyY3ByaXlhcXVnenNpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjI0MzMyMjQsImV4cCI6MjAzODAwOTIyNH0.UQOmQ-wE63O32lyrLDO7ryowrM5LNA2UILHDA7hTH8E"; const supabase = createClient( - "https://bffcolwcakqrhlznyjns.supabase.co", + "https://wwqpylbrcpriyaqugzsi.supabase.co", apiKey, ); diff --git a/mpc/client/Cargo.toml b/mpc/client/Cargo.toml index dafe51e673..4e20e5aa8a 100644 --- a/mpc/client/Cargo.toml +++ b/mpc/client/Cargo.toml @@ -22,3 +22,4 @@ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } +tokio-util = "0.7" \ No newline at end of file diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index f9adfefc33..696663763f 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -35,9 +35,10 @@ use tokio::{ mpsc, oneshot, RwLock, }, }; +use tokio_util::sync::CancellationToken; use types::Status; -const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; +const SUPABASE_PROJECT: &str = "https://wwqpylbrcpriyaqugzsi.supabase.co"; const ENDPOINT: &str = "/contribute"; #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] @@ -376,9 +377,9 @@ async fn input_and_status_handling( tokio::spawn(async move { while let Ok(status) = rx_status.recv().await { *latest_status.write().await = status.clone(); - tx_ui_clone - .send(ui::Event::NewStatus(status)) - .expect("impossible"); + if let Err(_) = tx_ui_clone.send(ui::Event::NewStatus(status)) { + break; + } } }); tokio::spawn(async move { @@ -410,8 +411,9 @@ async fn main() -> Result<(), DynError> { let lock = Arc::new(AtomicBool::new(false)); let (tx_status, rx_status) = broadcast::channel(64); let graceful = GracefulShutdown::new(); - let (tx_shutdown, mut rx_shutdown) = oneshot::channel::<()>(); let status_clone = status.clone(); + let token = CancellationToken::new(); + let token_clone = token.clone(); let handle = tokio::spawn(async move { let addr = SocketAddr::from(([127, 0, 0, 1], 0x1337)); let listener = TcpListener::bind(addr).await.unwrap(); @@ -440,12 +442,12 @@ async fn main() -> Result<(), DynError> { } }); } - _ = &mut rx_shutdown => { - graceful.shutdown().await; - break + _ = token_clone.cancelled() => { + break; } } } + graceful.shutdown().await; }); // Dispatch terminal let (tx_ui, rx_ui) = mpsc::unbounded_channel(); @@ -462,7 +464,7 @@ async fn main() -> Result<(), DynError> { ui::run_ui(&mut terminal, rx_ui).await?; crossterm::terminal::disable_raw_mode()?; terminal.clear()?; - tx_shutdown.send(()).expect("impossible"); + token.cancel(); handle.await.expect("impossible"); - Ok(()) + std::process::exit(0); } diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index 69e652feaf..87f9de45d8 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -1,7 +1,7 @@ use clap::{Parser, Subcommand}; use mpc_shared::{phase2_verify, supabase::SupabaseMPCApi}; -const SUPABASE_PROJECT: &str = "https://bffcolwcakqrhlznyjns.supabase.co"; +const SUPABASE_PROJECT: &str = "https://wwqpylbrcpriyaqugzsi.supabase.co"; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] From 2caec356858cd402d08f76effa3b300be821d4f8 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 31 Jul 2024 18:43:24 +0200 Subject: [PATCH 13/48] fix(mpc): better ui --- mpc/client/src/ui.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mpc/client/src/ui.rs b/mpc/client/src/ui.rs index c8de9e57b4..b674b43a3c 100644 --- a/mpc/client/src/ui.rs +++ b/mpc/client/src/ui.rs @@ -118,9 +118,12 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { }, ); } - UiState::Contributing(_) => { + UiState::Contributing(started_at) => { let full = throbber_widgets_tui::Throbber::default() - .label("Your contribution is being computed, please be patient...") + .label(format!( + "Your contribution is being computed, please be patient (may take a while)... ({}s)", + started_at.elapsed().as_secs() + )) .style(ratatui::style::Style::default().fg(ratatui::style::Color::White)) .throbber_style( ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), @@ -145,7 +148,7 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { UiState::Successful => { // Set full with state let full = throbber_widgets_tui::Throbber::default() - .label("Contribution successfully upload...") + .label("Contribution successfully uploaded...") .style(ratatui::style::Style::default().fg(ratatui::style::Color::Cyan)) .throbber_style( ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), @@ -231,7 +234,7 @@ pub async fn run_ui( start_time = Instant::now(); terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ - Span::from("Started downloading"), + Span::from("Started downloading "), Span::styled( format!("checkpoint {}", &name), Style::default().add_modifier(Modifier::BOLD), @@ -248,9 +251,9 @@ pub async fn run_ui( (Status::DownloadEnded(_), UiState::Downloading(name, _, started_at)) => { terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ - Span::from("Finished "), + Span::from("Finished downloading "), Span::styled( - format!("downloading checkpoint {}", &name), + format!("checkpoint {}", &name), Style::default().add_modifier(Modifier::BOLD), ), Span::from(format!(" in {}s", started_at.elapsed().as_secs())), @@ -289,7 +292,7 @@ pub async fn run_ui( (Status::UploadStarted(name), _) => { terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ - Span::from("Started uploading"), + Span::from("Started uploading "), Span::styled( format!("contribution {}", &name), Style::default().add_modifier(Modifier::BOLD), @@ -305,9 +308,9 @@ pub async fn run_ui( ) => { terminal.insert_before(1, |buf| { Paragraph::new(Line::from(vec![ - Span::from("Finished "), + Span::from("Finished uploading "), Span::styled( - format!("uploading contribution {}", &name), + format!("contribution {}", &name), Style::default().add_modifier(Modifier::BOLD), ), Span::from(format!(" in {}s", started_at.elapsed().as_secs())), From 36504cd7ebcd72de35bc9ceacbd567172ad1f542 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 2 Sep 2024 20:54:28 +0200 Subject: [PATCH 14/48] feat(mpc): add readme/fixup sql and code --- mpc/README.md | 58 ++++++++++++++++++++++++++++++++++++ mpc/client/src/main.rs | 9 +++--- mpc/coordinator/database.sql | 2 +- mpc/mpc.nix | 6 ++-- 4 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 mpc/README.md diff --git a/mpc/README.md b/mpc/README.md new file mode 100644 index 0000000000..e4c6af1371 --- /dev/null +++ b/mpc/README.md @@ -0,0 +1,58 @@ +# Introduction + +This project contains the client and coordinator to conduct Groth16 multi-party computation for the circuit SRS. +Three components are in play: +- Supabase : host the state machine in postgresql and exposes api and storage services to upload contributions. +- Coordinator: contact Supabase and verify contribution to step the state machine. +- Client: pure function that accepts the current contributor id and generate then upload a contribution payload. + +## Supabase + +Hosts the database, storage services and state machine of the MPC round. Provides instant API on top of them. + +## Coordinator + +The coordinator is in charge of verifying contributions. When a contribution is deemed valid, it dispatches the value to Supabase (insert an entry), effectively stepping the MPC state machine. + +## Client + +Exposes an API to contribute at `localhost:4919`: +- `OPTIONS /contribute` +- `POST /contribute` a `Contribute` object in body. Returns : + - a `202 Accepted` if the contribution started. + - a `503 Unavailable` if the client is busy (likely already contributing). +- `GET /contribute` returns : + - a `200 Ok` if everything is ok with the body containing an encoded `Status` representing the client status (idle, contributing etc...). + - a `500 InternalServerError` if the contribution failed unexpectedly, the body contains the error message. + +### Structures + +#### Contribute +```json +{ + "supabase_project": "", + "bucket": "", + "jwt": "", + "api_key": "", + "contributor_id": "", + "payload_id": "" +} +``` + +#### Status +```rust +#[serde(rename_all = "camelCase")] +pub enum Status { + Idle, + Initializing, + DownloadStarted(String), + Downloading(String, u8), + DownloadEnded(String), + ContributionStarted, + ContributionEnded, + UploadStarted(String), + UploadEnded(String), + Failed(String), + Successful, +} +``` diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 696663763f..cac88e0800 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -38,12 +38,12 @@ use tokio::{ use tokio_util::sync::CancellationToken; use types::Status; -const SUPABASE_PROJECT: &str = "https://wwqpylbrcpriyaqugzsi.supabase.co"; const ENDPOINT: &str = "/contribute"; #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] struct Contribute { + supabase_project: String, bucket: String, jwt: String, api_key: String, @@ -74,6 +74,7 @@ type DynError = Box; async fn contribute( tx_status: Sender, Contribute { + supabase_project, bucket, jwt, api_key, @@ -81,7 +82,7 @@ async fn contribute( payload_id, }: Contribute, ) -> Result<(), DynError> { - let client = SupabaseMPCApi::new(SUPABASE_PROJECT.into(), api_key, jwt); + let client = SupabaseMPCApi::new(supabase_project.clone(), api_key, jwt); let current_contributor = client .current_contributor() .await? @@ -183,7 +184,7 @@ async fn contribute( // https://tus.io/protocols/resumable-upload#creation == // ===================================================== let response = upload_client - .post(format!("{SUPABASE_PROJECT}/storage/v1/upload/resumable")) + .post(format!("{supabase_project}/storage/v1/upload/resumable")) .header("Tus-Resumable", "1.0.0") .header("Upload-Length", CONTRIBUTION_SIZE.to_string()) .header( @@ -415,7 +416,7 @@ async fn main() -> Result<(), DynError> { let token = CancellationToken::new(); let token_clone = token.clone(); let handle = tokio::spawn(async move { - let addr = SocketAddr::from(([127, 0, 0, 1], 0x1337)); + let addr = SocketAddr::from(([0, 0, 0, 0], 0x1337)); let listener = TcpListener::bind(addr).await.unwrap(); loop { tokio::select! { diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 6f57c89231..7d759a62b2 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -16,8 +16,8 @@ CREATE TABLE queue ( ALTER TABLE queue ENABLE ROW LEVEL SECURITY; ALTER TABLE queue ADD FOREIGN KEY (id) REFERENCES auth.users(id); CREATE UNIQUE INDEX idx_queue_score_id ON queue(score, id); -CREATE UNIQUE INDEX idx_queue_score ON queue(score); CREATE UNIQUE INDEX idx_queue_id_payload ON queue(id, payload_id); +CREATE INDEX idx_queue_score ON queue(score); CREATE POLICY view_all ON queue diff --git a/mpc/mpc.nix b/mpc/mpc.nix index 206acf4665..91e8c31d2d 100644 --- a/mpc/mpc.nix +++ b/mpc/mpc.nix @@ -13,15 +13,15 @@ in { packages = mpc-coordinator.packages // mpc-client.packages // { - mpc-image = pkgs.dockerTools.buildImage { + mpc-client-image = pkgs.dockerTools.buildImage { name = "${self'.packages.mpc-client.name}-image"; copyToRoot = pkgs.buildEnv { name = "image-root"; - paths = [ pkgs.coreutils-full pkgs.cacert ]; + paths = [ pkgs.coreutils-full pkgs.cacert pkgs.ncurses ]; pathsToLink = [ "/bin" ]; }; config = { - Entrypoint = [ (pkgs.lib.getExe self'.packages.mpc) ]; + Entrypoint = [ (pkgs.lib.getExe self'.packages.mpc-client) ]; Env = [ "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]; }; }; From 55a4e988dfe95a3a2d838610b79170f255c0dcb5 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 9 Sep 2024 14:12:21 +0200 Subject: [PATCH 15/48] feat(mpc): parametric project url for coordinator --- mpc/coordinator/src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index 87f9de45d8..e5d4ad2466 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -1,8 +1,6 @@ use clap::{Parser, Subcommand}; use mpc_shared::{phase2_verify, supabase::SupabaseMPCApi}; -const SUPABASE_PROJECT: &str = "https://wwqpylbrcpriyaqugzsi.supabase.co"; - #[derive(Parser, Debug)] #[command(version, about, long_about = None)] struct Args { @@ -14,9 +12,9 @@ struct Args { enum Command { Start { #[arg(short, long)] - jwt: String, + url: String, #[arg(short, long)] - api_key: String, + jwt: String, }, } @@ -34,8 +32,8 @@ enum Error { async fn main() -> Result<(), Box> { let args = Args::parse(); match args.command { - Command::Start { jwt, api_key } => { - let client = SupabaseMPCApi::new(SUPABASE_PROJECT.into(), api_key, jwt); + Command::Start { url, jwt } => { + let client = SupabaseMPCApi::new(url, jwt.clone(), jwt); let progress = |percent| async move { println!("downloaded: {:.2}%", percent) }; loop { println!("downloading current payload..."); From 1223a6fcd83388a40d3e112ad34f0c9006205e7c Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 9 Sep 2024 14:12:49 +0200 Subject: [PATCH 16/48] feat(mpc): add current queue view and auto queue join --- mpc/coordinator/database.sql | 45 ++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 7d759a62b2..528d68d6fe 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -27,6 +27,22 @@ CREATE POLICY view_all true ); + +CREATE OR REPLACE VIEW current_queue AS + ( + SELECT *, (SELECT COUNT(*) FROM queue qq + WHERE + NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = qq.id) + AND qq.score > q.score + ) + 1 AS position FROM queue q + WHERE + -- Contribution round not started + NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id) + ORDER BY q.score DESC + ); + +ALTER VIEW current_queue SET (security_invoker = on); + CREATE OR REPLACE FUNCTION min_score() RETURNS INTEGER AS $$ BEGIN RETURN (SELECT COALESCE(MIN(score) - 1, 1000000) FROM queue); @@ -80,6 +96,9 @@ ALTER TABLE contribution_submitted ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution_submitted ADD FOREIGN KEY (id) REFERENCES contribution_status(id); ALTER TABLE contribution_submitted ADD FOREIGN KEY (object_id) REFERENCES storage.objects(id); +CREATE INDEX idx_contribution_submitted_object ON contribution_submitted(object_id); +CREATE INDEX idx_contribution_submitted_id_created_at ON contribution_submitted(id, created_at); + CREATE POLICY view_all ON contribution_submitted FOR SELECT @@ -95,11 +114,11 @@ CREATE TABLE contribution( id uuid PRIMARY KEY, seq smallserial NOT NULL, created_at timestamptz NOT NULL DEFAULT(now()), - success boolean + success boolean NOT NULL ); ALTER TABLE contribution ENABLE ROW LEVEL SECURITY; -ALTER TABLE contribution ADD FOREIGN KEY (id) REFERENCES contribution_status(id); +ALTER TABLE contribution ADD FOREIGN KEY (id) REFERENCES contribution_submitted(id); CREATE UNIQUE INDEX idx_contribution_seq ON contribution(seq); CREATE UNIQUE INDEX idx_contribution_seq_success ON contribution(success, seq); @@ -221,6 +240,14 @@ CREATE POLICY allow_authenticated_contributor_upload_insert can_upload(name) ); +CREATE POLICY allow_service_insert + ON storage.objects + FOR INSERT + TO service_role + WITH CHECK ( + true + ); + CREATE OR REPLACE FUNCTION can_download(name varchar) RETURNS BOOLEAN AS $$ BEGIN RETURN ( @@ -297,4 +324,18 @@ EXECUTE FUNCTION set_contribution_submitted_trigger(); -- Will rotate the current contributor if the slot expired without any contribution submitted SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); +-- Automatically join the queue +CREATE OR REPLACE FUNCTION user_join_queue() RETURNS TRIGGER AS $$ +BEGIN + INSERT INTO public.queue(id) VALUES(NEW.id); + RETURN NEW; +END +$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; + +CREATE TRIGGER user_join_queue + AFTER INSERT + ON auth.users + FOR EACH ROW + EXECUTE FUNCTION user_join_queue(); + COMMIT; From 43222be0d75a4a1ed3502954b91a357e923cda69 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 9 Sep 2024 14:17:57 +0200 Subject: [PATCH 17/48] feat(mpc): parametric expiration --- mpc/coordinator/database.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 528d68d6fe..039a7c076a 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -65,10 +65,16 @@ EXECUTE FUNCTION set_initial_score_trigger(); ------------------------- -- Contribution Status -- ------------------------- +CREATE OR REPLACE FUNCTION expiration_delay() RETURNS INTERVAL AS $$ +BEGIN + RETURN INTERVAL '30 minutes'; +END +$$ LANGUAGE plpgsql SET search_path = ''; + CREATE TABLE contribution_status( id uuid PRIMARY KEY, started timestamptz NOT NULL DEFAULT(now()), - expire timestamptz NOT NULL DEFAULT(now() + INTERVAL '30 minutes') + expire timestamptz NOT NULL DEFAULT(now() + expiration_delay()) ); ALTER TABLE contribution_status ENABLE ROW LEVEL SECURITY; @@ -330,7 +336,7 @@ BEGIN INSERT INTO public.queue(id) VALUES(NEW.id); RETURN NEW; END -$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; +$$ LANGUAGE plpgsql SET search_path = ''; CREATE TRIGGER user_join_queue AFTER INSERT From 199643ff891573e92e7ae20456d9277ba335ed5d Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 11 Sep 2024 11:54:27 +0200 Subject: [PATCH 18/48] feat(mpc): more view for averages and string search_path --- mpc/coordinator/database.sql | 75 ++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 039a7c076a..55f116f573 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -45,16 +45,16 @@ ALTER VIEW current_queue SET (security_invoker = on); CREATE OR REPLACE FUNCTION min_score() RETURNS INTEGER AS $$ BEGIN - RETURN (SELECT COALESCE(MIN(score) - 1, 1000000) FROM queue); + RETURN (SELECT COALESCE(MIN(score) - 1, 1000000) FROM public.queue); END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; CREATE OR REPLACE FUNCTION set_initial_score_trigger() RETURNS TRIGGER AS $$ BEGIN - NEW.score := min_score(); + NEW.score := public.min_score(); RETURN NEW; END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; CREATE TRIGGER queue_set_initial_score BEFORE INSERT @@ -80,6 +80,7 @@ CREATE TABLE contribution_status( ALTER TABLE contribution_status ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution_status ADD FOREIGN KEY (id) REFERENCES queue(id); CREATE UNIQUE INDEX idx_contribution_status_id_expire ON contribution_status(id, expire); +CREATE UNIQUE INDEX idx_contribution_status_id_started ON contribution_status(id, started); CREATE POLICY view_all ON contribution_status @@ -89,6 +90,7 @@ CREATE POLICY view_all true ); + ---------------------------- -- Contribution Submitted -- ---------------------------- @@ -103,7 +105,7 @@ ALTER TABLE contribution_submitted ADD FOREIGN KEY (id) REFERENCES contribution_ ALTER TABLE contribution_submitted ADD FOREIGN KEY (object_id) REFERENCES storage.objects(id); CREATE INDEX idx_contribution_submitted_object ON contribution_submitted(object_id); -CREATE INDEX idx_contribution_submitted_id_created_at ON contribution_submitted(id, created_at); +CREATE UNIQUE INDEX idx_contribution_submitted_id_created_at ON contribution_submitted(id, created_at); CREATE POLICY view_all ON contribution_submitted @@ -127,6 +129,7 @@ ALTER TABLE contribution ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution ADD FOREIGN KEY (id) REFERENCES contribution_submitted(id); CREATE UNIQUE INDEX idx_contribution_seq ON contribution(seq); CREATE UNIQUE INDEX idx_contribution_seq_success ON contribution(success, seq); +CREATE UNIQUE INDEX idx_contribution_id_created_at ON contribution(id, created_at); CREATE POLICY view_all ON contribution @@ -139,10 +142,10 @@ CREATE POLICY view_all -- The next contributor is the one with the higest score that didn't contribute yet. CREATE OR REPLACE FUNCTION set_next_contributor_trigger() RETURNS TRIGGER AS $$ BEGIN - CALL set_next_contributor(); + CALL public.set_next_contributor(); RETURN NEW; END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; -- Rotate the current contributor whenever a contribution is done. CREATE TRIGGER contribution_added @@ -151,6 +154,22 @@ ON contribution FOR EACH ROW EXECUTE FUNCTION set_next_contributor_trigger(); +CREATE OR REPLACE VIEW current_verification_average AS ( + SELECT AVG(c.created_at - cs.created_at) AS verification_average + FROM contribution c + INNER JOIN contribution_submitted cs ON (c.id = cs.id) +); + +ALTER VIEW current_verification_average SET (security_invoker = on); + +CREATE OR REPLACE VIEW current_contribution_average AS ( + SELECT AVG(cs.created_at - c.started) AS contribution_average + FROM contribution_status c + INNER JOIN contribution_submitted cs ON (c.id = cs.id) +); + +ALTER VIEW current_contribution_average SET (security_invoker = on); + -- Current contributor is the highest score in the queue with the contribution -- not done yet and it's status expired without payload submitted. CREATE OR REPLACE VIEW current_contributor_id AS @@ -207,34 +226,34 @@ ALTER VIEW current_payload_id SET (security_invoker = on); CREATE OR REPLACE PROCEDURE set_next_contributor() AS $$ BEGIN - IF (SELECT COUNT(*) FROM current_contributor_id) = 0 THEN - INSERT INTO contribution_status(id) SELECT q.id FROM queue q WHERE q.score = ( + IF (SELECT COUNT(*) FROM public.current_contributor_id) = 0 THEN + INSERT INTO public.contribution_status(id) SELECT q.id FROM public.queue q WHERE q.score = ( SELECT MAX(qq.score) - FROM queue qq + FROM public.queue qq WHERE NOT EXISTS ( - SELECT c.id FROM contribution c WHERE c.id = qq.id + SELECT c.id FROM public.contribution c WHERE c.id = qq.id ) AND NOT EXISTS ( - SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire < now() + SELECT cs.expire FROM public.contribution_status cs WHERE cs.id = qq.id AND cs.expire < now() ) ); END IF; END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; CREATE OR REPLACE FUNCTION can_upload(name varchar) RETURNS BOOLEAN AS $$ BEGIN RETURN ( -- User must be the current contributor. - (SELECT cci.id FROM current_contributor_id cci) = auth.uid() + (SELECT cci.id FROM public.current_contributor_id cci) = auth.uid() AND -- User is only allowed to submit the expected payload. - storage.filename(name) = (SELECT q.payload_id::text FROM queue q WHERE q.id = auth.uid()) + storage.filename(name) = (SELECT q.payload_id::text FROM public.queue q WHERE q.id = auth.uid()) AND -- Do not allow the user to interact with the file after its been submitted. - NOT EXISTS (SELECT * FROM contribution_submitted cs WHERE cs.id = auth.uid()) + NOT EXISTS (SELECT * FROM public.contribution_submitted cs WHERE cs.id = auth.uid()) ); END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; CREATE POLICY allow_authenticated_contributor_upload_insert ON storage.objects @@ -258,16 +277,16 @@ CREATE OR REPLACE FUNCTION can_download(name varchar) RETURNS BOOLEAN AS $$ BEGIN RETURN ( -- User must be the current contributor. - (SELECT cci.id FROM current_contributor_id cci) = auth.uid() + (SELECT cci.id FROM public.current_contributor_id cci) = auth.uid() AND -- User is only allowed to download the last verified contribution. - storage.filename(name) = (SELECT cpi.payload_id::text FROM current_payload_id cpi) + storage.filename(name) = (SELECT cpi.payload_id::text FROM public.current_payload_id cpi) AND -- Do not allow the user to interact with the file after its contribution has been submitted. - NOT EXISTS (SELECT * FROM contribution_submitted cs WHERE cs.id = auth.uid()) + NOT EXISTS (SELECT * FROM public.contribution_submitted cs WHERE cs.id = auth.uid()) ); END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; CREATE POLICY allow_authenticated_contributor_download ON storage.objects @@ -281,16 +300,16 @@ CREATE POLICY allow_authenticated_contributor_download CREATE OR REPLACE PROCEDURE set_contribution_submitted(queue_id uuid, object_id uuid) AS $$ BEGIN - INSERT INTO contribution_submitted(id, object_id) VALUES(queue_id, object_id); + INSERT INTO public.contribution_submitted(id, object_id) VALUES(queue_id, object_id); END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; -- Phase 2 contribution payload is constant size CREATE OR REPLACE FUNCTION expected_payload_size() RETURNS INTEGER AS $$ BEGIN RETURN 306032532; END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; -- Metadata pushed on upload. -- { @@ -310,15 +329,15 @@ BEGIN IF (NEW.metadata IS NOT NULL) THEN file_size := (NEW.metadata->>'size')::integer; CASE - WHEN file_size = expected_payload_size() - THEN CALL set_contribution_submitted(uuid(NEW.owner_id), NEW.id); + WHEN file_size = public.expected_payload_size() + THEN CALL public.set_contribution_submitted(uuid(NEW.owner_id), NEW.id); ELSE RAISE EXCEPTION 'invalid file size, name: %, got: %, expected: %, meta: %', NEW.name, file_size, expected_payload_size(), NEW.metadata; END CASE; END IF; RETURN NEW; END -$$ LANGUAGE plpgsql; +$$ LANGUAGE plpgsql SET search_path = ''; -- Rotate the current contributor whenever a contribution is done. CREATE TRIGGER contribution_payload_uploaded @@ -336,7 +355,7 @@ BEGIN INSERT INTO public.queue(id) VALUES(NEW.id); RETURN NEW; END -$$ LANGUAGE plpgsql SET search_path = ''; +$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; CREATE TRIGGER user_join_queue AFTER INSERT From 90bd36032ca62858b8109738f35bfe0839191acb Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 12 Sep 2024 14:10:34 +0200 Subject: [PATCH 19/48] feat(mpc): waitlist & redeemable code --- mpc/coordinator/database.sql | 71 ++++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 55f116f573..d54cae79f0 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -3,14 +3,35 @@ BEGIN; -- Default bucket for contributions upload INSERT INTO storage.buckets(id, name, public) VALUES('contributions', 'contributions', false); +CREATE TABLE waitlist( + id UUID PRIMARY KEY +); + +ALTER TABLE waitlist ENABLE ROW LEVEL SECURITY; +ALTER TABLE waitlist ADD FOREIGN KEY (id) REFERENCES auth.users(id); + +CREATE POLICY allow_insert_self + ON waitlist + FOR INSERT + TO authenticated + WITH CHECK ( + (SELECT auth.uid()) = id + ); + ----------- -- Queue -- ----------- +CREATE OR REPLACE FUNCTION open_to_public() RETURNS boolean AS $$ +BEGIN + RETURN false; +END +$$ LANGUAGE plpgsql SET search_path = ''; + CREATE TABLE queue ( id uuid PRIMARY KEY, payload_id uuid NOT NULL DEFAULT(gen_random_uuid()), joined timestamptz NOT NULL DEFAULT (now()), - score integer NOT NULL + score INTEGER NOT NULL ); ALTER TABLE queue ENABLE ROW LEVEL SECURITY; @@ -27,6 +48,13 @@ CREATE POLICY view_all true ); +CREATE POLICY allow_insert_self_if_open + ON queue + FOR INSERT + TO authenticated + WITH CHECK ( + (SELECT auth.uid()) = id AND open_to_public() + ); CREATE OR REPLACE VIEW current_queue AS ( @@ -62,6 +90,33 @@ ON queue FOR EACH ROW EXECUTE FUNCTION set_initial_score_trigger(); +----------- +-- Code -- +----------- +CREATE TABLE code ( + id text PRIMARY KEY, + user_id uuid DEFAULT NULL +); + +ALTER TABLE code ENABLE ROW LEVEL SECURITY; +ALTER TABLE code ADD FOREIGN KEY (user_id) REFERENCES auth.users(id); +CREATE UNIQUE INDEX idx_code_user_id ON code(user_id); + +CREATE OR REPLACE FUNCTION redeem(code_id text) RETURNS void AS $$ + DECLARE + redeemed_code public.code%ROWTYPE := NULL; +BEGIN + UPDATE public.code c + SET id = (SELECT auth.uid()) + WHERE c.id = code_id + RETURNING * INTO redeemed_code; + IF (redeemed_code IS NULL) THEN + RAISE EXCEPTION 'redeem_code_invalid'; + END IF; + INSERT INTO public.queue(id) VALUES ((SELECT auth.uid())); +END +$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; + ------------------------- -- Contribution Status -- ------------------------- @@ -349,18 +404,4 @@ EXECUTE FUNCTION set_contribution_submitted_trigger(); -- Will rotate the current contributor if the slot expired without any contribution submitted SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); --- Automatically join the queue -CREATE OR REPLACE FUNCTION user_join_queue() RETURNS TRIGGER AS $$ -BEGIN - INSERT INTO public.queue(id) VALUES(NEW.id); - RETURN NEW; -END -$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; - -CREATE TRIGGER user_join_queue - AFTER INSERT - ON auth.users - FOR EACH ROW - EXECUTE FUNCTION user_join_queue(); - COMMIT; From 6093f3c98a9d03f4fce8b5810b259c8ca382eef4 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 12 Sep 2024 20:38:10 +0200 Subject: [PATCH 20/48] feat(mpc): join queue facility --- mpc/coordinator/database.sql | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index d54cae79f0..68bce68692 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -48,14 +48,6 @@ CREATE POLICY view_all true ); -CREATE POLICY allow_insert_self_if_open - ON queue - FOR INSERT - TO authenticated - WITH CHECK ( - (SELECT auth.uid()) = id AND open_to_public() - ); - CREATE OR REPLACE VIEW current_queue AS ( SELECT *, (SELECT COUNT(*) FROM queue qq @@ -107,8 +99,9 @@ CREATE OR REPLACE FUNCTION redeem(code_id text) RETURNS void AS $$ redeemed_code public.code%ROWTYPE := NULL; BEGIN UPDATE public.code c - SET id = (SELECT auth.uid()) - WHERE c.id = code_id + SET user_id = (SELECT auth.uid()) + WHERE c.id = encode(sha256(code_id::bytea), 'hex') + AND c.user_id IS NULL RETURNING * INTO redeemed_code; IF (redeemed_code IS NULL) THEN RAISE EXCEPTION 'redeem_code_invalid'; @@ -117,6 +110,20 @@ BEGIN END $$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; +CREATE OR REPLACE FUNCTION join_queue(code_id text) RETURNS void AS $$ +BEGIN + IF (code_id IS NULL) THEN + IF (public.open_to_public()) THEN + INSERT INTO public.queue(id) VALUES ((SELECT auth.uid())); + ELSE + RAISE EXCEPTION 'not_open_yet'; + END IF; + ELSE + PERFORM public.redeem(code_id); + END IF; +END +$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; + ------------------------- -- Contribution Status -- ------------------------- From 64252ea0e08c7472e4747f30da0c98d076148cc1 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 12 Sep 2024 22:09:51 +0200 Subject: [PATCH 21/48] feat(mpc): open with mutex --- mpc/client/src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index cac88e0800..0b31cd66ab 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -13,7 +13,7 @@ use std::{ time::{Duration, Instant, UNIX_EPOCH}, }; -use async_sqlite::{JournalMode, PoolBuilder}; +use async_sqlite::{rusqlite::OpenFlags, JournalMode, PoolBuilder}; use base64::{prelude::BASE64_STANDARD, Engine}; use crossterm::event; use http_body_util::{BodyExt, Full}; @@ -136,6 +136,12 @@ async fn contribute( }; let pool = PoolBuilder::new() .path("db.sqlite3") + .flags( + OpenFlags::SQLITE_OPEN_READ_WRITE + | OpenFlags::SQLITE_OPEN_CREATE + | OpenFlags::SQLITE_OPEN_FULL_MUTEX + | OpenFlags::SQLITE_OPEN_URI, + ) .journal_mode(JournalMode::Wal) .open() .await?; @@ -153,7 +159,7 @@ async fn contribute( .await?; let mut upload_location = pool .conn(move |conn| { - let mut stmt = conn.prepare_cached( + let mut stmt = conn.prepare( "SELECT location FROM resumable_upload WHERE expire > unixepoch() LIMIT 1", )?; let mut rows = stmt.query(())?; @@ -213,7 +219,7 @@ async fn contribute( let expire_timestamp = expire.duration_since(UNIX_EPOCH)?.as_secs(); let location_clone = location.clone(); pool.conn(move |conn| { - let mut stmt = conn.prepare_cached( + let mut stmt = conn.prepare( "INSERT INTO resumable_upload (location, expire) VALUES (?, ?)", )?; let r = stmt.execute((location_clone, expire_timestamp))?; @@ -439,7 +445,6 @@ async fn main() -> Result<(), DynError> { let fut = graceful.watch(conn); tokio::task::spawn(async move { if let Err(err) = fut.await { - eprintln!("error serving connection: {:?}", err); } }); } From fe74d05638cd9bbf01960355797260f91fd2b026 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 12 Sep 2024 23:07:43 +0200 Subject: [PATCH 22/48] feat(mpc): upgrade goPkgs --- flake.lock | 8 ++++---- flake.nix | 2 +- mpc/client/src/main.rs | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index b2f1fcf4da..be806f5671 100644 --- a/flake.lock +++ b/flake.lock @@ -417,16 +417,16 @@ }, "nixpkgs-go": { "locked": { - "lastModified": 1707786466, - "narHash": "sha256-yLPfrmW87M2qt+8bAmwopJawa+MJLh3M9rUbXtpUc1o=", + "lastModified": 1725930920, + "narHash": "sha256-RVhD9hnlTT2nJzPHlAqrWqCkA7T6CYrP41IoVRkciZM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "01885a071465e223f8f68971f864b15829988504", + "rev": "44a71ff39c182edaf25a7ace5c9454e7cba2c658", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 19f96c1a6c..e0644d4d57 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,7 @@ # Track a separate nixpkgs for latest solc nixpkgs-solc.url = "github:NixOS/nixpkgs/nixos-unstable"; # We need the latest nixpkgs for buildGo121Module, remove this once we upgrade nixpkgs - nixpkgs-go.url = "github:NixOS/nixpkgs/nixos-23.11"; + nixpkgs-go.url = "github:NixOS/nixpkgs/nixos-24.05"; # Track a separate nixpkgs for unstable nixos nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; # Remove when lnav is updated on upstream nixpkgs diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 0b31cd66ab..61944d0708 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -444,8 +444,7 @@ async fn main() -> Result<(), DynError> { ); let fut = graceful.watch(conn); tokio::task::spawn(async move { - if let Err(err) = fut.await { - } + let _ = fut.await; }); } _ = token_clone.cancelled() => { From 4770788ac32df16c1df6c640fd1e4449aec9b49d Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 13 Sep 2024 22:15:26 +0200 Subject: [PATCH 23/48] feat(mpc): attest contrib using gpg --- mpc/client/Cargo.toml | 38 ++++++------ mpc/client/src/main.rs | 84 +++++++++++++++++++++++++-- mpc/client/src/types.rs | 24 +++++++- mpc/coordinator/Cargo.toml | 2 + mpc/coordinator/database.sql | 109 ++++++++++++++++++++++++++++------- mpc/coordinator/src/main.rs | 56 +++++++++++++++++- mpc/shared/Cargo.toml | 13 +++-- mpc/shared/src/lib.rs | 6 +- mpc/shared/src/supabase.rs | 50 +++++++++++++++- mpc/shared/src/types.rs | 7 +++ 10 files changed, 329 insertions(+), 60 deletions(-) diff --git a/mpc/client/Cargo.toml b/mpc/client/Cargo.toml index 4e20e5aa8a..ccb9d7127d 100644 --- a/mpc/client/Cargo.toml +++ b/mpc/client/Cargo.toml @@ -4,22 +4,24 @@ name = "mpc-client" version = "0.1.0" [dependencies] -async-sqlite = "0.2.2" -base64 = { workspace = true } -clap = { version = "4.5", features = ["derive"] } -crossterm = "0.27.0" -http-body-util = "0.1" -httpdate = "1.0" -hyper = { version = "1", features = ["full"] } -hyper-util = { version = "0.1", features = ["full"] } -mpc-shared = { workspace = true } -postgrest = "1.0" -rand = "0.8.5" -ratatui = "0.27.0" +async-sqlite = "0.2.2" +base64 = { workspace = true } +clap = { version = "4.5", features = ["derive"] } +crossterm = "0.27.0" +hex = { workspace = true } +http-body-util = "0.1" +httpdate = "1.0" +hyper = { version = "1", features = ["full"] } +hyper-util = { version = "0.1", features = ["full"] } +mpc-shared = { workspace = true } +pgp = "0.13" +postgrest = "1.0" +rand = "0.8.5" +ratatui = "0.27.0" +reqwest = { workspace = true, features = ["json"] } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +thiserror = { workspace = true } throbber-widgets-tui = "0.6" -reqwest = { workspace = true, features = ["json"] } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } -thiserror = { workspace = true } -tokio = { workspace = true, features = ["full"] } -tokio-util = "0.7" \ No newline at end of file +tokio = { workspace = true, features = ["full"] } +tokio-util = "0.7" diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 61944d0708..91eef09b9f 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -15,7 +15,7 @@ use std::{ use async_sqlite::{rusqlite::OpenFlags, JournalMode, PoolBuilder}; use base64::{prelude::BASE64_STANDARD, Engine}; -use crossterm::event; +use crossterm::{cursor::Show, event, execute}; use http_body_util::{BodyExt, Full}; use httpdate::parse_http_date; use hyper::{ @@ -24,7 +24,13 @@ use hyper::{ Method, }; use hyper_util::{rt::TokioIo, server::graceful::GracefulShutdown}; -use mpc_shared::{phase2_contribute, supabase::SupabaseMPCApi, CONTRIBUTION_SIZE}; +use mpc_shared::{phase2_contribute, signed_message, supabase::SupabaseMPCApi, CONTRIBUTION_SIZE}; +use pgp::{ + cleartext::CleartextSignedMessage, + crypto::{hash::HashAlgorithm, sym::SymmetricKeyAlgorithm}, + types::SecretKeyTrait, + ArmorOptions, Deserializable, KeyType, SecretKeyParamsBuilder, SignedSecretKey, +}; use ratatui::{backend::CrosstermBackend, Terminal, Viewport}; use reqwest::header::LOCATION; use serde::Deserialize; @@ -40,6 +46,8 @@ use types::Status; const ENDPOINT: &str = "/contribute"; +const CONTRIB_SK_PATH: &str = "contrib_key.sk.asc"; + #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] struct Contribute { @@ -49,6 +57,7 @@ struct Contribute { api_key: String, contributor_id: String, payload_id: String, + user_email: Option, } #[derive(thiserror::Error, Debug, Clone)] @@ -71,6 +80,25 @@ type BoxBody = http_body_util::combinators::BoxBody; type DynError = Box; +fn generate_pgp_key(email: String) -> SignedSecretKey { + let mut key_params = SecretKeyParamsBuilder::default(); + key_params + .key_type(KeyType::EdDSA) + .can_certify(false) + .can_sign(true) + .can_encrypt(false) + .primary_user_id(email) + .preferred_symmetric_algorithms( + [SymmetricKeyAlgorithm::AES256].to_vec().try_into().unwrap(), + ) + .preferred_hash_algorithms([HashAlgorithm::None].to_vec().try_into().unwrap()); + let secret_key_params = key_params.build().expect("impossible"); + let secret_key = secret_key_params.generate().expect("impossible"); + let passwd_fn = || String::new(); + let signed_secret_key = secret_key.sign(passwd_fn).expect("impossible"); + signed_secret_key +} + async fn contribute( tx_status: Sender, Contribute { @@ -80,8 +108,26 @@ async fn contribute( api_key, contributor_id, payload_id, + user_email, }: Contribute, ) -> Result<(), DynError> { + let mut secret_key = if let Ok(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { + SignedSecretKey::from_armor_single::<&[u8]>( + tokio::fs::read(CONTRIB_SK_PATH).await?.as_ref(), + ) + .expect("impossible") + .0 + } else { + let secret_key = generate_pgp_key(user_email.unwrap_or("placeholder@test.com".into())); + tokio::fs::write( + CONTRIB_SK_PATH, + secret_key + .to_armored_bytes(ArmorOptions::default()) + .expect("impossible"), + ) + .await?; + secret_key + }; let client = SupabaseMPCApi::new(supabase_project.clone(), api_key, jwt); let current_contributor = client .current_contributor() @@ -134,6 +180,32 @@ async fn contribute( tokio::fs::write(&payload_id, &phase2_contribution).await?; phase2_contribution }; + + // ------------------------ + // Sign and submits the sig + // Gnark phase2 contribution appends the sha256 hash at the end + let phase2_contribution_hash = &phase2_contribution[phase2_contribution.len() - 32..]; + let signature = CleartextSignedMessage::sign( + &signed_message(&payload_id, &hex::encode(phase2_contribution_hash)), + &mut secret_key, + || String::new(), + ) + .expect("impossible"); + let public_key = secret_key + .public_key() + .sign(&secret_key, || String::new()) + .expect("impossible") + .to_armored_bytes(ArmorOptions::default()) + .expect("impossible"); + client + .insert_contribution_signature( + current_contributor.id, + public_key, + signature + .to_armored_bytes(ArmorOptions::default()) + .expect("impossible"), + ) + .await?; let pool = PoolBuilder::new() .path("db.sqlite3") .flags( @@ -219,9 +291,8 @@ async fn contribute( let expire_timestamp = expire.duration_since(UNIX_EPOCH)?.as_secs(); let location_clone = location.clone(); pool.conn(move |conn| { - let mut stmt = conn.prepare( - "INSERT INTO resumable_upload (location, expire) VALUES (?, ?)", - )?; + let mut stmt = + conn.prepare("INSERT INTO resumable_upload (location, expire) VALUES (?, ?)")?; let r = stmt.execute((location_clone, expire_timestamp))?; assert!(r == 1); Ok(()) @@ -467,8 +538,9 @@ async fn main() -> Result<(), DynError> { )?; input_and_status_handling(status, rx_status, tx_ui).await; ui::run_ui(&mut terminal, rx_ui).await?; - crossterm::terminal::disable_raw_mode()?; terminal.clear()?; + crossterm::terminal::disable_raw_mode()?; + let _ = execute!(io::stdout(), Show); token.cancel(); handle.await.expect("impossible"); std::process::exit(0); diff --git a/mpc/client/src/types.rs b/mpc/client/src/types.rs index c224eb7452..cb7d3073ed 100644 --- a/mpc/client/src/types.rs +++ b/mpc/client/src/types.rs @@ -1,7 +1,6 @@ use serde::Serialize; -#[derive(PartialEq, Eq, Debug, Clone, Serialize)] -#[serde(rename_all = "camelCase")] +#[derive(PartialEq, Eq, Debug, Clone)] pub enum Status { Idle, Initializing, @@ -15,3 +14,24 @@ pub enum Status { Failed(String), Successful, } + +impl Serialize for Status { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(match self { + Status::Idle => "idle", + Status::Initializing => "initializing", + Status::DownloadStarted(_) => "downloadStarted", + Status::Downloading(_, _) => "downloading", + Status::DownloadEnded(_) => "downloadEnded", + Status::ContributionStarted => "contributionStarted", + Status::ContributionEnded => "contributionEnded", + Status::UploadStarted(_) => "uploadStarted", + Status::UploadEnded(_) => "uploadEnded", + Status::Failed(_) => "failed", + Status::Successful => "successful", + }) + } +} diff --git a/mpc/coordinator/Cargo.toml b/mpc/coordinator/Cargo.toml index 55eb53abe0..50c8f5cd51 100644 --- a/mpc/coordinator/Cargo.toml +++ b/mpc/coordinator/Cargo.toml @@ -7,7 +7,9 @@ version = "0.1.0" async-sqlite = "0.2.2" clap = { version = "4.5", features = ["derive"] } futures.workspace = true +hex = { workspace = true } mpc-shared = { workspace = true } +pgp = "0.13" postgrest = "1.0" reqwest = { workspace = true, features = ["json"] } serde_json = { workspace = true } diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 68bce68692..78a82cd97b 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -3,6 +3,30 @@ BEGIN; -- Default bucket for contributions upload INSERT INTO storage.buckets(id, name, public) VALUES('contributions', 'contributions', false); +CREATE TABLE wallet_address( + id UUID PRIMARY KEY, + wallet TEXT NOT NULL +); + +ALTER TABLE wallet_address ENABLE ROW LEVEL SECURITY; +ALTER TABLE wallet_address ADD FOREIGN KEY (id) REFERENCES auth.users(id); + +CREATE POLICY view_self + ON wallet_address + FOR SELECT + TO authenticated + USING ( + (SELECT auth.uid()) = id + ); + +CREATE POLICY allow_insert_self + ON wallet_address + FOR INSERT + TO authenticated + WITH CHECK ( + (SELECT auth.uid()) = id + ); + CREATE TABLE waitlist( id UUID PRIMARY KEY ); @@ -10,6 +34,14 @@ CREATE TABLE waitlist( ALTER TABLE waitlist ENABLE ROW LEVEL SECURITY; ALTER TABLE waitlist ADD FOREIGN KEY (id) REFERENCES auth.users(id); +CREATE POLICY view_self + ON waitlist + FOR SELECT + TO authenticated + USING ( + (SELECT auth.uid()) = id + ); + CREATE POLICY allow_insert_self ON waitlist FOR INSERT @@ -235,19 +267,17 @@ ALTER VIEW current_contribution_average SET (security_invoker = on); -- Current contributor is the highest score in the queue with the contribution -- not done yet and it's status expired without payload submitted. CREATE OR REPLACE VIEW current_contributor_id AS - SELECT q.id - FROM queue q - WHERE q.score = ( - SELECT MAX(qq.score) - FROM queue qq - WHERE NOT EXISTS ( - SELECT c.id FROM contribution c WHERE c.id = qq.id - ) AND ( - EXISTS (SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire > now()) - OR - EXISTS (SELECT cs.id FROM contribution_submitted cs WHERE cs.id = qq.id) - ) - ); + SELECT qq.id + FROM queue qq + WHERE NOT EXISTS ( + SELECT c.id FROM contribution c WHERE c.id = qq.id + ) AND ( + EXISTS (SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire > now()) + OR + EXISTS (SELECT cs.id FROM contribution_submitted cs WHERE cs.id = qq.id) + ) + ORDER BY qq.score DESC + LIMIT 1; ALTER VIEW current_contributor_id SET (security_invoker = on); @@ -289,15 +319,9 @@ ALTER VIEW current_payload_id SET (security_invoker = on); CREATE OR REPLACE PROCEDURE set_next_contributor() AS $$ BEGIN IF (SELECT COUNT(*) FROM public.current_contributor_id) = 0 THEN - INSERT INTO public.contribution_status(id) SELECT q.id FROM public.queue q WHERE q.score = ( - SELECT MAX(qq.score) - FROM public.queue qq - WHERE NOT EXISTS ( - SELECT c.id FROM public.contribution c WHERE c.id = qq.id - ) AND NOT EXISTS ( - SELECT cs.expire FROM public.contribution_status cs WHERE cs.id = qq.id AND cs.expire < now() - ) - ); + INSERT INTO public.contribution_status(id) + SELECT cq.id + FROM public.current_queue cq LIMIT 1; END IF; END $$ LANGUAGE plpgsql SET search_path = ''; @@ -408,6 +432,47 @@ ON storage.objects FOR EACH ROW EXECUTE FUNCTION set_contribution_submitted_trigger(); +----------------- +-- Attestation -- +----------------- +CREATE TABLE contribution_signature( + id uuid PRIMARY KEY, + public_key text NOT NULL, + signature text NOT NULL +); + +ALTER TABLE contribution_signature ENABLE ROW LEVEL SECURITY; +ALTER TABLE contribution_signature ADD FOREIGN KEY (id) REFERENCES contribution_status(id); + +CREATE POLICY view_self + ON contribution_signature + FOR SELECT + TO authenticated + USING ( + (SELECT auth.uid()) = id + ); + +CREATE POLICY allow_insert_self + ON contribution_signature + FOR INSERT + TO authenticated + WITH CHECK ( + (SELECT auth.uid()) = id + ); + + + +CREATE OR REPLACE VIEW current_user_state AS ( + SELECT (EXISTS (SELECT * FROM waitlist WHERE id = (SELECT auth.id)) AS in_waitlist +); + +ALTER VIEW current_user_state SET (security_invoker = off); + + +---------- +-- CRON -- +---------- + -- Will rotate the current contributor if the slot expired without any contribution submitted SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index e5d4ad2466..c0c24ca251 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -1,5 +1,6 @@ use clap::{Parser, Subcommand}; -use mpc_shared::{phase2_verify, supabase::SupabaseMPCApi}; +use mpc_shared::{phase2_verify, signed_message, supabase::SupabaseMPCApi}; +use pgp::{cleartext::CleartextSignedMessage, Deserializable, SignedPublicKey}; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] @@ -26,6 +27,8 @@ enum Error { CurrentPayloadNotFound, #[error("next payload not found.")] NextPayloadNotFound, + #[error("contributor signature not found")] + ContributorSignatureNotFound, } #[tokio::main] @@ -71,11 +74,58 @@ async fn main() -> Result<(), Box> { .contributor_payload(¤t_contributor.id) .await? .ok_or(Error::NextPayloadNotFound)?; - let payload_next = client + let next_payload = client .download_payload(&next_payload.id, &next_payload.id, progress) .await?; + println!("verifying signature..."); + let contribution_signature = client + .contributor_signature(¤t_contributor.id) + .await? + .ok_or(Error::ContributorSignatureNotFound)?; + let signed_public_key = SignedPublicKey::from_armor_single::<&[u8]>( + hex::decode(contribution_signature.public_key) + .expect("impossible") + .as_ref(), + ) + .expect("impossible") + .0; + + // Last bytes are the sh256 of the whole contrib + let next_payload_hash = &next_payload[&next_payload.len() - 32..]; + + let public_key_is_valid = signed_public_key.verify().is_ok(); + if !public_key_is_valid { + println!("public key is invalid"); + } + + let raw_signature = + hex::decode(&contribution_signature.signature).expect("impossible"); + let signature = CleartextSignedMessage::from_armor::<&[u8]>(raw_signature.as_ref()) + .expect("impossible") + .0; + + let signature_matches = signature.signed_text() + == signed_message(¤t_payload.id, &hex::encode(next_payload_hash)); + if !signature_matches { + println!("signature signed text mismatch"); + } + + let signature_is_valid = signature.verify(&signed_public_key).is_ok(); + if !signature_is_valid { + println!("contribution signature is invalid"); + } + println!("verifying payload..."); - if phase2_verify(&payload_current, &payload_next).is_ok() { + let contribution_is_valid = phase2_verify(&payload_current, &next_payload).is_ok(); + if !contribution_is_valid { + println!("contribution is invalid"); + } + + if public_key_is_valid + && signature_matches + && signature_is_valid + && contribution_is_valid + { println!("verification succeeded."); client .insert_contribution(current_contributor.id.clone(), true) diff --git a/mpc/shared/Cargo.toml b/mpc/shared/Cargo.toml index c642afe909..c3da4337b0 100644 --- a/mpc/shared/Cargo.toml +++ b/mpc/shared/Cargo.toml @@ -4,9 +4,10 @@ name = "mpc-shared" version = "0.1.0" [dependencies] -serde = { workspace = true, features = ["derive"] } -thiserror = { workspace = true } -postgrest = "1.0" -reqwest = { workspace = true, features = ["json"] } -serde_json = { workspace = true } -tokio = { workspace = true, features = ["full"] } \ No newline at end of file +hex = { workspace = true, features = ["alloc"] } +postgrest = "1.0" +reqwest = { workspace = true, features = ["json"] } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full"] } diff --git a/mpc/shared/src/lib.rs b/mpc/shared/src/lib.rs index c3618fb265..f7fa9f19db 100644 --- a/mpc/shared/src/lib.rs +++ b/mpc/shared/src/lib.rs @@ -1,5 +1,5 @@ -pub mod types; pub mod supabase; +pub mod types; use std::ffi::{c_char, c_int}; @@ -83,3 +83,7 @@ pub fn phase2_verify( } } } + +pub fn signed_message(payload_id: &str, payload_hash: &str) -> String { + format!("0______0 - {} - {}", payload_id, payload_hash) +} diff --git a/mpc/shared/src/supabase.rs b/mpc/shared/src/supabase.rs index 4996a7353a..d898d1aa3a 100644 --- a/mpc/shared/src/supabase.rs +++ b/mpc/shared/src/supabase.rs @@ -3,12 +3,12 @@ use std::{future::Future, io::SeekFrom, str::FromStr}; use postgrest::Postgrest; use reqwest::{ header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_LENGTH, RANGE}, - ClientBuilder, + ClientBuilder, StatusCode, }; use tokio::io::{AsyncSeekExt, AsyncWriteExt}; use crate::{ - types::{Contribution, ContributorId, PayloadId}, + types::{Contribution, ContributionSignature, ContributorId, PayloadId}, CONTRIBUTION_SIZE, }; @@ -133,6 +133,52 @@ impl SupabaseMPCApi { Ok(()) } + pub async fn insert_contribution_signature( + &self, + contributor_id: String, + public_key: Vec, + signature: Vec, + ) -> Result<(), DynError> { + if let Err(e) = self + .client + .from("contribution_signature") + .insert(serde_json::to_string(&ContributionSignature { + id: contributor_id, + public_key: hex::encode(&public_key), + signature: hex::encode(&signature), + })?) + .execute() + .await? + .error_for_status() + { + // Conflict means we already have an entry. + // If network drops or something we must allow this to happen. + if e.status() == Some(StatusCode::CONFLICT) { + return Ok(()); + } else { + return Err(e.into()); + } + } + Ok(()) + } + + pub async fn contributor_signature( + &self, + contributor_id: &str, + ) -> Result, DynError> { + Ok(self + .client + .from("contribution_signature") + .eq("id", &contributor_id) + .select("*") + .execute() + .await? + .json::>() + .await? + .first() + .cloned()) + } + pub async fn download_payload( &self, payload_id: &str, diff --git a/mpc/shared/src/types.rs b/mpc/shared/src/types.rs index 72bdf1ba1f..67806140a8 100644 --- a/mpc/shared/src/types.rs +++ b/mpc/shared/src/types.rs @@ -16,3 +16,10 @@ pub struct Contribution { pub id: String, pub success: bool, } + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct ContributionSignature { + pub id: String, + pub public_key: String, + pub signature: String, +} From ddadddc2a3b0d9c0d97d6f35ae0fb810ed489fa7 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 13 Sep 2024 22:16:11 +0200 Subject: [PATCH 24/48] fix(galois): non static after go upgrade --- galoisd/cmd/galoisd/cmd/phase1_init.go | 2 +- galoisd/cmd/galoisd/cmd/phase2_extract.go | 10 +++++----- galoisd/galoisd.nix | 5 ----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/galoisd/cmd/galoisd/cmd/phase1_init.go b/galoisd/cmd/galoisd/cmd/phase1_init.go index bb20d0719f..386a78b3e6 100644 --- a/galoisd/cmd/galoisd/cmd/phase1_init.go +++ b/galoisd/cmd/galoisd/cmd/phase1_init.go @@ -852,7 +852,7 @@ func convertPtauToPhase1(ptau Ptau) (phase1 mpc.Phase1, err error) { } } - phase1 = mpc.InitPhase1(int(ptau.Header.Power)); + phase1 = mpc.InitPhase1(int(ptau.Header.Power)) phase1.Parameters.G1.Tau = tauG1 phase1.Parameters.G1.AlphaTau = alphaTauG1 diff --git a/galoisd/cmd/galoisd/cmd/phase2_extract.go b/galoisd/cmd/galoisd/cmd/phase2_extract.go index d58438b9cf..6366d20f5a 100644 --- a/galoisd/cmd/galoisd/cmd/phase2_extract.go +++ b/galoisd/cmd/galoisd/cmd/phase2_extract.go @@ -18,31 +18,31 @@ func Phase2ExtractCmd() *cobra.Command { var r1cs bn254.R1CS err := readFrom(r1csPath, &r1cs) if err != nil { - return fmt.Errorf("failed to read r1cs: %v", err); + return fmt.Errorf("failed to read r1cs: %v", err) } phase1Path := args[1] var srs1 mpc.Phase1 err = readFrom(phase1Path, &srs1) if err != nil { - return fmt.Errorf("failed to read phase1: %v", err); + return fmt.Errorf("failed to read phase1: %v", err) } phase2Path := args[2] var srs2 mpc.Phase2 err = readFrom(phase2Path, &srs2) if err != nil { - return fmt.Errorf("failed to read phase2: %v", err); + return fmt.Errorf("failed to read phase2: %v", err) } phase2EvalsPath := args[3] var evals mpc.Phase2Evaluations err = readFrom(phase2EvalsPath, &evals) if err != nil { - return fmt.Errorf("failed to read phase2 evals: %v", err); + return fmt.Errorf("failed to read phase2 evals: %v", err) } pk, vk := mpc.ExtractKeys(&r1cs, &srs1, &srs2, &evals) pkOutput := args[4] err = saveTo(pkOutput, &pk) if err != nil { - return fmt.Errorf("failed to write pk: %v", err); + return fmt.Errorf("failed to write pk: %v", err) } vkOutput := args[5] return saveTo(vkOutput, &vk) diff --git a/galoisd/galoisd.nix b/galoisd/galoisd.nix index 600dace88a..5650d42828 100644 --- a/galoisd/galoisd.nix +++ b/galoisd/galoisd.nix @@ -30,12 +30,7 @@ meta = { mainProgram = "galoisd"; }; tags = [ "binary" ]; } // (if pkgs.stdenv.isLinux then { - nativeBuildInputs = [ pkgs.musl ]; CGO_ENABLED = 0; - ldflags = [ - "-linkmode external" - "-extldflags '-static -L${pkgs.musl}/lib -s -w'" - ]; } else { })); From 339a3676166d76fb16332b92ced079e155a12579 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Sun, 15 Sep 2024 17:16:23 +0200 Subject: [PATCH 25/48] feat(mpc): join_queue for waitlist and current_user_state --- mpc/coordinator/database.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 78a82cd97b..ea70a52683 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -148,7 +148,7 @@ BEGIN IF (public.open_to_public()) THEN INSERT INTO public.queue(id) VALUES ((SELECT auth.uid())); ELSE - RAISE EXCEPTION 'not_open_yet'; + INSERT INTO public.waitlist(id) VALUES ((SELECT auth.uid())); END IF; ELSE PERFORM public.redeem(code_id); @@ -460,15 +460,15 @@ CREATE POLICY allow_insert_self (SELECT auth.uid()) = id ); - - CREATE OR REPLACE VIEW current_user_state AS ( - SELECT (EXISTS (SELECT * FROM waitlist WHERE id = (SELECT auth.id)) AS in_waitlist + SELECT + (EXISTS (SELECT * FROM waitlist WHERE id = (SELECT auth.uid()))) AS in_waitlist, + (EXISTS (SELECT * FROM code WHERE user_id = (SELECT auth.uid()))) AS has_redeemed, + (EXISTS (SELECT * FROM queue WHERE id = (SELECT auth.uid()))) AS in_queue ); ALTER VIEW current_user_state SET (security_invoker = off); - ---------- -- CRON -- ---------- From cd826e90245b361c9fd4b7a52fd5e44eb05dccdc Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 18 Sep 2024 15:42:04 +0200 Subject: [PATCH 26/48] feat(mpc): better handling of sqlite and tracing on coordinator --- Cargo.lock | 2 + mpc/client/src/main.rs | 4 +- mpc/coordinator/Cargo.toml | 2 + mpc/coordinator/database.sql | 28 ++++++-- mpc/coordinator/src/main.rs | 130 ++++++++++++++++++++++++++++++----- mpc/shared/src/lib.rs | 4 +- mpc/shared/src/types.rs | 14 ++++ 7 files changed, 156 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d32b19425e..e3f1b19547 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7644,6 +7644,8 @@ dependencies = [ "quote", "syn 2.0.77", "tokio", + "tracing", + "tracing-subscriber", ] [[package]] diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 91eef09b9f..5da327c1d5 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -186,7 +186,7 @@ async fn contribute( // Gnark phase2 contribution appends the sha256 hash at the end let phase2_contribution_hash = &phase2_contribution[phase2_contribution.len() - 32..]; let signature = CleartextSignedMessage::sign( - &signed_message(&payload_id, &hex::encode(phase2_contribution_hash)), + &signed_message(¤t_payload.id, &payload_id, &hex::encode(phase2_contribution_hash)), &mut secret_key, || String::new(), ) @@ -215,6 +215,7 @@ async fn contribute( | OpenFlags::SQLITE_OPEN_URI, ) .journal_mode(JournalMode::Wal) + .num_conns(1) .open() .await?; pool.conn(|conn| { @@ -350,6 +351,7 @@ async fn contribute( .send(Status::UploadEnded(payload_id.clone())) .expect("impossible"); } + pool.close().await?; Ok(()) } diff --git a/mpc/coordinator/Cargo.toml b/mpc/coordinator/Cargo.toml index 50c8f5cd51..cf5368fd7b 100644 --- a/mpc/coordinator/Cargo.toml +++ b/mpc/coordinator/Cargo.toml @@ -15,3 +15,5 @@ reqwest = { workspace = true, features = ["json"] } serde_json = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true, features = ["env-filter", "json", "tracing-log"] } \ No newline at end of file diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index ea70a52683..dc76233ef7 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -119,7 +119,8 @@ EXECUTE FUNCTION set_initial_score_trigger(); ----------- CREATE TABLE code ( id text PRIMARY KEY, - user_id uuid DEFAULT NULL + user_id uuid DEFAULT NULL, + display_name text NOT NULL DEFAULT ('John Doe') ); ALTER TABLE code ENABLE ROW LEVEL SECURITY; @@ -127,7 +128,7 @@ ALTER TABLE code ADD FOREIGN KEY (user_id) REFERENCES auth.users(id); CREATE UNIQUE INDEX idx_code_user_id ON code(user_id); CREATE OR REPLACE FUNCTION redeem(code_id text) RETURNS void AS $$ - DECLARE +DECLARE redeemed_code public.code%ROWTYPE := NULL; BEGIN UPDATE public.code c @@ -444,12 +445,12 @@ CREATE TABLE contribution_signature( ALTER TABLE contribution_signature ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution_signature ADD FOREIGN KEY (id) REFERENCES contribution_status(id); -CREATE POLICY view_self +CREATE POLICY view_all ON contribution_signature FOR SELECT TO authenticated USING ( - (SELECT auth.uid()) = id + true ); CREATE POLICY allow_insert_self @@ -462,13 +463,26 @@ CREATE POLICY allow_insert_self CREATE OR REPLACE VIEW current_user_state AS ( SELECT - (EXISTS (SELECT * FROM waitlist WHERE id = (SELECT auth.uid()))) AS in_waitlist, - (EXISTS (SELECT * FROM code WHERE user_id = (SELECT auth.uid()))) AS has_redeemed, - (EXISTS (SELECT * FROM queue WHERE id = (SELECT auth.uid()))) AS in_queue + (EXISTS (SELECT * FROM public.waitlist WHERE id = (SELECT auth.uid()))) AS in_waitlist, + (EXISTS (SELECT * FROM public.code WHERE user_id = (SELECT auth.uid()))) AS has_redeemed, + (EXISTS (SELECT * FROM public.queue WHERE id = (SELECT auth.uid()))) AS in_queue, + (COALESCE((SELECT display_name FROM public.code WHERE user_id = (SELECT auth.uid())), (SELECT raw_user_meta_data->>'name' FROM auth.users u WHERE u.id = (SELECT auth.uid())))) AS display_name ); ALTER VIEW current_user_state SET (security_invoker = off); +CREATE OR REPLACE VIEW users_contribution AS ( + SELECT c.id, u.raw_user_meta_data->>'user_name' AS user_name, u.raw_user_meta_data->>'avatar_url' AS avatar_url, c.seq, q.payload_id, cs.public_key, cs.signature + FROM public.contribution c + INNER JOIN public.queue q ON (c.id = q.id) + INNER JOIN public.contribution_signature cs ON (c.id = cs.id) + INNER JOIN auth.users u ON (c.id = u.id) + WHERE c.success + ORDER BY c.seq ASC +); + +ALTER VIEW users_contribution SET (security_invoker = on); + ---------- -- CRON -- ---------- diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index c0c24ca251..ee3d6e7ec2 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -1,14 +1,47 @@ +use std::str::FromStr; + use clap::{Parser, Subcommand}; use mpc_shared::{phase2_verify, signed_message, supabase::SupabaseMPCApi}; use pgp::{cleartext::CleartextSignedMessage, Deserializable, SignedPublicKey}; +use tracing::{debug, error, info, warn}; +use tracing_subscriber::EnvFilter; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] struct Args { + #[arg( + global = true, + short = 'f', + long, + default_value = "json" + )] + log_format: LogFormat, #[command(subcommand)] command: Command, } +#[derive(Debug, Copy, Clone)] +pub enum LogFormat { + Text, + Json, +} + +#[derive(Debug, thiserror::Error)] +#[error("unknown log format {0}")] +pub struct UnknownLogFormatError(String); + +impl FromStr for LogFormat { + type Err = UnknownLogFormatError; + + fn from_str(s: &str) -> std::result::Result { + match s { + "text" => Ok(Self::Text), + "json" => Ok(Self::Json), + s => Err(UnknownLogFormatError(s.to_owned())), + } + } +} + #[derive(Subcommand, Debug, Clone)] enum Command { Start { @@ -34,12 +67,25 @@ enum Error { #[tokio::main] async fn main() -> Result<(), Box> { let args = Args::parse(); + match args.log_format { + LogFormat::Text => { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .init(); + } + LogFormat::Json => { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .json() + .init(); + } + }; match args.command { Command::Start { url, jwt } => { let client = SupabaseMPCApi::new(url, jwt.clone(), jwt); - let progress = |percent| async move { println!("downloaded: {:.2}%", percent) }; + let progress = |percent| async move { debug!("downloaded: {:.2}%", percent) }; loop { - println!("downloading current payload..."); + info!("downloading current payload..."); let current_payload = client .current_payload() .await? @@ -47,6 +93,7 @@ async fn main() -> Result<(), Box> { let payload_current = client .download_payload(¤t_payload.id, ¤t_payload.id, progress) .await?; + info!(%current_payload, "download current payload."); let current_contributor = { match client .current_contributor() @@ -54,7 +101,7 @@ async fn main() -> Result<(), Box> { .ok_or(Error::ContributorNotFound) { Ok(contributor) => { - println!("awaiting contribution of {}...", &contributor.id); + info!(%contributor, %current_payload, "awaiting contribution of {}...", &contributor.id); if client.contribution_submitted(&contributor.id).await? { contributor } else { @@ -63,27 +110,27 @@ async fn main() -> Result<(), Box> { } } Err(_) => { - println!("awaiting contributor to join queue..."); + warn!("awaiting contributor to join queue..."); tokio::time::sleep(std::time::Duration::from_secs(10)).await; continue; } } }; - println!("detected contribution submission, downloading..."); let next_payload = client .contributor_payload(¤t_contributor.id) .await? .ok_or(Error::NextPayloadNotFound)?; - let next_payload = client + info!(%current_contributor, %current_payload, %next_payload, "dected contribution, downloading..."); + let next_payload_content = client .download_payload(&next_payload.id, &next_payload.id, progress) .await?; - println!("verifying signature..."); + info!(%current_contributor, %current_payload, %next_payload, "verifying signature..."); let contribution_signature = client .contributor_signature(¤t_contributor.id) .await? .ok_or(Error::ContributorSignatureNotFound)?; let signed_public_key = SignedPublicKey::from_armor_single::<&[u8]>( - hex::decode(contribution_signature.public_key) + hex::decode(&contribution_signature.public_key) .expect("impossible") .as_ref(), ) @@ -91,11 +138,18 @@ async fn main() -> Result<(), Box> { .0; // Last bytes are the sh256 of the whole contrib - let next_payload_hash = &next_payload[&next_payload.len() - 32..]; + let next_payload_hash = &next_payload_content[&next_payload_content.len() - 32..]; let public_key_is_valid = signed_public_key.verify().is_ok(); if !public_key_is_valid { - println!("public key is invalid"); + error!( + %current_contributor, + %current_payload, + %next_payload, + %contribution_signature.public_key, + %contribution_signature.signature, + "public key is invalid" + ); } let raw_signature = @@ -105,20 +159,46 @@ async fn main() -> Result<(), Box> { .0; let signature_matches = signature.signed_text() - == signed_message(¤t_payload.id, &hex::encode(next_payload_hash)); + == signed_message( + ¤t_payload.id, + &next_payload.id, + &hex::encode(next_payload_hash), + ); if !signature_matches { - println!("signature signed text mismatch"); + error!( + %current_contributor, + %current_payload, + %next_payload, + %contribution_signature.public_key, + %contribution_signature.signature, + "signature signed text mismatch" + ); } let signature_is_valid = signature.verify(&signed_public_key).is_ok(); if !signature_is_valid { - println!("contribution signature is invalid"); + error!( + %current_contributor, + %current_payload, + %next_payload, + %contribution_signature.public_key, + %contribution_signature.signature, + "contribution signature is invalid" + ); } - println!("verifying payload..."); - let contribution_is_valid = phase2_verify(&payload_current, &next_payload).is_ok(); + info!("verifying payload..."); + let contribution_is_valid = + phase2_verify(&payload_current, &next_payload_content).is_ok(); if !contribution_is_valid { - println!("contribution is invalid"); + error!( + %current_contributor, + %current_payload, + %next_payload, + %contribution_signature.public_key, + %contribution_signature.signature, + "contribution is invalid" + ); } if public_key_is_valid @@ -126,13 +206,27 @@ async fn main() -> Result<(), Box> { && signature_is_valid && contribution_is_valid { - println!("verification succeeded."); + info!( + %current_contributor, + %current_payload, + %next_payload, + %contribution_signature.public_key, + %contribution_signature.signature, + "verification succeeded." + ); client .insert_contribution(current_contributor.id.clone(), true) .await?; tokio::fs::remove_file(¤t_payload.id).await?; } else { - println!("verification failed."); + error!( + %current_contributor, + %current_payload, + %next_payload, + %contribution_signature.public_key, + %contribution_signature.signature, + "verification failed." + ); client .insert_contribution(current_contributor.id.clone(), false) .await?; diff --git a/mpc/shared/src/lib.rs b/mpc/shared/src/lib.rs index f7fa9f19db..b69a463891 100644 --- a/mpc/shared/src/lib.rs +++ b/mpc/shared/src/lib.rs @@ -84,6 +84,6 @@ pub fn phase2_verify( } } -pub fn signed_message(payload_id: &str, payload_hash: &str) -> String { - format!("0______0 - {} - {}", payload_id, payload_hash) +pub fn signed_message(previous_payload_id: &str, next_payload_id: &str, payload_hash: &str) -> String { + format!("0______0 - {} - {} - {}", previous_payload_id, next_payload_id, payload_hash) } diff --git a/mpc/shared/src/types.rs b/mpc/shared/src/types.rs index 67806140a8..ddb899590c 100644 --- a/mpc/shared/src/types.rs +++ b/mpc/shared/src/types.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -5,12 +7,24 @@ pub struct ContributorId { pub id: String, } +impl Display for ContributorId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.id.fmt(f) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct PayloadId { #[serde(rename = "payload_id")] pub id: String, } +impl Display for PayloadId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.id.fmt(f) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Contribution { pub id: String, From 1fc676225328ce204fa7ad03d2fd847e207be9ff Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 18 Sep 2024 16:01:39 +0200 Subject: [PATCH 27/48] fix: revert changes to app --- app/src/routes/ceremony/+page.svelte | 195 --------------------------- 1 file changed, 195 deletions(-) delete mode 100644 app/src/routes/ceremony/+page.svelte diff --git a/app/src/routes/ceremony/+page.svelte b/app/src/routes/ceremony/+page.svelte deleted file mode 100644 index b1cb587985..0000000000 --- a/app/src/routes/ceremony/+page.svelte +++ /dev/null @@ -1,195 +0,0 @@ - - - - Union | Ceremony - - - -
- {#if queuePosition != null} - Queue position: {queuePosition} - {:else} -
- Queue position: -
- {/if} - - {#each messages as message} -
- {@html message} -
- {/each} -
From 4af7ca9dc29eba222dab55e32e710faa116db0d8 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 18 Sep 2024 16:01:53 +0200 Subject: [PATCH 28/48] fix(mpc): spelling and better naming --- mpc/coordinator/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index ee3d6e7ec2..d6d672c6b3 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -120,7 +120,7 @@ async fn main() -> Result<(), Box> { .contributor_payload(¤t_contributor.id) .await? .ok_or(Error::NextPayloadNotFound)?; - info!(%current_contributor, %current_payload, %next_payload, "dected contribution, downloading..."); + info!(%current_contributor, %current_payload, %next_payload, "detected contribution, downloading..."); let next_payload_content = client .download_payload(&next_payload.id, &next_payload.id, progress) .await?; @@ -158,13 +158,13 @@ async fn main() -> Result<(), Box> { .expect("impossible") .0; - let signature_matches = signature.signed_text() + let signed_text_matches = signature.signed_text() == signed_message( ¤t_payload.id, &next_payload.id, &hex::encode(next_payload_hash), ); - if !signature_matches { + if !signed_text_matches { error!( %current_contributor, %current_payload, @@ -202,7 +202,7 @@ async fn main() -> Result<(), Box> { } if public_key_is_valid - && signature_matches + && signed_text_matches && signature_is_valid && contribution_is_valid { From 7c9cd720df46ea01c8c8b59fa8585fb465554002 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 18 Sep 2024 16:12:17 +0200 Subject: [PATCH 29/48] chore: update cargo.lock --- Cargo.lock | 570 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 557 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3f1b19547..43a105c745 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -864,7 +864,7 @@ dependencies = [ "thiserror", "tiny-keccak", "typenum", - "x25519-dalek", + "x25519-dalek 1.2.0", ] [[package]] @@ -1361,6 +1361,18 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash 0.5.0", +] + [[package]] name = "arith" version = "0.2.3" @@ -2306,6 +2318,12 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + [[package]] name = "bitflags" version = "1.3.2" @@ -2441,6 +2459,25 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "blowfish" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" +dependencies = [ + "byteorder", + "cipher", +] + [[package]] name = "blst" version = "0.3.13" @@ -2521,6 +2558,25 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "bstr" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "buffer-redux" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e8acf87c5b9f5897cd3ebb9a327f420e0cae9dd4e5c1d2e36f2c84c571a58f1" +dependencies = [ + "memchr", +] + [[package]] name = "bulletproofs" version = "4.0.0" @@ -2621,6 +2677,16 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" +[[package]] +name = "camellia" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3264e2574e9ef2b53ce6f536dea83a69ac0bc600b762d1523ff83fe07230ce30" +dependencies = [ + "byteorder", + "cipher", +] + [[package]] name = "camino" version = "1.1.6" @@ -2669,12 +2735,36 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cassowary" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" + [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "cast5" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b07d673db1ccf000e90f54b819db9e75a8348d6eb056e9b8ab53231b7a9911" +dependencies = [ + "cipher", +] + +[[package]] +name = "castaway" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.0.90" @@ -2691,6 +2781,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cfb-mode" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "738b8d467867f80a71351933f70461f5b56f24d5c93e0cf216e59229c968d330" +dependencies = [ + "cipher", +] + [[package]] name = "cfg-expr" version = "0.15.7" @@ -2909,6 +3008,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest 0.10.7", +] + [[package]] name = "codespan" version = "0.11.1" @@ -3098,6 +3208,19 @@ dependencies = [ "unionlabs", ] +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if 1.0.0", + "itoa", + "ryu", + "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "concurrent-queue" version = "2.4.0" @@ -3448,6 +3571,12 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +[[package]] +name = "crc24" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd121741cf3eb82c08dd3023eb55bf2665e5f60ec20f89760cf836ae4562e6a0" + [[package]] name = "crc32fast" version = "1.4.0" @@ -3536,6 +3665,31 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +[[package]] +name = "crossterm" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +dependencies = [ + "bitflags 2.5.0", + "crossterm_winapi", + "libc", + "mio 0.8.11", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi 0.3.9", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -4084,6 +4238,15 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "der" version = "0.7.9" @@ -4137,6 +4300,37 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "derive_builder" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38" +dependencies = [ + "darling 0.20.8", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" +dependencies = [ + "derive_builder_core", + "syn 2.0.77", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -4171,6 +4365,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "des" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdd80ce8ce993de27e9f063a444a4d53ce8e8db4c1f00cc03af5ad5a9867a1e" +dependencies = [ + "cipher", +] + [[package]] name = "devnet-compose" version = "0.1.0" @@ -4330,6 +4533,22 @@ dependencies = [ "unionlabs", ] +[[package]] +name = "dsa" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48bc224a9084ad760195584ce5abb3c2c34a225fa312a128ad245a6b412b7689" +dependencies = [ + "digest 0.10.7", + "num-bigint-dig", + "num-traits", + "pkcs8", + "rfc6979", + "sha2 0.10.8", + "signature 2.2.0", + "zeroize", +] + [[package]] name = "dummy-ibc-app" version = "0.1.0" @@ -4356,6 +4575,19 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "eax" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9954fabd903b82b9d7a68f65f97dc96dd9ad368e40ccc907a7c19d53e6bfac28" +dependencies = [ + "aead", + "cipher", + "cmac", + "ctr", + "subtle 2.5.0", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -4494,6 +4726,7 @@ dependencies = [ "ff", "generic-array 0.14.7", "group", + "hkdf 0.12.4", "pem-rfc7468", "pkcs8", "rand_core 0.6.4", @@ -6538,6 +6771,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "idea" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "075557004419d7f2031b8bb7f44bb43e55a83ca7b63076a8fb8fe75753836477" +dependencies = [ + "cipher", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -6768,6 +7010,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "iter-read" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071ed4cc1afd86650602c7b11aa2e1ce30762a1c27193201cb5cee9c6ebb1294" + [[package]] name = "itertools" version = "0.10.5" @@ -7549,6 +7797,18 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + [[package]] name = "mio" version = "1.0.2" @@ -7644,8 +7904,6 @@ dependencies = [ "quote", "syn 2.0.77", "tokio", - "tracing", - "tracing-subscriber", ] [[package]] @@ -8055,6 +8313,65 @@ dependencies = [ "triomphe", ] +[[package]] +name = "mpc-client" +version = "0.1.0" +dependencies = [ + "async-sqlite", + "base64 0.21.7", + "clap 4.5.4", + "crossterm", + "hex", + "http-body-util", + "httpdate", + "hyper 1.3.1", + "hyper-util", + "mpc-shared", + "pgp", + "postgrest", + "rand 0.8.5", + "ratatui", + "reqwest 0.11.27", + "serde", + "serde_json", + "thiserror", + "throbber-widgets-tui", + "tokio", + "tokio-util", +] + +[[package]] +name = "mpc-coordinator" +version = "0.1.0" +dependencies = [ + "async-sqlite", + "clap 4.5.4", + "futures", + "hex", + "mpc-shared", + "pgp", + "postgrest", + "reqwest 0.11.27", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-subscriber 0.3.18", +] + +[[package]] +name = "mpc-shared" +version = "0.1.0" +dependencies = [ + "hex", + "postgrest", + "reqwest 0.11.27", + "serde", + "serde_json", + "thiserror", + "tokio", +] + [[package]] name = "multer" version = "3.1.0" @@ -8253,7 +8570,7 @@ dependencies = [ "proc-macro2", "quote", "strum 0.26.2", - "strum_macros 0.26.2", + "strum_macros 0.26.4", "syn 2.0.77", ] @@ -8270,7 +8587,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.2", - "strum_macros 0.26.2", + "strum_macros 0.26.4", "syn 2.0.77", ] @@ -8444,6 +8761,7 @@ dependencies = [ "num-iter", "num-traits", "rand 0.8.5", + "serde", "smallvec", "zeroize", ] @@ -8584,6 +8902,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "ocb3" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c196e0276c471c843dd5777e7543a36a298a4be942a2a688d8111cd43390dedb" +dependencies = [ + "aead", + "cipher", + "ctr", + "subtle 2.5.0", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -8739,6 +9069,32 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "p384" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2 0.10.8", +] + +[[package]] +name = "p521" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" +dependencies = [ + "base16ct", + "ecdsa", + "elliptic-curve", + "primeorder", + "rand_core 0.6.4", + "sha2 0.10.8", +] + [[package]] name = "pairing" version = "0.23.0" @@ -8867,6 +9223,17 @@ dependencies = [ "subtle 2.5.0", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle 2.5.0", +] + [[package]] name = "pasta_curves" version = "0.5.1" @@ -8938,7 +9305,7 @@ checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", "hmac 0.12.1", - "password-hash", + "password-hash 0.4.2", "sha2 0.10.8", ] @@ -9093,6 +9460,70 @@ dependencies = [ "tracing", ] +[[package]] +name = "pgp" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6c842436d5fa2b59eac1e9b3d142b50bfff99c1744c816b1f4c2ac55a20754" +dependencies = [ + "aes", + "aes-gcm", + "argon2", + "base64 0.22.1", + "bitfield", + "block-padding 0.3.3", + "blowfish", + "bstr", + "buffer-redux", + "byteorder", + "camellia", + "cast5", + "cfb-mode", + "chrono", + "cipher", + "const-oid", + "crc24", + "curve25519-dalek 4.1.3", + "derive_builder", + "des", + "digest 0.10.7", + "dsa", + "eax", + "ecdsa", + "ed25519-dalek 2.1.1", + "elliptic-curve", + "flate2", + "generic-array 0.14.7", + "hex", + "hkdf 0.12.4", + "idea", + "iter-read", + "k256", + "log", + "md-5", + "nom", + "num-bigint-dig", + "num-traits", + "num_enum", + "ocb3", + "p256", + "p384", + "p521", + "rand 0.8.5", + "ripemd", + "rsa", + "sha1", + "sha1-checked", + "sha2 0.10.8", + "sha3 0.10.8", + "signature 2.2.0", + "smallvec", + "thiserror", + "twofish", + "x25519-dalek 2.0.1", + "zeroize", +] + [[package]] name = "pharos" version = "0.5.3" @@ -9409,6 +9840,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "postgrest" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a966c650b47a064e7082170b4be74fca08c088d893244fc4b70123e3c1f3ee7" +dependencies = [ + "reqwest 0.11.27", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -10011,6 +10451,27 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "ratatui" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" +dependencies = [ + "bitflags 2.5.0", + "cassowary", + "compact_str", + "crossterm", + "itertools 0.13.0", + "lru 0.12.3", + "paste", + "stability", + "strum 0.26.2", + "strum_macros 0.26.4", + "unicode-segmentation", + "unicode-truncate", + "unicode-width", +] + [[package]] name = "raw-cpuid" version = "11.1.0" @@ -11210,6 +11671,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1-checked" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89f599ac0c323ebb1c6082821a54962b839832b03984598375bff3975b804423" +dependencies = [ + "digest 0.10.7", + "sha1", +] + [[package]] name = "sha2" version = "0.8.2" @@ -11287,6 +11758,27 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio 0.8.11", + "signal-hook", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -11714,6 +12206,16 @@ dependencies = [ "unionlabs", ] +[[package]] +name = "stability" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" +dependencies = [ + "quote", + "syn 2.0.77", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -11827,7 +12329,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] @@ -11858,11 +12360,11 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", @@ -12272,6 +12774,16 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "throbber-widgets-tui" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685391f5e78b08989c1014f5a0edddf6751e0726b6a8dd1bdcc98d05921b19b6" +dependencies = [ + "rand 0.8.5", + "ratatui", +] + [[package]] name = "tidy" version = "0.1.0" @@ -12399,7 +12911,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -12957,6 +13469,15 @@ dependencies = [ "utf-8", ] +[[package]] +name = "twofish" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78e83a30223c757c3947cd144a31014ff04298d8719ae10d03c31c0448c8013" +dependencies = [ + "cipher", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -13178,11 +13699,22 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unicode-truncate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" +dependencies = [ + "itertools 0.13.0", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -14308,6 +14840,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek 4.1.3", + "rand_core 0.6.4", + "serde", + "zeroize", +] + [[package]] name = "yaml-rust" version = "0.4.5" From 9b93fc1d6060e5e9783c28e9207c6be5baf94245 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 18 Sep 2024 16:39:34 +0200 Subject: [PATCH 30/48] chore: spelling & fmt --- Cargo.toml | 2 +- dictionary.txt | 34 ++++++++++++++++++++++++++++++++++ mpc/client/src/main.rs | 6 +++++- mpc/coordinator/Cargo.toml | 24 ++++++++++++------------ mpc/coordinator/database.sql | 4 ++-- mpc/coordinator/src/main.rs | 7 +------ mpc/shared/src/lib.rs | 11 +++++++++-- 7 files changed, 64 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 17a29f8540..bc9a4b80db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -133,9 +133,9 @@ ics23 = { path = "lib/ics23", default-features = false linea-verifier = { path = "lib/linea-verifier", default-features = false } linea-zktrie = { path = "lib/linea-zktrie", default-features = false } macros = { path = "lib/macros", default-features = false } -mpc-shared = { path = "mpc/shared", default-features = false } move-bindgen = { path = "tools/move-bindgen", default-features = false } move-bindgen-derive = { path = "lib/move-bindgen-derive", default-features = false } +mpc-shared = { path = "mpc/shared", default-features = false } pg-queue = { path = "lib/pg-queue", default-features = false } poseidon-rs = { path = "lib/poseidon-rs", default-features = false } protos = { path = "generated/rust/protos", default-features = false } diff --git a/dictionary.txt b/dictionary.txt index 4bac9974c2..f993ac1445 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -33,6 +33,7 @@ Celestia Celestine Certus Chainer +Cleartext Cleper Codehash Coeff @@ -46,6 +47,7 @@ Counterparty Cpath Cpolygon Creds +Crossterm Cryptopunkssvg Csvg Cypherpunk @@ -62,7 +64,9 @@ ECTO Edgi EigenLayer Embedder +Evals F1bonacc1 +FFLONK FLUSHCOMPLETE Fatalf Feegrant @@ -76,6 +80,7 @@ Fsvg Fuga Fwww GOARCH +GOBIN GOPATH GOPRIVATE Getenv @@ -150,6 +155,7 @@ PINGPONG PRECOMMIT PREVOTE PROTOC +PTAU Parameterizable Paramspace Partset @@ -158,13 +164,16 @@ Pedersen Phasellus PoisonPhang Polkadot +Postgrest Prefixer Protobuf Proxiable Pruijs +Ptau QUMGLDJ Quickstart Qyby +ROWTYPE RUSTFLAGS Recvs Redelegate @@ -199,6 +208,7 @@ Subdemom Sublist Subo Subtrie +TIMSTAMPTZ TOCTOU Tada Tempdirs @@ -241,7 +251,9 @@ YMSB Yair ZFTB ZKACCOUNT +ZKEY ZKTRIE +Zkey aarch abci abidump @@ -271,6 +283,7 @@ ankr antialised anypb anys +apikey appchain appchains appetito @@ -304,6 +317,7 @@ autocapitalize autocli autocliv autocorrect +autoresize autotests awkroot axelar @@ -331,6 +345,7 @@ binaryen bindgen bindingstypes bindir +binutils biomejs bitarray bitcanna @@ -359,6 +374,7 @@ bools bootnode borsh brainer +buildmode builtins bumpp bunx @@ -387,6 +403,7 @@ chevdor chrono circom clazz +cleartext cliclack clientkeeper clienttx @@ -405,6 +422,7 @@ codespace coeff cofactor coinbases +combinators comdex cometbft cometbls @@ -454,6 +472,7 @@ cratedir crisiskeeper crisistypes crossorigin +crossterm cryptocom cryptware ctfassets @@ -531,6 +550,7 @@ ethcall etherbase ethevent ethkey +evals evidencekeeper evidencetypes evmincosmos @@ -636,6 +656,7 @@ hlist hmac holiman horcrux +httpdate httpie httptemplate hubblestatus @@ -677,6 +698,7 @@ icahostkeeper icahosttypes icatypes iconify +iden identifer identifing idents @@ -754,6 +776,7 @@ libcxx libdir libexec libfuzzer +libgalois libgit libiconv libmuslc @@ -814,6 +837,7 @@ monniker monomorphized moreutils mosmo +mpcsetup msgservice msvc muldefs @@ -932,7 +956,9 @@ popd porttypes postcss postgrespassword +postgrest posthandler +powersoftau precommit precommits prehash @@ -963,6 +989,7 @@ prysm prysmaticlabs prysmctl psim +ptau pubkey pubkey's pubkeys @@ -985,6 +1012,7 @@ qxrx qypy rabby randao +ratatui ratelimit ratelimited rawfile @@ -1088,6 +1116,7 @@ slurpfile smallvec snapshotter snapshottypes +snarkjs soketto solomachine sonner @@ -1123,6 +1152,7 @@ statesync staticcheck staticlib stdenv +stdlib storemetrics storetypes storyblok @@ -1155,6 +1185,7 @@ substituters substores subtrie sumbitter +supa supabase superforms supermajority @@ -1275,6 +1306,7 @@ unionvaloper unionvaloperpub unionvisor unittests +unixepoch unjail unjailed unloadable @@ -1377,7 +1409,9 @@ zerion zeroize zerolog zetachain +zket zkevm +zkey zkgm zkps zktrie diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 5da327c1d5..cd17778a6b 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -186,7 +186,11 @@ async fn contribute( // Gnark phase2 contribution appends the sha256 hash at the end let phase2_contribution_hash = &phase2_contribution[phase2_contribution.len() - 32..]; let signature = CleartextSignedMessage::sign( - &signed_message(¤t_payload.id, &payload_id, &hex::encode(phase2_contribution_hash)), + &signed_message( + ¤t_payload.id, + &payload_id, + &hex::encode(phase2_contribution_hash), + ), &mut secret_key, || String::new(), ) diff --git a/mpc/coordinator/Cargo.toml b/mpc/coordinator/Cargo.toml index cf5368fd7b..acbfa65c2b 100644 --- a/mpc/coordinator/Cargo.toml +++ b/mpc/coordinator/Cargo.toml @@ -4,16 +4,16 @@ name = "mpc-coordinator" version = "0.1.0" [dependencies] -async-sqlite = "0.2.2" -clap = { version = "4.5", features = ["derive"] } -futures.workspace = true -hex = { workspace = true } -mpc-shared = { workspace = true } -pgp = "0.13" -postgrest = "1.0" -reqwest = { workspace = true, features = ["json"] } -serde_json = { workspace = true } -thiserror = { workspace = true } -tokio = { workspace = true, features = ["full"] } +async-sqlite = "0.2.2" +clap = { version = "4.5", features = ["derive"] } +futures.workspace = true +hex = { workspace = true } +mpc-shared = { workspace = true } +pgp = "0.13" +postgrest = "1.0" +reqwest = { workspace = true, features = ["json"] } +serde_json = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["full"] } tracing = { workspace = true } -tracing-subscriber = { workspace = true, features = ["env-filter", "json", "tracing-log"] } \ No newline at end of file +tracing-subscriber = { workspace = true, features = ["env-filter", "json", "tracing-log"] } diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index dc76233ef7..ac91a23c4e 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -234,7 +234,7 @@ CREATE POLICY view_all true ); --- The next contributor is the one with the higest score that didn't contribute yet. +-- The next contributor is the one with the highest score that didn't contribute yet. CREATE OR REPLACE FUNCTION set_next_contributor_trigger() RETURNS TRIGGER AS $$ BEGIN CALL public.set_next_contributor(); @@ -302,7 +302,7 @@ CREATE OR REPLACE VIEW current_queue_position AS ALTER VIEW current_queue_position SET (security_invoker = on); --- The current payload is from the latest successfull contribution +-- The current payload is from the latest successful contribution CREATE OR REPLACE VIEW current_payload_id AS SELECT COALESCE( (SELECT q.payload_id diff --git a/mpc/coordinator/src/main.rs b/mpc/coordinator/src/main.rs index d6d672c6b3..c21f4be55a 100644 --- a/mpc/coordinator/src/main.rs +++ b/mpc/coordinator/src/main.rs @@ -9,12 +9,7 @@ use tracing_subscriber::EnvFilter; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] struct Args { - #[arg( - global = true, - short = 'f', - long, - default_value = "json" - )] + #[arg(global = true, short = 'f', long, default_value = "json")] log_format: LogFormat, #[command(subcommand)] command: Command, diff --git a/mpc/shared/src/lib.rs b/mpc/shared/src/lib.rs index b69a463891..dfd32ca68f 100644 --- a/mpc/shared/src/lib.rs +++ b/mpc/shared/src/lib.rs @@ -84,6 +84,13 @@ pub fn phase2_verify( } } -pub fn signed_message(previous_payload_id: &str, next_payload_id: &str, payload_hash: &str) -> String { - format!("0______0 - {} - {} - {}", previous_payload_id, next_payload_id, payload_hash) +pub fn signed_message( + previous_payload_id: &str, + next_payload_id: &str, + payload_hash: &str, +) -> String { + format!( + "0______0 - {} - {} - {}", + previous_payload_id, next_payload_id, payload_hash + ) } From 157a072dc976d49ea45185d6824a424c81b165e6 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 19 Sep 2024 14:59:41 +0200 Subject: [PATCH 31/48] feat(mpc): chunked upload --- Cargo.lock | 1 + mpc/client/Cargo.toml | 5 +++-- mpc/client/src/main.rs | 20 ++++++++++++-------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43a105c745..6b4a4b98b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8321,6 +8321,7 @@ dependencies = [ "base64 0.21.7", "clap 4.5.4", "crossterm", + "futures-util", "hex", "http-body-util", "httpdate", diff --git a/mpc/client/Cargo.toml b/mpc/client/Cargo.toml index ccb9d7127d..b5c07cbc19 100644 --- a/mpc/client/Cargo.toml +++ b/mpc/client/Cargo.toml @@ -8,6 +8,7 @@ async-sqlite = "0.2.2" base64 = { workspace = true } clap = { version = "4.5", features = ["derive"] } crossterm = "0.27.0" +futures-util = "0.3" hex = { workspace = true } http-body-util = "0.1" httpdate = "1.0" @@ -18,10 +19,10 @@ pgp = "0.13" postgrest = "1.0" rand = "0.8.5" ratatui = "0.27.0" -reqwest = { workspace = true, features = ["json"] } +reqwest = { workspace = true, features = ["json", "stream", "multipart"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } thiserror = { workspace = true } throbber-widgets-tui = "0.6" tokio = { workspace = true, features = ["full"] } -tokio-util = "0.7" +tokio-util = { version = "0.7", features = ["codec"] } diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index cd17778a6b..0ab02d90df 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -32,7 +32,7 @@ use pgp::{ ArmorOptions, Deserializable, KeyType, SecretKeyParamsBuilder, SignedSecretKey, }; use ratatui::{backend::CrosstermBackend, Terminal, Viewport}; -use reqwest::header::LOCATION; +use reqwest::{header::LOCATION, Body}; use serde::Deserialize; use tokio::{ net::TcpListener, @@ -279,7 +279,8 @@ async fn contribute( ), ) .send() - .await?; + .await? + .error_for_status()?; let location = response .headers() .get(LOCATION) @@ -337,17 +338,20 @@ async fn contribute( // ================================================== // https://tus.io/protocols/resumable-upload#patch == // ================================================== + let chunks = phase2_contribution + .into_iter() + .skip(upload_offset) + .collect::>() + // 1mb + .chunks(1024 * 1024) + .map(|x| Ok::<_, std::io::Error>(x.to_vec())) + .collect::>(); upload_client .patch(&upload_location) .header("Tus-Resumable", "1.0.0") .header("Content-Type", "application/offset+octet-stream") .header("Upload-Offset", upload_offset.to_string()) - .body( - phase2_contribution - .into_iter() - .skip(upload_offset) - .collect::>(), - ) + .body(Body::wrap_stream(futures_util::stream::iter(chunks))) .send() .await? .error_for_status()?; From 3603de39d8926bbcfedcfa29453e9c4e48bc6f70 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 19 Sep 2024 14:59:59 +0200 Subject: [PATCH 32/48] feat(mpc): waitlist timestamp hardening and materialized contribs --- mpc/coordinator/database.sql | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index ac91a23c4e..7a0300fe8d 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -28,7 +28,8 @@ CREATE POLICY allow_insert_self ); CREATE TABLE waitlist( - id UUID PRIMARY KEY + id UUID PRIMARY KEY, + created_at TIMESTAMPTZ NOT NULL DEFAULT(now()) ); ALTER TABLE waitlist ENABLE ROW LEVEL SECURITY; @@ -47,9 +48,22 @@ CREATE POLICY allow_insert_self FOR INSERT TO authenticated WITH CHECK ( - (SELECT auth.uid()) = id + (SELECT auth.uid()) = id AND open_to_public() = false ); +CREATE OR REPLACE FUNCTION waitlist_overwrite_timestamp() RETURNS TRIGGER AS $$ +BEGIN + NEW.created_at = now(); + RETURN NEW; +END +$$ LANGUAGE plpgsql SET search_path = ''; + +CREATE TRIGGER waitlist_overwrite_timestamp +BEFORE INSERT +ON waitlist +FOR EACH ROW +EXECUTE FUNCTION waitlist_overwrite_timestamp(); + ----------- -- Queue -- ----------- @@ -162,7 +176,7 @@ $$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; ------------------------- CREATE OR REPLACE FUNCTION expiration_delay() RETURNS INTERVAL AS $$ BEGIN - RETURN INTERVAL '30 minutes'; + RETURN INTERVAL '1 hour'; END $$ LANGUAGE plpgsql SET search_path = ''; @@ -439,11 +453,13 @@ EXECUTE FUNCTION set_contribution_submitted_trigger(); CREATE TABLE contribution_signature( id uuid PRIMARY KEY, public_key text NOT NULL, - signature text NOT NULL + signature text NOT NULL, + public_key_hash text GENERATED ALWAYS AS (encode(sha256(decode(public_key, 'hex')), 'hex')) STORED ); ALTER TABLE contribution_signature ENABLE ROW LEVEL SECURITY; ALTER TABLE contribution_signature ADD FOREIGN KEY (id) REFERENCES contribution_status(id); +CREATE UNIQUE INDEX idx_contribution_signature_pkh ON contribution_signature(public_key_hash); CREATE POLICY view_all ON contribution_signature @@ -471,17 +487,20 @@ CREATE OR REPLACE VIEW current_user_state AS ( ALTER VIEW current_user_state SET (security_invoker = off); -CREATE OR REPLACE VIEW users_contribution AS ( - SELECT c.id, u.raw_user_meta_data->>'user_name' AS user_name, u.raw_user_meta_data->>'avatar_url' AS avatar_url, c.seq, q.payload_id, cs.public_key, cs.signature +CREATE MATERIALIZED VIEW IF NOT EXISTS users_contribution AS ( + SELECT c.id, u.raw_user_meta_data->>'name' AS user_name, u.raw_user_meta_data->>'avatar_url' AS avatar_url, c.seq, q.payload_id, cs.public_key, cs.signature, cs.public_key_hash, s.started AS time_started, su.created_at AS time_submitted, c.created_at AS time_verified FROM public.contribution c INNER JOIN public.queue q ON (c.id = q.id) + INNER JOIN public.contribution_status s ON (c.id = s.id) + INNER JOIN public.contribution_submitted su ON (c.id = su.id) INNER JOIN public.contribution_signature cs ON (c.id = cs.id) INNER JOIN auth.users u ON (c.id = u.id) WHERE c.success ORDER BY c.seq ASC ); -ALTER VIEW users_contribution SET (security_invoker = on); +CREATE UNIQUE INDEX idx_users_contribution_user_id ON users_contribution(id); +CREATE UNIQUE INDEX idx_users_contribution_pkh ON users_contribution(public_key_hash); ---------- -- CRON -- @@ -490,4 +509,6 @@ ALTER VIEW users_contribution SET (security_invoker = on); -- Will rotate the current contributor if the slot expired without any contribution submitted SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); +SELECT cron.schedule('update-users-contribution', '30 seconds', 'REFRESH MATERIALIZED VIEW CONCURRENTLY public.users_contribution'); + COMMIT; From 0c3d835b20318c586e06065f0d4615c828a719b0 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 19 Sep 2024 15:53:33 +0200 Subject: [PATCH 33/48] feat(mpc): add `/secret_key` and `/clear` endpoints --- mpc/client/src/main.rs | 74 +++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 0ab02d90df..49dc0c8984 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -44,7 +44,9 @@ use tokio::{ use tokio_util::sync::CancellationToken; use types::Status; -const ENDPOINT: &str = "/contribute"; +const CONTRIBUTE_ENDPOINT: &str = "/contribute"; +const SK_ENDPOINT: &str = "/secret_key"; +const CLEAR_ENDPOINT: &str = "/clear"; const CONTRIB_SK_PATH: &str = "contrib_key.sk.asc"; @@ -383,9 +385,33 @@ async fn handle( .body(body) .unwrap()) }; + let raw_response = |status, body| { + Ok(hyper::Response::builder() + .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .header(hyper::header::CONTENT_TYPE, "application/octet-stream") + .header( + hyper::header::CONTENT_DISPOSITION, + format!("attachment; filename={CONTRIB_SK_PATH}"), + ) + .status(status) + .body(body) + .unwrap()) + }; let response_empty = |status| response(status, BoxBody::default()); match (req.method(), req.uri().path()) { - (&Method::POST, ENDPOINT) + (&Method::POST, CLEAR_ENDPOINT) => { + let _ = tokio::fs::remove_file(CONTRIB_SK_PATH).await; + response_empty(hyper::StatusCode::OK) + } + (&Method::GET, SK_ENDPOINT) => { + if let Ok(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { + let content = tokio::fs::read(CONTRIB_SK_PATH).await?; + raw_response(hyper::StatusCode::OK, full(content)) + } else { + response_empty(hyper::StatusCode::NOT_FOUND) + } + } + (&Method::POST, CONTRIBUTE_ENDPOINT) if lock .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) .is_ok() => @@ -416,8 +442,10 @@ async fn handle( response_empty(hyper::StatusCode::ACCEPTED) } // FE must poll GET and dispatch accordingly. - (&Method::POST, ENDPOINT) => response_empty(hyper::StatusCode::SERVICE_UNAVAILABLE), - (&Method::GET, ENDPOINT) => match latest_status.read().await.clone() { + (&Method::POST, CONTRIBUTE_ENDPOINT) => { + response_empty(hyper::StatusCode::SERVICE_UNAVAILABLE) + } + (&Method::GET, CONTRIBUTE_ENDPOINT) => match latest_status.read().await.clone() { Status::Failed(e) => { lock.compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) .expect("impossible"); @@ -434,24 +462,26 @@ async fn handle( ), }, // CORS preflight request. - (&Method::OPTIONS, ENDPOINT) => Ok(hyper::Response::builder() - .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") - .header( - hyper::header::ACCESS_CONTROL_ALLOW_HEADERS, - hyper::header::CONTENT_TYPE, - ) - .header( - hyper::header::ACCESS_CONTROL_ALLOW_METHODS, - format!( - "{}, {}, {}", - Method::OPTIONS.as_str(), - Method::GET.as_str(), - Method::POST.as_str() - ), - ) - .status(hyper::StatusCode::OK) - .body(BoxBody::default()) - .unwrap()), + (&Method::OPTIONS, CONTRIBUTE_ENDPOINT | SK_ENDPOINT | CLEAR_ENDPOINT) => { + Ok(hyper::Response::builder() + .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .header( + hyper::header::ACCESS_CONTROL_ALLOW_HEADERS, + hyper::header::CONTENT_DISPOSITION, + ) + .header( + hyper::header::ACCESS_CONTROL_ALLOW_METHODS, + format!( + "{}, {}, {}", + Method::OPTIONS.as_str(), + Method::GET.as_str(), + Method::POST.as_str() + ), + ) + .status(hyper::StatusCode::OK) + .body(BoxBody::default()) + .unwrap()) + } _ => response_empty(hyper::StatusCode::NOT_FOUND), } } From 2c53ea2c906f5b12f85a7f258219f432cb1064ea Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 19 Sep 2024 23:27:44 +0200 Subject: [PATCH 34/48] feat(mpc): improve username selection --- mpc/coordinator/database.sql | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 7a0300fe8d..86db3f733d 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -1,5 +1,13 @@ BEGIN; +----------- +-- Erase -- +----------- + -- TRUNCATE TABLE auth.users CASCADE; + -- DELETE FROM storage.objects o + -- WHERE o.bucket_id = 'contributions' + -- AND o.name <> '00000000-0000-0000-0000-000000000000'; + -- Default bucket for contributions upload INSERT INTO storage.buckets(id, name, public) VALUES('contributions', 'contributions', false); @@ -488,7 +496,7 @@ CREATE OR REPLACE VIEW current_user_state AS ( ALTER VIEW current_user_state SET (security_invoker = off); CREATE MATERIALIZED VIEW IF NOT EXISTS users_contribution AS ( - SELECT c.id, u.raw_user_meta_data->>'name' AS user_name, u.raw_user_meta_data->>'avatar_url' AS avatar_url, c.seq, q.payload_id, cs.public_key, cs.signature, cs.public_key_hash, s.started AS time_started, su.created_at AS time_submitted, c.created_at AS time_verified + SELECT c.id, COALESCE(u.raw_user_meta_data->>'user_name', u.raw_user_meta_data->>'name') AS user_name, u.raw_user_meta_data->>'avatar_url' AS avatar_url, c.seq, q.payload_id, cs.public_key, cs.signature, cs.public_key_hash, s.started AS time_started, su.created_at AS time_submitted, c.created_at AS time_verified FROM public.contribution c INNER JOIN public.queue q ON (c.id = q.id) INNER JOIN public.contribution_status s ON (c.id = s.id) From a53b9cce8544ba35df02e9bff6c148094db6903c Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 20 Sep 2024 14:57:17 +0200 Subject: [PATCH 35/48] feat(mpc): add timeline logs and more infors on contribution --- mpc/coordinator/database.sql | 132 +++++++++++++++++++++++++++++++---- 1 file changed, 117 insertions(+), 15 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 86db3f733d..f526d5139a 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -12,8 +12,8 @@ BEGIN; INSERT INTO storage.buckets(id, name, public) VALUES('contributions', 'contributions', false); CREATE TABLE wallet_address( - id UUID PRIMARY KEY, - wallet TEXT NOT NULL + id uuid PRIMARY KEY, + wallet text NOT NULL ); ALTER TABLE wallet_address ENABLE ROW LEVEL SECURITY; @@ -36,12 +36,14 @@ CREATE POLICY allow_insert_self ); CREATE TABLE waitlist( - id UUID PRIMARY KEY, - created_at TIMESTAMPTZ NOT NULL DEFAULT(now()) + id uuid PRIMARY KEY, + created_at timestamptz NOT NULL DEFAULT(now()), + seq smallserial NOT NULL, ); ALTER TABLE waitlist ENABLE ROW LEVEL SECURITY; ALTER TABLE waitlist ADD FOREIGN KEY (id) REFERENCES auth.users(id); +CREATE UNIQUE INDEX idx_waitlist_seq ON waitlist(seq); CREATE POLICY view_self ON waitlist @@ -85,7 +87,7 @@ CREATE TABLE queue ( id uuid PRIMARY KEY, payload_id uuid NOT NULL DEFAULT(gen_random_uuid()), joined timestamptz NOT NULL DEFAULT (now()), - score INTEGER NOT NULL + score integer NOT NULL ); ALTER TABLE queue ENABLE ROW LEVEL SECURITY; @@ -154,14 +156,27 @@ DECLARE redeemed_code public.code%ROWTYPE := NULL; BEGIN UPDATE public.code c - SET user_id = (SELECT auth.uid()) - WHERE c.id = encode(sha256(code_id::bytea), 'hex') - AND c.user_id IS NULL - RETURNING * INTO redeemed_code; + SET user_id = (SELECT auth.uid()) + WHERE c.id = encode(sha256(code_id::bytea), 'hex') + AND c.user_id IS NULL + RETURNING * INTO redeemed_code; IF (redeemed_code IS NULL) THEN RAISE EXCEPTION 'redeem_code_invalid'; END IF; INSERT INTO public.queue(id) VALUES ((SELECT auth.uid())); + PERFORM public.do_log( + json_build_object( + 'type', 'redeem', + 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())), + 'code', code_id + ) + ); + PERFORM public.do_log( + json_build_object( + 'type', 'join_queue', + 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + ) + ); END $$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; @@ -170,8 +185,20 @@ BEGIN IF (code_id IS NULL) THEN IF (public.open_to_public()) THEN INSERT INTO public.queue(id) VALUES ((SELECT auth.uid())); + PERFORM public.do_log( + json_build_object( + 'type', 'join_queue', + 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + ) + ); ELSE INSERT INTO public.waitlist(id) VALUES ((SELECT auth.uid())); + PERFORM public.do_log( + json_build_object( + 'type', 'join_waitlist', + 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + ) + ); END IF; ELSE PERFORM public.redeem(code_id); @@ -179,6 +206,19 @@ BEGIN END $$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; +-- Username +CREATE OR REPLACE VIEW user_name AS + SELECT u.id, + COALESCE( + (SELECT c.display_name FROM public.code c WHERE c.user_id = u.id), + COALESCE( + u.raw_user_meta_data->>'user_name', + u.raw_user_meta_data->>'name' + ) + ) AS user_name FROM auth.users u; + +ALTER VIEW user_name SET (security_invoker = off); + ------------------------- -- Contribution Status -- ------------------------- @@ -207,7 +247,6 @@ CREATE POLICY view_all true ); - ---------------------------- -- Contribution Submitted -- ---------------------------- @@ -259,6 +298,12 @@ CREATE POLICY view_all -- The next contributor is the one with the highest score that didn't contribute yet. CREATE OR REPLACE FUNCTION set_next_contributor_trigger() RETURNS TRIGGER AS $$ BEGIN + PERFORM public.do_log( + json_build_object( + 'type', 'contribution_verified', + 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = NEW.id) + ) + ); CALL public.set_next_contributor(); RETURN NEW; END @@ -341,13 +386,20 @@ ALTER VIEW current_payload_id SET (security_invoker = on); CREATE OR REPLACE PROCEDURE set_next_contributor() AS $$ BEGIN - IF (SELECT COUNT(*) FROM public.current_contributor_id) = 0 THEN + IF (NOT EXISTS (SELECT * FROM public.current_contributor_id)) THEN INSERT INTO public.contribution_status(id) SELECT cq.id - FROM public.current_queue cq LIMIT 1; + FROM public.current_queue cq + LIMIT 1; + PERFORM public.do_log( + json_build_object( + 'type', 'contribution_started', + 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT cci.id FROM public.current_contributor_id cci)) + ) + ); END IF; END -$$ LANGUAGE plpgsql SET search_path = ''; +$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; CREATE OR REPLACE FUNCTION can_upload(name varchar) RETURNS BOOLEAN AS $$ BEGIN @@ -410,6 +462,12 @@ CREATE POLICY allow_authenticated_contributor_download CREATE OR REPLACE PROCEDURE set_contribution_submitted(queue_id uuid, object_id uuid) AS $$ BEGIN INSERT INTO public.contribution_submitted(id, object_id) VALUES(queue_id, object_id); + PERFORM public.do_log( + json_build_object( + 'type', 'contribution_submitted', + 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + ) + ); END $$ LANGUAGE plpgsql SET search_path = ''; @@ -490,18 +548,62 @@ CREATE OR REPLACE VIEW current_user_state AS ( (EXISTS (SELECT * FROM public.waitlist WHERE id = (SELECT auth.uid()))) AS in_waitlist, (EXISTS (SELECT * FROM public.code WHERE user_id = (SELECT auth.uid()))) AS has_redeemed, (EXISTS (SELECT * FROM public.queue WHERE id = (SELECT auth.uid()))) AS in_queue, - (COALESCE((SELECT display_name FROM public.code WHERE user_id = (SELECT auth.uid())), (SELECT raw_user_meta_data->>'name' FROM auth.users u WHERE u.id = (SELECT auth.uid())))) AS display_name + (SELECT un.user_name FROM public.user_name un WHERE un.id = (SELECT auth.uid())) AS display_name, + ((SELECT COUNT(*) + FROM public.waitlist w + WHERE w.id <> (SELECT auth.uid()) + AND w.seq < (SELECT ww.seq FROM public.waitlist ww WHERE w.id = (SELECT auth.uid())) + ) + 1) AS waitlist_position ); ALTER VIEW current_user_state SET (security_invoker = off); +----------------- +-- Logging -- +----------------- +CREATE TABLE log( + id smallserial PRIMARY KEY, + created_at timestamptz NOT NULL DEFAULT(now()), + message jsonb NOT NULL +); + +ALTER TABLE log ENABLE ROW LEVEL SECURITY; + +CREATE POLICY view_all + ON log + FOR SELECT + TO authenticated + USING ( + true + ); + +CREATE OR REPLACE FUNCTION do_log(message jsonb) RETURNS void AS $$ +BEGIN + INSERT INTO public.log(message) VALUES (message); +END +$$ LANGUAGE plpgsql SET search_path = ''; + CREATE MATERIALIZED VIEW IF NOT EXISTS users_contribution AS ( - SELECT c.id, COALESCE(u.raw_user_meta_data->>'user_name', u.raw_user_meta_data->>'name') AS user_name, u.raw_user_meta_data->>'avatar_url' AS avatar_url, c.seq, q.payload_id, cs.public_key, cs.signature, cs.public_key_hash, s.started AS time_started, su.created_at AS time_submitted, c.created_at AS time_verified + SELECT c.id, + un.user_name, + u.raw_user_meta_data->>'avatar_url' AS avatar_url, + c.seq, + q.payload_id, + cs.public_key, + cs.signature, + cs.public_key_hash, + s.started AS time_started, + su.created_at AS time_submitted, + c.created_at AS time_verified, + w.wallet AS wallet, + (su.created_at - s.started) AS time_contribute FROM public.contribution c INNER JOIN public.queue q ON (c.id = q.id) INNER JOIN public.contribution_status s ON (c.id = s.id) INNER JOIN public.contribution_submitted su ON (c.id = su.id) INNER JOIN public.contribution_signature cs ON (c.id = cs.id) + INNER JOIN public.wallet_address w ON (c.id = w.id) + INNER JOIN public.user_name un ON (c.id = un.id) INNER JOIN auth.users u ON (c.id = u.id) WHERE c.success ORDER BY c.seq ASC From c1c14d1825c80a776a9547c3e0c5605c25b339eb Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 20 Sep 2024 14:57:35 +0200 Subject: [PATCH 36/48] feat(mpc): tmp dir for client, pgp secret generation req/res --- mpc/client/src/main.rs | 143 ++++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 51 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 49dc0c8984..f43db80f73 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -46,9 +46,10 @@ use types::Status; const CONTRIBUTE_ENDPOINT: &str = "/contribute"; const SK_ENDPOINT: &str = "/secret_key"; -const CLEAR_ENDPOINT: &str = "/clear"; -const CONTRIB_SK_PATH: &str = "contrib_key.sk.asc"; +const ZKGM_DIR: &str = "zkgm"; +const CONTRIB_SK_PATH: &str = "zkgm/contrib_key.sk.asc"; +const SUCCESSFUL_PATH: &str = ".zkgm_successful"; #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] @@ -76,12 +77,18 @@ enum Error { Phase2ContributionFailed(#[from] mpc_shared::Phase2ContributionError), #[error(transparent)] Phase2VerificationFailed(#[from] mpc_shared::Phase2VerificationError), + #[error("pgp key couldn't be found")] + PGPKeyNotFound, } type BoxBody = http_body_util::combinators::BoxBody; type DynError = Box; +fn temp_file(payload_id: &str) -> String { + format!("{ZKGM_DIR}/{payload_id}") +} + fn generate_pgp_key(email: String) -> SignedSecretKey { let mut key_params = SecretKeyParamsBuilder::default(); key_params @@ -101,6 +108,20 @@ fn generate_pgp_key(email: String) -> SignedSecretKey { signed_secret_key } +async fn is_already_successful() -> bool { + tokio::fs::metadata(SUCCESSFUL_PATH).await.is_ok() +} + +async fn wait_successful(tx_status: Sender) { + loop { + if is_already_successful().await { + tx_status.send(Status::Successful).expect("impossible"); + tokio::time::sleep(tokio::time::Duration::from_millis(2000)).await; + break; + } + } +} + async fn contribute( tx_status: Sender, Contribute { @@ -110,9 +131,12 @@ async fn contribute( api_key, contributor_id, payload_id, - user_email, + .. }: Contribute, ) -> Result<(), DynError> { + if is_already_successful().await { + return Ok(()); + } let mut secret_key = if let Ok(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { SignedSecretKey::from_armor_single::<&[u8]>( tokio::fs::read(CONTRIB_SK_PATH).await?.as_ref(), @@ -120,15 +144,7 @@ async fn contribute( .expect("impossible") .0 } else { - let secret_key = generate_pgp_key(user_email.unwrap_or("placeholder@test.com".into())); - tokio::fs::write( - CONTRIB_SK_PATH, - secret_key - .to_armored_bytes(ArmorOptions::default()) - .expect("impossible"), - ) - .await?; - secret_key + return Err(Error::PGPKeyNotFound.into()); }; let client = SupabaseMPCApi::new(supabase_project.clone(), api_key, jwt); let current_contributor = client @@ -159,11 +175,11 @@ async fn contribute( tx_status .send(Status::DownloadEnded(current_payload.id.clone())) .expect("impossible"); - let phase2_contribution = if let Ok(true) = tokio::fs::metadata(&payload_id) + let phase2_contribution = if let Ok(true) = tokio::fs::metadata(temp_file(&payload_id)) .await .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) { - tokio::fs::read(&payload_id).await? + tokio::fs::read(temp_file(&payload_id)).await? } else { tx_status .send(Status::ContributionStarted) @@ -179,7 +195,7 @@ async fn contribute( tx_status .send(Status::ContributionEnded) .expect("impossible"); - tokio::fs::write(&payload_id, &phase2_contribution).await?; + tokio::fs::write(temp_file(&payload_id), &phase2_contribution).await?; phase2_contribution }; @@ -213,7 +229,7 @@ async fn contribute( ) .await?; let pool = PoolBuilder::new() - .path("db.sqlite3") + .path(temp_file("state.sqlite3")) .flags( OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE @@ -385,7 +401,7 @@ async fn handle( .body(body) .unwrap()) }; - let raw_response = |status, body| { + let file_response = |status, body| { Ok(hyper::Response::builder() .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") .header(hyper::header::CONTENT_TYPE, "application/octet-stream") @@ -399,16 +415,31 @@ async fn handle( }; let response_empty = |status| response(status, BoxBody::default()); match (req.method(), req.uri().path()) { - (&Method::POST, CLEAR_ENDPOINT) => { - let _ = tokio::fs::remove_file(CONTRIB_SK_PATH).await; - response_empty(hyper::StatusCode::OK) + (&Method::POST, SK_ENDPOINT) => { + let whole_body = req.collect().await?.aggregate(); + let email = serde_json::from_reader(whole_body.reader())?; + let guard = latest_status.write().await; + let result = { + if let Err(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { + let secret_key = generate_pgp_key(email); + let secret_key_serialized = secret_key + .to_armored_bytes(ArmorOptions::default()) + .expect("impossible"); + tokio::fs::write(CONTRIB_SK_PATH, &secret_key_serialized).await?; + response_empty(hyper::StatusCode::CREATED) + } else { + response_empty(hyper::StatusCode::OK) + } + }; + drop(guard); + result } (&Method::GET, SK_ENDPOINT) => { - if let Ok(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { - let content = tokio::fs::read(CONTRIB_SK_PATH).await?; - raw_response(hyper::StatusCode::OK, full(content)) - } else { + if let Err(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { response_empty(hyper::StatusCode::NOT_FOUND) + } else { + let content = tokio::fs::read(CONTRIB_SK_PATH).await?; + file_response(hyper::StatusCode::OK, full(content)) } } (&Method::POST, CONTRIBUTE_ENDPOINT) @@ -430,13 +461,14 @@ async fn handle( .await; match result { Ok(_) => { - lock.compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) + let _ = tokio::fs::write(SUCCESSFUL_PATH, &[1u8]).await; + let _ = tokio::fs::remove_dir(ZKGM_DIR).await; + } + Err(e) => { + tx_status + .send(Status::Failed(format!("{:?}", e))) .expect("impossible"); - tx_status.send(Status::Successful).expect("impossible") } - Err(e) => tx_status - .send(Status::Failed(format!("{:?}", e))) - .expect("impossible"), } }); response_empty(hyper::StatusCode::ACCEPTED) @@ -462,26 +494,28 @@ async fn handle( ), }, // CORS preflight request. - (&Method::OPTIONS, CONTRIBUTE_ENDPOINT | SK_ENDPOINT | CLEAR_ENDPOINT) => { - Ok(hyper::Response::builder() - .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") - .header( - hyper::header::ACCESS_CONTROL_ALLOW_HEADERS, - hyper::header::CONTENT_DISPOSITION, - ) - .header( - hyper::header::ACCESS_CONTROL_ALLOW_METHODS, - format!( - "{}, {}, {}", - Method::OPTIONS.as_str(), - Method::GET.as_str(), - Method::POST.as_str() - ), - ) - .status(hyper::StatusCode::OK) - .body(BoxBody::default()) - .unwrap()) - } + (&Method::OPTIONS, CONTRIBUTE_ENDPOINT | SK_ENDPOINT) => Ok(hyper::Response::builder() + .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") + .header( + hyper::header::ACCESS_CONTROL_ALLOW_HEADERS, + format!( + "{}, {}", + hyper::header::CONTENT_TYPE, + hyper::header::CONTENT_DISPOSITION + ), + ) + .header( + hyper::header::ACCESS_CONTROL_ALLOW_METHODS, + format!( + "{}, {}, {}", + Method::OPTIONS.as_str(), + Method::GET.as_str(), + Method::POST.as_str() + ), + ) + .status(hyper::StatusCode::OK) + .body(BoxBody::default()) + .unwrap()), _ => response_empty(hyper::StatusCode::NOT_FOUND), } } @@ -525,6 +559,9 @@ async fn input_and_status_handling( #[tokio::main] async fn main() -> Result<(), DynError> { + if let Err(_) = tokio::fs::metadata(ZKGM_DIR).await { + tokio::fs::create_dir(ZKGM_DIR).await?; + } let status = Arc::new(RwLock::new(Status::Idle)); let lock = Arc::new(AtomicBool::new(false)); let (tx_status, rx_status) = broadcast::channel(64); @@ -532,6 +569,7 @@ async fn main() -> Result<(), DynError> { let status_clone = status.clone(); let token = CancellationToken::new(); let token_clone = token.clone(); + let tx_status_clone = tx_status.clone(); let handle = tokio::spawn(async move { let addr = SocketAddr::from(([0, 0, 0, 0], 0x1337)); let listener = TcpListener::bind(addr).await.unwrap(); @@ -540,7 +578,7 @@ async fn main() -> Result<(), DynError> { Ok((stream, _)) = listener.accept() => { let io = TokioIo::new(stream); let status_clone = status_clone.clone(); - let tx_status_clone = tx_status.clone(); + let tx_status_clone = tx_status_clone.clone(); let lock_clone = lock.clone(); let conn = hyper::server::conn::http1::Builder::new().serve_connection( io, @@ -577,7 +615,10 @@ async fn main() -> Result<(), DynError> { }, )?; input_and_status_handling(status, rx_status, tx_ui).await; - ui::run_ui(&mut terminal, rx_ui).await?; + tokio::select! { + _ = ui::run_ui(&mut terminal, rx_ui) => {} + _ = wait_successful(tx_status) => {} + } terminal.clear()?; crossterm::terminal::disable_raw_mode()?; let _ = execute!(io::stdout(), Show); From 5082157cc46351e27f448817ae284fb140574aff Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 20 Sep 2024 15:01:59 +0200 Subject: [PATCH 37/48] chore: update Cargo.lock --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b4a4b98b2..d759c1f00c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1839,9 +1839,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", @@ -7626,9 +7626,9 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", @@ -7638,9 +7638,9 @@ dependencies = [ [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", "derive-syn-parse", @@ -7652,9 +7652,9 @@ dependencies = [ [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", @@ -7663,9 +7663,9 @@ dependencies = [ [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", From d82f8a4856bf0136644db18ca1aea2cc56a6bfa9 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Sat, 21 Sep 2024 13:06:08 +0200 Subject: [PATCH 38/48] feat(mpc): better state management, better username view in db --- mpc/client/src/main.rs | 30 +++++++++-------- mpc/client/src/ui.rs | 40 +++++++++++++--------- mpc/coordinator/database.sql | 65 +++++++++++++++++++++++++----------- 3 files changed, 87 insertions(+), 48 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index f43db80f73..6645e9ae5b 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -115,8 +115,9 @@ async fn is_already_successful() -> bool { async fn wait_successful(tx_status: Sender) { loop { if is_already_successful().await { + let _ = tokio::fs::remove_dir_all(ZKGM_DIR).await; tx_status.send(Status::Successful).expect("impossible"); - tokio::time::sleep(tokio::time::Duration::from_millis(2000)).await; + tokio::time::sleep(tokio::time::Duration::from_millis(10000)).await; break; } } @@ -162,15 +163,19 @@ async fn contribute( .send(Status::DownloadStarted(current_payload.id.clone())) .expect("impossible"); let payload = client - .download_payload(¤t_payload.id, ¤t_payload.id, |percent| { - let tx_status = tx_status.clone(); - let current_payload_clone = current_payload.id.clone(); - async move { - tx_status - .send(Status::Downloading(current_payload_clone, percent as u8)) - .expect("impossible"); - } - }) + .download_payload( + ¤t_payload.id, + &temp_file(¤t_payload.id), + |percent| { + let tx_status = tx_status.clone(); + let current_payload_clone = current_payload.id.clone(); + async move { + tx_status + .send(Status::Downloading(current_payload_clone, percent as u8)) + .expect("impossible"); + } + }, + ) .await?; tx_status .send(Status::DownloadEnded(current_payload.id.clone())) @@ -360,8 +365,8 @@ async fn contribute( .into_iter() .skip(upload_offset) .collect::>() - // 1mb - .chunks(1024 * 1024) + // 4mb + .chunks(4 * 1024 * 1024) .map(|x| Ok::<_, std::io::Error>(x.to_vec())) .collect::>(); upload_client @@ -462,7 +467,6 @@ async fn handle( match result { Ok(_) => { let _ = tokio::fs::write(SUCCESSFUL_PATH, &[1u8]).await; - let _ = tokio::fs::remove_dir(ZKGM_DIR).await; } Err(e) => { tx_status diff --git a/mpc/client/src/ui.rs b/mpc/client/src/ui.rs index b674b43a3c..935279318e 100644 --- a/mpc/client/src/ui.rs +++ b/mpc/client/src/ui.rs @@ -39,9 +39,14 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { ); f.render_widget(block, area); - let vertical = Layout::vertical([Constraint::Length(2), Constraint::Length(4)]).margin(1); + let vertical = Layout::vertical([ + Constraint::Length(2), + Constraint::Length(4), + Constraint::Length(4), + ]) + .margin(1); let horizontal = Layout::horizontal([Constraint::Percentage(40), Constraint::Percentage(60)]); - let [progress_area, main] = vertical.areas(area); + let [progress_area, warning_area, main] = vertical.areas(area); let [list_area, gauge_area] = horizontal.areas(main); let chunks = ratatui::layout::Layout::default() .direction(ratatui::layout::Direction::Horizontal) @@ -73,19 +78,24 @@ fn ui(f: &mut Frame, state: &UiState, throbber_state: &mut ThrobberState) { .ratio(steps_done as f64 / num_steps as f64); f.render_widget(progress, progress_area); + // Set full with state + let full = throbber_widgets_tui::Throbber::default() + .label(Span::styled( + "[!] This terminal must remain open, go back to the browser now. [!]", + Style::default() + .add_modifier(Modifier::BOLD) + .fg(Color::Yellow), + )) + .style(ratatui::style::Style::default().fg(ratatui::style::Color::White)) + .throbber_style( + ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), + ) + .throbber_set(throbber_widgets_tui::CLOCK) + .use_type(throbber_widgets_tui::WhichUse::Spin); + f.render_stateful_widget(full, warning_area, throbber_state); + match state { - UiState::Idle => { - // Set full with state - let full = throbber_widgets_tui::Throbber::default() - .label("Awaiting orders...") - .style(ratatui::style::Style::default().fg(ratatui::style::Color::White)) - .throbber_style( - ratatui::style::Style::default().add_modifier(ratatui::style::Modifier::BOLD), - ) - .throbber_set(throbber_widgets_tui::CLOCK) - .use_type(throbber_widgets_tui::WhichUse::Spin); - f.render_stateful_widget(full, chunks[0], throbber_state); - } + UiState::Idle => {} UiState::Downloading(name, progress, started_at) => { // in progress download let item = ListItem::new(Line::from(vec![ @@ -324,7 +334,7 @@ pub async fn run_ui( Paragraph::new(Line::from(vec![ Span::from("Done, "), Span::styled( - "successfully contributed", + "successfully contributed, you can now exit this terminal", Style::default() .add_modifier(Modifier::BOLD) .fg(Color::Green), diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index f526d5139a..3855bd5f56 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -3,10 +3,11 @@ BEGIN; ----------- -- Erase -- ----------- - -- TRUNCATE TABLE auth.users CASCADE; - -- DELETE FROM storage.objects o - -- WHERE o.bucket_id = 'contributions' - -- AND o.name <> '00000000-0000-0000-0000-000000000000'; +TRUNCATE TABLE public.log; +TRUNCATE TABLE auth.users CASCADE; +DELETE FROM storage.objects o +WHERE o.bucket_id = 'contributions' +AND o.name <> '00000000-0000-0000-0000-000000000000'; -- Default bucket for contributions upload INSERT INTO storage.buckets(id, name, public) VALUES('contributions', 'contributions', false); @@ -167,14 +168,13 @@ BEGIN PERFORM public.do_log( json_build_object( 'type', 'redeem', - 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())), - 'code', code_id + 'user', (SELECT un.user_name FROM public.user_name un WHERE un.id = (SELECT auth.uid())) ) ); PERFORM public.do_log( json_build_object( 'type', 'join_queue', - 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + 'user', (SELECT un.user_name FROM public.user_name un WHERE un.id = (SELECT auth.uid())) ) ); END @@ -188,7 +188,7 @@ BEGIN PERFORM public.do_log( json_build_object( 'type', 'join_queue', - 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + 'user', (SELECT un.user_name FROM public.user_name un WHERE un.id = (SELECT auth.uid())) ) ); ELSE @@ -196,7 +196,7 @@ BEGIN PERFORM public.do_log( json_build_object( 'type', 'join_waitlist', - 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + 'user', (SELECT un.user_name FROM public.user_name un WHERE un.id = (SELECT auth.uid())) ) ); END IF; @@ -301,9 +301,10 @@ BEGIN PERFORM public.do_log( json_build_object( 'type', 'contribution_verified', - 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = NEW.id) + 'user', (SELECT un.user_name FROM public.user_name un WHERE un.id = NEW.id), + 'success', NEW.success ) - ); + ); CALL public.set_next_contributor(); RETURN NEW; END @@ -386,17 +387,41 @@ ALTER VIEW current_payload_id SET (security_invoker = on); CREATE OR REPLACE PROCEDURE set_next_contributor() AS $$ BEGIN - IF (NOT EXISTS (SELECT * FROM public.current_contributor_id)) THEN + IF (NOT EXISTS (SELECT cci.id FROM public.current_contributor_id cci)) THEN INSERT INTO public.contribution_status(id) SELECT cq.id FROM public.current_queue cq LIMIT 1; - PERFORM public.do_log( - json_build_object( - 'type', 'contribution_started', - 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT cci.id FROM public.current_contributor_id cci)) - ) - ); + IF (EXISTS (SELECT cci.id FROM public.current_contributor_id cci)) THEN + PERFORM public.do_log( + json_build_object( + 'type', 'contribution_started', + 'user', (SELECT un.user_name FROM public.user_name un WHERE un.id = (SELECT cci.id FROM public.current_contributor_id cci)) + ) + ); + IF (EXISTS (SELECT cq.id FROM public.current_queue cq WHERE cq.position = 5)) THEN + -- I know it's ugly, just for the alert email + -- The JWT here is the public anon one, already embedded in the frontend + -- 5th in the queue get alerted + PERFORM net.http_post( + url := 'https://otfaamdxmgnkjqsosxye.supabase.co/functions/v1/ping', + headers := '{"Content-Type": "application/json", "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im90ZmFhbWR4bWdua2pxc29zeHllIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjEzMjA5NDMsImV4cCI6MjAzNjg5Njk0M30.q91NJPFFHKJXnbhbpUYwsB0NmimtD7pGPx6PkbB_A3w"}'::jsonb, + body := concat( + '{"email": "', + (SELECT u.email + FROM auth.users u + WHERE u.id = ( + SELECT cq.id + FROM public.current_queue cq + WHERE cq.position = 5 + )), + '", "secret":"', + (SELECT private.ping_secret()), + '"}' + )::jsonb + ); + END IF; + END IF; END IF; END $$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; @@ -465,7 +490,7 @@ BEGIN PERFORM public.do_log( json_build_object( 'type', 'contribution_submitted', - 'user', (SELECT un.user_name FROM auth.users u WHERE u.id = (SELECT auth.uid())) + 'user', (SELECT un.user_name FROM public.user_name un WHERE un.id = queue_id) ) ); END @@ -577,7 +602,7 @@ CREATE POLICY view_all true ); -CREATE OR REPLACE FUNCTION do_log(message jsonb) RETURNS void AS $$ +CREATE OR REPLACE FUNCTION do_log(message json) RETURNS void AS $$ BEGIN INSERT INTO public.log(message) VALUES (message); END From bbfaa2f39d0183c2fd6c1d2505fad6c64ddb39e1 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 30 Sep 2024 11:36:29 +0200 Subject: [PATCH 39/48] feat(mpc): anon display name --- mpc/coordinator/database.sql | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 3855bd5f56..2ca80692d6 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -208,17 +208,22 @@ $$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; -- Username CREATE OR REPLACE VIEW user_name AS - SELECT u.id, - COALESCE( - (SELECT c.display_name FROM public.code c WHERE c.user_id = u.id), - COALESCE( - u.raw_user_meta_data->>'user_name', - u.raw_user_meta_data->>'name' - ) - ) AS user_name FROM auth.users u; + SELECT u.id, ('anon_' || left(encode(sha256(u.id::text::bytea), 'hex'), 20)) AS user_name FROM auth.users u; ALTER VIEW user_name SET (security_invoker = off); +-- CREATE OR REPLACE VIEW user_name AS +-- SELECT u.id, +-- COALESCE( +-- (SELECT c.display_name FROM public.code c WHERE c.user_id = u.id), +-- COALESCE( +-- u.raw_user_meta_data->>'user_name', +-- u.raw_user_meta_data->>'name' +-- ) +-- ) AS user_name FROM auth.users u; + +-- ALTER VIEW user_name SET (security_invoker = off); + ------------------------- -- Contribution Status -- ------------------------- @@ -577,7 +582,7 @@ CREATE OR REPLACE VIEW current_user_state AS ( ((SELECT COUNT(*) FROM public.waitlist w WHERE w.id <> (SELECT auth.uid()) - AND w.seq < (SELECT ww.seq FROM public.waitlist ww WHERE w.id = (SELECT auth.uid())) + AND w.seq < (SELECT ww.seq FROM public.waitlist ww WHERE ww.id = (SELECT auth.uid())) ) + 1) AS waitlist_position ); From d177a980dd2ca26e1ee8cf6e3e45cbe4d50040ea Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 4 Oct 2024 10:05:24 +0200 Subject: [PATCH 40/48] feat(mpc): index state files by contributor --- mpc/client/src/main.rs | 132 +++++++++++++++++++++++++---------------- 1 file changed, 81 insertions(+), 51 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 6645e9ae5b..17e805d1ba 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -47,10 +47,6 @@ use types::Status; const CONTRIBUTE_ENDPOINT: &str = "/contribute"; const SK_ENDPOINT: &str = "/secret_key"; -const ZKGM_DIR: &str = "zkgm"; -const CONTRIB_SK_PATH: &str = "zkgm/contrib_key.sk.asc"; -const SUCCESSFUL_PATH: &str = ".zkgm_successful"; - #[derive(PartialEq, Eq, Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] struct Contribute { @@ -60,7 +56,7 @@ struct Contribute { api_key: String, contributor_id: String, payload_id: String, - user_email: Option, + user_email: String, } #[derive(thiserror::Error, Debug, Clone)] @@ -85,8 +81,42 @@ type BoxBody = http_body_util::combinators::BoxBody; type DynError = Box; -fn temp_file(payload_id: &str) -> String { - format!("{ZKGM_DIR}/{payload_id}") +fn successful_file(contributor_id: &str) -> String { + temp_file( + contributor_id, + &format!("{}.zkgm_successful", contributor_id), + ) +} + +fn temp_dir(contributor_id: &str) -> String { + format!("{contributor_id}.zkgm") +} + +fn temp_file(contributor_id: &str, file: &str) -> String { + let dir = temp_dir(contributor_id); + format!("{dir}/{file}") +} + +fn pgp_secret_file(email: &str) -> String { + format!("{email}.contrib_key.sk.asc") +} + +async fn is_already_successful(contributor_id: &str) -> bool { + tokio::fs::metadata(successful_file(contributor_id)) + .await + .is_ok() +} + +async fn create_temp_dir(contributor_id: &str) -> Result<(), DynError> { + if let Err(_) = tokio::fs::metadata(temp_dir(contributor_id)).await { + tokio::fs::create_dir(temp_dir(contributor_id)).await?; + } + Ok(()) +} + +async fn remove_temp_dir(contributor_id: &str) -> Result<(), DynError> { + tokio::fs::remove_dir_all(temp_dir(contributor_id)).await?; + Ok(()) } fn generate_pgp_key(email: String) -> SignedSecretKey { @@ -108,21 +138,6 @@ fn generate_pgp_key(email: String) -> SignedSecretKey { signed_secret_key } -async fn is_already_successful() -> bool { - tokio::fs::metadata(SUCCESSFUL_PATH).await.is_ok() -} - -async fn wait_successful(tx_status: Sender) { - loop { - if is_already_successful().await { - let _ = tokio::fs::remove_dir_all(ZKGM_DIR).await; - tx_status.send(Status::Successful).expect("impossible"); - tokio::time::sleep(tokio::time::Duration::from_millis(10000)).await; - break; - } - } -} - async fn contribute( tx_status: Sender, Contribute { @@ -132,15 +147,20 @@ async fn contribute( api_key, contributor_id, payload_id, + user_email, .. }: Contribute, ) -> Result<(), DynError> { - if is_already_successful().await { + create_temp_dir(&contributor_id).await?; + if is_already_successful(&contributor_id).await { + remove_temp_dir(&contributor_id).await?; + tx_status.send(Status::Successful).expect("impossible"); return Ok(()); } - let mut secret_key = if let Ok(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { + let pgp_secret_file = pgp_secret_file(&user_email); + let mut secret_key = if let Ok(_) = tokio::fs::metadata(&pgp_secret_file).await { SignedSecretKey::from_armor_single::<&[u8]>( - tokio::fs::read(CONTRIB_SK_PATH).await?.as_ref(), + tokio::fs::read(&pgp_secret_file).await?.as_ref(), ) .expect("impossible") .0 @@ -165,7 +185,7 @@ async fn contribute( let payload = client .download_payload( ¤t_payload.id, - &temp_file(¤t_payload.id), + &temp_file(&contributor_id, ¤t_payload.id), |percent| { let tx_status = tx_status.clone(); let current_payload_clone = current_payload.id.clone(); @@ -180,11 +200,12 @@ async fn contribute( tx_status .send(Status::DownloadEnded(current_payload.id.clone())) .expect("impossible"); - let phase2_contribution = if let Ok(true) = tokio::fs::metadata(temp_file(&payload_id)) - .await - .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) + let phase2_contribution = if let Ok(true) = + tokio::fs::metadata(temp_file(&contributor_id, &payload_id)) + .await + .map(|meta| meta.size() as usize == CONTRIBUTION_SIZE) { - tokio::fs::read(temp_file(&payload_id)).await? + tokio::fs::read(temp_file(&contributor_id, &payload_id)).await? } else { tx_status .send(Status::ContributionStarted) @@ -200,7 +221,11 @@ async fn contribute( tx_status .send(Status::ContributionEnded) .expect("impossible"); - tokio::fs::write(temp_file(&payload_id), &phase2_contribution).await?; + tokio::fs::write( + temp_file(&contributor_id, &payload_id), + &phase2_contribution, + ) + .await?; phase2_contribution }; @@ -234,7 +259,7 @@ async fn contribute( ) .await?; let pool = PoolBuilder::new() - .path(temp_file("state.sqlite3")) + .path(temp_file(&contributor_id, "state.sqlite3")) .flags( OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE @@ -383,6 +408,7 @@ async fn contribute( .expect("impossible"); } pool.close().await?; + tokio::fs::write(successful_file(&contributor_id), &[0xBE, 0xEF]).await?; Ok(()) } @@ -406,31 +432,33 @@ async fn handle( .body(body) .unwrap()) }; - let file_response = |status, body| { + let file_response = |status, body, name| { Ok(hyper::Response::builder() .header(hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") .header(hyper::header::CONTENT_TYPE, "application/octet-stream") .header( hyper::header::CONTENT_DISPOSITION, - format!("attachment; filename={CONTRIB_SK_PATH}"), + format!("attachment; filename={name}"), ) .status(status) .body(body) .unwrap()) }; let response_empty = |status| response(status, BoxBody::default()); - match (req.method(), req.uri().path()) { + let path = req.uri().path(); + match (req.method(), path) { (&Method::POST, SK_ENDPOINT) => { let whole_body = req.collect().await?.aggregate(); - let email = serde_json::from_reader(whole_body.reader())?; + let email = serde_json::from_reader::<_, String>(whole_body.reader())?; + let pgp_secret_file = pgp_secret_file(&email); let guard = latest_status.write().await; let result = { - if let Err(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { + if let Err(_) = tokio::fs::metadata(&pgp_secret_file).await { let secret_key = generate_pgp_key(email); let secret_key_serialized = secret_key .to_armored_bytes(ArmorOptions::default()) .expect("impossible"); - tokio::fs::write(CONTRIB_SK_PATH, &secret_key_serialized).await?; + tokio::fs::write(pgp_secret_file, &secret_key_serialized).await?; response_empty(hyper::StatusCode::CREATED) } else { response_empty(hyper::StatusCode::OK) @@ -439,12 +467,20 @@ async fn handle( drop(guard); result } - (&Method::GET, SK_ENDPOINT) => { - if let Err(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { - response_empty(hyper::StatusCode::NOT_FOUND) + (&Method::GET, _) if path.starts_with(SK_ENDPOINT) => { + if let Some(email) = path + .strip_prefix(SK_ENDPOINT) + .and_then(|x| x.strip_prefix("/")) + { + let pgp_secret_file = pgp_secret_file(email); + if let Err(_) = tokio::fs::metadata(&pgp_secret_file).await { + response_empty(hyper::StatusCode::NOT_FOUND) + } else { + let content = tokio::fs::read(&pgp_secret_file).await?; + file_response(hyper::StatusCode::OK, full(content), pgp_secret_file) + } } else { - let content = tokio::fs::read(CONTRIB_SK_PATH).await?; - file_response(hyper::StatusCode::OK, full(content)) + response_empty(hyper::StatusCode::NOT_FOUND) } } (&Method::POST, CONTRIBUTE_ENDPOINT) @@ -466,7 +502,7 @@ async fn handle( .await; match result { Ok(_) => { - let _ = tokio::fs::write(SUCCESSFUL_PATH, &[1u8]).await; + tx_status.send(Status::Successful).expect("impossible"); } Err(e) => { tx_status @@ -563,9 +599,6 @@ async fn input_and_status_handling( #[tokio::main] async fn main() -> Result<(), DynError> { - if let Err(_) = tokio::fs::metadata(ZKGM_DIR).await { - tokio::fs::create_dir(ZKGM_DIR).await?; - } let status = Arc::new(RwLock::new(Status::Idle)); let lock = Arc::new(AtomicBool::new(false)); let (tx_status, rx_status) = broadcast::channel(64); @@ -619,10 +652,7 @@ async fn main() -> Result<(), DynError> { }, )?; input_and_status_handling(status, rx_status, tx_ui).await; - tokio::select! { - _ = ui::run_ui(&mut terminal, rx_ui) => {} - _ = wait_successful(tx_status) => {} - } + ui::run_ui(&mut terminal, rx_ui).await?; terminal.clear()?; crossterm::terminal::disable_raw_mode()?; let _ = execute!(io::stdout(), Show); From d9ba46c7899a319f9a225ac47b0fafed4d5d6020 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 4 Oct 2024 10:05:40 +0200 Subject: [PATCH 41/48] feat(mpc): allow rejoining the queue if slot expired --- mpc/coordinator/database.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 2ca80692d6..72a7b18e92 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -152,6 +152,22 @@ ALTER TABLE code ENABLE ROW LEVEL SECURITY; ALTER TABLE code ADD FOREIGN KEY (user_id) REFERENCES auth.users(id); CREATE UNIQUE INDEX idx_code_user_id ON code(user_id); +CREATE OR REPLACE FUNCTION rejoin_queue() RETURNS void AS $$ +BEGIN + IF (NOT EXISTS (SELECT * FROM public.queue q WHERE q.id = (SELECT auth.uid()))) THEN + RAISE EXCEPTION 'not_in_queue'; + END IF; + IF (EXISTS (SELECT * FROM public.contribution_submitted cs WHERE cs.id = (SELECT auth.uid()))) THEN + RAISE EXCEPTION 'already_submitted'; + END IF; + IF (NOT EXISTS (SELECT * FROM public.contribution_status cs WHERE cs.id = (SELECT auth.uid()) AND cs.expire < now())) THEN + RAISE EXCEPTION 'not_expired'; + END IF; + UPDATE public.queue SET score = public.min_score() WHERE id = (SELECT auth.uid()); + DELETE FROM public.contribution_status cs WHERE id = (SELECT auth.uid()); +END +$$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; + CREATE OR REPLACE FUNCTION redeem(code_id text) RETURNS void AS $$ DECLARE redeemed_code public.code%ROWTYPE := NULL; From b286f673920e0465bfe61c2ee1df1e128a6414d7 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 7 Oct 2024 13:03:39 +0200 Subject: [PATCH 42/48] feat(mpc): add rls policy to wallet_address for users to edit their entry --- mpc/coordinator/database.sql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 72a7b18e92..616d200da7 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -36,6 +36,14 @@ CREATE POLICY allow_insert_self (SELECT auth.uid()) = id ); +CREATE POLICY allow_edit_self + ON wallet_address + FOR UPDATE + TO authenticated + USING ( + (SELECT auth.uid()) = id + ); + CREATE TABLE waitlist( id uuid PRIMARY KEY, created_at timestamptz NOT NULL DEFAULT(now()), From ff26a71afa98a4e4397f4db9453f3c3521f9150a Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Tue, 8 Oct 2024 13:32:26 +0200 Subject: [PATCH 43/48] feat(mpc): properly exit on successful contribution --- mpc/client/src/main.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 17e805d1ba..98dad518bc 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -107,6 +107,16 @@ async fn is_already_successful(contributor_id: &str) -> bool { .is_ok() } +async fn wait_successful(latest_status: Arc>) { + loop { + if *latest_status.read().await == Status::Successful { + tokio::time::sleep(tokio::time::Duration::from_millis(10000)).await; + break; + } + tokio::time::sleep(tokio::time::Duration::from_millis(10)).await; + } +} + async fn create_temp_dir(contributor_id: &str) -> Result<(), DynError> { if let Err(_) = tokio::fs::metadata(temp_dir(contributor_id)).await { tokio::fs::create_dir(temp_dir(contributor_id)).await?; @@ -651,8 +661,11 @@ async fn main() -> Result<(), DynError> { viewport: Viewport::Inline(8), }, )?; - input_and_status_handling(status, rx_status, tx_ui).await; - ui::run_ui(&mut terminal, rx_ui).await?; + input_and_status_handling(status.clone(), rx_status, tx_ui).await; + tokio::select! { + _ = ui::run_ui(&mut terminal, rx_ui) => {} + _ = wait_successful(status) => {} + } terminal.clear()?; crossterm::terminal::disable_raw_mode()?; let _ = execute!(io::stdout(), Show); From 820b16aea87f95c2733e9ecbb8bb48fc6d9a952b Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Thu, 10 Oct 2024 14:31:58 +0200 Subject: [PATCH 44/48] fix(mpc): ensure signature is wiped if we rejoin --- mpc/coordinator/database.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 616d200da7..02d4445bd5 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -172,6 +172,7 @@ BEGIN RAISE EXCEPTION 'not_expired'; END IF; UPDATE public.queue SET score = public.min_score() WHERE id = (SELECT auth.uid()); + DELETE FROM public.contribution_signature cs WHERE id = (SELECT auth.uid()); DELETE FROM public.contribution_status cs WHERE id = (SELECT auth.uid()); END $$ LANGUAGE plpgsql SECURITY DEFINER SET search_path = ''; From 825116e1311b839262b307cd4ed8f7391d72773f Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 11 Oct 2024 18:09:29 +0200 Subject: [PATCH 45/48] fix(cli): wipe cache if payload cursor changed --- mpc/client/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mpc/client/src/main.rs b/mpc/client/src/main.rs index 98dad518bc..fce0aa4416 100644 --- a/mpc/client/src/main.rs +++ b/mpc/client/src/main.rs @@ -192,6 +192,13 @@ async fn contribute( tx_status .send(Status::DownloadStarted(current_payload.id.clone())) .expect("impossible"); + // If the current payload is not present, wipe all cached contribution + // files. This is needed because if a user rejoin the queue after having + // contributed using the previous cursor, it may have changed. + if let Err(_) = tokio::fs::metadata(&temp_file(&contributor_id, ¤t_payload.id)).await { + remove_temp_dir(&contributor_id).await?; + create_temp_dir(&contributor_id).await?; + } let payload = client .download_payload( ¤t_payload.id, From 45d6e1a8a1925e85b34286bbc64ed6af5b05f258 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Tue, 29 Oct 2024 10:52:03 +0100 Subject: [PATCH 46/48] feat(mpc): add ping feature to rotate contrib if they don't ping within 10 mint in their slot --- mpc/coordinator/database.sql | 52 +++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 02d4445bd5..18e554fc9c 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -12,6 +12,29 @@ AND o.name <> '00000000-0000-0000-0000-000000000000'; -- Default bucket for contributions upload INSERT INTO storage.buckets(id, name, public) VALUES('contributions', 'contributions', false); +CREATE TABLE user_ping( + id uuid PRIMARY KEY +); + +ALTER TABLE user_ping ENABLE ROW LEVEL SECURITY; +ALTER TABLE user_ping ADD FOREIGN KEY (id) REFERENCES auth.users(id); + +CREATE POLICY view_self + ON user_ping + FOR SELECT + TO authenticated + USING ( + (SELECT auth.uid()) = id + ); + +CREATE POLICY allow_insert_self + ON user_ping + FOR INSERT + TO authenticated + WITH CHECK ( + (SELECT auth.uid()) = id + ); + CREATE TABLE wallet_address( id uuid PRIMARY KEY, wallet text NOT NULL @@ -369,11 +392,26 @@ CREATE OR REPLACE VIEW current_contributor_id AS SELECT qq.id FROM queue qq WHERE NOT EXISTS ( - SELECT c.id FROM contribution c WHERE c.id = qq.id + SELECT c.id + FROM contribution c + WHERE c.id = qq.id ) AND ( - EXISTS (SELECT cs.expire FROM contribution_status cs WHERE cs.id = qq.id AND cs.expire > now()) + EXISTS ( + SELECT cs.expire + FROM contribution_status cs + WHERE cs.id = qq.id + AND cs.expire > now() + AND ( + cs.started > (now() - INTERVAL '10 minutes') + OR + EXISTS (SELECT * FROM public.user_ping up WHERE up.id = qq.id)) + ) OR - EXISTS (SELECT cs.id FROM contribution_submitted cs WHERE cs.id = qq.id) + EXISTS ( + SELECT cs.id + FROM contribution_submitted cs + WHERE cs.id = qq.id + ) ) ORDER BY qq.score DESC LIMIT 1; @@ -490,8 +528,10 @@ CREATE POLICY allow_service_insert ); CREATE OR REPLACE FUNCTION can_download(name varchar) RETURNS BOOLEAN AS $$ +DECLARE + r BOOLEAN; BEGIN - RETURN ( + r := ( -- User must be the current contributor. (SELECT cci.id FROM public.current_contributor_id cci) = auth.uid() AND @@ -501,6 +541,10 @@ BEGIN -- Do not allow the user to interact with the file after its contribution has been submitted. NOT EXISTS (SELECT * FROM public.contribution_submitted cs WHERE cs.id = auth.uid()) ); + IF(r = true) THEN + INSERT INTO public.user_ping(id) VALUES (auth.uid()) ON CONFLICT DO NOTHING; + END IF; + RETURN r; END $$ LANGUAGE plpgsql SET search_path = ''; From e786fc230dd3049596348f0522342a0445e567c2 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 30 Oct 2024 10:15:32 +0100 Subject: [PATCH 47/48] feat(mpc): open to public --- mpc/coordinator/database.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index 18e554fc9c..af14ba41f2 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -90,7 +90,7 @@ CREATE POLICY allow_insert_self FOR INSERT TO authenticated WITH CHECK ( - (SELECT auth.uid()) = id AND open_to_public() = false + (SELECT auth.uid()) = id ); CREATE OR REPLACE FUNCTION waitlist_overwrite_timestamp() RETURNS TRIGGER AS $$ @@ -111,7 +111,7 @@ EXECUTE FUNCTION waitlist_overwrite_timestamp(); ----------- CREATE OR REPLACE FUNCTION open_to_public() RETURNS boolean AS $$ BEGIN - RETURN false; + RETURN true; END $$ LANGUAGE plpgsql SET search_path = ''; From 5df334ceb157f9fc382079649b7326172ee89557 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 30 Oct 2024 10:16:04 +0100 Subject: [PATCH 48/48] feat(mpc): materialize `current_queue` and better indexes on `log` --- mpc/coordinator/database.sql | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mpc/coordinator/database.sql b/mpc/coordinator/database.sql index af14ba41f2..08954e830c 100644 --- a/mpc/coordinator/database.sql +++ b/mpc/coordinator/database.sql @@ -136,7 +136,7 @@ CREATE POLICY view_all true ); -CREATE OR REPLACE VIEW current_queue AS +CREATE MATERIALIZED VIEW IF NOT EXISTS current_queue AS ( SELECT *, (SELECT COUNT(*) FROM queue qq WHERE @@ -146,10 +146,10 @@ CREATE OR REPLACE VIEW current_queue AS WHERE -- Contribution round not started NOT EXISTS (SELECT cs.id FROM contribution_status cs WHERE cs.id = q.id) - ORDER BY q.score DESC ); -ALTER VIEW current_queue SET (security_invoker = on); +CREATE UNIQUE INDEX idx_current_queue_id ON current_queue(id); +CREATE INDEX idx_current_queue_position ON current_queue(position); CREATE OR REPLACE FUNCTION min_score() RETURNS INTEGER AS $$ BEGIN @@ -459,6 +459,7 @@ BEGIN INSERT INTO public.contribution_status(id) SELECT cq.id FROM public.current_queue cq + ORDER BY cq.position ASC LIMIT 1; IF (EXISTS (SELECT cci.id FROM public.current_contributor_id cci)) THEN PERFORM public.do_log( @@ -668,6 +669,9 @@ CREATE TABLE log( ALTER TABLE log ENABLE ROW LEVEL SECURITY; +CREATE INDEX idx_log_created_at ON log(created_at); +CREATE INDEX idx_log_created_at_id ON log(created_at, id); + CREATE POLICY view_all ON log FOR SELECT @@ -717,7 +721,7 @@ CREATE UNIQUE INDEX idx_users_contribution_pkh ON users_contribution(public_key_ -- Will rotate the current contributor if the slot expired without any contribution submitted SELECT cron.schedule('update-contributor', '10 seconds', 'CALL set_next_contributor()'); - SELECT cron.schedule('update-users-contribution', '30 seconds', 'REFRESH MATERIALIZED VIEW CONCURRENTLY public.users_contribution'); +SELECT cron.schedule('update-current-queue', '30 seconds', 'REFRESH MATERIALIZED VIEW CONCURRENTLY public.current_queue'); COMMIT;